1 #define GAUDISVC_EVENTLOOPMGR_CPP
3 #include "GaudiKernel/SmartIF.h"
4 #include "GaudiKernel/Incident.h"
5 #include "GaudiKernel/MsgStream.h"
6 #include "GaudiKernel/DataObject.h"
7 #include "GaudiKernel/IIncidentSvc.h"
8 #include "GaudiKernel/IEvtSelector.h"
9 #include "GaudiKernel/IDataManagerSvc.h"
10 #include "GaudiKernel/IDataProviderSvc.h"
11 #include "GaudiKernel/IConversionSvc.h"
12 #include "GaudiKernel/AppReturnCode.h"
22 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
23 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
25 #define DEBMSG ON_DEBUG debug()
26 #define VERMSG ON_VERBOSE verbose()
46 "Set this property to false to suppress warning messages");
68 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
75 fatal() <<
"Error retrieving EventDataSvc interface IDataManagerSvc." <<
endmsg;
80 fatal() <<
"Error retrieving EventDataSvc interface IDataProviderSvc." <<
endmsg;
87 fatal() <<
"IProperty interface not found in ApplicationMgr." <<
endmsg;
100 fatal() <<
"Can not create the event selector Context." <<
endmsg;
113 warning() <<
"Unable to locate service \"EventSelector\" " <<
endmsg;
114 warning() <<
"No events will be processed from external input." <<
endmsg;
121 fatal() <<
"Error retrieving HistogramDataSvc." <<
endmsg;
127 warning() <<
"Histograms cannot not be saved - though required." <<
endmsg;
141 DEBMSG <<
"Error Initializing base class MinimalEventLoopMgr." <<
endmsg;
161 error() <<
"Failure Reinitializing EventSelector "
169 error() <<
"Failure Initializing EventSelector "
179 info() <<
"EventSelector service changed to "
224 error() <<
"Error finalizing base class" <<
endmsg;
235 if ( objects->size() > 0 ) {
236 IDataSelector::iterator
i;
237 for ( i = objects->begin(); i != objects->end(); i++ ) {
241 (*i)->registry()->setAddress(pAddr);
247 for ( i = objects->begin(); i != objects->end(); i++ ) {
256 info() <<
"Histograms converted successfully according to request." <<
endmsg;
259 error() <<
"Error while saving Histograms." <<
endmsg;
263 error() <<
"Error while traversing Histogram data store" <<
endmsg;
293 always() <<
"Terminating event processing loop due to a stop scheduled by an incident listener" <<
endmsg;
304 error() <<
"Terminating event processing loop due to errors" <<
endmsg;
323 static int total_nevt = 0;
329 for(
int nevt = 0; (maxevt == -1 ?
true :
nevt < maxevt);
nevt++, total_nevt++) {
334 always() <<
"Terminating event processing loop due to scheduled stop" <<
endmsg;
338 if( 0 != total_nevt ) {
357 info() <<
"No more events in event selection " <<
endmsg;
363 warning() <<
"Error declaring event root address." <<
endmsg;
368 warning() <<
"Unable to retrieve Event root object" <<
endmsg;
375 warning() <<
"Error declaring event root DataObject" <<
endmsg;
382 error() <<
"Terminating event processing loop due to errors" <<
endmsg;
const std::string BeginEvent
Processing of a new event has started.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
virtual StatusCode executeEvent(void *par)
implementation of IEventProcessor::executeEvent(void* par)
virtual StatusCode setRoot(const std::string &root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
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.
virtual Gaudi::StateMachine::State FSMState() const =0
Get the current state.
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.
virtual StatusCode setProperty(const Property &p)
Set the property by property.
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)...
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.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
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...
virtual StatusCode executeRun(int maxevt)
implementation of IEventProcessor::executeRun()
Class definition of EventLoopMgr.
virtual const std::string & name() const =0
Retrieve the name of the instance.
TYPE * get() const
Get interface pointer.
virtual StatusCode sysInitialize()=0
Initialize Service.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
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)
virtual StatusCode initialize()
implementation of IService::initialize
virtual StatusCode reinitialize()
implementation of IService::reinitialize
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.
#define DECLARE_COMPONENT(type)
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
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.
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 const std::string & name() const
Retrieve name of the service.
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.
virtual StatusCode finalize()
implementation of IService::finalize
virtual StatusCode executeRun(int maxevt)
implementation of IEventProcessor::executeRun( )
virtual unsigned long release()=0
Release Interface instance.
bool isValid() const
Allow for check if smart pointer is valid.
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
Base class for all Incidents (computing events).
virtual ~EventLoopMgr()
Standard Destructor.
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.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
This is the default processing manager of the application manager.
virtual StatusCode stop()
implementation of IService::stop
virtual StatusCode nextEvent(int maxevt)
implementation of IService::nextEvent
Opaque address interface definition.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
std::string m_evtsel
Event selector.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
const int AlgorithmFailure
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.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.