DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
dd4hep::cond::ConditionsMappedUserPool< MAPPING > Class Template Reference

Class implementing the conditions user pool for a given IOV type. More...

Inheritance diagram for dd4hep::cond::ConditionsMappedUserPool< MAPPING >:
dd4hep::cond::UserPool dd4hep::ConditionsMap

Public Member Functions

 ConditionsMappedUserPool (ConditionsManager mgr, ConditionsIOVPool *pool)
 Default constructor. More...
 
virtual ~ConditionsMappedUserPool ()
 Default destructor. More...
 
virtual void print (const std::string &opt) const override
 Print pool content. More...
 
virtual size_t size () const override
 Total entry count. More...
 
virtual void clear () override
 Full cleanup of all managed conditions. More...
 
virtual bool exists (Condition::key_type hash) const override
 Check a condition for existence. More...
 
virtual bool exists (const ConditionKey &key) const override
 Check a condition for existence. More...
 
virtual Condition get (Condition::key_type hash) const override
 Check if a condition exists in the pool and return it to the caller. More...
 
virtual Condition get (const ConditionKey &key) const override
 Check if a condition exists in the pool and return it to the caller
More...
 
virtual bool remove (Condition::key_type hash_key) override
 Remove condition by key from pool. More...
 
virtual bool remove (const ConditionKey &key) override
 Remove condition by key from pool. More...
 
virtual bool registerOne (const IOV &iov, Condition cond) override
 Do single insertion of condition including registration to the manager. More...
 
virtual size_t registerMany (const IOV &iov, const std::vector< Condition > &values) override
 Do block insertions of conditions with identical IOV including registration to the manager. More...
 
virtual bool insert (Condition cond) override
 Register a new condition to this pool. More...
 
virtual bool insert (DetElement detector, Condition::itemkey_type key, Condition condition) override
 ConditionsMap overload: Add a condition directly to the slice. More...
 
virtual Condition get (DetElement detector, Condition::itemkey_type key) const override
 ConditionsMap overload: Access a condition. More...
 
virtual std::vector< Conditionget (DetElement detector, Condition::itemkey_type lower, Condition::itemkey_type upper) const override
 No ConditionsMap overload: Access all conditions within a key range in the interval [lower,upper]. More...
 
virtual std::vector< Conditionget (Condition::key_type lower, Condition::key_type upper) const override
 Access all conditions within the key range of a detector element. More...
 
virtual void scan (const Condition::Processor &processor) const override
 ConditionsMap overload: Interface to scan data content of the conditions mapping. More...
 
virtual void scan (Condition::key_type lower, Condition::key_type upper, const Condition::Processor &processor) const override
 ConditionsMap overload: Interface to scan data content of the conditions mapping. More...
 
virtual void scan (DetElement detector, Condition::itemkey_type lower, Condition::itemkey_type upper, const Condition::Processor &processor) const override
 ConditionsMap overload: Interface to scan data content of the conditions mapping. More...
 
virtual ConditionsManager::Result prepare (const IOV &required, ConditionsSlice &slice, ConditionUpdateUserContext *user_param) override
 Prepare user pool for usage (load, fill etc.) according to required IOV. More...
 
virtual size_t compute (const Dependencies &dependencies, ConditionUpdateUserContext *user_param, bool force) override
 Evaluate and register all derived conditions from the dependency list. More...
 
virtual ConditionsManager::Result load (const IOV &required, ConditionsSlice &slice, ConditionUpdateUserContext *user_param) override
 Prepare user pool for usage (load, fill etc.) according to required IOV. More...
 
virtual ConditionsManager::Result compute (const IOV &required, ConditionsSlice &slice, ConditionUpdateUserContext *user_param) override
 Prepare user pool for usage (load, fill etc.) according to required IOV. More...
 
void scan (Condition::key_type lower, Condition::key_type upper, const Condition::Processor &processor) const
 Access all conditions within a given key range. More...
 
std::vector< Conditionget (Condition::key_type lower, Condition::key_type upper) const
 Access all conditions within a given key range. More...
 
- Public Member Functions inherited from dd4hep::cond::UserPool
 UserPool (ConditionsManager mgr)
 Default constructor. More...
 
virtual ~UserPool ()
 Default destructor. More...
 
const IOVvalidity () const
 Access the interval of validity for this user pool. More...
 
const IOVvalidityPtr () const
 Access the interval of validity for this user pool. More...
 
template<typename CONT >
size_t registerUnmapped (const IOV &iov, CONT &c)
 Insert multiple conditions. Note: the conditions must already have a hash key. More...
 
