4 #include "GaudiKernel/IAlgManager.h"
5 #include "GaudiAlg/GaudiSequencer.h"
6 #include "GaudiAlg/ISequencerTimerTool.h"
7 #include "GaudiKernel/IJobOptionsSvc.h"
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 #pragma warning(push)
184 #pragma warning(disable:1572)
193 bool addedContext =
false;
194 bool addedRootInTES =
false;
195 bool addedGlobalTimeOffset =
false;
200 const std::vector<std::string>& nameVector =
m_names.
value();
201 std::vector<std::string>::const_iterator it;
202 for ( it = nameVector.begin(); nameVector.end() != it; it++ ) {
204 const std::string &theName = typeName.
name();
205 const std::string &theType = typeName.
type();
215 bool foundContext =
false;
216 bool foundRootInTES =
false;
217 bool foundGlobalTimeOffset =
false;
218 const std::vector<const Property*>* properties = jos->
getProperties( theName );
219 if ( 0 != properties ) {
221 for ( std::vector<const Property*>::const_iterator itProp = properties->begin();
222 itProp != properties->end();
226 if (
"Context" == (*itProp)->name() ) {
229 if (
"RootInTES" == (*itProp)->name() ) {
230 foundRootInTES =
true;
232 if (
"GlobalTimeOffset" == (*itProp)->name() ) {
233 foundGlobalTimeOffset =
true;
238 if ( !foundContext &&
"" !=
context() ) {
243 if ( !foundRootInTES &&
"" !=
rootInTES() ) {
246 addedRootInTES =
true;
251 addedGlobalTimeOffset =
true;
270 if ( addedContext ) {
272 addedContext =
false;
274 if ( addedRootInTES ) {
276 addedRootInTES =
false;
278 if ( addedGlobalTimeOffset ) {
280 addedGlobalTimeOffset =
false;
313 warning() << theName <<
" is not an Algorithm - failed dynamic_cast"
318 warning() <<
"Unable to find or create " << theName <<
endmsg;
330 msg <<
"Member list: ";
331 std::vector<AlgorithmEntry>::iterator itE;
335 if ( myAlg->
name() == myAlgType ) {
336 msg << myAlg->
name();
338 msg << myAlgType <<
"/" << myAlg->
name();
340 if ( itE+1 !=
m_entries.end() ) msg <<
", ";
342 if (
"" !=
context() ) msg <<
", with context '" <<
context() <<
"'";
370 {
m_timerTool = tool<ISequencerTimerTool>(
"SequencerTimerTool" ) ; }
377 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.
virtual StatusCode sysStart()=0
Startup method invoked by the framework.
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.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual StatusCode sysExecute()
The actions to be performed by the algorithm on an event.
bool isSuccess() const
Test for a status code of SUCCESS.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
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.
virtual StatusCode sysInitialize()=0
Initialization method invoked by the framework.
MSG::Level msgLevel() const
The current message service output level.
TYPE * get() const
Get interface pointer.
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
virtual StatusCode finalize()
standard finalization method
Helper class to parse a string of format "type/name".
Main interface for the JobOptions service.
virtual Gaudi::StateMachine::State FSMState() const =0
Get the current state.
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 )
const TYPE & value() const
explicit conversion
virtual StatusCode beginRun()
Algorithm beginRun.
StatusCode decodeNames()
Decode a vector of string.
Base class from which all concrete algorithm classes should be derived.
Property base class allowing Property* collections to be "homogeneous".
bool isValid() const
Allow for check if smart pointer is valid.
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.
std::vector< AlgorithmEntry > m_entries
List of algorithms to process.
int m_timer
Timer number for the sequencer.
ISequencerTimerTool * m_timerTool
Pointer to the timer tool.
StringArrayProperty m_names
Input string, list of algorithms.