Sequencer Class Reference

ClassName: Sequencer. More...

#include </tmp/marcocle/lhcb-release/1122/GAUDI/GAUDI_v27r0/InstallArea/x86_64-slc6-gcc49-opt/include/GaudiAlg/Sequencer.h>

Inheritance diagram for Sequencer:
Collaboration diagram for Sequencer:

Public Member Functions

 Sequencer (const std::string &name, ISvcLocator *svcloc)
 Constructor(s) More...
 
 ~Sequencer () override=default
 Destructor. More...
 
StatusCode initialize () override
 Initialization of a sequencer. More...
 
StatusCode reinitialize () override
 Sequencer Reinitialization. More...
 
StatusCode start () override
 Sequencer finalization. More...
 
StatusCode execute () override
 The actions to be performed by the sequencer on an event. More...
 
StatusCode stop () override
 Sequencer finalization. More...
 
StatusCode finalize () override
 Sequencer finalization. More...
 
StatusCode beginRun () override
 Sequencer beginRun. More...
 
StatusCode endRun () override
 Sequencer endRun. More...
 
void resetExecuted () override
 Reset the Sequencer executed state for the current event. More...
 
virtual bool branchFilterPassed () const
 additional interface methods More...
 
virtual StatusCode setBranchFilterPassed (bool state)
 Set the branch filter passed flag for the last event. More...
 
virtual bool isStopOverride () const
 Has the StopOverride mode been set? More...
 
StatusCode append (Algorithm *pAlgorithm)
 Append an algorithm to the sequencer. More...
 
StatusCode appendToBranch (Algorithm *pAlgorithm)
 Append an algorithm to the sequencer branch. More...
 
StatusCode createAndAppend (const std::string &type, const std::string &name, Algorithm *&pAlgorithm)
 Create a algorithm and append it to the sequencer. More...
 
StatusCode createAndAppendToBranch (const std::string &type, const std::string &name, Algorithm *&pAlgorithm)
 Create a algorithm and append it to the sequencer branch. More...
 
StatusCode remove (Algorithm *pAlgorithm)
 Remove the specified algorithm from the sequencer. More...
 
StatusCode remove (const std::string &name)
 
StatusCode removeFromBranch (Algorithm *pAlgorithm)
 
StatusCode removeFromBranch (const std::string &name)
 
const std::vector< Algorithm * > & branchAlgorithms () const
 List of branch algorithms. More...
 
std::vector< Algorithm * > & branchAlgorithms ()
 
StatusCode decodeMemberNames ()
 Decode Member Name list. More...
 
void membershipHandler (Property &theProp)
 "Members" property handler More...
 
StatusCode decodeBranchMemberNames ()
 Decode branch member name list. More...
 
void branchMembershipHandler (Property &theProp)
 "BranchMembers" property handler More...
 
 Sequencer (const std::string &name, ISvcLocator *svcloc)
 Constructor(s) More...
 
 ~Sequencer () override=default
 Destructor. More...
 
StatusCode initialize () override
 Initialization of a sequencer. More...
 
StatusCode reinitialize () override
 Sequencer Reinitialization. More...
 
StatusCode start () override
 Sequencer finalization. More...
 
StatusCode execute () override
 The actions to be performed by the sequencer on an event. More...
 
StatusCode stop () override
 Sequencer finalization. More...
 
StatusCode finalize () override
 Sequencer finalization. More...
 
StatusCode beginRun () override
 Sequencer beginRun. More...
 
StatusCode endRun () override
 Sequencer endRun. More...
 
void resetExecuted () override
 Reset the Sequencer executed state for the current event. More...
 
virtual bool branchFilterPassed () const
 additional interface methods More...
 
virtual StatusCode setBranchFilterPassed (bool state)
 Set the branch filter passed flag for the last event. More...
 
virtual bool isStopOverride () const
 Has the StopOverride mode been set? More...
 
StatusCode append (Algorithm *pAlgorithm)
 Append an algorithm to the sequencer. More...
 
StatusCode appendToBranch (Algorithm *pAlgorithm)
 Append an algorithm to the sequencer branch. More...
 
StatusCode createAndAppend (const std::string &type, const std::string &name, Algorithm *&pAlgorithm)
 Create a algorithm and append it to the sequencer. More...
 
StatusCode createAndAppendToBranch (const std::string &type, const std::string &name, Algorithm *&pAlgorithm)
 Create a algorithm and append it to the sequencer branch. More...
 
StatusCode remove (Algorithm *pAlgorithm)
 Remove the specified algorithm from the sequencer. More...
 
StatusCode remove (const std::string &name)
 
StatusCode removeFromBranch (Algorithm *pAlgorithm)
 
StatusCode removeFromBranch (const std::string &name)
 
const std::vector< Algorithm * > & branchAlgorithms () const
 List of branch algorithms. More...
 
std::vector< Algorithm * > & branchAlgorithms ()
 
StatusCode decodeMemberNames ()
 Decode Member Name list. More...
 
void membershipHandler (Property &theProp)
 "Members" property handler More...
 
StatusCode decodeBranchMemberNames ()
 Decode branch member name list. More...
 
void branchMembershipHandler (Property &theProp)
 "BranchMembers" property handler More...
 
- Public Member Functions inherited from Algorithm
 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor. More...
 
 ~Algorithm () override=default
 Destructor. More...
 
StatusCode sysStart () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysInitialize () override
 Initialization method invoked by the framework. More...
 
StatusCode sysReinitialize () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysRestart () override
 Restart method invoked by the framework. More...
 
StatusCode sysExecute () override
 The actions to be performed by the algorithm on an event. More...
 
StatusCode sysStop () override
 System stop. More...
 
StatusCode sysFinalize () override
 System finalization. More...
 
StatusCode sysBeginRun () override
 beginRun method invoked by the framework. More...
 
StatusCode sysEndRun () override
 endRun method invoked by the framework. More...
 
const std::string & name () const override
 The identifying name of the algorithm object. More...
 
const std::string & type () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::string & version () const override
 
unsigned int index () override
 
StatusCode configure () override
 Dummy implementation of IStateful::configure() method. More...
 
StatusCode terminate () override
 Dummy implementation of IStateful::terminate() method. More...
 
StatusCode initialize () override
 the default (empty) implementation of IStateful::initialize() method More...
 
StatusCode start () override
 the default (empty) implementation of IStateful::start() method More...
 
StatusCode stop () override
 the default (empty) implementation of IStateful::stop() method More...
 
StatusCode finalize () override
 the default (empty) implementation of IStateful::finalize() method More...
 
StatusCode reinitialize () override
 the default (empty) implementation of IStateful::reinitialize() method More...
 
StatusCode restart () override
 the default (empty) implementation of IStateful::restart() method More...
 
