| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Member Functions | Private Attributes

# Prescaler Class Reference

`#include <Prescaler.h>`

Inheritance diagram for Prescaler:
[legend]
Collaboration diagram for Prescaler:
[legend]

List of all members.

## Public Member Functions
| Prescaler (const std::string &name, ISvcLocator *pSvcLocator)
| Constructor(s)
virtual | ~Prescaler ()
| Destructor.
StatusCode | initialize ()
| standard initialization method
StatusCode | execute ()
| standard execution method
StatusCode | finalize ()
| standard finalization method
## Private Attributes
DoubleProperty | m_percentPass
| Percentage of events that should be passed.
int | m_pass
| Number of events passed.
int | m_seen
| Number of events seen.

## Detailed Description

Definition at line 5 of file Prescaler.h.

## Constructor & Destructor Documentation

Prescaler::Prescaler | ( | const std::string & | name,
|  | ISvcLocator * | pSvcLocator
| ) |  |

Constructor(s)

Definition at line 6 of file Prescaler.cpp.

                                                                        :
      GaudiAlgorithm(name, pSvcLocator) ,
      m_pass( 0 ),
      m_seen( 0 )
    {
      declareProperty( "PercentPass", m_percentPass=100.0 );
      m_percentPass.verifier().setBounds( 0.0, 100.0 );
    }

Prescaler::~Prescaler | ( | ) | `[virtual]`

Destructor.

Definition at line 15 of file Prescaler.cpp.

    {
    }

## Member Function Documentation

StatusCode Prescaler::execute | ( | void | ) | `[virtual]`

standard execution method

See also:
  Algorithm
  IAlgorithm

Returns:
  status code

Reimplemented from GaudiAlgorithm.

Definition at line 31 of file Prescaler.cpp.

    {
      ++m_seen;
      float fraction = (float(100.0) * (float)(m_pass+1)) / (float)m_seen;
      if ( fraction > m_percentPass ) {
        setFilterPassed( false );
        info() << name() << ":Prescaler::execute - filter failed" << endmsg;
      } else {
        info() << name() << ":Prescaler::execute - filter passed" << endmsg;
        ++m_pass;
      }
      return StatusCode::SUCCESS;
    }

StatusCode Prescaler::finalize | ( | void | ) | `[virtual]`

standard finalization method

See also:
  Algorithm
  IAlgorithm

Returns:
  status code

Reimplemented from GaudiAlgorithm.

Definition at line 46 of file Prescaler.cpp.

    {
      info() << name( ) << ":Prescaler::finalize - total events: "
             << m_seen << ", passed events: " << m_pass << endmsg;
      return GaudiAlgorithm::finalize();
    }

StatusCode Prescaler::initialize | ( | void | ) | `[virtual]`

standard initialization method

See also:
  Algorithm
  IAlgorithm

Returns:
  status code

Reimplemented from GaudiAlgorithm.

Definition at line 20 of file Prescaler.cpp.

    {
      const StatusCode sc = GaudiAlgorithm::initialize();
      if ( !sc) return sc;

      info() << name( ) << ":Prescaler::Initialize - pass: " << m_percentPass << endmsg;

     return sc;
    }

## Member Data Documentation

int Prescaler::m_pass`[private]`

Number of events passed.

Definition at line 42 of file Prescaler.h.

DoubleProperty Prescaler::m_percentPass`[private]`

Percentage of events that should be passed.

Definition at line 37 of file Prescaler.h.

int Prescaler::m_seen`[private]`

Number of events seen.

Definition at line 47 of file Prescaler.h.

The documentation for this class was generated from the following files:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiAlg/GaudiAlg/Prescaler.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiAlg/src/lib/Prescaler.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines