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};
93 error() <<
"Unable to set detector data store root" <<
endmsg;
98 error() <<
"Unable to create address for /dd" <<
endmsg;
106 info() <<
"Detector description not requested to be loaded" <<
endmsg;
156 unsigned long iargs[] = {0,0};
168 error() <<
"Unable to set detector data store root" <<
endmsg;
171 error() <<
"Unable to create address for /dd" <<
endmsg;
225 error() <<
"There is no DataObject to update" <<
endmsg;
226 return INVALID_OBJECT;
233 <<
"Cannot update DataObject: DataObject does not implement IValidity"
241 <<
"Cannot update DataObject: event time undefined"
248 DEBMSG <<
"DataObject is valid: no need to update" <<
endmsg;
256 DEBMSG <<
"Delegate update to relevant conversion service" <<
endmsg;
259 error() <<
"Could not update DataObject" <<
endmsg;
260 if ( status == NO_DATA_LOADER )
266 condition =
dynamic_cast<IValidity*
>(toUpdate);
268 error() <<
"Updated DataObject does not implement IValidity" <<
endmsg;
273 error() <<
"Updated DataObject is not valid" <<
endmsg;
274 error() <<
"Are you sure the conversion service has updated it?" <<
endmsg;
279 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...
const std::string & type() const
Access to the incident type.
Gaudi::StateMachine::State FSMState() const override
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
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.
const std::string & source() const
Access to the source of the incident.
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.
std::string m_rootName
Name of root event.
StatusCode initialize() override
Service initialization.
std::string m_persistencySvcName
Name of the persistency service.
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
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.
int m_detStorageType
Detector Data Persistency Storage type.
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.
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
const long XML_StorageType
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=0) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
std::string m_detDbRootName
Name of the root node of the detector.
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.
std::string m_detDbLocation
Location of detector Db (filename,URL)
Base class for all Incidents (computing events).
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.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
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.
bool m_usePersistency
Flag to control if the persistency is required.