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() 33 auto cnv_svc = serviceLocator()->service<
IConversionSvc>( m_persistencySvcName );
35 error() <<
"Unable to retrieve " << m_persistencySvcName <<
endmsg;
39 sc = setDataLoader( cnv_svc );
41 error() <<
"Unable to set DataLoader" <<
endmsg;
46 m_addrCreator = cnv_svc;
48 error() <<
"Unable to get AddressCreator." <<
endmsg;
52 return setupDetectorDescription();
59 debug() <<
"Setting DetectorDataSvc root node... " <<
endmsg;
77 error() <<
"Detector data location name not set. Detector data will " 83 unsigned long iargs[] = {0, 0};
89 error() <<
"Unable to set detector data store root" <<
endmsg;
93 error() <<
"Unable to create address for /dd" <<
endmsg;
100 info() <<
"Detector description not requested to be loaded" <<
endmsg;
149 unsigned long iargs[] = {0, 0};
158 error() <<
"Unable to create address for /dd" <<
endmsg;
199 error() <<
"There is no DataObject to update" <<
endmsg;
200 return Status::INVALID_OBJECT;
204 IValidity* condition = dynamic_cast<IValidity*>( toUpdate );
206 warning() <<
"Cannot update DataObject: DataObject does not implement IValidity" <<
endmsg;
212 warning() <<
"Cannot update DataObject: event time undefined" <<
endmsg;
218 DEBMSG <<
"DataObject is valid: no need to update" <<
endmsg;
226 DEBMSG <<
"Delegate update to relevant conversion service" <<
endmsg;
229 error() <<
"Could not update DataObject" <<
endmsg;
230 if ( status == Status::NO_DATA_LOADER )
error() <<
"There is no data loader" <<
endmsg;
235 condition = dynamic_cast<IValidity*>( toUpdate );
237 error() <<
"Updated DataObject does not implement IValidity" <<
endmsg;
241 error() <<
"Updated DataObject is not valid" <<
endmsg;
242 error() <<
"Are you sure the conversion service has updated it?" <<
endmsg;
247 DEBMSG <<
"Method updateObject exiting successfully" <<
endmsg;
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
bool validEventTime() const override
Check if the event time has been set.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Gaudi::StateMachine::State FSMState() const override
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
const std::string & type() const
Access to the incident type.
const Gaudi::Time & eventTime() const override
Get the event time.
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.
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
StatusCode updateObject(DataObject *toUpdate) override
Update object.
Gaudi::Property< std::string > m_detDbRootName
Gaudi::Property< std::string > m_detDbLocation
constexpr static const auto SUCCESS
StatusCode initialize() override
Service initialization.
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
const std::string & source() const
Access to the source of the incident.
#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)
A DataSvc specialized in detector data.
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.
virtual bool isValid() const =0
Check if the object is valid (it can be always invalid).
StatusCode finalize() override
Finalize the service.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
const StatusCode & ignore() const
Ignore/check StatusCode.
StatusCode finalize() override
Service initialization.
Gaudi::Time m_eventTime
Current event time.
Base class used to extend a class implementing other interfaces.
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Base class for all Incidents (computing events).
constexpr static const auto FAILURE
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.
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.