The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
DetDataSvc.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
12
13// Base classes
14// #include "GaudiKernel/DataSvc.h"
15// D. Piparo: Change to the new thread safe version
19#include <GaudiKernel/Time.h>
21
22// Forward declarations
23class StatusCode;
24class IAddressCreator;
25
27 //--------------------------------------------------------------------------
37
38class DetDataSvc : public extends<TsDataSvc, IDetDataSvc, IIncidentListener> {
39
40 // unhides DataSvc updateObject methods
42
43public:
44 // Overloaded DataSvc methods
45
47 StatusCode initialize() override;
48
50 StatusCode reinitialize() override;
51
53 StatusCode finalize() override;
54
56 StatusCode clearStore() override;
57
59 StatusCode updateObject( DataObject* toUpdate ) override;
60
62 DetDataSvc( const std::string& name, ISvcLocator* svc );
63
65 ~DetDataSvc() override = default;
66
67private:
70
72 StatusCode loadObject( IConversionSvc* pLoader, IRegistry* pNode ) override final {
74 return TsDataSvc::loadObject( pLoader, pNode );
75 }
76 error() << "Trying to load " << pNode->identifier() << " while RUNNING" << endmsg;
78 }
79
80public:
81 // Implementation of the IDetDataSvc interface
82
85 bool validEventTime() const override;
86
88 const Gaudi::Time& eventTime() const override;
89
91 void setEventTime( const Gaudi::Time& time ) override;
92
93public:
94 // Implementation of the IIncidentListener interface
95
97 void handle( const Incident& ) override;
98
99private:
101 "Detector Data Persistency Storage type" };
102 Gaudi::Property<std::string> m_detDbLocation{ this, "DetDbLocation", "empty",
103 "location of detector Db (filename,URL)" };
105 "DetDbRootName",
106 "dd",
108 this->setProperty( "RootName", "/" + this->m_detDbRootName ).ignore();
109 },
111 "name of the root node of the detector" };
112 Gaudi::Property<bool> m_usePersistency{ this, "UsePersistency", false, "control if the persistency is required" };
113 Gaudi::Property<std::string> m_persistencySvcName{ this, "PersistencySvc", "DetectorPersistencySvc",
114 "name of the persistency service" };
115
116 Gaudi::Property<bool> m_allowLoadInRunning{ this, "AllowLoadInRunning", true,
117 "if set to false, no new object can be loaded while in running state "
118 "(updates are still allowed), this forces preloading of the geometry" };
119
122
125};
bool PyHelper setProperty(IInterface *p, char *name, char *value)
const long XML_StorageType
Definition ClassID.h:65
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
A DataObject is the base class of any identifiable object on any data store.
Definition DataObject.h:37
Gaudi::Time m_eventTime
Current event time.
Definition DetDataSvc.h:121
StatusCode initialize() override
Initialize the service.
Gaudi::Property< int > m_detStorageType
Definition DetDataSvc.h:100
Gaudi::Property< std::string > m_detDbLocation
Definition DetDataSvc.h:102
DetDataSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
StatusCode setupDetectorDescription()
Deal with Detector Description initialization.
bool validEventTime() const override
Check if the event time has been set.
Gaudi::Property< std::string > m_detDbRootName
Definition DetDataSvc.h:104
StatusCode reinitialize() override
Initialize the service.
StatusCode clearStore() override
Remove all data objects in the data store.
StatusCode finalize() override
Finalize the service.
void setEventTime(const Gaudi::Time &time) override
Set the new event time.
Gaudi::Property< bool > m_usePersistency
Definition DetDataSvc.h:112
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
Definition DetDataSvc.h:124
Gaudi::Property< bool > m_allowLoadInRunning
Definition DetDataSvc.h:116
Gaudi::Property< std::string > m_persistencySvcName
Definition DetDataSvc.h:113
StatusCode loadObject(IConversionSvc *pLoader, IRegistry *pNode) override final
Invoke Persistency service to create transient object from its persistent representation.
Definition DetDataSvc.h:72
StatusCode updateObject(DataObject *toUpdate) override
Update object.
void handle(const Incident &) override
Inform that a new incident has occured.
const Gaudi::Time & eventTime() const override
Get the event time.
~DetDataSvc() override=default
Standard Destructor.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
Based on seal::Time.
Definition Time.h:235
IAddressCreator interface definition.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition IRegistry.h:29
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
Base class for all Incidents (computing events).
Definition Incident.h:24
Gaudi::StateMachine::State FSMState() const override
Definition Service.h:55
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
const std::string & name() const override
Retrieve name of the service.
Definition Service.cpp:333
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
constexpr static const auto FAILURE
Definition StatusCode.h:100
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Base class used to extend a class implementing other interfaces.
Definition extends.h:19
Gaudi::tagged_bool< class ImmediatelyInvokeHandler_tag > ImmediatelyInvokeHandler
Definition Property.h:23