| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
Prescaler Class Reference

`#include <Prescaler.h>`

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

## 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
Public Member Functions inherited from GaudiAlgorithm
virtual StatusCode | sysExecute ()
| the generic actions for the execution.
void | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store.
void | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store.
template<class TYPE >
Gaudi::Utils::GetData< TYPE > ::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store.
template<class TYPE >
Gaudi::Utils::GetData< TYPE > ::return_type | getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store.
template<class TYPE >
Gaudi::Utils::GetData< TYPE > ::return_type | get (const std::string &location, const bool useRootInTES=true) const
| Templated access to the data from Gaudi Event Transient Store.
template<class TYPE >
Gaudi::Utils::GetData< TYPE > ::return_type | getIfExists (const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store.
template<class TYPE >
TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store.
template<class TYPE >
Gaudi::Utils::GetData< TYPE > ::return_type | getDetIfExists (IDataProviderSvc *svc, const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store.
template<class TYPE >
TYPE * | getDet (const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store.
template<class TYPE >
Gaudi::Utils::GetData< TYPE > ::return_type | getDetIfExists (const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store.
template<class TYPE >
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store.
template<class TYPE >
bool | exist (const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store.
template<class TYPE >
bool | existDet (IDataProviderSvc *svc, const std::string &location) const
| Check the existence of detector objects in the Gaudi Transient Detector Store.
template<class TYPE >
bool | existDet (const std::string &location) const
| Check the existence of detector objects in the Gaudi Transient Detector Store.
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE > ::return_type | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store.
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE > ::return_type | getOrCreate (const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store.
| GaudiAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
| Standard constructor (protected)
virtual | ~GaudiAlgorithm ()
| destructor, virtual and protected
SmartIF< INTupleSvc > & | evtColSvc () const
| Access the standard event collection service.
Public Member Functions inherited from GaudiCommon< Algorithm >
Gaudi::Utils::GetData< TYPE > ::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store.
Gaudi::Utils::GetData< TYPE > ::return_type | getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Quicker version of the get function which bypasses the check on the retrieved data.
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store.
Gaudi::Utils::GetData< TYPE > ::return_type | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store.
DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store.
TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
| Useful method for the easy location of tools.
TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const
| A useful method for the easy location of tools.
SmartIF< SERVICE > | svc (const std::string &name, const bool create=true) const
| A useful method for the easy location of services.
IUpdateManagerSvc * | updMgrSvc () const
| Short-cut to locate the Update Manager Service.
StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the error message and return with the given StatusCode.
StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the warning message and return with the given StatusCode.
StatusCode | Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
| Print the info message and return with the given StatusCode.
StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
| Print the message and return with the given StatusCode.
void | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Assertion - throw exception if the given condition is not fulfilled.
void | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Assertion - throw exception if the given condition is not fulfilled.
void | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and (re)-throw a given GaudiException.
void | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and (re)-throw a given exception.
void | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and throw an exception with the given message.
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts.
MsgStream & | always () const
| shortcut for the method msgStream ( MSG::ALWAYS )
MsgStream & | fatal () const
| shortcut for the method msgStream ( MSG::FATAL )
MsgStream & | err () const
| shortcut for the method msgStream ( MSG::ERROR )
MsgStream & | error () const
| shortcut for the method msgStream ( MSG::ERROR )
MsgStream & | warning () const
| shortcut for the method msgStream ( MSG::WARNING )
MsgStream & | info () const
| shortcut for the method msgStream ( MSG::INFO )
MsgStream & | debug () const
| shortcut for the method msgStream ( MSG::DEBUG )
MsgStream & | verbose () const
| shortcut for the method msgStream ( MSG::VERBOSE )
MsgStream & | msg () const
| shortcut for the method msgStream ( MSG::INFO )
const Statistics & | counters () const
| accessor to all counters
StatEntity & | counter (const std::string &tag) const
| accessor to certain counter by name
MSG::Level | msgLevel () const
| The current message service output level.
bool | msgLevel (const MSG::Level level) const
| Test the output level.
void | resetMsgStream () const
| Reset (delete) the current message stream object.
bool | typePrint () const
| Insert the actual C++ type of the algorithm/tool in the messages ?
bool | propsPrint () const
| Print properties at initialization ?
bool | statPrint () const
| Print statistical counters at finalization ?
bool | errorsPrint () const
| Print error counters at finalization ?
long | printStat (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of statistical counters
long | printErrors (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of error counters
long | printProps (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of properties
void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL)
| register the current instance to the UpdateManagerSvc as a consumer for a condition.
void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL)
| register the current instance to the UpdateManagerSvc as a consumer for a condition.
void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
| just to avoid conflicts with the version using a pointer to a template class.
void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL)
| register the current instance to the UpdateManagerSvc as a consumer for a condition.
StatusCode | runUpdate ()
| asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident.
| GaudiCommon (const std::string &name, ISvcLocator *pSvcLocator)
| Algorithm constructor.
| GaudiCommon (const std::string &type, const std::string &name, const IInterface *parent)
| Tool constructor.
StatusCode | release (const IInterface *interface) const
| Manual forced (and 'safe') release of the active tool or service.
virtual unsigned long | release ()
| Un-hide IInterface::release (ICC warning #1125)
const AlgTools & | tools () const
| get the list of aquired tools
const Services & | services () const
| get the list of aquired services
const std::string & | context () const
| Returns the "context" string. Used to identify different processing states.
const std::string & | rootInTES () const
| Returns the "rootInTES" string.
double | globalTimeOffset () const
| Returns the "globalTimeOffset" double.
const std::string | fullTESLocation (const std::string &location, const bool useRootInTES) const
| Returns the full correct event location given the rootInTes settings.
Public Member Functions inherited from Algorithm
| Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
| Constructor.
virtual | ~Algorithm ()
| Destructor.
virtual StatusCode | sysStart ()
| Reinitialization method invoked by the framework.
virtual StatusCode | sysInitialize ()
| Initialization method invoked by the framework.
virtual StatusCode | sysReinitialize ()
| Reinitialization method invoked by the framework.
virtual StatusCode | sysRestart ()
| Restart method invoked by the framework.
virtual StatusCode | sysStop ()
| System stop.
virtual StatusCode | sysFinalize ()
| System finalization.
virtual StatusCode | sysBeginRun ()
| beginRun method invoked by the framework.
virtual StatusCode | sysEndRun ()
| endRun method invoked by the framework.
virtual const std::string & | name () const
| The identifying name of the algorithm object.
virtual const std::string & | version () const
virtual StatusCode | configure ()
| Dummy implementation of IStateful::configure() method.
virtual StatusCode | terminate ()
| Dummy implementation of IStateful::terminate() method.
virtual StatusCode | start ()
| the default (empty) implementation of IStateful::start() method
virtual StatusCode | stop ()
| the default (empty) implementation of IStateful::stop() method
virtual StatusCode | reinitialize ()
| the default (empty) implementation of IStateful::reinitialize() method
virtual StatusCode | restart ()
| the default (empty) implementation of IStateful::restart() method
virtual bool | isExecuted () const
| Has this algorithm been executed since the last reset?
virtual void | setExecuted (bool state)
| Set the executed flag to the specified state.
virtual void | resetExecuted ()
| Reset the executed state of the Algorithm for the duration of the current event.
virtual StatusCode | beginRun ()
| Algorithm begin run.
virtual StatusCode | endRun ()
| Algorithm end run. This method is called at the end of the event loop.
virtual Gaudi::StateMachine::State | FSMState () const
| returns the current state of the algorithm
virtual Gaudi::StateMachine::State | targetFSMState () const
| returns the state the algorithm will be in after the ongoing transition
virtual bool | isEnabled () const
| Is this algorithm enabled or disabled?
virtual bool | filterPassed () const
| Did this algorithm pass or fail its filter criterion for the last event?
virtual void | setFilterPassed (bool state)
| Set the filter passed flag to the specified state.
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist.
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist.
SmartIF< IService > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
| Return a pointer to the service identified by name (or "type/name")
void | setOutputLevel (int level)
| Set the output level for current algorithm.
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked.
SmartIF< IChronoStatSvc > & | chronoSvc () const
| The standard Chrono & Stat service, Return a pointer to the service if present.
SmartIF< IChronoStatSvc > & | chronoStatService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< IDataProviderSvc > & | detSvc () const
| The standard detector data service.
SmartIF< IDataProviderSvc > & | detDataService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< IConversionSvc > & | detCnvSvc () const
| The standard detector data persistency conversion service.
SmartIF< IConversionSvc > & | detDataCnvService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< IDataProviderSvc > & | eventSvc () const
| The standard event data service.
SmartIF< IDataProviderSvc > & | evtSvc () const
| shortcut for method eventSvc
SmartIF< IDataProviderSvc > & | eventDataService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< IConversionSvc > & | eventCnvSvc () const
| The standard event data persistency conversion service.
SmartIF< IConversionSvc > & | eventDataCnvService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< IHistogramSvc > & | histoSvc () const
| The standard histogram service.
SmartIF< IHistogramSvc > & | histogramDataService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service.
SmartIF< IMessageSvc > & | messageService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< INTupleSvc > & | ntupleSvc () const
| The standard N tuple service.
SmartIF< INTupleSvc > & | ntupleService () const
| Obsoleted name, kept due to the backwards compatibility.
SmartIF< IRndmGenSvc > & | randSvc () const
| AIDA-based NTuple service Returns a pointer to the AIDATuple service if present.
SmartIF< IToolSvc > & | toolSvc () const
| The standard ToolSvc service, Return a pointer to the service if present.
SmartIF< IExceptionSvc > & | exceptionSvc () const
| Get the exception Service.
SmartIF< IAlgContextSvc > & | contextSvc () const
| get Algorithm Context Service
SmartIF< ISvcLocator > & | serviceLocator () const
| The standard service locator.
SmartIF< ISvcLocator > & | svcLoc () const
| shortcut for method serviceLocator
bool | registerContext () const
| register for Algorithm Context Service?
StatusCode | createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
| Create a sub algorithm.
std::vector< Algorithm * > * | subAlgorithms () const
| List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
virtual StatusCode | setProperty (const Property &p)
| Implementation of IProperty::setProperty.
virtual StatusCode | setProperty (const std::string &s)
| Implementation of IProperty::setProperty.
virtual StatusCode | setProperty (const std::string &n, const std::string &v)
| Implementation of IProperty::setProperty.
virtual StatusCode | getProperty (Property *p) const
| Implementation of IProperty::getProperty.
virtual const Property & | getProperty (const std::string &name) const
| Implementation of IProperty::getProperty.
virtual StatusCode | getProperty (const std::string &n, std::string &v) const
| Implementation of IProperty::getProperty.
virtual const std::vector < Property * > & | getProperties () const
| Implementation of IProperty::getProperties.
StatusCode | setProperties ()
| Set the algorithm's properties.
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property.
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties.
SmartIF< IMonitorSvc > & | monitorSvc () const
| Access the monitor service.
template<class T >
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const
| Declare monitoring information.
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
| Declare monitoring information (special case)
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value

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

## Additional Inherited Members
Public Types inherited from Algorithm
typedef Gaudi::PluginService::Factory2 < IAlgorithm *, const std::string &, ISvcLocator * > | Factory
Protected Types inherited from GaudiCommon< Algorithm >
typedef std::map< std::string, StatEntity > | Statistics
| the actual type of general counters
typedef std::map< std::string, unsigned int > | Counter
| the actual type error/warning counter
typedef std::vector< IAlgTool * > | AlgTools
| storage for active tools
typedef GaudiUtils::HashMap < std::string, SmartIF < IService > > | Services
| storage for active services
Protected Member Functions inherited from GaudiCommon< Algorithm >
virtual | ~GaudiCommon ()
| Destructor.
StatusCode | releaseTool (const IAlgTool *tool) const
| manual forced (and 'safe') release of the tool
StatusCode | releaseSvc (const IInterface *svc) const
| manual forced (and 'safe') release of the service
Protected Attributes inherited from GaudiCommon< Algorithm >
ICounterSummarySvc * | m_counterSummarySvc
| a pointer to the CounterSummarySvc
std::vector< std::string > | m_counterList
| list of counters to declare. Set by property CounterList. This can be a regular expression.
std::vector< std::string > | m_statEntityList
Static Protected Attributes inherited from GaudiCommon< Algorithm >
static const bool | IgnoreRootInTES
| Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods.
static const bool | UseRootInTES
| Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods.

## 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 5 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 14 of file Prescaler.cpp.

{
}

## Member Function Documentation

StatusCode Prescaler::execute | ( |  | ) |
| virtual

standard execution method

See Also
  Algorithm
  IAlgorithm

Returns
  status code

Reimplemented from GaudiAlgorithm.

Definition at line 30 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 | ( |  | ) |
| virtual

standard finalization method

See Also
  Algorithm
  IAlgorithm

Returns
  status code

Reimplemented from GaudiAlgorithm.

Definition at line 45 of file Prescaler.cpp.

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

StatusCode Prescaler::initialize | ( |  | ) |
| virtual

standard initialization method

See Also
  Algorithm
  IAlgorithm

Returns
  status code

Reimplemented from GaudiAlgorithm.

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