1 #define GAUDISVC_EVENTLOOPMGR_CPP
3 #include "GaudiKernel/Incident.h"
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/DataObject.h"
6 #include "GaudiKernel/IIncidentSvc.h"
7 #include "GaudiKernel/IEvtSelector.h"
8 #include "GaudiKernel/IDataManagerSvc.h"
9 #include "GaudiKernel/IDataProviderSvc.h"
10 #include "GaudiKernel/IConversionSvc.h"
11 #include "GaudiKernel/AppReturnCode.h"
21 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
22 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
24 #define DEBMSG ON_DEBUG debug()
25 #define VERMSG ON_VERBOSE verbose()
35 declareProperty(
"EvtSel",
m_evtsel );
37 "Set this property to false to suppress warning messages");
54 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
61 fatal() <<
"Error retrieving EventDataSvc interface IDataManagerSvc." <<
endmsg;
64 m_evtDataSvc = serviceLocator()->service(
"EventDataSvc");
66 fatal() <<
"Error retrieving EventDataSvc interface IDataProviderSvc." <<
endmsg;
73 fatal() <<
"IProperty interface not found in ApplicationMgr." <<
endmsg;
86 fatal() <<
"Can not create the event selector Context." <<
endmsg;
91 fatal() <<
"EventSelector not found." <<
endmsg;
98 warning() <<
"Unable to locate service \"EventSelector\" " <<
endmsg;
99 warning() <<
"No events will be processed from external input." <<
endmsg;
106 fatal() <<
"Error retrieving HistogramDataSvc." <<
endmsg;
110 m_histoPersSvc = serviceLocator()->service(
"HistogramPersistencySvc");
112 warning() <<
"Histograms cannot not be saved - though required." <<
endmsg;
126 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
133 auto theSvc = serviceLocator()->service<
IService>(
"EventSelector");
144 sc = theSvc->reinitialize();
146 error() <<
"Failure Reinitializing EventSelector "
147 << theSvc->name( ) <<
endmsg;
151 sc = theSvc->sysInitialize();
153 error() <<
"Failure Initializing EventSelector "
154 << theSvc->name( ) <<
endmsg;
160 error() <<
"Can not create Context " << theSvc->name( ) <<
endmsg;
163 info() <<
"EventSelector service changed to "
164 << theSvc->name( ) <<
endmsg;
173 error() <<
"Can not create Context " << theSvc->name( ) <<
endmsg;
208 error() <<
"Error finalizing base class" <<
endmsg;
219 if ( objects->size() > 0 ) {
220 for (
auto&
i : *objects ) {
224 i->registry()->setAddress(pAddr);
230 for (
auto&
i : *objects ) {
237 info() <<
"Histograms converted successfully according to request." <<
endmsg;
240 error() <<
"Error while saving Histograms." <<
endmsg;
244 error() <<
"Error while traversing Histogram data store" <<
endmsg;
274 always() <<
"Terminating event processing loop due to a stop scheduled by an incident listener" <<
endmsg;
285 error() <<
"Terminating event processing loop due to errors" <<
endmsg;
294 static int total_nevt = 0;
300 for(
int nevt = 0; maxevt == -1 ||
nevt < maxevt; ++
nevt, ++total_nevt) {
305 always() <<
"Terminating event processing loop due to scheduled stop" <<
endmsg;
309 if( 0 != total_nevt ) {
328 info() <<
"No more events in event selection " <<
endmsg;
334 warning() <<
"Error declaring event root address." <<
endmsg;
339 warning() <<
"Unable to retrieve Event root object" <<
endmsg;
345 warning() <<
"Error declaring event root DataObject" <<
endmsg;
352 error() <<
"Terminating event processing loop due to errors" <<
endmsg;
372 warning() <<
"Error creating IOpaqueAddress." <<
endmsg;
const std::string BeginEvent
Processing of a new event has started.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
StatusCode finalize() override
implementation of IService::finalize
bool m_scheduledStop
Scheduled stop of event processing.
const std::string BeginProcessing
Incident raised just before entering loop over the algorithms.
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual StatusCode initialize()
implementation of IService::initialize
const std::string EndProcessing
Incident raised just after the loop over the algorithms (note: before the execution of OutputStreams)...
The Event Selector Interface.
bool isSuccess() const
Test for a status code of SUCCESS.
HistogramAgent base in charge of collecting all the refereces to DataObjects in a transient store tha...
std::string m_histPersName
Name of the Hist Pers type.
StatusCode reinitialize() override
implementation of IService::reinitialize
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
std::vector< DataObject * > IDataSelector
This is only a placeholder to allow me compiling until the responsible guy does his work! M...
Class definition of EventLoopMgr.
TYPE * get() const
Get interface pointer.
const std::string EndEvent
Processing of the last event has finished.
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
virtual StatusCode executeEvent(void *par)
implementation of IEventProcessor::executeEvent(void* par)
bool m_warnings
Flag to disable warning messages when using external input.
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
StatusCode executeEvent(void *par) override
implementation of IEventProcessor::executeEvent(void* par)
#define DECLARE_COMPONENT(type)
StatusCode nextEvent(int maxevt) override
implementation of IService::nextEvent
General service interface definition.
This class is used for returning status codes from appropriate routines.
virtual StatusCode next(Context &c) const =0
Fetch the next event or the first event if it will be use soon after the creation of the context...
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
IDataSelector * selectedObjects()
Return the set of selected DataObjects.
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual StatusCode reinitialize()
implementation of IService::reinitialize
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
EventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
virtual StatusCode stop()
implementation of IService::stop
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
StatusCode initialize() override
implementation of IService::initialize
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
IEvtSelector::Context * m_evtContext
Event Iterator.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
virtual StatusCode finalize()
implementation of IService::finalize
StatusCode stop() override
implementation of IService::stop
Base class for all Incidents (computing events).
constexpr int AlgorithmFailure
virtual StatusCode clearStore()=0
Remove all data objects in the data store.
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event) ...
SmartIF< IDataProviderSvc > m_evtDataSvc
Reference to the Event Data Service's IDataProviderSvc interface.
This is the default processing manager of the application manager.
~EventLoopMgr() override
Standard Destructor.
Opaque address interface definition.
std::string m_evtsel
Event selector.
virtual StatusCode createAddress(const Context &c, IOpaqueAddress *&iop) const =0
Create an IOpaqueAddress object from the event fetched.
A DataObject is the base class of any identifiable object on any data store.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.