| # Gaudi Framework, version v21r7 |

Home |  | Generated: 22 Jan 2010

# 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).
| ~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.

    00006                                                                     :
    00007   GaudiAlgorithm(name, pSvcLocator) ,
    00008   m_pass( 0 ),
    00009   m_seen( 0 )
    00010 {
    00011   declareProperty( "PercentPass", m_percentPass=100.0 );
    00012   m_percentPass.verifier().setBounds( 0.0, 100.0 );
    00013 }

Prescaler::~Prescaler | ( |  | ) |

Destructor.

Definition at line 15 of file Prescaler.cpp.

    00016 {
    00017 }

## Member Function Documentation

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

standard initialization method

See also:
  Algorithm

  IAlgorithm

Returns:
  status code

Reimplemented from GaudiAlgorithm.

Definition at line 20 of file Prescaler.cpp.

    00021 {
    00022   const StatusCode sc = GaudiAlgorithm::initialize();
    00023   if ( !sc) return sc;
    00024
    00025   info() << name( ) << ":Prescaler::Initialize - pass: " << m_percentPass << endmsg;
    00026
    00027  return sc;
    00028 }

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

standard execution method

See also:
  Algorithm

  IAlgorithm

Returns:
  status code

Reimplemented from GaudiAlgorithm.

Definition at line 31 of file Prescaler.cpp.

    00032 {
    00033   ++m_seen;
    00034   float fraction = (float(100.0) * (float)(m_pass+1)) / (float)m_seen;
    00035   if ( fraction > m_percentPass ) {
    00036     setFilterPassed( false );
    00037     info() << name() << ":Prescaler::execute - filter failed" << endmsg;
    00038   } else {
    00039     info() << name() << ":Prescaler::execute - filter passed" << endmsg;
    00040     ++m_pass;
    00041   }
    00042   return StatusCode::SUCCESS;
    00043 }

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.

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

## Member Data Documentation

DoubleProperty Prescaler::m_percentPass`[private]`

Percentage of events that should be passed.

Definition at line 37 of file Prescaler.h.

int Prescaler::m_pass`[private]`

Number of events passed.

Definition at line 42 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_v21r7/GaudiAlg/GaudiAlg/Prescaler.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r7/GaudiAlg/src/lib/Prescaler.cpp