DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Manager_Type1.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DDCOND_TYPE1_MANAGER_TYPE1_H
14 #define DDCOND_TYPE1_MANAGER_TYPE1_H
15 
16 // Framework include files%
17 #include "DD4hep/Mutex.h"
20 
21 // C/C++ include files
22 #include <memory>
23 
25 namespace dd4hep {
26 
28  namespace cond {
29 
30  class Entry;
31  class ConditionsPool;
32  class ConditionsSlice;
33  class ConditionsIOVPool;
34  class ConditionsDataLoader;
35 
37 
46  public ObjectExtensions
47  {
48  public:
49  typedef std::vector<ConditionsIOVPool*> TypedConditionPool;
50 
51  protected:
52 
55  int m_maxIOVTypes;
58  std::string m_poolType;
60  std::string m_updateType;
62  std::string m_userType;
64  std::string m_loaderType;
65 
67  std::vector<IOVType> m_iovTypes;
68 
75  std::unique_ptr<UpdatePool> m_updatePool;
77  std::unique_ptr<ConditionsCleanup> m_cleaner;
78 
79  public:
83  int m_locked;
84 
85  protected:
87  bool select(key_type key, const IOV& req_validity, RangeConditions& conditions);
88 
90  bool select_range(key_type key, const IOV& req_validity, RangeConditions& conditions);
91 
93  // void __register_immediate(RangeConditions& c);
94 
95 
97  void __get_checked_pool(const IOV& required_validity, std::unique_ptr<UserPool>& user_pool);
98 
104 
105  public:
107  Manager_Type1(Detector& description);
108 
110  virtual ~Manager_Type1();
111 
113  //const TypedConditionPool& conditionsPool() const { return m_rawPool; }
114 
116  void initialize();
117 
119 
122  virtual std::pair<bool, const IOVType*> registerIOVType(size_t iov_index, const std::string& iov_name) final;
123 
125  virtual const std::vector<IOVType>& iovTypes () const final { return m_iovTypes; }
126 
128  virtual const IOVType* iovType (size_t iov_index) const final;
129 
131  virtual const IOVType* iovType (const std::string& iov_name) const final;
132 
134  virtual ConditionsPool* registerIOV(const IOVType& typ, IOV::Key key) final;
135 
137  virtual ConditionsIOVPool* iovPool(const IOVType& type) const final;
138 
140  virtual bool registerUnlocked(ConditionsPool& pool, Condition cond) final;
141 
143  virtual size_t blockRegister(ConditionsPool& pool, const std::vector<Condition>& cond) const final;
144 
146  virtual void adoptCleanup(ConditionsCleanup* cleaner) final;
147 
149 
150  virtual int clean(const IOVType* typ, int max_age) final;
151 
153 
154  virtual std::pair<int,int> clean(const ConditionsCleanup& cleaner) final;
155 
157 
158  virtual std::pair<int,int> clear() final;
159 
161 
164  virtual void pushUpdates() final;
165 #if 0
166  virtual Condition get(key_type key, const IOV& req_validity) final;
168 
170  virtual RangeConditions getRange(key_type key, const IOV& req_validity) final;
171 #endif
172  virtual std::unique_ptr<UserPool> createUserPool(const IOVType* iovT) const;
174 
176 
182  virtual Result prepare(const IOV& req_iov, ConditionsSlice& slice, ConditionUpdateUserContext* ctxt) final;
183 
185  virtual Result load(const IOV& required_validity,
186  ConditionsSlice& slice,
187  ConditionUpdateUserContext* ctxt=0) final;
189  virtual Result compute(const IOV& required_validity,
190  ConditionsSlice& slice,
191  ConditionUpdateUserContext* ctxt=0) final;
192 
193 
194  };
195  } /* End namespace cond */
196 } /* End namespace dd4hep */
197 #endif // DDCOND_TYPE1_MANAGER_TYPE1_H
dd4hep::RangeConditions
std::vector< Condition > RangeConditions
Definition: Conditions.h:491
dd4hep::cond::Manager_Type1::m_userType
std::string m_userType
Property: UserPool constructor type (default: DD4hep_ConditionsLinearUserPool)
Definition: Manager_Type1.h:62
cond
AlignmentCondition::Object * cond
Definition: AlignmentsCalculator.cpp:68
dd4hep::cond::Manager_Type1::iovType
virtual const IOVType * iovType(size_t iov_index) const final
Access IOV by its type.
Definition: Manager_Type1.cpp:198
dd4hep::cond::Manager_Type1::initialize
void initialize()
Access to managed pool of typed conditions indexed by IOV-type and IOV key.
Definition: Manager_Type1.cpp:156
dd4hep::cond::Manager_Type1::m_poolType
std::string m_poolType
Property: ConditionsPool constructor type (default: empty. MUST BE SET!)
Definition: Manager_Type1.h:58
dd4hep::ObjectExtensions
Implementation of an object supporting arbitrary user extensions.
Definition: ObjectExtensions.h:33
dd4hep::cond::Manager_Type1::load
virtual Result load(const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0) final
Load all updates to the clients with the defined IOV (1rst step of prepare)
Definition: Manager_Type1.cpp:523
dd4hep::cond::Manager_Type1::iovTypes
virtual const std::vector< IOVType > & iovTypes() const final
Access IOV by its type.
Definition: Manager_Type1.h:125
ObjectExtensions.h
dd4hep::cond::Manager_Type1::m_updateType
std::string m_updateType
Property: UpdatePool constructor type (default: DD4hep_ConditionsLinearUpdatePool)
Definition: Manager_Type1.h:60
Entry
GlobalAlignmentStack::StackEntry Entry
Definition: GlobalAlignmentCache.cpp:25
dd4hep::cond::Manager_Type1::createUserPool
virtual std::unique_ptr< UserPool > createUserPool(const IOVType *iovT) const
Create empty user pool object.
Definition: Manager_Type1.cpp:544
dd4hep::cond::Manager_Type1::compute
virtual Result compute(const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0) final
Compute all derived conditions with the defined IOV (2nd step of prepare)
Definition: Manager_Type1.cpp:534
dd4hep::dd4hep_mutex_t
Do-nothing compatibility std::unique_ptr emulation for cxx-98.
Definition: Mutex.h:30
dd4hep::IOV::Key
std::pair< Key_value_type, Key_value_type > Key
Definition: IOV.h:74
dd4hep::cond::Manager_Type1::clear
virtual std::pair< int, int > clear() final
Full cleanup of all managed conditions.
Definition: Manager_Type1.cpp:372
dd4hep::cond::ConditionUpdateUserContext
ConditionUpdateUserContext class used by the derived conditions calculation mechanism.
Definition: ConditionDerived.h:49
dd4hep::cond::Manager_Type1
The data class behind a conditions manager handle.
Definition: Manager_Type1.h:47
dd4hep::IOVType
Class describing the interval of validty type.
Definition: IOV.h:37
dd4hep::cond::Manager_Type1::__get_checked_pool
void __get_checked_pool(const IOV &required_validity, std::unique_ptr< UserPool > &user_pool)
Register a set of new managed condition for an IOV range. Called by __load_immediate.
Definition: Manager_Type1.cpp:324
dd4hep::cond::Manager_Type1::m_cleaner
std::unique_ptr< ConditionsCleanup > m_cleaner
Reference to the default conditions cleanup object (if registered)
Definition: Manager_Type1.h:77
dd4hep::cond::ConditionsManagerObject
Basic conditions manager implementation.
Definition: ConditionsManagerObject.h:54
ConditionsManagerObject.h
dd4hep::Condition
Main condition object handle.
Definition: Conditions.h:51
dd4hep::IOV
Class describing the interval of validty.
Definition: IOV.h:67
dd4hep::cond::ConditionsPool
Class implementing the conditions collection for a given IOV type.
Definition: ConditionsPool.h:54
dd4hep::cond::ConditionsManagerObject::key_type
Condition::key_type key_type
Definition: ConditionsManagerObject.h:56
dd4hep::cond::Manager_Type1::m_rawPool
TypedConditionPool m_rawPool
Managed pool of typed conditions indexed by IOV-type and IOV key.
Definition: Manager_Type1.h:81
dd4hep::cond::Manager_Type1::m_poolLock
dd4hep_mutex_t m_poolLock
Lock to protect the pool of all known conditions.
Definition: Manager_Type1.h:73
dd4hep::align::AlignmentsCalculator::Result
Object encapsulating the result of a computation call to the alignments calculator.
Definition: AlignmentsCalculator.h:45
dd4hep::cond::Manager_Type1::__queue_update
Condition __queue_update(cond::Entry *data)
Definition: Manager_Type1.cpp:292
dd4hep::cond::Manager_Type1::Manager_Type1
Manager_Type1(Detector &description)
Standard constructor.
Definition: Manager_Type1.cpp:136
dd4hep::cond::Manager_Type1::m_iovTypes
std::vector< IOVType > m_iovTypes
Collection of IOV types managed.
Definition: Manager_Type1.h:67
dd4hep::cond::Manager_Type1::m_locked
int m_locked
Public access: if locked, DetElements stay intact and are not altered.
Definition: Manager_Type1.h:83
dd4hep::cond::Manager_Type1::prepare
virtual Result prepare(const IOV &req_iov, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt) final
Prepare all updates for the given keys to the clients with the defined IOV.
Definition: Manager_Type1.cpp:507
Mutex.h
dd4hep::cond::Manager_Type1::m_maxIOVTypes
int m_maxIOVTypes
Property: maximal number of IOV types to be handled.
Definition: Manager_Type1.h:56
key
unsigned char key
Definition: AlignmentsCalculator.cpp:69
dd4hep::cond::Manager_Type1::adoptCleanup
virtual void adoptCleanup(ConditionsCleanup *cleaner) final
Adopt cleanup handler. If a handler is registered, it is invoked at every "prepare" step.
Definition: Manager_Type1.cpp:343
dd4hep::cond::ConditionsCleanup
Base class to handle conditions cleanups.
Definition: ConditionsCleanup.h:32
dd4hep::cond::Manager_Type1::~Manager_Type1
virtual ~Manager_Type1()
Default destructor.
Definition: Manager_Type1.cpp:151
dd4hep::cond::Manager_Type1::registerUnlocked
virtual bool registerUnlocked(ConditionsPool &pool, Condition cond) final
Register new condition with the conditions store. Unlocked version, not multi-threaded.
Definition: Manager_Type1.cpp:243
dd4hep::cond::Manager_Type1::TypedConditionPool
std::vector< ConditionsIOVPool * > TypedConditionPool
Definition: Manager_Type1.h:49
dd4hep::cond::Manager_Type1::m_updatePool
std::unique_ptr< UpdatePool > m_updatePool
Reference to update conditions pool.
Definition: Manager_Type1.h:75
dd4hep::cond::Manager_Type1::clean
virtual int clean(const IOVType *typ, int max_age) final
Clean conditions, which are above the age limit.
Definition: Manager_Type1.cpp:348
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::cond::Manager_Type1::m_updateLock
dd4hep_mutex_t m_updateLock
Lock to protect the update/delayed conditions pool.
Definition: Manager_Type1.h:71
dd4hep::cond::Manager_Type1::m_loaderType
std::string m_loaderType
Property: Conditions loader type (default: "multi" -> DD4hep_Conditions_multi_Loader)
Definition: Manager_Type1.h:64
dd4hep::cond::Manager_Type1::select
bool select(key_type key, const IOV &req_validity, RangeConditions &conditions)
Retrieve a condition set given a Detector Element and the conditions name according to their validity...
Definition: Manager_Type1.cpp:408
dd4hep::cond::Manager_Type1::blockRegister
virtual size_t blockRegister(ConditionsPool &pool, const std::vector< Condition > &cond) const final
Register a whole block of conditions with identical IOV.
Definition: Manager_Type1.cpp:270
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::cond::Manager_Type1::registerIOVType
virtual std::pair< bool, const IOVType * > registerIOVType(size_t iov_index, const std::string &iov_name) final
Register new IOV type if it does not (yet) exist.
Definition: Manager_Type1.cpp:175
dd4hep::NamedObject::type
std::string type
The object type.
Definition: NamedObject.h:35
dd4hep::cond::Manager_Type1::iovPool
virtual ConditionsIOVPool * iovPool(const IOVType &type) const final
Access conditions multi IOV pool by iov type.
Definition: Manager_Type1.cpp:238
dd4hep::cond::ConditionsIOVPool
Pool of conditions satisfying one IOV type (epoch, run, fill, etc)
Definition: ConditionsIOVPool.h:38
dd4hep::cond::Manager_Type1::registerIOV
virtual ConditionsPool * registerIOV(const IOVType &typ, IOV::Key key) final
Register IOV with type and key.
Definition: Manager_Type1.cpp:216
dd4hep::cond::Manager_Type1::select_range
bool select_range(key_type key, const IOV &req_validity, RangeConditions &conditions)
Retrieve a condition set given a Detector Element and the conditions name according to their validity...
Definition: Manager_Type1.cpp:425
dd4hep::cond::Manager_Type1::pushUpdates
virtual void pushUpdates() final
Push all pending updates to the conditions store.
Definition: Manager_Type1.cpp:385
dd4hep::cond::ConditionsSlice
Conditions slice object. Defines which conditions should be loaded by the ConditionsManager.
Definition: ConditionsSlice.h:53
dd4hep::cond::Entry
The intermediate conditions data used to populate the DetElement conditions.
Definition: ConditionsEntry.h:36