1 #define GAUDISVC_EVENTLOOPMGR_CPP 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() 40 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
47 fatal() <<
"Error retrieving EventDataSvc interface IDataManagerSvc." <<
endmsg;
52 fatal() <<
"Error retrieving EventDataSvc interface IDataProviderSvc." <<
endmsg;
59 fatal() <<
"IProperty interface not found in ApplicationMgr." <<
endmsg;
72 fatal() <<
"Can not create the event selector Context." <<
endmsg;
83 warning() <<
"Unable to locate service \"EventSelector\" " <<
endmsg;
84 warning() <<
"No events will be processed from external input." <<
endmsg;
91 fatal() <<
"Error retrieving HistogramDataSvc." <<
endmsg;
97 warning() <<
"Histograms cannot not be saved - though required." <<
endmsg;
112 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
130 sc = theSvc->reinitialize();
132 error() <<
"Failure Reinitializing EventSelector " << theSvc->name() <<
endmsg;
136 sc = theSvc->sysInitialize();
138 error() <<
"Failure Initializing EventSelector " << theSvc->name() <<
endmsg;
144 error() <<
"Can not create Context " << theSvc->name() <<
endmsg;
147 info() <<
"EventSelector service changed to " << theSvc->name() <<
endmsg;
155 error() <<
"Can not create Context " << theSvc->name() <<
endmsg;
190 error() <<
"Error finalizing base class" <<
endmsg;
201 if ( objects->
size() > 0 ) {
202 for (
auto& i : *objects ) {
206 i->registry()->setAddress( pAddr );
211 for (
auto& i : *objects ) {
218 info() <<
"Histograms converted successfully according to request." <<
endmsg;
220 error() <<
"Error while saving Histograms." <<
endmsg;
223 error() <<
"Error while traversing Histogram data store" <<
endmsg;
256 always() <<
"Terminating event processing loop due to a stop scheduled by an incident listener" <<
endmsg;
267 error() <<
"Terminating event processing loop due to errors" <<
endmsg;
283 typedef Clock::time_point time_point;
285 const float oneOver1024 = 1.f / 1024.f;
287 static int total_nevt = 0;
293 time_point start_time = Clock::now();
294 for (
int nevt = 0; maxevt == -1 || nevt <
maxevt; ++nevt, ++total_nevt ) {
297 start_time = Clock::now();
306 always() <<
"Terminating event processing loop due to scheduled stop" <<
endmsg;
310 if ( 0 != total_nevt ) {
329 info() <<
"No more events in event selection " <<
endmsg;
335 warning() <<
"Error declaring event root address." <<
endmsg;
340 warning() <<
"Unable to retrieve Event root object" <<
endmsg;
346 warning() <<
"Error declaring event root DataObject" <<
endmsg;
353 error() <<
"Terminating event processing loop due to errors" <<
endmsg;
358 time_point end_time = Clock::now();
361 debug() <<
"---> Loop Finished - " 363 <<
" | total time (skipping 1st evt) " virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
constexpr static const auto FAILURE
StatusCode finalize() override
implementation of IService::finalize
const std::string & name() const override
Retrieve name of the service.
StatusCode finalize() override
implementation of IService::finalize
bool m_scheduledStop
Scheduled stop of event processing.
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Gaudi::Property< bool > m_warnings
The Event Selector Interface.
HistogramAgent base in charge of collecting all the refereces to DataObjects in a transient store tha...
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
StatusCode initialize() override
implementation of IService::initialize
int outputLevel() const
get the Service's output level
StatusCode reinitialize() override
implementation of IService::reinitialize
T duration_cast(T...args)
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const =0
Get the property by property.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
virtual StatusCode clearStore()=0
Remove all data objects in the data store.
Class definition of EventLoopMgr.
StatusCode reinitialize() override
implementation of IService::reinitialize
StatusCode stop() override
implementation of IService::stop
#define DECLARE_COMPONENT(type)
TYPE * get() const
Get interface pointer.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
StatusCode executeEvent(void *par) override
implementation of IEventProcessor::executeEvent(void* par)
StatusCode nextEvent(int maxevt) override
implementation of IService::nextEvent
General service interface definition.
This class is used for returning status codes from appropriate routines.
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
IDataSelector * selectedObjects()
Return the set of selected DataObjects.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
constexpr static const auto SUCCESS
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
GAUDI_API long mappedMemory(MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
Basic Process Information: priority boost.
StatusCode initialize() override
implementation of IService::initialize
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
IEvtSelector::Context * m_evtContext
Event Iterator.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
StatusCode stop() override
implementation of IService::stop
const StatusCode & ignore() const
Ignore/check StatusCode.
Base class for all Incidents (computing events).
constexpr int AlgorithmFailure
Gaudi::Property< std::string > m_evtsel
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.
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.
~EventLoopMgr() override
Standard Destructor.
virtual StatusCode createAddress(const Context &c, IOpaqueAddress *&iop) const =0
Create an IOpaqueAddress object from the event fetched.
Opaque address interface definition.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
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< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode executeEvent(void *par) override
implementation of IEventProcessor::executeEvent(void* par)
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.