Gaudi::StateMachine::State FSMState () const override
 returns the current state of the algorithm More...
 
Gaudi::StateMachine::State targetFSMState () const override
 returns the state the algorithm will be in after the ongoing transition More...
 
bool isExecuted () const override
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) override
 Set the executed flag to the specified state. More...
 
void resetExecuted () override
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
StatusCode beginRun () override
 Algorithm begin run. More...
 
StatusCode endRun () override
 Algorithm end run. This method is called at the end of the event loop. More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool filterPassed () const override
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) override
 Set the filter passed flag to the specified state. More...
 
int errorCount () const
 Get the number of failures of the algorithm. More...
 
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. More...
 
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. More...
 
SmartIF< IServiceservice (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") More...
 
template<class T >
SmartIF< T > service (const std::string &name, bool createIf=true, bool quiet=false) const
 
void setOutputLevel (int level)
 Set the output level for current algorithm. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
SmartIF< IChronoStatSvc > & chronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present. More...
 
SmartIF< IChronoStatSvc > & chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IDataProviderSvc > & detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IConversionSvc > & detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IDataProviderSvc > & eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IConversionSvc > & eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< IHistogramSvc > & histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< INTupleSvc > & ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 AIDA-based NTuple service Returns a pointer to the AIDATuple service if present. More...
 
SmartIF< IToolSvc > & toolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
SmartIF< IExceptionSvc > & exceptionSvc () const
 Get the exception Service. More...
 
SmartIF< IAlgContextSvc > & contextSvc () const
 get Algorithm Context Service More...
 
SmartIF< ITimelineSvc > & timelineSvc () const
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm. More...
 
const std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
std::vector< Algorithm * > * subAlgorithms ()
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
StatusCode setProperty (const Property &p) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Implementation of IProperty::getProperty. More...
 
const PropertygetProperty (const std::string &name) const override
 Implementation of IProperty::getProperty. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Implementation of IProperty::getProperties. More...
 
bool hasProperty (const std::string &name) const override
 Implementation of IProperty::hasProperty. More...
 
StatusCode setProperties ()
 Set the algorithm's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IMonitorSvc > & monitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
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) More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
EventContextgetContext ()
 get the context More...
 
void setContext (EventContext *context)
 set the context More...
 
template<typename T >
 __attribute__ ((deprecated)) StatusCode declareDataObj(const std
 Declare data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
__attribute__((deprecated)) const std const DataObjectDescriptorCollectioninputDataObjects () const override
 Return the handles declared in the algorithm. More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Private tool. More...
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Public tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
bool isClonable () const override
 Specifies the clonability of the algorithm. More...
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor. More...
 
 ~Algorithm () override=default
 Destructor. More...
 
StatusCode sysStart () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysInitialize () override
 Initialization method invoked by the framework. More...
 
StatusCode sysReinitialize () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysRestart () override
 Restart method invoked by the framework. More...
 
StatusCode sysExecute () override
 The actions to be performed by the algorithm on an event. More...
 
StatusCode sysStop () override
 System stop. More...
 
StatusCode sysFinalize () override
 System finalization. More...
 
StatusCode sysBeginRun () override
 beginRun method invoked by the framework. More...
 
StatusCode sysEndRun () override
 endRun method invoked by the framework. More...
 
const std::string & name () const override
 The identifying name of the algorithm object. More...
 
const std::string & type () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::string & version () const override
 
unsigned int index () override
 
StatusCode configure () override
 Dummy implementation of IStateful::configure() method. More...
 
StatusCode terminate () override
 Dummy implementation of IStateful::terminate() method. More...
 
StatusCode initialize () override
 the default (empty) implementation of IStateful::initialize() method More...
 
StatusCode start () override
 the default (empty) implementation of IStateful::start() method More...
 
StatusCode stop () override
 the default (empty) implementation of IStateful::stop() method More...
 
StatusCode finalize () override
 the default (empty) implementation of IStateful::finalize() method More...
 
StatusCode reinitialize () override
 the default (empty) implementation of IStateful::reinitialize() method More...
 
StatusCode restart () override
 the default (empty) implementation of IStateful::restart() method More...
 
Gaudi::StateMachine::State FSMState () const override
 returns the current state of the algorithm More...
 
Gaudi::StateMachine::State targetFSMState () const override
 returns the state the algorithm will be in after the ongoing transition More...
 
bool isExecuted () const override
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) override
 Set the executed flag to the specified state. More...
 
void resetExecuted () override
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
StatusCode beginRun () override
 Algorithm begin run. More...
 
StatusCode endRun () override
 Algorithm end run. This method is called at the end of the event loop. More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool filterPassed () const override
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) override
 Set the filter passed flag to the specified state. More...
 
int errorCount () const
 Get the number of failures of the algorithm. More...
 
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. More...
 
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. More...
 
SmartIF< IServiceservice (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") More...
 
template<class T >
SmartIF< T > service (const std::string &name, bool createIf=true, bool quiet=false) const
 
void setOutputLevel (int level)
 Set the output level for current algorithm. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
SmartIF< IChronoStatSvc > & chronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present. More...
 
SmartIF< IChronoStatSvc > & chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IDataProviderSvc > & detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IConversionSvc > & detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IDataProviderSvc > & eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IConversionSvc > & eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< IHistogramSvc > & histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< INTupleSvc > & ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 AIDA-based NTuple service Returns a pointer to the AIDATuple service if present. More...
 
SmartIF< IToolSvc > & toolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
SmartIF< IExceptionSvc > & exceptionSvc () const
 Get the exception Service. More...
 
SmartIF< IAlgContextSvc > & contextSvc () const
 get Algorithm Context Service More...
 
SmartIF< ITimelineSvc > & timelineSvc () const
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm. More...
 
const std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
std::vector< Algorithm * > * subAlgorithms ()
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
StatusCode setProperty (const Property &p) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Implementation of IProperty::getProperty. More...
 
const PropertygetProperty (const std::string &name) const override
 Implementation of IProperty::getProperty. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Implementation of IProperty::getProperties. More...
 
bool hasProperty (const std::string &name) const override
 Implementation of IProperty::hasProperty. More...
 
StatusCode setProperties ()
 Set the algorithm's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IMonitorSvc > & monitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
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) More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
EventContextgetContext ()
 get the context More...
 
void setContext (EventContext *context)
 set the context More...
 
