Go to the documentation of this file.
11 #define DETECTORDATASVC_DETDATASVC_CPP
26 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
27 #define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) )
29 #define DEBMSG ON_DEBUG debug()
30 #define VERMSG ON_VERBOSE verbose()
43 auto cnv_svc = serviceLocator()->service<
IConversionSvc>( m_persistencySvcName );
45 error() <<
"Unable to retrieve " << m_persistencySvcName <<
endmsg;
49 sc = setDataLoader( cnv_svc );
51 error() <<
"Unable to set DataLoader" <<
endmsg;
56 m_addrCreator = cnv_svc;
57 if ( !m_addrCreator ) {
58 error() <<
"Unable to get AddressCreator." <<
endmsg;
62 return setupDetectorDescription();
69 debug() <<
"Setting DetectorDataSvc root node... " <<
endmsg;
87 error() <<
"Detector data location name not set. Detector data will "
93 unsigned long iargs[] = { 0, 0 };
99 error() <<
"Unable to set detector data store root" <<
endmsg;
103 error() <<
"Unable to create address for /dd" <<
endmsg;
110 info() <<
"Detector description not requested to be loaded" <<
endmsg;
159 unsigned long iargs[] = { 0, 0 };
166 if ( sc.
isFailure() ) { error() <<
"Unable to set detector data store root" <<
endmsg; }
168 error() <<
"Unable to create address for /dd" <<
endmsg;
195 debug() <<
"New incident received" <<
endmsg;
196 debug() <<
"Incident source: " << inc.
source() <<
endmsg;
197 debug() <<
"Incident type: " << inc.
type() <<
endmsg;
209 error() <<
"There is no DataObject to update" <<
endmsg;
210 return Status::INVALID_OBJECT;
216 warning() <<
"Cannot update DataObject: DataObject does not implement IValidity" <<
endmsg;
222 warning() <<
"Cannot update DataObject: event time undefined" <<
endmsg;
228 DEBMSG <<
"DataObject is valid: no need to update" <<
endmsg;
236 DEBMSG <<
"Delegate update to relevant conversion service" <<
endmsg;
239 error() <<
"Could not update DataObject" <<
endmsg;
240 if ( status == Status::NO_DATA_LOADER ) error() <<
"There is no data loader" <<
endmsg;
245 condition =
dynamic_cast<IValidity*
>( toUpdate );
247 error() <<
"Updated DataObject does not implement IValidity" <<
endmsg;
251 error() <<
"Updated DataObject is not valid" <<
endmsg;
252 error() <<
"Are you sure the conversion service has updated it?" <<
endmsg;
257 DEBMSG <<
"Method updateObject exiting successfully" <<
endmsg;
Gaudi::Property< std::string > m_detDbRootName
const std::string & source() const
Access to the source of the incident.
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
StatusCode finalize() override
Service initialization.
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
void setEventTime(const Gaudi::Time &time) override
Set the new event time.
StatusCode initialize() override
Service initialization.
StatusCode updateObject(DataObject *toUpdate) override
Update object.
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Gaudi::StateMachine::State FSMState() const override
Gaudi::Property< bool > m_usePersistency
const ValueType & value() const
bool validEventTime() const override
Check if the event time has been set.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
DetDataSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Base class used to extend a class implementing other interfaces.
StatusCode finalize() override
Finalize the service.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
const Gaudi::Time & eventTime() const override
Get the event time.
StatusCode setupDetectorDescription()
Deal with Detector Description initialization.
constexpr static const auto SUCCESS
Gaudi::Property< std::string > m_detDbLocation
virtual bool isValid() const =0
Check if the object is valid (it can be always invalid).
#define DECLARE_COMPONENT(type)
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
StatusCode reinitialize() override
Initialize the service.
StatusCode clearStore() override
Remove all data objects in the data store.
void handle(const Incident &) override
Inform that a new incident has occured.
const std::string & type() const
Access to the incident type.
Gaudi::Property< int > m_detStorageType
constexpr static const auto FAILURE
Gaudi::Time m_eventTime
Current event time.