48 m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" );
60 std::vector<AlgorithmEntry>::iterator itE;
66 status = itE->algorithm()->sysInitialize();
68 return Error(
"Can not initialize " + itE->algorithm()->name(),
92 std::vector<AlgorithmEntry>::const_iterator itE;
107 verbose() <<
"Algorithm " << myAlg->
name() <<
" returned filter passed "
108 << (passed ?
"true" :
"false") <<
endmsg;
109 if ( itE->reverse() ) passed = !passed;
127 if (
m_modeOR ? passed : !passed ) {
130 verbose() <<
"SeqPass is now " << (seqPass ?
"true" :
"false") <<
endmsg;
137 verbose() <<
"SeqPass is " << (seqPass ?
"true" :
"false") <<
endmsg;
183 std::vector<AlgorithmEntry>::const_iterator itE;
185 itE->algorithm()->resetExecuted();
194 #pragma warning(push)
195 #pragma warning(disable:1572)
204 bool addedContext =
false;
205 bool addedRootInTES =
false;
206 bool addedGlobalTimeOffset =
false;
211 const std::vector<std::string>& nameVector =
m_names.
value();
212 std::vector<std::string>::const_iterator it;
213 for ( it = nameVector.begin(); nameVector.end() != it; it++ ) {
215 const std::string &theName = typeName.
name();
216 const std::string &theType = typeName.
type();
226 bool foundContext =
false;
227 bool foundRootInTES =
false;
228 bool foundGlobalTimeOffset =
false;
229 const std::vector<const Property*>* properties = jos->
getProperties( theName );
230 if ( 0 != properties ) {
232 for ( std::vector<const Property*>::const_iterator itProp = properties->begin();
233 itProp != properties->end();
237 if (
"Context" == (*itProp)->name() ) {
240 if (
"RootInTES" == (*itProp)->name() ) {
241 foundRootInTES =
true;
243 if (
"GlobalTimeOffset" == (*itProp)->name() ) {
244 foundGlobalTimeOffset =
true;
249 if ( !foundContext &&
"" !=
context() ) {
254 if ( !foundRootInTES &&
"" !=
rootInTES() ) {
257 addedRootInTES =
true;
262 addedGlobalTimeOffset =
true;
281 if ( addedContext ) {
283 addedContext =
false;
285 if ( addedRootInTES ) {
287 addedRootInTES =
false;
289 if ( addedGlobalTimeOffset ) {
291 addedGlobalTimeOffset =
false;
324 warning() << theName <<
" is not an Algorithm - failed dynamic_cast"
329 warning() <<
"Unable to find or create " << theName <<
endmsg;
341 msg <<
"Member list: ";
342 std::vector<AlgorithmEntry>::iterator itE;
346 if ( myAlg->
name() == myAlgType ) {
347 msg << myAlg->
name();
349 msg << myAlgType <<
"/" << myAlg->
name();
351 if ( itE+1 !=
m_entries.end() ) msg <<
", ";
353 if (
"" !=
context() ) msg <<
", with context '" <<
context() <<
"'";
381 {
m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" ) ; }
388 for ( std::vector<AlgorithmEntry>::iterator itE =
m_entries.begin() ;
MsgStream & warning() const
shortcut for the method msgStream ( MSG::WARNING )
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
void membershipHandler(Property &theProp)
for asynchronous changes in the list of algorithms
std::vector< Algorithm * > * subAlgorithms() const
List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
Definition of the MsgStream class used to transmit messages.
virtual const std::vector< const Property * > * getProperties(const std::string &client) const =0
Get the properties associated to a given client.
bool m_shortCircuit
Indicates whether to stop processing as soon as possible, or to always execute all subalgorithms...
virtual void setExecuted(bool state)
Set the executed flag to the specified state.
MsgStream & info() const
shortcut for the method msgStream ( MSG::INFO )
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode createSubAlgorithm(const std::string &type, const std::string &name, Algorithm *&pSubAlg)
Create a sub algorithm.
const std::string & rootInTES() const
Returns the "rootInTES" string.
virtual bool filterPassed() const
Did this algorithm pass or fail its filter criterion for the last event?
bool m_returnOK
Forces the sequencer to return a good status.
bool m_modeOR
Indicates that the OR is wanted instead of AND.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
virtual StatusCode sysExecute()
The actions to be performed by the algorithm on an event.
bool isSuccess() const
Test for a status code of SUCCESS.
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.
virtual bool isEnabled() const
Is this algorithm enabled or disabled?
virtual StatusCode initialize()
standard initialization method
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
virtual bool isExecuted() const
Has this algorithm been executed since the last reset?
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
const std::string & context() const
Returns the "context" string. Used to identify different processing states.
bool isFailure() const
Test for a status code of FAILURE.
MSG::Level msgLevel() const
The current message service output level.
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
virtual StatusCode finalize()
standard finalization method
ISequencerTimerTool * m_timerTool
Pointer to the timer tool.
Helper class to parse a string of format "type/name".
Main interface for the JobOptions service.
virtual void resetExecuted()
Reset the executed state of the Algorithm for the duration of the current event.
bool isValid() const
Allow for check if smart pointer is valid.
virtual unsigned long release()
Un-hide IInterface::release (ICC warning #1125)
This class is used for returning status codes from appropriate routines.
virtual void setFilterPassed(bool state)
Set the filter passed flag to the specified state.
MsgStream & verbose() const
shortcut for the method msgStream ( MSG::VERBOSE )
virtual StatusCode finalize()
Algorithm finalization.
virtual Gaudi::StateMachine::State FSMState() const
returns the current state of the algorithm
bool m_measureTime
Flag to measure time.
virtual StatusCode execute()
Algorithm execution.
virtual const std::string & name() const
The identifying name of the algorithm object.
The useful base class for data processing algorithms.
MsgStream & msg() const
shortcut for the method msgStream ( MSG::INFO )
MsgStream & debug() const
shortcut for the method msgStream ( MSG::DEBUG )
TYPE * get() const
Get interface pointer.
const TYPE & value() const
explicit conversion
virtual StatusCode beginRun()
Algorithm beginRun.
StatusCode decodeNames()
Decode a vector of string.
void resetExecuted()
Called before an event processing.
Base class from which all concrete algorithm classes should be derived.
Property base class allowing Property* collections to be "homogeneous".
const std::string & type() const
virtual StatusCode removePropertyFromCatalogue(const std::string &client, const std::string &name)=0
Remove a property from the JobOptions catalog.
virtual ~GaudiSequencer()
Destructor.
virtual StatusCode addPropertyToCatalogue(const std::string &client, const Property &property)=0
Add a property into the JobOptions catalog.
virtual StatusCode initialize()
Algorithm initialization.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
GaudiSequencer(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
const std::string & name() const
double globalTimeOffset() const
Returns the "globalTimeOffset" double.
std::string typeName(const std::type_info &typ)
virtual StatusCode endRun()
Algorithm endRun.
bool m_ignoreFilter
True if one continues always.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
int m_timer
Timer number for the sequencer.
std::vector< AlgorithmEntry > m_entries
List of algorithms to process.
StringArrayProperty m_names
Input string, list of algorithms.