template<typename T >
 __attribute__ ((deprecated)) StatusCode declareDataObj(const std
 Declare data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
__attribute__((deprecated)) const std const DataObjectDescriptorCollectioninputDataObjects () const override
 Return the handles declared in the algorithm. More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Private tool. More...
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Public tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
bool isClonable () const override
 Specifies the clonability of the algorithm. More...
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
- Public Member Functions inherited from implements< Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

StatusCode append (Algorithm *pAlgorithm, std::vector< Algorithm * > &theAlgs)
 Append an algorithm to the sequencer. More...
 
StatusCode createAndAppend (const std::string &type, const std::string &name, Algorithm *&pAlgorithm, std::vector< Algorithm * > &theAlgs)
 Create a algorithm and append it to the sequencer. More...
 
StatusCode decodeNames (StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs, std::vector< bool > &theLogic)
 Decode algorithm names, creating or appending algorithms as appropriate. More...
 
StatusCode execute (const std::vector< Algorithm * > &theAlgs, std::vector< bool > &theLogic, Algorithm *&lastAlgorithm, unsigned int first=0)
 Execute the members in the specified list. More...
 
StatusCode executeMember (Algorithm *theAlgorithm)
 Execute member algorithm. More...
 
StatusCode remove (const std::string &algname, std::vector< Algorithm * > &theAlgs)
 Remove the specified algorithm from the sequencer. More...
 
 Sequencer (const Sequencer &a)=delete
 
Sequenceroperator= (const Sequencer &rhs)=delete
 
StatusCode append (Algorithm *pAlgorithm, std::vector< Algorithm * > &theAlgs)
 Append an algorithm to the sequencer. More...
 
StatusCode createAndAppend (const std::string &type, const std::string &name, Algorithm *&pAlgorithm, std::vector< Algorithm * > &theAlgs)
 Create a algorithm and append it to the sequencer. More...
 
StatusCode decodeNames (StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs, std::vector< bool > &theLogic)
 Decode algorithm names, creating or appending algorithms as appropriate. More...
 
StatusCode execute (const std::vector< Algorithm * > &theAlgs, std::vector< bool > &theLogic, Algorithm *&lastAlgorithm, unsigned int first=0)
 Execute the members in the specified list. More...
 
StatusCode executeMember (Algorithm *theAlgorithm)
 Execute member algorithm. More...
 
StatusCode remove (const std::string &algname, std::vector< Algorithm * > &theAlgs)
 Remove the specified algorithm from the sequencer. More...
 
 Sequencer (const Sequencer &a)=delete
 
Sequenceroperator= (const Sequencer &rhs)=delete
 
- Protected Member Functions inherited from Algorithm
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
void addSubAlgorithmDataObjectHandles ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
int outputLevel () const
 retrieve the Algorithm output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 Callback for output level property. More...
 
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
void addSubAlgorithmDataObjectHandles ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
int outputLevel () const
 retrieve the Algorithm output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 Callback for output level property. More...
 

Private Attributes

StringArrayProperty m_names
 
std::vector< bool > m_isInverted
 
StringArrayProperty m_branchNames
 
std::vector< Algorithm * > m_branchAlgs
 
std::vector< bool > m_isBranchInverted
 
BooleanProperty m_stopOverride
 
bool m_branchFilterPassed = false
 

Additional Inherited Members

- Public Types inherited from Algorithm
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from implements< Interfaces >
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
- Protected Attributes inherited from Algorithm
EventContextm_event_context
 Event specific data for multiple event processing. More...
 
- Protected Attributes inherited from implements< Interfaces >
std::atomic_ulong m_refCount = {0}
 Reference counter. More...
 

Detailed Description

ClassName: Sequencer.

Description: A Sequencer is essentially a list of Algorithms and is responsible for their management. Note that Sequences may themselves contain other Sequences. The default execute( ) implementation loops over the members of the sequence, calling their execute( ) methods. However, this can be modified if a member is disabled, has already been executed, or a member indicates that it's filter fails. The the former two cases the execution of the member is bypassed. In the latter case, the loop is terminated and the Sequencer assumes the same filtered state as the last member.

Definition at line 23 of file Sequencer.h.

Constructor & Destructor Documentation

Sequencer::Sequencer ( const std::string &  name,
ISvcLocator svcloc 
)

Constructor(s)

Definition at line 21 of file Sequencer.cpp.

22 : Algorithm( name, pSvcLocator )
23 {
24  // Declare Sequencer properties with their defaults
25  declareProperty( "Members", m_names );
26  declareProperty( "BranchMembers", m_branchNames );
27  declareProperty( "StopOverride", m_stopOverride=false );
28 
29  // Associate action handlers with the "Members" and "BranchMembers" properties
32 
33 }
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Algorithm.h:435
void branchMembershipHandler(Property &theProp)
"BranchMembers" property handler
Definition: Sequencer.cpp:419
BooleanProperty m_stopOverride
Definition: Sequencer.h:244
StringArrayProperty m_branchNames
Definition: Sequencer.h:241
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
Algorithm(const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
Constructor.
Definition: Algorithm.cpp:39
void membershipHandler(Property &theProp)
"Members" property handler
Definition: Sequencer.cpp:404
StringArrayProperty m_names
Definition: Sequencer.h:239
Sequencer::~Sequencer ( )
overridedefault

Destructor.

Sequencer::Sequencer ( const Sequencer a)
protecteddelete
Sequencer::Sequencer ( const std::string &  name,
ISvcLocator svcloc 
)

Constructor(s)

Sequencer::~Sequencer ( )
overridedefault

Destructor.

Sequencer::Sequencer ( const Sequencer a)
protecteddelete

Member Function Documentation

StatusCode Sequencer::append ( Algorithm pAlgorithm)

Append an algorithm to the sequencer.

Definition at line 333 of file Sequencer.cpp.

334 {
335  return append( pAlgorithm, *subAlgorithms( ) );
336 }
StatusCode append(Algorithm *pAlgorithm)
Append an algorithm to the sequencer.
Definition: Sequencer.cpp:333
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
StatusCode Sequencer::append ( Algorithm pAlgorithm)

Append an algorithm to the sequencer.

StatusCode Sequencer::append ( Algorithm pAlgorithm,
std::vector< Algorithm * > &  theAlgs 
)
protected

Append an algorithm to the sequencer.

Protected Member Functions.

Definition at line 429 of file Sequencer.cpp.

431 {
432  // Check that the specified algorithm doesn't already exist in the membership list
433  if (std::find(std::begin(theAlgs),std::end(theAlgs),pAlgorithm)!=std::end(theAlgs)) {
434  return StatusCode::FAILURE;
435  }
436  theAlgs.push_back( pAlgorithm );
437  pAlgorithm->addRef();
438  return StatusCode::SUCCESS;
439 }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
StatusCode Sequencer::append ( Algorithm pAlgorithm,
std::vector< Algorithm * > &  theAlgs 
)
protected

Append an algorithm to the sequencer.

StatusCode Sequencer::appendToBranch ( Algorithm pAlgorithm)

Append an algorithm to the sequencer branch.

StatusCode Sequencer::appendToBranch ( Algorithm pAlgorithm)

Append an algorithm to the sequencer branch.

Definition at line 339 of file Sequencer.cpp.

340 {
341  return append( pAlgorithm, branchAlgorithms( ) );
342 }
StatusCode append(Algorithm *pAlgorithm)
Append an algorithm to the sequencer.
Definition: Sequencer.cpp:333
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
StatusCode Sequencer::beginRun ( )
override

Sequencer beginRun.

StatusCode Sequencer::beginRun ( )
override

Sequencer beginRun.

Definition at line 215 of file Sequencer.cpp.

216 {
218  MsgStream log( msgSvc( ), name( ) );
219 
220  // Bypass the loop if this sequencer is disabled
221  if ( isEnabled( ) ) {
222 
223  // Loop over all members calling their sysInitialize functions
224  // if they are not disabled. Note that the Algoriithm::sysInitialize
225  // function protects this from affecting Algorithms that have already
226  // been initialized.
227  for (auto& alg : *subAlgorithms() ) {
228  result = alg->sysInitialize( );
229  if( result.isFailure() ) {
230  log << MSG::ERROR << "Unable to initialize Algorithm " << alg->name() << endmsg;
231  break;
232  }
233  result = alg->sysStart( );
234  if( result.isFailure() ) {
235  log << MSG::ERROR << "Unable to start Algorithm " << alg->name() << endmsg;
236  break;
237  }
238  }
239 
240  // Loop over all members calling their beginRun functions
241  // if they are not disabled.
242  for (auto& alg : *subAlgorithms() ) {
243  if ( ! alg->isEnabled( ) ) {
244  alg->beginRun( ).ignore();
245  }
246  }
247 
248  // Loop over all branch members calling their sysInitialize functions
249  // if they are not disabled. Note that the Algoriithm::sysInitialize
250  // function protects this from affecting Algorithms that have already
251  // been initialized.
252  for (auto& alg : branchAlgorithms() ) {
253  result = alg->sysInitialize( );
254  if( result.isFailure() ) {
255  log << MSG::ERROR << "Unable to initialize Algorithm " << alg->name() << endmsg;
256  break;
257  }
258  result = alg->sysStart( );
259  if( result.isFailure() ) {
260  log << MSG::ERROR << "Unable to start Algorithm " << alg->name() << endmsg;
261  break;
262  }
263  }
264 
265  // Loop over all branch members calling their beginRun functions
266  // if they are not disabled.
267  for (auto& alg : branchAlgorithms()) {
268  if ( ! alg->isEnabled( ) ) {
269  alg->beginRun( ).ignore();
270  }
271  }
272  }
273  return StatusCode::SUCCESS;
274 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:944
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
const std::vector< Algorithm * > & Sequencer::branchAlgorithms ( ) const

List of branch algorithms.

These are the algorithms that would get executed if a filter algorithm indicated a failure. The branch is located within the main sequence by the first element, which is the filter algorithm.

Definition at line 385 of file Sequencer.cpp.

385  {
386  return m_branchAlgs;
387 }
std::vector< Algorithm * > m_branchAlgs
Definition: Sequencer.h:242
const std::vector<Algorithm*>& Sequencer::branchAlgorithms ( ) const

List of branch algorithms.

These are the algorithms that would get executed if a filter algorithm indicated a failure. The branch is located within the main sequence by the first element, which is the filter algorithm.

std::vector< Algorithm * > & Sequencer::branchAlgorithms ( )

Definition at line 390 of file Sequencer.cpp.

390  {
391  return m_branchAlgs;
392 }
std::vector< Algorithm * > m_branchAlgs
Definition: Sequencer.h:242
std::vector<Algorithm*>& Sequencer::branchAlgorithms ( )
virtual bool Sequencer::branchFilterPassed ( ) const
virtual

additional interface methods

Was the branch filter passed for the last event?

bool Sequencer::branchFilterPassed ( ) const
virtual

additional interface methods

Was the branch filter passed for the last event?

Definition at line 314 of file Sequencer.cpp.

315 {
316  return m_branchFilterPassed;
317 }
bool m_branchFilterPassed
Definition: Sequencer.h:245
void Sequencer::branchMembershipHandler ( Property theProp)

"BranchMembers" property handler

Definition at line 419 of file Sequencer.cpp.

420 {
422 }
StatusCode decodeBranchMemberNames()
Decode branch member name list.
Definition: Sequencer.cpp:410
bool isInitialized() const override
Has the Algorithm already been initialized?
Definition: Algorithm.h:829
void Sequencer::branchMembershipHandler ( Property theProp)

"BranchMembers" property handler

StatusCode Sequencer::createAndAppend ( const std::string &  type,
const std::string &  name,
Algorithm *&  pAlgorithm 
)

Create a algorithm and append it to the sequencer.

A call to this method creates a child algorithm object. Note that the returned pointer is to Algorithm (as opposed to IAlgorithm), and thus the methods of IProperty are also available for the direct setting of the algorithm's properties. Using this mechanism instead of creating algorithms directly via the new operator is preferred since then the framework may take care of all of the necessary book-keeping.

StatusCode Sequencer::createAndAppend ( const std::string &  type,
const std::string &  name,
Algorithm *&  pAlgorithm 
)

Create a algorithm and append it to the sequencer.

A call to this method creates a child algorithm object. Note that the returned pointer is to Algorithm (as opposed to IAlgorithm), and thus the methods of IProperty are also available for the direct setting of the algorithm's properties. Using this mechanism instead of creating algorithms directly via the new operator is preferred since then the framework may take care of all of the necessary book-keeping.

Definition at line 345 of file Sequencer.cpp.

348 {
349  return createAndAppend( type, name, pAlgorithm, *subAlgorithms( ) );
350 }
const std::string & type() const override
The type of the algorithm object.
Definition: Algorithm.h:167
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
StatusCode createAndAppend(const std::string &type, const std::string &name, Algorithm *&pAlgorithm)
Create a algorithm and append it to the sequencer.
Definition: Sequencer.cpp:345
StatusCode Sequencer::createAndAppend ( const std::string &  type,
const std::string &  name,
Algorithm *&  pAlgorithm,
std::vector< Algorithm * > &  theAlgs 
)
protected

Create a algorithm and append it to the sequencer.

A call to this method creates a child algorithm object. Note that the returned pointer is to Algorithm (as opposed to IAlgorithm), and thus the methods of IProperty are also available for the direct setting of the algorithm's properties. Using this mechanism instead of creating algorithms directly via the new operator is preferred since then the framework may take care of all of the necessary book-keeping.

Definition at line 442 of file Sequencer.cpp.

446 {
447  MsgStream log( msgSvc( ), name( ) );
448  auto theAlgMgr = serviceLocator()->service<IAlgManager>("ApplicationMgr");
449  if ( !theAlgMgr ) return StatusCode::FAILURE;
450 
451  IAlgorithm* tmp;
452  StatusCode result = theAlgMgr->createAlgorithm( type, algName, tmp );
453  if ( result.isSuccess( ) ) {
454  try{
455  pAlgorithm = dynamic_cast<Algorithm*>(tmp);
456  theAlgs.push_back( pAlgorithm );
457  } catch(...){
458  log << MSG::ERROR << "Unable to create Algorithm " << algName << endmsg;
459  result = StatusCode::FAILURE;
460  }
461  }
462 
463  return result;
464 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Algorithm.cpp:1045
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
const std::string & type() const override
The type of the algorithm object.
Definition: Algorithm.h:167
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:23
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode Sequencer::createAndAppend ( const std::string &  type,
const std::string &  name,
Algorithm *&  pAlgorithm,
std::vector< Algorithm * > &  theAlgs 
)
protected

Create a algorithm and append it to the sequencer.

A call to this method creates a child algorithm object. Note that the returned pointer is to Algorithm (as opposed to IAlgorithm), and thus the methods of IProperty are also available for the direct setting of the algorithm's properties. Using this mechanism instead of creating algorithms directly via the new operator is preferred since then the framework may take care of all of the necessary book-keeping.

StatusCode Sequencer::createAndAppendToBranch ( const std::string &  type,
const std::string &  name,
Algorithm *&  pAlgorithm 
)

Create a algorithm and append it to the sequencer branch.

A call to this method creates a child algorithm object. Note that the returned pointer is to Algorithm (as opposed to IAlgorithm), and thus the methods of IProperty are also available for the direct setting of the algorithm's properties. Using this mechanism instead of creating algorithms directly via the new operator is preferred since then the framework may take care of all of the necessary book-keeping.

Definition at line 353 of file Sequencer.cpp.

356 {
357  return createAndAppend( type, name, pAlgorithm, branchAlgorithms( ) );
358 }
const std::string & type() const override
The type of the algorithm object.
Definition: Algorithm.h:167
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
StatusCode createAndAppend(const std::string &type, const std::string &name, Algorithm *&pAlgorithm)
Create a algorithm and append it to the sequencer.
Definition: Sequencer.cpp:345
StatusCode Sequencer::createAndAppendToBranch ( const std::string &  type,
const std::string &  name,
Algorithm *&  pAlgorithm 
)

Create a algorithm and append it to the sequencer branch.

A call to this method creates a child algorithm object. Note that the returned pointer is to Algorithm (as opposed to IAlgorithm), and thus the methods of IProperty are also available for the direct setting of the algorithm's properties. Using this mechanism instead of creating algorithms directly via the new operator is preferred since then the framework may take care of all of the necessary book-keeping.

StatusCode Sequencer::decodeBranchMemberNames ( )

Decode branch member name list.

Definition at line 410 of file Sequencer.cpp.

411 {
412  // Decode the branch membership list
413  return decodeNames( m_branchNames,
414  branchAlgorithms( ),
416 }
std::vector< bool > m_isBranchInverted
Definition: Sequencer.h:243
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
StringArrayProperty m_branchNames
Definition: Sequencer.h:241
StatusCode decodeNames(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs, std::vector< bool > &theLogic)
Decode algorithm names, creating or appending algorithms as appropriate.
Definition: Sequencer.cpp:467
StatusCode Sequencer::decodeBranchMemberNames ( )

Decode branch member name list.

StatusCode Sequencer::decodeMemberNames ( )

Decode Member Name list.

Definition at line 395 of file Sequencer.cpp.

396 {
397  // Decode the membership list
398  return decodeNames( m_names,
399  *subAlgorithms( ),
400  m_isInverted );
401 }
StatusCode decodeNames(StringArrayProperty &theNames, std::vector< Algorithm * > &theAlgs, std::vector< bool > &theLogic)
Decode algorithm names, creating or appending algorithms as appropriate.
Definition: Sequencer.cpp:467
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
std::vector< bool > m_isInverted
Definition: Sequencer.h:240
StringArrayProperty m_names
Definition: Sequencer.h:239
StatusCode Sequencer::decodeMemberNames ( )

Decode Member Name list.

StatusCode Sequencer::decodeNames ( StringArrayProperty theNames,
std::vector< Algorithm * > &  theAlgs,
std::vector< bool > &  theLogic 
)
protected

Decode algorithm names, creating or appending algorithms as appropriate.

Definition at line 467 of file Sequencer.cpp.

470 {
471  StatusCode result;
472  MsgStream log( msgSvc( ), name( ) );
473  auto theAlgMgr = serviceLocator()->service<IAlgManager>("ApplicationMgr");
474  if ( theAlgMgr ) {
475  // Clear the existing list of algorithms
476  theAlgs.clear( );
477 
478  // Build the list of member algorithms from the contents of the
479  // theNames list.
480  for (const auto& n : theNames.value() ) {
481 
482  // Parse the name for a syntax of the form:
483  //
484  // <type>/<name>
485  //
486  // Where <name> is the algorithm instance name, and <type> is the
487  // algorithm class type (being a subclass of Algorithm).
489  std::string theName = typeName.name();
490  std::string theType = typeName.type();
491 
492  // Parse the name for a syntax of the form:
493  //
494  // <name>:invert
495  //
496  // Where <name> is the algorithm instance name and ":invert"
497  // indicates that the filter passed logic is inverted.
498  bool isInverted = false;
499  std::string::size_type invert = theName.find_first_of( ":" );
500  // Skip all occurrences of "::" (allow namespaces)
501  while ( std::string::npos != invert
502  && invert < (theName.size() - 1) && theName[invert+1] == ':' )
503  invert = theName.find_first_of( ":", invert+2 );
504  if ( std::string::npos != invert ) {
505  if ( theName == theType ) {
506  // This means that we got something like "Type:invert",
507  // so we have to strip the ":invert" from the type too.
508  theType = theType.substr( 0, invert );
509  }
510  theName = theName.substr( 0, invert );
511  isInverted = true;
512  }
513  // Check whether the supplied name corresponds to an existing
514  // Algorithm object.
515  SmartIF<IAlgorithm>& theIAlg = theAlgMgr->algorithm(theName, false);
516  Algorithm* theAlgorithm = nullptr;
518  if ( theIAlg ) {
519  try{
520  theAlgorithm = dynamic_cast<Algorithm*>(theIAlg.get());
521  } catch(...){
522  log << MSG::WARNING << theName << " is not an Algorithm - Failed dynamic cast" << endmsg;
523  theAlgorithm = nullptr; // release
524  }
525  }
526  if ( theAlgorithm ) {
527 
528  // The specified Algorithm already exists - just append it to the membership list.
529  status = append( theAlgorithm, theAlgs );
530  if ( status.isSuccess( ) ) {
531  ON_DEBUG log << MSG::DEBUG << theName << " already exists - appended to member list" << endmsg;
532  } else {
533  log << MSG::WARNING << theName << " already exists - append failed!!!" << endmsg;
534  result = StatusCode::FAILURE;
535  }
536  } else {
537 
538  // The specified name doesn't exist - create a new object of the specified type
539  // and append it to the membership list.
540  status = createAndAppend( theType, theName, theAlgorithm, theAlgs );
541  if ( status.isSuccess( ) ) {
542  ON_DEBUG log << MSG::DEBUG << theName << " doesn't exist - created and appended to member list" << endmsg;
543  } else {
544  log << MSG::WARNING << theName << " doesn't exist - creation failed!!!" << endmsg;
545  result = StatusCode::FAILURE;
546  }
547  }
548  if ( status.isSuccess( ) ) theLogic.push_back( isInverted );
549  }
550 
551  }
552  // Print membership list
553  if ( result.isSuccess() && theAlgs.size() != 0 ) {
554  log << MSG::INFO << "Member list: ";
555  auto ai = theAlgs.begin();
556  auto li = theLogic.begin();
557  for ( ; ai != theAlgs.end(); ++ai, ++li ) {
558 
559  if ( ai != theAlgs.begin() ) log << ", ";
560  auto alg = *ai;
561  if ( alg->name() == System::typeinfoName(typeid(*alg)) )
562  log << alg->name();
563  else
564  log << System::typeinfoName(typeid(*alg)) << "/" << alg->name();
565 
566  if (*li) log << ":invert";
567  }
568  log << endmsg;
569  }
570  return result;
571 }
StatusCode append(Algorithm *pAlgorithm)
Append an algorithm to the sequencer.
Definition: Sequencer.cpp:333
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Algorithm.cpp:1045
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
const TYPE & value() const
explicit conversion
Definition: Property.h:341
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
#define ON_DEBUG
Definition: Sequencer.cpp:15
StatusCode createAndAppend(const std::string &type, const std::string &name, Algorithm *&pAlgorithm)
Create a algorithm and append it to the sequencer.
Definition: Sequencer.cpp:345
std::string typeName(const std::type_info &typ)
Definition: Dictionary.cpp:21
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode Sequencer::decodeNames ( StringArrayProperty theNames,
std::vector< Algorithm * > &  theAlgs,
std::vector< bool > &  theLogic 
)
protected

Decode algorithm names, creating or appending algorithms as appropriate.

StatusCode Sequencer::endRun ( )
override

Sequencer endRun.

Definition at line 277 of file Sequencer.cpp.

278 {
279  // Bypass the loop if this sequencer is disabled
280  if ( isEnabled( ) ) {
281 
282  // Loop over all members calling their endRun functions
283  // if they are not disabled.
284  for (auto& alg : *subAlgorithms()) {
285  if ( ! alg->isEnabled( ) ) alg->endRun( ).ignore();
286  }
287  // Loop over all branch members calling their endRun functions
288  // if they are not disabled.
289  for (auto& alg : branchAlgorithms()) {
290  if ( ! alg->isEnabled( ) ) alg->endRun( ).ignore();
291  }
292  }
293  return StatusCode::SUCCESS;
294 }
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:944
StatusCode Sequencer::endRun ( )
override

Sequencer endRun.

StatusCode Sequencer::execute ( )
override

The actions to be performed by the sequencer on an event.

This method is invoked once per event.

StatusCode Sequencer::execute ( )
override

The actions to be performed by the sequencer on an event.

This method is invoked once per event.

Definition at line 98 of file Sequencer.cpp.

99 {
101  MsgStream log( msgSvc( ), name( ) );
102 
103  ON_DEBUG log << MSG::DEBUG << name( ) << " Sequencer::execute( )" << endmsg;
104 
105  // Bypass the loop if this sequencer is disabled or has already been executed
106  if ( isEnabled( ) && ! isExecuted( ) ) {
107  Algorithm* lastAlgorithm;
108  result = execute( *subAlgorithms( ), m_isInverted, lastAlgorithm );
109  if ( result.isSuccess( ) ) {
110  bool passed = filterPassed( );
111  if ( ! passed && ! isStopOverride( ) ) {
112 
113  // Filter failed and stop override not set. Execute the
114  // branch if there is one associated with the filter
115  // algorithm that failed. Note that the first member on
116  // the branch is the failing algorithm and so should
117  // be skipped.
118  const auto& theAlgs = branchAlgorithms( );
119  if ( !theAlgs.empty( ) ) {
120  Algorithm* branchAlgorithm = theAlgs[0];
121  if ( lastAlgorithm == branchAlgorithm ) {
122 
123  // Branch specified - Loop over branch members
124  result = execute( branchAlgorithms( ),
126  lastAlgorithm, 1 );
127  if ( result.isSuccess( ) ) {
128 
129  // The final filter passed state will be set true if either
130  // of the main or branches passed, otherwise false.
131 
132  // Save the branch filter passed state.
134  }
135  }
136  }
137  }
138  }
139 
140  // Prevent multiple executions of this sequencer for the current event
141  setExecuted( true );
142  }
143  return result;
144 }
std::vector< bool > m_isBranchInverted
Definition: Sequencer.h:243
virtual bool isStopOverride() const
Has the StopOverride mode been set?
Definition: Sequencer.cpp:327
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
Definition: Algorithm.cpp:948
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
virtual StatusCode setBranchFilterPassed(bool state)
Set the branch filter passed flag for the last event.
Definition: Sequencer.cpp:320
void setExecuted(bool state) override
Set the executed flag to the specified state.
Definition: Algorithm.cpp:935
StatusCode execute() override
The actions to be performed by the sequencer on an event.
Definition: Sequencer.cpp:98
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool isExecuted() const override
Has this algorithm been executed since the last reset?
Definition: Algorithm.cpp:931
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
#define ON_DEBUG
Definition: Sequencer.cpp:15
std::vector< bool > m_isInverted
Definition: Sequencer.h:240
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:944
void ignore() const
Definition: StatusCode.h:108
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode Sequencer::execute ( const std::vector< Algorithm * > &  theAlgs,
std::vector< bool > &  theLogic,
Algorithm *&  lastAlgorithm,
unsigned int  first = 0 
)
protected

Execute the members in the specified list.

Definition at line 574 of file Sequencer.cpp.

578 {
580 
581  // Loop over all algorithms calling their execute functions if they
582  // are (a) not disabled, and (b) aren't already executed. Note that
583  // in the latter case the filter state is still examined. Terminate
584  // the loop if an algorithm indicates that it's filter didn't pass.
585  unsigned int size = theAlgs.size( );
586  for (unsigned int i = first; i < size; i++) {
587  lastAlgorithm = theAlgs[i];
588  result = executeMember( lastAlgorithm );
589  if ( result.isSuccess( ) ) {
590 
591  // Take the filter passed status of this algorithm as my own status.
592  // Note that we take into account inverted logic.
593  bool passed = lastAlgorithm->filterPassed( );
594  bool isInverted = theLogic[i];
595  if ( isInverted ) passed = ! passed;
596  setFilterPassed( passed );
597 
598  // The behaviour when the filter fails depends on the StopOverride property.
599  // The default action is to stop processing, but this default can be
600  // overridden by setting the "StopOverride" property to true.
601  if ( ! isStopOverride( ) ) {
602  if ( ! passed ) break;
603  }
604  } else {
605  break;
606  }
607  }
608  return result;
609 }
virtual bool isStopOverride() const
Has the StopOverride mode been set?
Definition: Sequencer.cpp:327
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
Definition: Algorithm.cpp:948
StatusCode executeMember(Algorithm *theAlgorithm)
Execute member algorithm.
Definition: Sequencer.cpp:612
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
list i
Definition: ana.py:128
void setFilterPassed(bool state) override
Set the filter passed flag to the specified state.
Definition: Algorithm.cpp:952
StatusCode Sequencer::execute ( const std::vector< Algorithm * > &  theAlgs,
std::vector< bool > &  theLogic,
Algorithm *&  lastAlgorithm,
unsigned int  first = 0 
)
protected

Execute the members in the specified list.

StatusCode Sequencer::executeMember ( Algorithm theAlgorithm)
protected

Execute member algorithm.

StatusCode Sequencer::executeMember ( Algorithm theAlgorithm)
protected

Execute member algorithm.

Definition at line 612 of file Sequencer.cpp.

613 {
615  if ( theAlgorithm->isEnabled( ) ) {
616  if ( ! theAlgorithm->isExecuted( ) ) {
617  result = theAlgorithm->sysExecute( );
618 
619  // Set the executed state of the algorithm.
620  // I think this should be done by the algorithm itself, but just in case...
621  theAlgorithm->setExecuted( true );
622  }
623  }
624  return result;
625 }
void setExecuted(bool state) override
Set the executed flag to the specified state.
Definition: Algorithm.cpp:935
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode sysExecute() override
The actions to be performed by the algorithm on an event.
Definition: Algorithm.cpp:652
bool isExecuted() const override
Has this algorithm been executed since the last reset?
Definition: Algorithm.cpp:931
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:944
StatusCode Sequencer::finalize ( )
override

Sequencer finalization.

StatusCode Sequencer::finalize ( )
override

Sequencer finalization.

Definition at line 147 of file Sequencer.cpp.

148 {
149  // Loop over all branch members calling their finalize functions
150  // if they are not disabled. Note that the Algorithm::sysFinalize
151  // function already does this for the main members.
152  for (auto & alg : branchAlgorithms() ) {
153  if (alg->sysFinalize( ).isFailure()) {
154  MsgStream log( msgSvc( ), name( ) );
155  log << MSG::ERROR << "Unable to finalize Algorithm "
156  << alg->name() << endmsg;
157  }
158  }
159  return StatusCode::SUCCESS;
160 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode Sequencer::initialize ( )
override

Initialization of a sequencer.

Typically things like histogram creation, setting up of data structures etc, should be done here. If a sequence has properties specified in the job options file, they will be set to the requested values BEFORE the initialize() method is invoked.

Definition at line 36 of file Sequencer.cpp.

37 {
39  MsgStream log( msgSvc( ), name( ) );
40 
41 
42  result = decodeMemberNames();
43  if( result.isFailure() ) {
44  log << MSG::ERROR << "Unable to configure one or more sequencer members " << endmsg;
45  return result;
46  }
47  result = decodeBranchMemberNames();
48  if( result.isFailure() ) {
49  log << MSG::ERROR << "Unable to configure one or more branch members " << endmsg;
50  return result;
51  }
52 
53  // Loop over all sub-algorithms
54  for (auto& alg : *subAlgorithms() ) {
55  result = alg->sysInitialize( );
56  if( result.isFailure() ) {
57  log << MSG::ERROR << "Unable to initialize Algorithm " << alg->name() << endmsg;
58  return result;
59  }
60  }
61 
62  // Loop over all branches
63  for (auto& alg : branchAlgorithms() ) {
64  result = alg->sysInitialize( );
65  if( result.isFailure() ) {
66  log << MSG::ERROR << "Unable to initialize Algorithm " << alg->name() << endmsg;
67  return result;
68  }
69  }
70 
71  return result;
72 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode decodeBranchMemberNames()
Decode branch member name list.
Definition: Sequencer.cpp:410
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
StatusCode decodeMemberNames()
Decode Member Name list.
Definition: Sequencer.cpp:395
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode Sequencer::initialize ( )
override

Initialization of a sequencer.

Typically things like histogram creation, setting up of data structures etc, should be done here. If a sequence has properties specified in the job options file, they will be set to the requested values BEFORE the initialize() method is invoked.

virtual bool Sequencer::isStopOverride ( ) const
virtual

Has the StopOverride mode been set?

bool Sequencer::isStopOverride ( ) const
virtual

Has the StopOverride mode been set?

Definition at line 327 of file Sequencer.cpp.

328 {
329  return m_stopOverride.value( );
330 }
BooleanProperty m_stopOverride
Definition: Sequencer.h:244
const TYPE & value() const
explicit conversion
Definition: Property.h:341
void Sequencer::membershipHandler ( Property theProp)

"Members" property handler

void Sequencer::membershipHandler ( Property theProp)

"Members" property handler

Definition at line 404 of file Sequencer.cpp.

405 {
406  if ( isInitialized() ) decodeMemberNames();
407 }
StatusCode decodeMemberNames()
Decode Member Name list.
Definition: Sequencer.cpp:395
bool isInitialized() const override
Has the Algorithm already been initialized?
Definition: Algorithm.h:829
Sequencer& Sequencer::operator= ( const Sequencer rhs)
protecteddelete
Sequencer& Sequencer::operator= ( const Sequencer rhs)
protecteddelete
StatusCode Sequencer::reinitialize ( )
override

Sequencer Reinitialization.

StatusCode Sequencer::reinitialize ( )
override

Sequencer Reinitialization.

Definition at line 75 of file Sequencer.cpp.

76 {
77  // Bypass the loop if this sequencer is disabled
78  if ( isEnabled( ) ) {
79 
80  // Loop over all members calling their reinitialize functions
81  // if they are not disabled.
82  for (auto& alg : *subAlgorithms() ) {
83  if ( alg->isEnabled( ) ) alg->reinitialize( ).ignore();
84  }
85  // Loop over all branch members calling their reinitialize functions
86  // if they are not disabled.
87  for (auto& alg : branchAlgorithms() ) {
88  if ( alg->isEnabled( ) ) {
89  alg->reinitialize( ).ignore();
90  }
91  }
92 
93  }
94  return StatusCode::SUCCESS;
95 }
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:944
StatusCode Sequencer::remove ( Algorithm pAlgorithm)

Remove the specified algorithm from the sequencer.

Definition at line 361 of file Sequencer.cpp.

362 {
363  return remove( pAlgorithm->name( ) );
364 }
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
StatusCode Sequencer::remove ( Algorithm pAlgorithm)

Remove the specified algorithm from the sequencer.

StatusCode Sequencer::remove ( const std::string &  name)

Definition at line 367 of file Sequencer.cpp.

368 {
369  return remove( algname, *subAlgorithms( ) );
370 }
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
StatusCode Sequencer::remove ( const std::string &  name)
StatusCode Sequencer::remove ( const std::string &  algname,
std::vector< Algorithm * > &  theAlgs 
)
protected

Remove the specified algorithm from the sequencer.

StatusCode Sequencer::remove ( const std::string &  algname,
std::vector< Algorithm * > &  theAlgs 
)
protected

Remove the specified algorithm from the sequencer.

Definition at line 628 of file Sequencer.cpp.

629 {
630  MsgStream log( msgSvc( ), name( ) );
632 
633  // Test that the algorithm exists in the member list
634  for (auto& alg : theAlgs ) {
635  if ( alg->name( ) == algname ) {
636 
637  // Algorithm with specified name exists in the algorithm list - remove it
638  // THIS ISN'T IMPLEMENTED YET!!!!
639  log << MSG::INFO <<"Sequencer::remove( ) isn't implemented yet!!!!!" << endmsg;
640  result = StatusCode::SUCCESS;
641  break;
642  }
643  }
644  return result;
645 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode Sequencer::removeFromBranch ( Algorithm pAlgorithm)
StatusCode Sequencer::removeFromBranch ( Algorithm pAlgorithm)

Definition at line 373 of file Sequencer.cpp.

374 {
375  return removeFromBranch( pAlgorithm->name( ) );
376 }
StatusCode removeFromBranch(Algorithm *pAlgorithm)
Definition: Sequencer.cpp:373
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
StatusCode Sequencer::removeFromBranch ( const std::string &  name)
StatusCode Sequencer::removeFromBranch ( const std::string &  name)

Definition at line 379 of file Sequencer.cpp.

380 {
381  return remove( algname, branchAlgorithms( ) );
382 }
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
void Sequencer::resetExecuted ( )
override

Reset the Sequencer executed state for the current event.

Definition at line 297 of file Sequencer.cpp.

298 {
300 
301  // Loop over all members calling their resetExecuted functions
302  // if they are not disabled.
303  for (auto& alg : *subAlgorithms() ) alg->resetExecuted( );
304 
305  // Loop over all branch members calling their resetExecuted functions
306  // if they are not disabled.
307  for (auto& alg : branchAlgorithms() ) alg->resetExecuted( );
308 
309  // Reset the branch filter passed flag
310  m_branchFilterPassed = false;
311 }
void resetExecuted() override
Reset the executed state of the Algorithm for the duration of the current event.
Definition: Algorithm.cpp:939
bool m_branchFilterPassed
Definition: Sequencer.h:245
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
void Sequencer::resetExecuted ( )
override

Reset the Sequencer executed state for the current event.

virtual StatusCode Sequencer::setBranchFilterPassed ( bool  state)
virtual

Set the branch filter passed flag for the last event.

StatusCode Sequencer::setBranchFilterPassed ( bool  state)
virtual

Set the branch filter passed flag for the last event.

Definition at line 320 of file Sequencer.cpp.

321 {
323  return StatusCode::SUCCESS;
324 }
bool m_branchFilterPassed
Definition: Sequencer.h:245
StatusCode Sequencer::start ( )
override

Sequencer finalization.

Definition at line 163 of file Sequencer.cpp.

164 {
166  MsgStream log( msgSvc( ), name( ) );
167 
168 
169  // Loop over all sub-algorithms
170  for (auto& alg : *subAlgorithms() ) {
171  result = alg->sysStart( );
172  if( result.isFailure() ) {
173  log << MSG::ERROR << "Unable to start Algorithm " << alg->name() << endmsg;
174  return result;
175  }
176  }
177 
178  // Loop over all branches
179  for (auto& alg : branchAlgorithms() ) {
180  result = alg->sysStart( );
181  if( result.isFailure() ) {
182  log << MSG::ERROR << "Unable to start Algorithm " << alg->name() << endmsg;
183  return result;
184  }
185  }
186 
187  return result;
188 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
StatusCode Sequencer::start ( )
override

Sequencer finalization.

StatusCode Sequencer::stop ( )
override

Sequencer finalization.

StatusCode Sequencer::stop ( )
override

Sequencer finalization.

Definition at line 191 of file Sequencer.cpp.

192 {
193  // Loop over all branch members calling their finalize functions
194  // if they are not disabled.
195 
196  for (auto& alg : *subAlgorithms() ) {
197  if (alg->sysStop( ).isFailure()) {
198  MsgStream log( msgSvc( ), name( ) );
199  log << MSG::ERROR << "Unable to stop Algorithm "
200  << alg->name() << endmsg;
201  }
202  }
203 
204  for (auto& alg : branchAlgorithms() ) {
205  if (alg->sysStop( ).isFailure()) {
206  MsgStream log( msgSvc( ), name( ) );
207  log << MSG::ERROR << "Unable to stop Algorithm "
208  << alg->name() << endmsg;
209  }
210  }
211  return StatusCode::SUCCESS;
212 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::vector< Algorithm * > & branchAlgorithms() const
List of branch algorithms.
Definition: Sequencer.cpp:385
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
const std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition: Algorithm.cpp:956
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001

Member Data Documentation

std::vector< Algorithm * > Sequencer::m_branchAlgs
private

Definition at line 242 of file Sequencer.h.

bool Sequencer::m_branchFilterPassed = false
private

Definition at line 245 of file Sequencer.h.

StringArrayProperty Sequencer::m_branchNames
private

Definition at line 241 of file Sequencer.h.

std::vector< bool > Sequencer::m_isBranchInverted
private

Definition at line 243 of file Sequencer.h.

std::vector< bool > Sequencer::m_isInverted
private

Definition at line 240 of file Sequencer.h.

StringArrayProperty Sequencer::m_names
private

Definition at line 239 of file Sequencer.h.

BooleanProperty Sequencer::m_stopOverride
private

Definition at line 244 of file Sequencer.h.


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