| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Member Functions | Private Attributes | List of all members
DetDataSvc Class Reference

A DataSvc specialized in detector data. More...

`#include <DetectorDataSvc/DetDataSvc.h>`

Inheritance diagram for DetDataSvc:
[legend]
Collaboration diagram for DetDataSvc:
[legend]

## Public Member Functions
StatusCode | initialize () override
| Initialize the service. More...
StatusCode | reinitialize () override
| Initialize the service. More...
StatusCode | finalize () override
| Finalize the service. More...
StatusCode | clearStore () override
| Remove all data objects in the data store. More...
StatusCode | updateObject (DataObject *toUpdate) override
| Update object. More...
| DetDataSvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor. More...
| ~DetDataSvc () override=default
| Standard Destructor. More...
bool | validEventTime () const override
| Check if the event time has been set. More...
const Gaudi::Time & | eventTime () const override
| Get the event time. More...
void | setEventTime (const Gaudi::Time &time) override
| Set the new event time. More...
void | handle (const Incident &) override
| Inform that a new incident has occured. More...
Public Member Functions inherited from extends< TsDataSvc, IDetDataSvc, IIncidentListener >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
Public Member Functions inherited from TsDataSvc
CLID | rootCLID () const override
| IDataManagerSvc: Accessor for root event CLID. More...
const std::string & | rootName () const override
| IDataManagerSvc: Accessor for root event name. More...
StatusCode | registerAddress (std::string_view fullPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | unregisterAddress (std::string_view fullPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (IRegistry *pParent, std::string_view objPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
StatusCode | objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves) override
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
StatusCode | objectParent (const DataObject *pObject, IRegistry *&refpParent) override
| IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
StatusCode | objectParent (const IRegistry *pRegistry, IRegistry *&refpParent) override
| IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
StatusCode | clearSubTree (std::string_view sub_tree_path) override
| IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name. More...
StatusCode | clearSubTree (DataObject *pObject) override
| IDataManagerSvc: Remove all data objects below the sub tree identified by the object. More...
StatusCode | clearStore () override
| IDataManagerSvc: Remove all data objects in the data store. More...
StatusCode | traverseSubTree (std::string_view sub_tree_path, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
StatusCode | traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
StatusCode | traverseTree (IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
StatusCode | setRoot (std::string root_name, DataObject *pRootObj) override
| Initialize data store for new event by giving new event path and root object. More...
virtual StatusCode | i_setRoot (std::string root_name, DataObject *pRootObj)
| Initialize data store for new event by giving new event path and root object. More...
StatusCode | i_setRoot (DataObject *pRootObj)
StatusCode | setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
| Initialize data store for new event by giving new event path and address of root object. More...
virtual StatusCode | i_setRoot (std::string root_path, IOpaqueAddress *pRootAddr)
| Initialize data store for new event by giving new event path and address of root object. More...
StatusCode | i_setRoot (IOpaqueAddress *pRootAddr)
StatusCode | setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
| IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider. More...
StatusCode | addPreLoadItem (const DataStoreItem &item) override
| Add an item to the preload list. More...
StatusCode | removePreLoadItem (const DataStoreItem &item) override
| Remove an item from the preload list. More...
StatusCode | resetPreLoad () override
| Clear the preload list. More...
virtual StatusCode | preLoad (int depth, int load_depth, DataObject *pObject)
| Execute one level of preloading and recursively load until the final level is reached. More...
StatusCode | preLoad () override
| load all preload items of the list More...
StatusCode | registerObject (std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, std::string_view objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | unregisterObject (std::string_view fullPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject, std::string_view objectPath) override
| Unregister object from the data store. More...
StatusCode | retrieveObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | findObject (std::string_view fullPath, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | linkObject (IRegistry *from, std::string_view objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (std::string_view fullPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | unlinkObject (IRegistry *from, std::string_view objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (DataObject *fromObj, std::string_view objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (std::string_view fullPath) override
| Remove a link to another object. More...
StatusCode | updateObject (IRegistry *pDirectory) override
| Update object identified by its directory entry. More...
StatusCode | updateObject (DataObject *toUpdate) override
| Update object. More...
StatusCode | initialize () override
| Service initialization. More...
StatusCode | reinitialize () override
| Service initialization. More...
StatusCode | finalize () override
| Service initialization. More...
| TsDataSvc (const TsDataSvc &)=delete
| no copy constructor More...
TsDataSvc & | operator= (const TsDataSvc &)=delete
| no assignment operator More...
virtual StatusCode | registerAddress (std::string_view fullPath, IOpaqueAddress *pAddress)=0
| Register object address with the data store. More...
StatusCode | registerAddress (DataObject *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)
| Register object address with the data store. More...
virtual StatusCode | registerAddress (IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)=0
| Register object address with the data store. More...
virtual StatusCode | unregisterAddress (std::string_view fullPath)=0
| Unregister object address from the data store. More...
StatusCode | unregisterAddress (DataObject *pParent, std::string_view objPath)
| Unregister object address from the data store. More...
virtual StatusCode | unregisterAddress (IRegistry *pParent, std::string_view objPath)=0
| Unregister object address from the data store. More...
StatusCode | registerObject (std::string_view fullPath, DataObject *pObject)
| Register object with the data store. More...
virtual StatusCode | registerObject (std::string_view parentPath, std::string_view objectPath, DataObject *pObject)=0
| Register object with the data store. More...
StatusCode | registerObject (std::string_view parentPath, int item, DataObject *pObject)
| Register object with the data store. More...
virtual StatusCode | registerObject (DataObject *parentObj, std::string_view objectPath, DataObject *pObject)=0
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, int item, DataObject *pObject)
| Register object with the data store. More...
virtual StatusCode | retrieveObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
| Retrieve object identified by its directory entry. More...
StatusCode | retrieveObject (std::string_view fullPath, DataObject *&pObject)
| Retrieve object identified by its full path from the data store. More...
StatusCode | retrieveObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
| Retrieve object from data store. More...
StatusCode | retrieveObject (std::string_view parentPath, int item, DataObject *&pObject)
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
| Retrieve object from data store. More...
virtual StatusCode | findObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
| Find object identified by its directory entry. More...
virtual StatusCode | findObject (std::string_view fullPath, DataObject *&pObject)=0
| Find object identified by its full path in the data store. More...
StatusCode | findObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
| Find object identified by its parent object and the path to the object relative to the parent. More...
StatusCode | findObject (std::string_view parentPath, int item, DataObject *&pObject)
| Find object identified by its parent object and an integer identifier in the data store. More...
StatusCode | findObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
| Find object identified by its parent object and the path to the object relative to the parent. More...
StatusCode | findObject (DataObject *parentObj, int item, DataObject *&pObject)
| Find object identified by its parent object and an integer identifier in the data store. More...
virtual StatusCode | linkObject (IRegistry *from, std::string_view objPath, DataObject *toObj)=0
| Add a link to another object. More...
StatusCode | linkObject (std::string_view fromPath, std::string_view objPath, DataObject *toObj)
| Add a link to another object. More...
StatusCode | linkObject (DataObject *fromObj, std::string_view objPath, DataObject *toObj)
| Add a link to another object. More...
virtual StatusCode | linkObject (std::string_view fullPath, DataObject *toObj)=0
| Add a link to another object. More...
virtual StatusCode | unlinkObject (IRegistry *from, std::string_view objPath)=0
| Remove a link to another object. More...
StatusCode | unlinkObject (std::string_view fromPath, std::string_view objPath)
| Remove a link to another object. More...
virtual StatusCode | unlinkObject (DataObject *fromObj, std::string_view objPath)=0
| Remove a link to another object. More...
virtual StatusCode | unlinkObject (std::string_view fullPath)=0
| Remove a link to another object. More...
Public Member Functions inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
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. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
| Declare used tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Private Member Functions
StatusCode | setupDetectorDescription ()
| Deal with Detector Description initialization. More...
StatusCode | loadObject (IConversionSvc *pLoader, IRegistry *pNode) override final
| Invoke Persistency service to create transient object from its persistent representation. More...
StatusCode | updateObject (IRegistry *pDirectory) override
| Update object identified by its directory entry. More...
StatusCode | updateObject (DataObject *toUpdate) override
| Update object. More...
virtual StatusCode | loadObject (IRegistry *pNode)
| Invoke Persistency service to create transient object from its persistent representation. More...
virtual StatusCode | loadObject (IConversionSvc *pLoader, IRegistry *pNode)
| Invoke Persistency service to create transient object from its persistent representation. More...

## Private Attributes
Gaudi::Property< int > | m_detStorageType
Gaudi::Property< std::string > | m_detDbLocation
Gaudi::Property< std::string > | m_detDbRootName
Gaudi::Property< bool > | m_usePersistency {this, "UsePersistency", false, "control if the persistency is required"}
Gaudi::Property< std::string > | m_persistencySvcName
Gaudi::Property< bool > | m_allowLoadInRunning
Gaudi::Time | m_eventTime = 0
| Current event time. More...
SmartIF< IAddressCreator > | m_addrCreator = nullptr
| Address Creator to be used. More...

## Additional Inherited Members
Public Types inherited from extends< TsDataSvc, IDetDataSvc, IIncidentListener >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from Service
using | Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...
Protected Member Functions inherited from TsDataSvc
bool | checkRoot ()
| Check if root path is valid. More...
virtual IConversionSvc * | getDataLoader (IRegistry *pReg)
| Retrieve customizable data loader according to registry entry to be retrieved. More...
virtual DataObject * | createDefaultObject () const
| Create default objects in case forced creation of leaves is requested. More...
virtual StatusCode | loadObject (IRegistry *pNode)
| Invoke Persistency service to create transient object from its persistent representation. More...
StatusCode | retrieveEntry (DataSvcHelpers::RegistryEntry *pNode, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
| Retrieve registry entry from store. More...
DataObject * | handleDataFault (IRegistry *pReg, std::string_view path={})
| Invoke data fault handling if enabled. More...
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...
Protected Attributes inherited from TsDataSvc
tsDataSvcMutex | m_accessMutex
| Mutex to protect access to the store. More...
Protected Attributes inherited from Service
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
Gaudi::Property< bool > | m_auditInit {this, "AuditServices", false, " unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Detailed Description

A DataSvc specialized in detector data.

Now inherits from TsDataSvc, a thread safe version of the DataSvc, which allows concurrent retrieval of DataObjects.

Author
  Marco Clemencic (previous author unknown)
  Danilo Piparo

Definition at line 29 of file DetDataSvc.h.

## Constructor & Destructor Documentation

## ◆ DetDataSvc()

DetDataSvc::DetDataSvc | ( | const std::string & | name,
|  | ISvcLocator * | svc
| ) |  |

Standard Constructor.

Definition at line 166 of file DetDataSvc.cpp.

166 : extends( name, svc ) {
167 setProperty( "RootCLID", CLID_Catalog );
168 }
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:145
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10

## ◆ ~DetDataSvc()

DetDataSvc::~DetDataSvc | ( |  | ) |
| override default

Standard Destructor.

## Member Function Documentation

## ◆ clearStore()

StatusCode DetDataSvc::clearStore | ( |  | ) |
| override

Remove all data objects in the data store.

Definition at line 143 of file DetDataSvc.cpp.

143 {
144
145 TsDataSvc::clearStore().ignore();
146
147 if ( m_usePersistency ) {
148 // Create root address
149 unsigned long iargs[] = {0, 0};
150 const std::string args[] = {m_detDbLocation, m_detDbRootName};
151 IOpaqueAddress* rootAddr;
152 StatusCode sc = m_addrCreator->createAddress( m_detStorageType, CLID_Catalog, args, iargs, rootAddr );
153 // Set detector data store root
154 if ( sc.isSuccess() ) {
155 sc = i_setRoot( rootAddr );
156 if ( sc.isFailure() ) { error() << "Unable to set detector data store root" << endmsg; }
157 } else {
158 error() << "Unable to create address for /dd" << endmsg;
159 }
160 return sc;
161 }
162 return StatusCode::SUCCESS;
163 }
IAddressCreator::createAddress
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.
DetDataSvc::m_detDbRootName
Gaudi::Property< std::string > m_detDbRootName
Definition: DetDataSvc.h:96
DetDataSvc::m_detDbLocation
Gaudi::Property< std::string > m_detDbLocation
Definition: DetDataSvc.h:94
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::string
STL class.
DetDataSvc::m_usePersistency
Gaudi::Property< bool > m_usePersistency
Definition: DetDataSvc.h:104
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
gaudirun.args
args
Definition: gaudirun.py:307
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DetDataSvc::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
Definition: DetDataSvc.h:116
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
TsDataSvc::i_setRoot
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: TsDataSvc.cpp:149
DetDataSvc::m_detStorageType
Gaudi::Property< int > m_detStorageType
Definition: DetDataSvc.h:92
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:104
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ eventTime()

const Gaudi::Time & DetDataSvc::eventTime | ( |  | ) | const
| override

Get the event time.

Definition at line 180 of file DetDataSvc.cpp.

180 { return m_eventTime; }
DetDataSvc::m_eventTime
Gaudi::Time m_eventTime
Current event time.
Definition: DetDataSvc.h:113

## ◆ finalize()

StatusCode DetDataSvc::finalize | ( |  | ) |
| override

Finalize the service.

Definition at line 125 of file DetDataSvc.cpp.

125 {
126 DEBMSG << "Finalizing" << endmsg;
127
128 // clears the store
129 m_usePersistency = false; // avoid creation of an empty store when clearing
130 clearStore().ignore();
131
132 // Releases the address creator
133 m_addrCreator = nullptr;
134
135 // Releases the DataLoader
136 setDataLoader( nullptr ).ignore();
137
138 // Finalize the base class
139 return TsDataSvc::finalize();
140 }
TsDataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: TsDataSvc.cpp:184
DetDataSvc::m_usePersistency
Gaudi::Property< bool > m_usePersistency
Definition: DetDataSvc.h:104
DetDataSvc::clearStore
StatusCode clearStore() override
Remove all data objects in the data store.
Definition: DetDataSvc.cpp:143
DetDataSvc::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
Definition: DetDataSvc.h:116
DEBMSG
#define DEBMSG
Definition: DetDataSvc.cpp:19
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
TsDataSvc::finalize
StatusCode finalize() override
Service initialization.
Definition: TsDataSvc.cpp:840
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ handle()

void DetDataSvc::handle | ( | const Incident & | inc | ) |
| override

Inform that a new incident has occured.

Inform that a new incident has occurred.

Definition at line 183 of file DetDataSvc.cpp.

183 {
184 ON_DEBUG {
185 debug() << "New incident received" << endmsg;
186 debug() << "Incident source: " << inc.source() << endmsg;
187 debug() << "Incident type: " << inc.type() << endmsg;
188 }
189 }
Incident::type
const std::string & type() const
Access to the incident type.
Definition: Incident.h:38
ON_DEBUG
#define ON_DEBUG
Definition: DetDataSvc.cpp:16
Incident::source
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:44
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ initialize()

StatusCode DetDataSvc::initialize | ( |  | ) |
| override

Initialize the service.

Definition at line 27 of file DetDataSvc.cpp.

27 {
28 // Call base class initialization
29 StatusCode sc = TsDataSvc::initialize();
30 if ( UNLIKELY( sc.isFailure() ) ) return sc;
31
32 // Set Data Loader
33 auto cnv_svc = serviceLocator()->service<IConversionSvc>( m_persistencySvcName );
34 if ( UNLIKELY( !cnv_svc ) ) {
35 error() << "Unable to retrieve " << m_persistencySvcName << endmsg;
36 return StatusCode::FAILURE;
37 }
38
39 sc = setDataLoader( cnv_svc );
40 if ( UNLIKELY( sc.isFailure() ) ) {
41 error() << "Unable to set DataLoader" << endmsg;
42 return sc;
43 }
44
45 // Get address creator from the DetectorPersistencySvc
46 m_addrCreator = cnv_svc;
47 if ( UNLIKELY( !m_addrCreator ) ) {
48 error() << "Unable to get AddressCreator." << endmsg;
49 return StatusCode::FAILURE;
50 }
51
52 return setupDetectorDescription();
53 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
IConversionSvc
Definition: IConversionSvc.h:37
TsDataSvc::initialize
StatusCode initialize() override
Service initialization.
Definition: TsDataSvc.cpp:803
TsDataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: TsDataSvc.cpp:184
DetDataSvc::setupDetectorDescription
StatusCode setupDetectorDescription()
Deal with Detector Description initialization.
Definition: DetDataSvc.cpp:55
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DetDataSvc::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
Definition: DetDataSvc.h:116
DetDataSvc::m_persistencySvcName
Gaudi::Property< std::string > m_persistencySvcName
Definition: DetDataSvc.h:105
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ loadObject() [1/3]

StatusCode TsDataSvc::loadObject
| private

Invoke Persistency service to create transient object from its persistent representation.

Definition at line 467 of file TsDataSvc.cpp.

467 {
468 StatusCode status = Status::INVALID_OBJ_ADDR;
469 DataObject* pObject = nullptr;
470 STD_LOCK_GUARD_MACRO
471 if ( !pLoader ) { // Precondition: Data loader must be present
472 if ( handleDataFault( pRegistry ) )
473 return StatusCode::SUCCESS;
474 else
475 return Status::NO_DATA_LOADER;
476 }
477 if ( !pRegistry ) { // Precondition: Directory must be valid
478 if ( handleDataFault( pRegistry ) )
479 return StatusCode::SUCCESS;
480 else
481 return Status::INVALID_OBJ_ADDR;
482 }
483
484 VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
485
486 if ( m_enableAccessHdlr ) {
487 // Fire data access incident
488 DataIncident incident( name(), m_accessName, pRegistry->identifier() );
489 m_incidentSvc->fireIncident( incident );
490 }
491 if ( !m_inhibitPathes.empty() ) {
492 const auto& ident = pRegistry->identifier();
493 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
494 if ( inhibit != m_inhibitPathes.end() ) return Status::NO_ACCESS;
495 }
496 IOpaqueAddress* pAddress = pRegistry->address();
497 if ( !pAddress ) { // Precondition:
498 return Status::INVALID_OBJ_ADDR; // Address must be valid
499 }
500 try {
501 status = pLoader->createObj( pAddress, pObject ); // Call data loader
502 if ( status.isSuccess() ) {
503
504 VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
505
506 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pRegistry );
507 pEntry->setObject( pObject );
508
509 VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
510 status = pLoader->fillObjRefs( pAddress, pObject );
511 }
512 } catch ( const GaudiException& exc ) {
513 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
514 throw GaudiException( "GaudiException in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE,
515 exc );
516 } catch ( const std::exception& x ) {
517 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
518 throw GaudiException( "std::exception in loadObject() " + pRegistry->identifier() + ": " +
519 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
520 name(), StatusCode::FAILURE );
521 } catch ( ... ) {
522 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
523 throw GaudiException( "UNKN exception in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE );
524 }
525 if ( !status.isSuccess() ) {
526 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
527 }
528 ON_VERBOSE if ( status.isSuccess() ) {
529 verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
530 }
531 return status;
532 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
TsDataSvc::m_accessName
Gaudi::Property< std::string > m_accessName
Definition: TsDataSvc.h:75
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, std::string_view path={})
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:429
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
VERMSG
#define VERMSG
Definition: TsDataSvc.cpp:73
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:119
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:62
ON_VERBOSE
#define ON_VERBOSE
Definition: TsDataSvc.cpp:70
std::exception::what
T what(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
CommonMessagingBase::verbose
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
Definition: CommonMessaging.h:110
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:73
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::exception
STL class.
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
DataIncident
Data service incident class.
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
TsDataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: TsDataSvc.h:67
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ loadObject() [2/3]

StatusCode TsDataSvc::loadObject
| private

Invoke Persistency service to create transient object from its persistent representation.

Definition at line 459 of file TsDataSvc.cpp.

459 {
460 IConversionSvc* pLoader = getDataLoader( pRegistry );
461 return loadObject( pLoader, pRegistry );
462 }
IConversionSvc
Definition: IConversionSvc.h:37
TsDataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: TsDataSvc.cpp:864
DetDataSvc::loadObject
StatusCode loadObject(IConversionSvc *pLoader, IRegistry *pNode) override final
Invoke Persistency service to create transient object from its persistent representation.
Definition: DetDataSvc.h:63

## ◆ loadObject() [3/3]

StatusCode DetDataSvc::loadObject | ( | IConversionSvc * | pLoader,
|  | IRegistry * | pNode
| ) |  |
| inline final override private virtual

Invoke Persistency service to create transient object from its persistent representation.

Reimplemented from TsDataSvc.

Definition at line 63 of file DetDataSvc.h.

63 {
64 if ( LIKELY( m_allowLoadInRunning ||
65 serviceLocator().as<IStateful>()->FSMState() != Gaudi::StateMachine::RUNNING ) ) {
66 return TsDataSvc::loadObject( pLoader, pNode );
67 }
68 error() << "Trying to load " << pNode->identifier() << " while RUNNING" << endmsg;
69 return StatusCode::FAILURE;
70 }
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:52
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
LIKELY
#define LIKELY(x)
Definition: Kernel.h:95
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
DetDataSvc::m_allowLoadInRunning
Gaudi::Property< bool > m_allowLoadInRunning
Definition: DetDataSvc.h:108
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:459
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ reinitialize()

StatusCode DetDataSvc::reinitialize | ( |  | ) |
| override

Initialize the service.

Definition at line 107 of file DetDataSvc.cpp.

107 {
108 // The DetectorDataSvc does not need to be re-initialized. If it is done
109 // all the Algorithms having references to DetectorElements will become
110 // invalid and crash the program. (Pere Mato)
111
112 // Call base class reinitialization
113 // StatusCode sc = DataSvc::reinitialize();
114 // if( sc.isFailure() ) return sc;
115
116 // Delete the associated event time
117 // if( 0 != m_eventTime ) delete m_eventTime;
118 // m_eventTimeDefined = false;
119
120 // return setupDetectorDescription();
121 return StatusCode::SUCCESS;
122 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ setEventTime()

void DetDataSvc::setEventTime | ( | const Gaudi::Time & | time | ) |
| override

Set the new event time.

Definition at line 171 of file DetDataSvc.cpp.

171 {
172 m_eventTime = time;
173 DEBMSG << "Event Time set to " << eventTime() << endmsg;
174 }
plotSpeedupsPyRoot.time
def time
Definition: plotSpeedupsPyRoot.py:152
DetDataSvc::eventTime
const Gaudi::Time & eventTime() const override
Get the event time.
Definition: DetDataSvc.cpp:180
DEBMSG
#define DEBMSG
Definition: DetDataSvc.cpp:19
DetDataSvc::m_eventTime
Gaudi::Time m_eventTime
Current event time.
Definition: DetDataSvc.h:113
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ setupDetectorDescription()

StatusCode DetDataSvc::setupDetectorDescription | ( |  | ) |
| private

Deal with Detector Description initialization.

Todo:
  : remove references to obsolete package XMLDDDBROOT

Definition at line 55 of file DetDataSvc.cpp.

55 {
56 // Initialize the detector data transient store
57 ON_DEBUG {
58 debug() << "Storage type used is: " << m_detStorageType << endmsg;
59 debug() << "Setting DetectorDataSvc root node... " << endmsg;
60 }
61
62 if ( m_usePersistency ) {
63
64 IOpaqueAddress* rootAddr = nullptr;
65 if ( m_detDbLocation.empty() || "empty" == m_detDbLocation ) {
66
67 // if the name of DBlocation is not given - construct it!
68 // by retrieving the value of XMLDDBROOT
69
71 if ( isEnvSet( "XMLDDDBROOT" ) ) {
72 const std::string loc = getEnv( "XMLDDDBROOT" );
73 m_detDbLocation = loc + "/DDDB/lhcb.xml";
74 }
75 }
76 if ( m_detDbLocation.empty() || "empty" == m_detDbLocation ) {
77 error() << "Detector data location name not set. Detector data will "
78 "not be found."
79 << endmsg;
80 return StatusCode::FAILURE;
81 } else {
82 // Create address
83 unsigned long iargs[] = {0, 0};
84 const std::string args[] = {m_detDbLocation, m_detDbRootName};
85 StatusCode sc = m_addrCreator->createAddress( m_detStorageType, CLID_Catalog, args, iargs, rootAddr );
86 if ( sc.isSuccess() ) {
87 sc = i_setRoot( rootAddr );
88 if ( sc.isFailure() ) {
89 error() << "Unable to set detector data store root" << endmsg;
90 return sc;
91 }
92 } else {
93 error() << "Unable to create address for /dd" << endmsg;
94 return sc;
95 }
96 }
97 // Writing the description file in the output log file [bugs #2854]
98 always() << "Detector description database: " << m_detDbLocation.value() << endmsg;
99 } else {
100 info() << "Detector description not requested to be loaded" << endmsg;
101 }
102
103 return StatusCode::SUCCESS;
104 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:369
IAddressCreator::createAddress
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.
DetDataSvc::m_detDbRootName
Gaudi::Property< std::string > m_detDbRootName
Definition: DetDataSvc.h:96
DetDataSvc::m_detDbLocation
Gaudi::Property< std::string > m_detDbLocation
Definition: DetDataSvc.h:94
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
CommonMessagingBase::always
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
Definition: CommonMessaging.h:89
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:104
ON_DEBUG
#define ON_DEBUG
Definition: DetDataSvc.cpp:16
std::string
STL class.
DetDataSvc::m_usePersistency
Gaudi::Property< bool > m_usePersistency
Definition: DetDataSvc.h:104
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
gaudirun.args
args
Definition: gaudirun.py:307
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DetDataSvc::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
Definition: DetDataSvc.h:116
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
System::isEnvSet
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
Definition: System.cpp:389
TsDataSvc::i_setRoot
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: TsDataSvc.cpp:149
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
DetDataSvc::m_detStorageType
Gaudi::Property< int > m_detStorageType
Definition: DetDataSvc.h:92
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ updateObject() [1/3]

StatusCode TsDataSvc::updateObject
| override private

Update object identified by its directory entry.

Update object.

Definition at line 649 of file TsDataSvc.cpp.

649 {
650 if ( !pRegistry ) return Status::INVALID_OBJ_ADDR; // Precondition: Addres must be valid
651 DataObject* toUpdate = pRegistry->object();
652 return toUpdate ? updateObject( toUpdate ) : loadObject( pRegistry );
653 }
DetDataSvc::updateObject
StatusCode updateObject(DataObject *toUpdate) override
Update object.
Definition: DetDataSvc.cpp:193
DetDataSvc::loadObject
StatusCode loadObject(IConversionSvc *pLoader, IRegistry *pNode) override final
Invoke Persistency service to create transient object from its persistent representation.
Definition: DetDataSvc.h:63
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ updateObject() [2/3]

StatusCode TsDataSvc::updateObject
| override private

Update object.

Definition at line 656 of file TsDataSvc.cpp.

656 {
657 StatusCode status = Status::INVALID_OBJ_ADDR;
658 if ( !toUpdate ) return Status::INVALID_OBJECT; // Precondition: Address must be valid
659 IRegistry* pRegistry = toUpdate->registry();
660 if ( !pRegistry ) return Status::INVALID_OBJECT; // Precondition: Need valid registry
661 IOpaqueAddress* pAddress = pRegistry->address();
662 if ( !pAddress ) return Status::INVALID_OBJ_ADDR; // Precondition: Need valid address
663 STD_LOCK_GUARD_MACRO
664 IConversionSvc* pLoader = getDataLoader( pRegistry );
665 if ( !pLoader ) return Status::NO_DATA_LOADER; // Precondition: Data loader must be present
666 if ( !m_inhibitPathes.empty() ) {
667 auto& ident = pRegistry->identifier();
668 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
669 if ( inhibit != m_inhibitPathes.end() ) return Status::NO_ACCESS;
670 }
671 try {
672 status = pLoader->updateObj( pAddress, toUpdate ); // Call data loader
673 if ( status.isSuccess() ) { status = pLoader->updateObjRefs( pAddress, toUpdate ); }
674 } catch ( const GaudiException& exc ) {
675 throw GaudiException( "GaudiException in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE, exc );
676 } catch ( const std::exception& x ) {
677 throw GaudiException( "std::exception in updateObject() " + pRegistry->name() + ": " +
678 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
679 name(), StatusCode::FAILURE );
680 } catch ( ... ) {
681 throw GaudiException( "UNKN exception in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE );
682 }
683 return status;
684 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
IConversionSvc
Definition: IConversionSvc.h:37
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
TsDataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: TsDataSvc.cpp:864
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
std::exception::what
T what(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::exception
STL class.
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::find
T find(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
TsDataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: TsDataSvc.h:67
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44

## ◆ updateObject() [3/3]

StatusCode DetDataSvc::updateObject | ( | DataObject * | toUpdate | ) |
| override

Update object.

Todo:
  update also its ancestors in the data store if necessary

Definition at line 193 of file DetDataSvc.cpp.

193 {
194
195 DEBMSG << "Method updateObject starting" << endmsg;
196
197 // Check that object to update exists
198 if ( !toUpdate ) {
199 error() << "There is no DataObject to update" << endmsg;
200 return Status::INVALID_OBJECT;
201 }
202
203 // Retrieve IValidity interface of object to update
204 IValidity* condition = dynamic_cast<IValidity*>( toUpdate );
205 if ( !condition ) {
206 warning() << "Cannot update DataObject: DataObject does not implement IValidity" << endmsg;
207 return StatusCode::SUCCESS;
208 }
209
210 // Check that the event time has been defined
211 if ( !validEventTime() ) {
212 warning() << "Cannot update DataObject: event time undefined" << endmsg;
213 return StatusCode::SUCCESS;
214 }
215
216 // No need to update if condition is valid
217 if ( condition->isValid( eventTime() ) ) {
218 DEBMSG << "DataObject is valid: no need to update" << endmsg;
219 return StatusCode::SUCCESS;
220 }
221
222 DEBMSG << "DataObject is invalid: update it" << endmsg;
223 // TODO: before loading updated object, update HERE its parent in data store
224
225 // Now delegate update to the conversion service by calling the base class
226 DEBMSG << "Delegate update to relevant conversion service" << endmsg;
227 StatusCode status = TsDataSvc::updateObject( toUpdate );
228 if ( !status.isSuccess() ) {
229 error() << "Could not update DataObject" << endmsg;
230 if ( status == Status::NO_DATA_LOADER ) error() << "There is no data loader" << endmsg;
231 return status;
232 }
233
234 // Now cross-check that the new condition is valid
235 condition = dynamic_cast<IValidity*>( toUpdate );
236 if ( !condition ) {
237 error() << "Updated DataObject does not implement IValidity" << endmsg;
238 return StatusCode::FAILURE;
239 }
240 if ( FSMState() == Gaudi::StateMachine::RUNNING && !condition->isValid( eventTime() ) ) {
241 error() << "Updated DataObject is not valid" << endmsg;
242 error() << "Are you sure the conversion service has updated it?" << endmsg;
243 return StatusCode::FAILURE;
244 }
245
246 // DataObject was successfully updated
247 DEBMSG << "Method updateObject exiting successfully" << endmsg;
248 return StatusCode::SUCCESS;
249 }
DetDataSvc::validEventTime
bool validEventTime() const override
Check if the event time has been set.
Definition: DetDataSvc.cpp:177
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:52
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:101
DetDataSvc::eventTime
const Gaudi::Time & eventTime() const override
Get the event time.
Definition: DetDataSvc.cpp:180
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:649
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IValidity::isValid
virtual bool isValid() const =0
Check if the object is valid (it can be always invalid).
DEBMSG
#define DEBMSG
Definition: DetDataSvc.cpp:19
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
IValidity
Interface for objects with a validity.
Definition: IValidity.h:11
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ validEventTime()

bool DetDataSvc::validEventTime | ( |  | ) | const
| override

Check if the event time has been set.

Kept for backward compatibility, returns always true.

Definition at line 177 of file DetDataSvc.cpp.

177 { return true; }

## Member Data Documentation

## ◆ m_addrCreator

SmartIF<IAddressCreator> DetDataSvc::m_addrCreator = nullptr
| private

Address Creator to be used.

Definition at line 116 of file DetDataSvc.h.

## ◆ m_allowLoadInRunning

Gaudi::Property<bool> DetDataSvc::m_allowLoadInRunning
| private

Initial value:
{this, "AllowLoadInRunning", true,
"if set to false, no new object can be loaded while in running state "
"(updates are still allowed), this forces preloading of the geometry"}

Definition at line 108 of file DetDataSvc.h.

## ◆ m_detDbLocation

Gaudi::Property<std::string> DetDataSvc::m_detDbLocation
| private

Initial value:
{this, "DetDbLocation", "empty",
"location of detector Db (filename,URL)"}

Definition at line 94 of file DetDataSvc.h.

## ◆ m_detDbRootName

Gaudi::Property<std::string> DetDataSvc::m_detDbRootName
| private

Initial value:
{this,
"DetDbRootName",
"dd",
[this]( Gaudi::Details::PropertyBase& ) {
this->setProperty( "RootName", "/" + this->m_detDbRootName ).ignore();
},
Gaudi::Details::Property::ImmediatelyInvokeHandler{true},
"name of the root node of the detector"}

Definition at line 96 of file DetDataSvc.h.

## ◆ m_detStorageType

Gaudi::Property<int> DetDataSvc::m_detStorageType
| private

Initial value:
{this, "DetStorageType", XML_StorageType,
"Detector Data Persistency Storage type"}

Definition at line 92 of file DetDataSvc.h.

## ◆ m_eventTime

Gaudi::Time DetDataSvc::m_eventTime = 0
| private

Current event time.

Definition at line 113 of file DetDataSvc.h.

## ◆ m_persistencySvcName

Gaudi::Property<std::string> DetDataSvc::m_persistencySvcName
| private

Initial value:
{this, "PersistencySvc", "DetectorPersistencySvc",
"name of the persistency service"}

Definition at line 105 of file DetDataSvc.h.

## ◆ m_usePersistency

Gaudi::Property<bool> DetDataSvc::m_usePersistency {this, "UsePersistency", false, "control if the persistency is required"}
| private

Definition at line 104 of file DetDataSvc.h.

The documentation for this class was generated from the following files:

- GaudiSvc/src/DetectorDataSvc/DetDataSvc.h
- GaudiSvc/src/DetectorDataSvc/DetDataSvc.cpp