Gaudi Framework, version v23r9

Home   Generated: Thu Jul 18 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Prescaler.cpp
Go to the documentation of this file.
1 #include "GaudiAlg/Prescaler.h"
2 
5 
6 Prescaler::Prescaler(const std::string& name, ISvcLocator* pSvcLocator) :
7  GaudiAlgorithm(name, pSvcLocator) ,
8  m_pass( 0 ),
9  m_seen( 0 )
10 {
11  declareProperty( "PercentPass", m_percentPass=100.0 );
12  m_percentPass.verifier().setBounds( 0.0, 100.0 );
13 }
14 
16 {
17 }
18 
21 {
23  if ( !sc) return sc;
24 
25  info() << name( ) << ":Prescaler::Initialize - pass: " << m_percentPass << endmsg;
26 
27  return sc;
28 }
29 
32 {
33  ++m_seen;
34  float fraction = (float(100.0) * (float)(m_pass+1)) / (float)m_seen;
35  if ( fraction > m_percentPass ) {
36  setFilterPassed( false );
37  info() << name() << ":Prescaler::execute - filter failed" << endmsg;
38  } else {
39  info() << name() << ":Prescaler::execute - filter passed" << endmsg;
40  ++m_pass;
41  }
42  return StatusCode::SUCCESS;
43 }
44 
47 {
48  info() << name( ) << ":Prescaler::finalize - total events: "
49  << m_seen << ", passed events: " << m_pass << endmsg;
50  return GaudiAlgorithm::finalize();
51 }

Generated at Thu Jul 18 2013 12:18:01 for Gaudi Framework, version v23r9 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004