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;
79 info() <<
"Unable to locate service \"EventSelector\": "
80 <<
"No events will be processed from external input." <<
endmsg;
88 fatal() <<
"Error retrieving HistogramDataSvc." <<
endmsg;
104 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
113 if ( theEvtSel && ( theEvtSel.get() !=
m_evtSelector.get() ) ) {
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 );
190 sc = std::accumulate( begin( objects ), end( objects ), sc, [&](
StatusCode isc,
auto& i ) {
194 i->registry()->setAddress( pAddr );
197 sc = std::accumulate( begin( objects ), end( objects ), sc, [&](
StatusCode isc,
auto& i ) {
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;
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"
bool PyHelper setProperty(IInterface *p, char *name, char *value)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
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 const CLID & clID() const
Retrieve reference to class definition structure.
This class represents an entry point to all the event specific data.
Class definition of EventLoopMgr.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
StatusCode reinitialize() override
implementation of IService::reinitialize
StatusCode stop() override
implementation of IService::stop
IEvtSelector::Context * m_evtContext
Event Iterator.
Gaudi::Property< std::string > m_histPersName
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Gaudi::Property< std::string > m_evtsel
SmartIF< IDataProviderSvc > m_evtDataSvc
Reference to the Event Data Service's IDataProviderSvc interface.
StatusCode finalize() override
implementation of IService::finalize
~EventLoopMgr() override
Standard Destructor.
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event)
StatusCode initialize() override
implementation of IService::initialize
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
The Event Selector Interface.
Opaque address interface definition.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual DataObject * object() const =0
Retrieve object behind the link.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
General service interface definition.
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
Base class for all Incidents (computing events).
StatusCode stop() override
implementation of IService::stop
bool m_scheduledStop
Scheduled stop of event processing.
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
StatusCode finalize() override
implementation of IService::finalize
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
StatusCode initialize() override
implementation of IService::initialize
StatusCode reinitialize() override
implementation of IService::reinitialize
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
const std::string & name() const override
Retrieve name of the service.
int outputLevel() const
get the Service's output level
This class is used for returning status codes from appropriate routines.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
constexpr int AlgorithmFailure
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
GAUDI_API long mappedMemory(MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
Basic Process Information: priority boost.