template<typename CONT >
size_t registerMapping (const IOV &iov, CONT &c)
 Insert multiple conditions. Note: the conditions must already have a hash key. More...
 
- Public Member Functions inherited from dd4hep::ConditionsMap
virtual ~ConditionsMap ()=default
 Standard destructor. More...
 

Private Types

typedef MAPPING Mapping
 

Private Member Functions

Condition::Objecti_findCondition (Condition::key_type key) const
 Internal helper to find conditions. More...
 
bool i_insert (Condition::Object *o)
 Internal insertion helper. More...
 

Private Attributes

Mapping m_conditions
 
ConditionsIOVPoolm_iovPool = 0
 IOV Pool as data source. More...
 
ConditionsDataLoaderm_loader = 0
 The loader to access non-existing conditions. More...
 

Additional Inherited Members

- Public Types inherited from dd4hep::cond::UserPool
enum  {
  PRINT_NONE = 0, PRINT_INSERT = 1<<0, PRINT_CLEAR = 1<<1, PRINT_LOAD = 1<<2,
  PRINT_COMPUTE = 1<<3, PRINT_LAST
}
 Printout flags for debugging. More...
 
typedef std::map< Condition::key_type, const ConditionDependency * > Dependencies
 Forward definition of the key type. More...
 
- Public Types inherited from dd4hep::ConditionsMap
enum  { FIRST_ITEM = Condition::FIRST_ITEM_KEY, LAST_ITEM = Condition::LAST_ITEM_KEY }
 
enum  { FIRST_KEY = Condition::FIRST_KEY, LAST_KEY = Condition::LAST_KEY }
 
- Public Attributes inherited from dd4hep::cond::UserPool
unsigned int flags = 0
 Processing flags (printout etc.) More...
 
- Protected Attributes inherited from dd4hep::cond::UserPool
IOV m_iov
 The pool's interval of validity. More...
 
ConditionsManager m_manager
 Handle to conditions manager object. More...
 

Detailed Description

template<typename MAPPING>
class dd4hep::cond::ConditionsMappedUserPool< MAPPING >

Class implementing the conditions user pool for a given IOV type.

Please note: Users should not directly interact with object instances of this type. Data are not thread protected and interaction may cause serious harm. Only the ConditionsManager implementation should interact with this class or any subclass to ensure data integrity.

Author
M.Frank
Version
1.0

Definition at line 47 of file ConditionsUserPool.cpp.

Member Typedef Documentation

◆ Mapping

template<typename MAPPING >
typedef MAPPING dd4hep::cond::ConditionsMappedUserPool< MAPPING >::Mapping
private

Definition at line 48 of file ConditionsUserPool.cpp.

Constructor & Destructor Documentation

◆ ConditionsMappedUserPool()

template<typename MAPPING >
ConditionsMappedUserPool::ConditionsMappedUserPool ( ConditionsManager  mgr,
ConditionsIOVPool pool 
)

Default constructor.

Definition at line 208 of file ConditionsUserPool.cpp.

◆ ~ConditionsMappedUserPool()

template<typename MAPPING >
ConditionsMappedUserPool::~ConditionsMappedUserPool
virtual

Default destructor.

Definition at line 226 of file ConditionsUserPool.cpp.

Member Function Documentation

◆ clear()

template<typename MAPPING >
void ConditionsMappedUserPool::clear
overridevirtual

Full cleanup of all managed conditions.

Implements dd4hep::cond::UserPool.

Definition at line 277 of file ConditionsUserPool.cpp.

◆ compute() [1/2]

template<typename MAPPING >
std::size_t ConditionsMappedUserPool::compute ( const Dependencies dependencies,
ConditionUpdateUserContext user_param,
bool  force 
)
overridevirtual

Evaluate and register all derived conditions from the dependency list.

This condition is no longer valid. remove it! It will be added again by the handler.

1rst pass: Compute/create the missing condiions

2nd pass: Resolve missing dependencies

Implements dd4hep::cond::UserPool.

Definition at line 444 of file ConditionsUserPool.cpp.

◆ compute() [2/2]

template<typename MAPPING >
ConditionsManager::Result ConditionsMappedUserPool::compute ( const IOV required,
ConditionsSlice slice,
ConditionUpdateUserContext user_param 
)
overridevirtual

Prepare user pool for usage (load, fill etc.) according to required IOV.

1rst pass: Compute/create the missing condiions

2nd pass: Resolve missing dependencies

Implements dd4hep::cond::UserPool.

Definition at line 705 of file ConditionsUserPool.cpp.

