Go to the documentation of this file.
25 #define ON_DEBUG if ( outputLevel() <= MSG::DEBUG )
26 #define ON_VERBOSE if ( outputLevel() <= MSG::VERBOSE )
28 #define DEBMSG ON_DEBUG debug()
29 #define VERMSG ON_VERBOSE verbose()
37 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
44 fatal() <<
"Error retrieving EventDataSvc interface IDataManagerSvc." <<
endmsg;
49 fatal() <<
"Error retrieving EventDataSvc interface IDataProviderSvc." <<
endmsg;
56 fatal() <<
"IProperty interface not found in ApplicationMgr." <<
endmsg;
69 fatal() <<
"Can not create the event selector Context." <<
endmsg;
73 fatal() <<
"EventSelector not found." <<
endmsg;
79 info() <<
"Unable to locate service \"EventSelector\": "
80 <<
"No events will be processed from external input." <<
endmsg;
88 fatal() <<
"Error retrieving HistogramDataSvc." <<
endmsg;
93 if ( !
m_histoPersSvc ) { warning() <<
"Histograms cannot not be saved - though required." <<
endmsg; }
104 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
122 sc = theSvc->reinitialize();
124 error() <<
"Failure Reinitializing EventSelector " << theSvc->name() <<
endmsg;
128 sc = theSvc->sysInitialize();
130 error() <<
"Failure Initializing EventSelector " << theSvc->name() <<
endmsg;
136 error() <<
"Can not create Context " << theSvc->name() <<
endmsg;
139 info() <<
"EventSelector service changed to " << theSvc->name() <<
endmsg;
147 error() <<
"Can not create Context " << theSvc->name() <<
endmsg;
168 .orElse( [
this]() {
DEBMSG <<
"Clear of Event data store failed" <<
endmsg; } );
175 error() <<
"Error finalizing base class" <<
endmsg;
181 std::vector<DataObject*> objects;
184 if ( !obj || obj->
clID() == CLID_StatisticsFile )
return false;
185 objects.push_back( obj );
194 i->registry()->setAddress( pAddr );
202 if ( sc.isSuccess() ) {
203 info() <<
"Histograms converted successfully according to request." <<
endmsg;
205 error() <<
"Error while saving Histograms." <<
endmsg;
208 error() <<
"Error while traversing Histogram data store" <<
endmsg;
237 always() <<
"Terminating event processing loop due to a stop scheduled by an incident listener" <<
endmsg;
247 if ( !sc.
isSuccess() ) { error() <<
"Terminating event processing loop due to errors" <<
endmsg; }
255 typedef std::chrono::high_resolution_clock Clock;
256 typedef Clock::time_point time_point;
258 const float oneOver1024 = 1.f / 1024.f;
265 time_point start_time = Clock::now();
266 for (
int nevt = 0; maxevt == -1 || nevt < maxevt; ++nevt ) {
269 start_time = Clock::now();
280 always() <<
"Terminating event processing loop due to scheduled stop" <<
endmsg;
284 if ( 0 !=
ctx.evt() ) {
301 info() <<
"No more events in event selection " <<
endmsg;
307 warning() <<
"Error declaring event root address." <<
endmsg;
312 warning() <<
"Unable to retrieve Event root object" <<
endmsg;
317 if ( !sc.
isSuccess() ) { warning() <<
"Error declaring event root DataObject" <<
endmsg; }
323 error() <<
"Terminating event processing loop due to errors" <<
endmsg;
330 debug() <<
"---> Loop Finished - "
332 <<
" | total time (skipping 1st evt) "
333 << std::chrono::duration_cast<std::chrono::nanoseconds>( Clock::now() - start_time ).count() <<
" ns"
350 if ( !sc.
isSuccess() ) warning() <<
"Error creating IOpaqueAddress." <<
endmsg;
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event)
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Gaudi::Property< std::string > m_evtsel
SmartIF< IDataProviderSvc > m_evtDataSvc
Reference to the Event Data Service's IDataProviderSvc interface.
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Class definition of EventLoopMgr.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
~EventLoopMgr() override
Standard Destructor.
StatusCode finalize() override
implementation of IService::finalize
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
const std::string & name() const override
Retrieve name of the service
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
StatusCode reinitialize() override
implementation of IService::reinitialize
StatusCode stop() override
implementation of IService::stop
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
constexpr int AlgorithmFailure
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
IEvtSelector::Context * m_evtContext
Event Iterator.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
StatusCode stop() override
implementation of IService::stop
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
constexpr static const auto SUCCESS
TYPE * get() const
Get interface pointer.
#define DECLARE_COMPONENT(type)
Gaudi::Property< std::string > m_histPersName
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
StatusCode reinitialize() override
implementation of IService::reinitialize
virtual DataObject * object() const =0
Retrieve object behind the link.
int outputLevel() const
get the Service's output level
StatusCode finalize() override
implementation of IService::finalize
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
GAUDI_API long mappedMemory(MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
Basic Process Information: priority boost.
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
constexpr static const auto FAILURE
virtual const CLID & clID() const
Retrieve reference to class definition structure.
void accumulate(Counter &counter, const Container &container, Fun f=Identity{})
A helper function for accumulating data from a container into a counter This is internally using buff...
StatusCode initialize() override
implementation of IService::initialize
StatusCode initialize() override
implementation of IService::initialize
bool m_scheduledStop
Scheduled stop of event processing.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator