1 #define DETECTORDATASVC_DETDATASVC_CPP 16 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) ) 17 #define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) ) 19 #define DEBMSG ON_DEBUG debug() 20 #define VERMSG ON_VERBOSE verbose() 34 auto cnv_svc = serviceLocator()->service<
IConversionSvc>( m_persistencySvcName );
36 error() <<
"Unable to retrieve " << m_persistencySvcName <<
endmsg;
40 sc = setDataLoader( cnv_svc );
42 error() <<
"Unable to set DataLoader" <<
endmsg;
47 m_addrCreator = cnv_svc;
49 error() <<
"Unable to get AddressCreator." <<
endmsg;
53 return setupDetectorDescription();
62 debug() <<
"Setting DetectorDataSvc root node... " <<
endmsg;
80 error() <<
"Detector data location name not set. Detector data will " 86 unsigned long iargs[] = {0, 0};
92 error() <<
"Unable to set detector data store root" <<
endmsg;
96 error() <<
"Unable to create address for /dd" <<
endmsg;
103 info() <<
"Detector description not requested to be loaded" <<
endmsg;
155 unsigned long iargs[] = {0, 0};
163 error() <<
"Unable to set detector data store root" <<
endmsg;
166 error() <<
"Unable to create address for /dd" <<
endmsg;
215 error() <<
"There is no DataObject to update" <<
endmsg;
216 return INVALID_OBJECT;
222 warning() <<
"Cannot update DataObject: DataObject does not implement IValidity" <<
endmsg;
228 warning() <<
"Cannot update DataObject: event time undefined" <<
endmsg;
234 DEBMSG <<
"DataObject is valid: no need to update" <<
endmsg;
242 DEBMSG <<
"Delegate update to relevant conversion service" <<
endmsg;
245 error() <<
"Could not update DataObject" <<
endmsg;
246 if ( status == NO_DATA_LOADER )
error() <<
"There is no data loader" <<
endmsg;
251 condition =
dynamic_cast<IValidity*
>( toUpdate );
253 error() <<
"Updated DataObject does not implement IValidity" <<
endmsg;
257 error() <<
"Updated DataObject is not valid" <<
endmsg;
258 error() <<
"Are you sure the conversion service has updated it?" <<
endmsg;
263 DEBMSG <<
"Method updateObject exiting successfully" <<
endmsg;
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const std::string & name() const override
Retrieve name of the service.
const std::string & type() const
Access to the incident type.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
void handle(const Incident &) override
Inform that a new incident has occured.
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ipar, IOpaqueAddress *&refpAddress)=0
Create a Generic address using explicit arguments to identify a single object.
const std::string & source() const
Access to the source of the incident.
bool validEventTime() const override
Check if the event time has been set.
bool isSuccess() const
Test for a status code of SUCCESS.
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
StatusCode updateObject(DataObject *toUpdate) override
Update object.
Gaudi::Property< CLID > m_rootCLID
Gaudi::Property< std::string > m_detDbRootName
Gaudi::Property< std::string > m_detDbLocation
const Gaudi::Time & eventTime() const override
Get the event time.
StatusCode initialize() override
Service initialization.
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
Gaudi::Property< bool > m_usePersistency
StatusCode setupDetectorDescription()
Deal with Detector Description initialization.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
StatusCode clearStore() override
Remove all data objects in the data store.
This class is used for returning status codes from appropriate routines.
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
DetDataSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
StatusCode reinitialize() override
Initialize the service.
StatusCode finalize() override
Finalize the service.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
StatusCode finalize() override
Service initialization.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Gaudi::Time m_eventTime
Current event time.
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
virtual bool isValid() const =0
Check if the object is valid (it can be always invalid).
Base class for all Incidents (computing events).
Gaudi::StateMachine::State FSMState() const override
Gaudi::Property< int > m_detStorageType
void setEventTime(const Gaudi::Time &time) override
Set the new event time.
Interface for objects with a validity.
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Opaque address interface definition.
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
A DataObject is the base class of any identifiable object on any data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Gaudi::Property< std::string > m_rootName