◆ exists() [1/2]

template<typename MAPPING >
bool ConditionsMappedUserPool::exists ( Condition::key_type  hash) const
overridevirtual

Check a condition for existence.

Implements dd4hep::cond::UserPool.

Definition at line 287 of file ConditionsUserPool.cpp.

◆ exists() [2/2]

template<typename MAPPING >
bool ConditionsMappedUserPool::exists ( const ConditionKey key) const
overridevirtual

Check a condition for existence.

Implements dd4hep::cond::UserPool.

Definition at line 293 of file ConditionsUserPool.cpp.

◆ get() [1/6]

template<typename MAPPING >
dd4hep::Condition ConditionsMappedUserPool::get ( Condition::key_type  hash) const
overridevirtual

Check if a condition exists in the pool and return it to the caller.

Implements dd4hep::cond::UserPool.

Definition at line 299 of file ConditionsUserPool.cpp.

◆ get() [2/6]

std::vector< Condition > dd4hep::cond::ConditionsMappedUserPool< umap_t >::get ( Condition::key_type  lower,
Condition::key_type  upper 
) const
virtual

Access all conditions within a given key range.

Specialization necessary, since unordered maps have no lower bound.

Implements dd4hep::cond::UserPool.

Definition at line 797 of file ConditionsUserPool.cpp.

◆ get() [3/6]

template<typename MAPPING >
std::vector< dd4hep::Condition > ConditionsMappedUserPool::get ( Condition::key_type  lower,
Condition::key_type  upper 
) const
overridevirtual

Access all conditions within the key range of a detector element.

Specialization for std::map: Access all conditions within a given key range.

Implements dd4hep::cond::UserPool.

Definition at line 382 of file ConditionsUserPool.cpp.

◆ get() [4/6]

template<typename MAPPING >
dd4hep::Condition ConditionsMappedUserPool::get ( const ConditionKey key) const
overridevirtual

Check if a condition exists in the pool and return it to the caller

Implements dd4hep::cond::UserPool.

Definition at line 305 of file ConditionsUserPool.cpp.

◆ get() [5/6]

template<typename MAPPING >
dd4hep::Condition ConditionsMappedUserPool::get ( DetElement  detector,
Condition::itemkey_type  key 
) const
overridevirtual

ConditionsMap overload: Access a condition.

Implements dd4hep::cond::UserPool.

Definition at line 366 of file ConditionsUserPool.cpp.

◆ get() [6/6]

template<typename MAPPING >
std::vector< dd4hep::Condition > ConditionsMappedUserPool::get ( DetElement  detector,
Condition::itemkey_type  lower,
Condition::itemkey_type  upper 
) const
overridevirtual

No ConditionsMap overload: Access all conditions within a key range in the interval [lower,upper].

Implements dd4hep::cond::UserPool.

Definition at line 372 of file ConditionsUserPool.cpp.

◆ i_findCondition()

template<typename MAPPING >
dd4hep::Condition::Object * ConditionsMappedUserPool::i_findCondition ( Condition::key_type  key) const
inlineprivate

Internal helper to find conditions.

Definition at line 232 of file ConditionsUserPool.cpp.

◆ i_insert()

template<typename MAPPING >
bool ConditionsMappedUserPool::i_insert ( Condition::Object o)
inlineprivate

Internal insertion helper.

Definition at line 243 of file ConditionsUserPool.cpp.

◆ insert() [1/2]

template<typename MAPPING >
bool ConditionsMappedUserPool::insert ( Condition  cond)
overridevirtual

Register a new condition to this pool.

Implements dd4hep::cond::UserPool.

Definition at line 348 of file ConditionsUserPool.cpp.

◆ insert() [2/2]

template<typename MAPPING >
bool ConditionsMappedUserPool::insert ( DetElement  detector,
Condition::itemkey_type  key,
Condition  condition 
)
overridevirtual

ConditionsMap overload: Add a condition directly to the slice.

Implements dd4hep::cond::UserPool.

Definition at line 357 of file ConditionsUserPool.cpp.

◆ load()

template<typename MAPPING >
ConditionsManager::Result ConditionsMappedUserPool::load ( const IOV required,
ConditionsSlice slice,
ConditionUpdateUserContext user_param 
)
overridevirtual

Prepare user pool for usage (load, fill etc.) according to required IOV.

Implements dd4hep::cond::UserPool.

Definition at line 631 of file ConditionsUserPool.cpp.

◆ prepare()

template<typename MAPPING >
ConditionsManager::Result ConditionsMappedUserPool::prepare ( const IOV required,
ConditionsSlice slice,
ConditionUpdateUserContext user_param 
)
overridevirtual

