DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | List of all members

ConditionsMap class. More...

#include <ConditionsMap.h>

Inheritance diagram for dd4hep::ConditionsMap:
dd4hep::AlignmentsNominalMap dd4hep::cond::ConditionsSlice dd4hep::cond::UserPool dd4hep::ConditionsMapping< T > dd4hep::cond::ConditionsMappedUserPool< MAPPING >

Public Types

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 Member Functions

virtual ~ConditionsMap ()=default
 Standard destructor. More...
 
virtual bool insert (DetElement detector, Condition::itemkey_type key, Condition condition)=0
 Insert a new entry to the map. The detector element key and the item key make a unique global conditions key. More...
 
virtual Condition get (DetElement detector, Condition::itemkey_type key) const =0
 Interface to access conditions by hash value. The detector element key and the item key make a unique global conditions key. More...
 
virtual void scan (const Condition::Processor &processor) const =0
 Interface to scan data content of the conditions mapping. More...
 
virtual std::vector< Conditionget (DetElement detector, Condition::itemkey_type lower, Condition::itemkey_type upper) const
 No ConditionsMap overload: Access all conditions within a key range in the interval [lower,upper]. More...
 
virtual void scan (DetElement detector, Condition::itemkey_type lower, Condition::itemkey_type upper, const Condition::Processor &processor) const
 Interface to partially scan data content of the conditions mapping. More...
 

Detailed Description

ConditionsMap class.

Access mechanisms of dd4hep conditions for utilities

The conditions map class is the basic interface to manage/access conditions in dd4hep. It's main use is to provide a common interface to utilities using dd4hep conditions, such as scanners, selectors, printers etc. Such utilities often require access to conditions sets based on individual DetElement instances.

Access to conditions is solely supported using this interface – All utilities must use this interface. – Any concrete implementation using conditions/alignment utilities must implement this interface – Basic implmentation using STL map, multimap and unordered_map are provided. – A special no-op implementation of this interface shall be provided to access "default" alignment conditions. This implementation shall fall-back internally to the DetElement::nominal() alignment. Known clients: VolumeManager (hence: DDG4, DDRec, etc.)

Though this sounds like a trivial change, the consequences concern the entire conditions and alignment handling. This interface decouples entirely the core part of dd4hep from the conditons cache handling and the alignment handling.

Based on this interface most utilities used to handle conditions, detectors scans to visit DetElement related condition sets, alignment and conditions printers etc.

Author
M.Frank
Version
1.0

Definition at line 59 of file ConditionsMap.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
FIRST_ITEM 
LAST_ITEM 

Definition at line 61 of file ConditionsMap.h.

◆ anonymous enum

anonymous enum
Enumerator
FIRST_KEY 
LAST_KEY 

Definition at line 65 of file ConditionsMap.h.

Constructor & Destructor Documentation

◆ ~ConditionsMap()

virtual dd4hep::ConditionsMap::~ConditionsMap ( )
virtualdefault

Standard destructor.

Member Function Documentation

◆ get() [1/2]

virtual Condition dd4hep::ConditionsMap::get ( DetElement  detector,
Condition::itemkey_type  key 
) const
pure virtual

Interface to access conditions by hash value. The detector element key and the item key make a unique global conditions key.

Implemented in dd4hep::cond::ConditionsSlice, dd4hep::ConditionsMapping< T >, dd4hep::cond::ConditionsMappedUserPool< MAPPING >, dd4hep::AlignmentsNominalMap, and dd4hep::cond::UserPool.

◆ get() [2/2]

std::vector< Condition > ConditionsMap::get ( DetElement  detector,
Condition::itemkey_type  lower,
Condition::itemkey_type  upper 
) const
virtual

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

Partial implementations for utilities accessing DetElement conditions
Note: This default implementation uses void scan(DetElement detector, itemkey_type lower, itemkey_type upper, const Processor& collector) The performance depends on the concrete implementation of the scan method!

Helper to implement partial scans.

Constructor

Conditions callback for object processing

Reimplemented in dd4hep::cond::ConditionsSlice, dd4hep::ConditionsMapping< T >, dd4hep::cond::ConditionsMappedUserPool< MAPPING >, dd4hep::AlignmentsNominalMap, and dd4hep::cond::UserPool.

Definition at line 59 of file ConditionsMap.cpp.

◆ insert()

virtual bool dd4hep::ConditionsMap::insert ( DetElement  detector,
Condition::itemkey_type  key,
Condition  condition 
)
pure virtual

Insert a new entry to the map. The detector element key and the item key make a unique global conditions key.

Implemented in dd4hep::cond::UserPool, dd4hep::cond::ConditionsSlice, dd4hep::ConditionsMapping< T >, dd4hep::cond::ConditionsMappedUserPool< MAPPING >, dd4hep::AlignmentsNominalMap, and dd4hep::ConditionsMapping< T >.

◆ scan() [1/2]

virtual void dd4hep::ConditionsMap::scan ( const Condition::Processor processor) const
pure virtual

◆ scan() [2/2]

void ConditionsMap::scan ( DetElement  detector,
Condition::itemkey_type  lower,
Condition::itemkey_type  upper,
const Condition::Processor processor 
) const
virtual

Interface to partially scan data content of the conditions mapping.

Note: This default implementation assumes unordered containers and hence is not the most efficient implementation! Internaly it uses "scan(Processor& processor)" the subselection hence is linearly depending of the number of elements.

This default implementation uses std::vector<Condition> get(DetElement detector, itemkey_type lower, itemkey_type upper) The performance depends on the concrete implementation of the scan method!

Using ordered maps with "lower_bound(key)" this can be greatly improved. See the concrete implementations below.

Helper to implement partial scans.

Constructor

Conditions callback for object processing

Reimplemented in dd4hep::cond::ConditionsSlice, dd4hep::ConditionsMapping< T >, dd4hep::cond::ConditionsMappedUserPool< MAPPING >, dd4hep::AlignmentsNominalMap, dd4hep::cond::UserPool, and dd4hep::ConditionsMapping< T >.

Definition at line 22 of file ConditionsMap.cpp.


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