2 #include "GaudiKernel/SvcFactory.h"
3 #include "GaudiKernel/IAlgorithm.h"
4 #include "GaudiKernel/Algorithm.h"
5 #include "GaudiKernel/IProperty.h"
6 #include "GaudiKernel/AppReturnCode.h"
25 m_eventContext(
nullptr),
27 declareProperty(
"UseTopAlgList", m_useTopAlgList=
true);
39 warning () <<
"Base class could not be initialized" <<
endmsg;
43 if (!algResourcePool.
isValid()){
44 error() <<
"Error retrieving AlgResourcePool" <<
endmsg;
60 warning () <<
"Base class could not be finalized" <<
endmsg;
80 if (
LIKELY(
nullptr != ialg)) ialg->resetExecuted();
85 bool eventfailed=
false;
92 "SequentialSchedulerSvc",
96 debug() <<
"Running algorithm " << this_algo->
name() <<
endmsg;
108 sc = ialgorithm->sysExecute();
110 warning() <<
"Execution of algorithm " << ialgorithm->name() <<
" failed" <<
endmsg;
115 error() <<
".executeEvent(): Exception with tag=" << Exception.
tag()
116 <<
" thrown by " << ialgorithm->name() <<
endmsg;
117 error() << Exception <<
endmsg;
118 }
catch (
const std::exception& Exception ) {
119 fatal() <<
".executeEvent(): Standard std::exception thrown by "
120 << ialgorithm->name() <<
endmsg;
121 error() << Exception.what() <<
endmsg;
123 fatal() <<
".executeEvent(): UNKNOWN Exception thrown by "
124 << ialgorithm->name() <<
endmsg;
127 debug() <<
"Algorithm " << this_algo->
name() << (eventfailed ?
" failed" :
" succeeded") << endmsg;
128 debug() <<
"Algorithm " << this_algo->
name() << (this_algo->
filterPassed() ?
" passed" :
" rejected") << endmsg;
145 for (
auto context : eventContexts){
StatusCode initialize() override
Define general base for Gaudi exception.
Helper class to set the application return code in case of early exit (e.g.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode finalize() override
std::list< IAlgorithm * > m_algList
Cache the list of algs to be executed.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual StatusCode tryPopFinishedEvent(EventContext *&eventContext)
Try to fetch an event from the scheduler.
virtual StatusCode pushNewEvents(std::vector< EventContext * > &eventContexts)
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
virtual const std::vector< IAlgorithm * > & getAlgorithms() const =0
Return the list of Algorithms.
virtual StatusCode finalize()
Finalise.
virtual std::list< IAlgorithm * > getFlatAlgList()=0
Get the flat list of algorithms.
virtual unsigned int freeSlots()
Get free slots number.
This class represents an entry point to all the event specific data.
void setContext(EventContext *context)
set the context
const std::string & name() const override
The identifying name of the algorithm object.
constexpr int UnhandledException
~SequentialSchedulerSvc()
Destructor.
virtual std::list< IAlgorithm * > getTopAlgList()=0
Get top list of algorithms.
This class is used for returning status codes from appropriate routines.
void setFail(const bool &b=true)
virtual const std::string & tag() const
name tag for the exception, or exception type
#define DECLARE_SERVICE_FACTORY(x)
The IAlgorithm is the interface implemented by the Algorithm base class.
virtual StatusCode pushNewEvent(EventContext *eventContext)
Make an event available to the scheduler.
int m_freeSlots
The number of free slots (0 or 1)
Base class from which all concrete algorithm classes should be derived.
virtual StatusCode initialize()
Initialise.
bool isValid() const
Allow for check if smart pointer is valid.
Base class used to extend a class implementing other interfaces.
virtual StatusCode popFinishedEvent(EventContext *&eventContext)
Blocks until an event is availble.
bool m_useTopAlgList
Decide if the top alglist or its flat version has to be used.
This SchedulerSvc implements the IScheduler interface.
EventContext * m_eventContext
The context of the event being processed.