Prepare user pool for usage (load, fill etc.) according to required IOV.

1rst pass: Compute/create the missing condiions

2nd pass: Resolve missing dependencies

Implements dd4hep::cond::UserPool.

Definition at line 503 of file ConditionsUserPool.cpp.

◆ print()

template<typename MAPPING >
void ConditionsMappedUserPool::print ( const std::string &  opt) const
overridevirtual

Print pool content.

Implements dd4hep::cond::UserPool.

Definition at line 265 of file ConditionsUserPool.cpp.

◆ registerMany()

template<typename MAPPING >
std::size_t ConditionsMappedUserPool::registerMany ( const IOV iov,
const std::vector< Condition > &  values 
)
overridevirtual

Do block insertions of conditions with identical IOV including registration to the manager.

Implements dd4hep::cond::UserPool.

Definition at line 326 of file ConditionsUserPool.cpp.

◆ registerOne()

template<typename MAPPING >
bool ConditionsMappedUserPool::registerOne ( const IOV iov,
Condition  cond 
)
overridevirtual

Do single insertion of condition including registration to the manager.

Do block insertions of conditions with identical IOV including registration to the manager.

Implements dd4hep::cond::UserPool.

Definition at line 311 of file ConditionsUserPool.cpp.

◆ remove() [1/2]

template<typename MAPPING >
bool ConditionsMappedUserPool::remove ( Condition::key_type  hash_key)
overridevirtual

Remove condition by key from pool.

Implements dd4hep::cond::UserPool.

Definition at line 433 of file ConditionsUserPool.cpp.

◆ remove() [2/2]

template<typename MAPPING >
bool ConditionsMappedUserPool::remove ( const ConditionKey key)
overridevirtual

Remove condition by key from pool.

Implements dd4hep::cond::UserPool.

Definition at line 427 of file ConditionsUserPool.cpp.

◆ scan() [1/4]

void dd4hep::cond::ConditionsMappedUserPool< umap_t >::scan ( Condition::key_type  lower,
Condition::key_type  upper,
const Condition::Processor processor 
) const
virtual

Access all conditions within a given key range.

Specialization necessary, since unordered maps have no lower bound.

Implements dd4hep::cond::UserPool.

Definition at line 786 of file ConditionsUserPool.cpp.

◆ scan() [2/4]

template<typename MAPPING >
void ConditionsMappedUserPool::scan ( Condition::key_type  lower,
Condition::key_type  upper,
const Condition::Processor processor 
) const
overridevirtual

ConditionsMap overload: Interface to scan data content of the conditions mapping.

Implements dd4hep::cond::UserPool.

Definition at line 416 of file ConditionsUserPool.cpp.

◆ scan() [3/4]

template<typename MAPPING >
void ConditionsMappedUserPool::scan ( const Condition::Processor processor) const
overridevirtual

ConditionsMap overload: Interface to scan data content of the conditions mapping.

Implements dd4hep::cond::UserPool.

Definition at line 396 of file ConditionsUserPool.cpp.

◆ scan() [4/4]

template<typename MAPPING >
void ConditionsMappedUserPool::scan ( DetElement  detector,
Condition::itemkey_type  lower,
Condition::itemkey_type  upper,
const Condition::Processor processor 
) const
overridevirtual

ConditionsMap overload: Interface to scan data content of the conditions mapping.

Implements dd4hep::cond::UserPool.

Definition at line 403 of file ConditionsUserPool.cpp.

◆ size()

template<typename MAPPING >
size_t ConditionsMappedUserPool::size
overridevirtual

Total entry count.

Implements dd4hep::cond::UserPool.

Definition at line 259 of file ConditionsUserPool.cpp.

Member Data Documentation

◆ m_conditions

template<typename MAPPING >
Mapping dd4hep::cond::ConditionsMappedUserPool< MAPPING >::m_conditions
private

Definition at line 49 of file ConditionsUserPool.cpp.

◆ m_iovPool

template<typename MAPPING >
ConditionsIOVPool* dd4hep::cond::ConditionsMappedUserPool< MAPPING >::m_iovPool = 0
private

IOV Pool as data source.

Definition at line 51 of file ConditionsUserPool.cpp.

◆ m_loader

template<typename MAPPING >
ConditionsDataLoader* dd4hep::cond::ConditionsMappedUserPool< MAPPING >::m_loader = 0
private

The loader to access non-existing conditions.

Definition at line 53 of file ConditionsUserPool.cpp.


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