DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
dd4hep::cond::ConditionsDependencyHandler Class Reference

Callback handler to update condition dependencies. More...

#include <ConditionsDependencyHandler.h>

Inheritance diagram for dd4hep::cond::ConditionsDependencyHandler:
dd4hep::cond::ConditionResolver

Classes

struct  Work
 Helper structure to define the current update item. More...
 

Public Types

enum  State { INVALID, CREATED, RESOLVED }
 Obect state definitions. More...
 
typedef std::map< Condition::key_type, const ConditionDependency * > Dependencies
 
typedef std::map< Condition::key_type, Work * > WorkConditions
 

Public Member Functions

 ConditionsDependencyHandler (ConditionsManager mgr, UserPool &pool, const Dependencies &dependencies, ConditionUpdateUserContext *user_param)
 Initializing constructor. More...
 
 ~ConditionsDependencyHandler ()
 Default destructor. More...
 
void compute ()
 Access the conditions created during processing. More...
 
void resolve ()
 2nd pass: Handler callback for the second turn to resolve missing dependencies More...
 
virtual DetectordetectorDescription () const override
 Access to the detector description instance. More...
 
virtual Ref_t manager () const override
 Access to the conditions manager. More...
 
virtual const IOVrequiredValidity () const override
 Access to pool IOV. More...
 
virtual ConditionsMapconditionsMap () const override
 Accessor for the current conditons mapping. More...
 
virtual Condition get (const ConditionKey &key) override
 ConditionResolver implementation: Interface to access conditions. More...
 
virtual Condition get (const ConditionKey &key, bool throw_if_not) override
 Interface to access conditions by conditions key. More...
 
virtual Condition get (Condition::key_type key) override
 ConditionResolver implementation: Interface to access conditions. More...
 
virtual Condition get (Condition::key_type key, bool throw_if_not) override
 Interface to access conditions by hash value. More...
 
virtual Condition get (Condition::key_type key, const ConditionDependency *dependency, bool throw_if_not) override
 Interface to access conditions by hash value. More...
 
virtual std::vector< Conditionget (DetElement de) override
 Interface to access conditions by hash value of the DetElement (only valid at resolve!) More...
 
virtual std::vector< Conditionget (Condition::detkey_type key) override
 Interface to access conditions by hash value of the DetElement (only valid at resolve!) More...
 
virtual std::vector< ConditiongetByItem (Condition::itemkey_type key) override
 Interface to access conditions by hash value of the item (only valid at resolve!) More...
 
virtual bool registerOne (const IOV &iov, Condition cond) override
 Interface to handle multi-condition inserts by callbacks: One single insert. More...
 
virtual size_t registerMany (const IOV &iov, const std::vector< Condition > &values) override
 Handle multi-condition inserts by callbacks: block insertions of conditions with identical IOV. More...
 
- Public Member Functions inherited from dd4hep::cond::ConditionResolver
virtual ~ConditionResolver ()
 Standard destructor. More...
 
template<typename CONT >
size_t registerUnmapped (const IOV &iov, CONT &c)
 Handle multi-condition inserts by callbacks with identical key. Handle unmapped containers. More...
 
template<typename CONT >
size_t registerMapping (const IOV &iov, CONT &c)
 Handle multi-condition inserts by callbacks with identical key. Handle mapped containers. More...
 

Public Attributes

size_t num_callback
 Number of callbacks to the handler for monitoring. More...
 

Protected Member Functions

void do_callback (Work *dep)
 Internal call to trigger update callback. More...
 

Protected Attributes

ConditionsManagerObjectm_manager
 Reference to conditions manager. More...
 
UserPoolm_pool
 Reference to the user pool object. More...
 
const Dependenciesm_dependencies
 Dependency container to be resolved. More...
 
ConditionUpdateUserContextm_userParam
 User defined optional processing parameter. More...
 
const IOVTypem_iovType = 0
 Local cacheL pool's IOV type. More...
 
WorkConditions m_todo
 The objects created during processing. More...
 
State m_state = CREATED
 Handler's state. More...
 
Workm_block = 0
 Current block work item. More...
 
Workm_currentWork = 0
 Current item of the block. More...
 

Detailed Description

Callback handler to update condition dependencies.

Fully stack based condition resolution. Any user request for dependent conditions are fully handled by

The ConditionsDependencyHandler implements the ConditionResolver interface, which is offered to the clients as an embedded parameter during the conversion mechanism. Clients must direct any subsequent conditions access to the ConditionResolver interface in order to allow for upgrades of this implementation which might not be polymorph.

Author
M.Frank
Version
1.0

Definition at line 50 of file ConditionsDependencyHandler.h.

Member Typedef Documentation

◆ Dependencies

Definition at line 86 of file ConditionsDependencyHandler.h.

◆ WorkConditions

Definition at line 87 of file ConditionsDependencyHandler.h.

Member Enumeration Documentation

◆ State

Obect state definitions.

Enumerator
INVALID 
CREATED 
RESOLVED 

Definition at line 53 of file ConditionsDependencyHandler.h.

Constructor & Destructor Documentation

◆ ConditionsDependencyHandler()

ConditionsDependencyHandler::ConditionsDependencyHandler ( ConditionsManager  mgr,
UserPool pool,
const Dependencies dependencies,
ConditionUpdateUserContext user_param 
)

Initializing constructor.

Default constructor.

Definition at line 63 of file ConditionsDependencyHandler.cpp.

◆ ~ConditionsDependencyHandler()

ConditionsDependencyHandler::~ConditionsDependencyHandler ( )

Default destructor.

Definition at line 82 of file ConditionsDependencyHandler.cpp.

Member Function Documentation

◆ compute()

void ConditionsDependencyHandler::compute ( )

Access the conditions created during processing.

1rst pass: Compute/create the missing conditions

Definition at line 94 of file ConditionsDependencyHandler.cpp.

◆ conditionsMap()

virtual ConditionsMap& dd4hep::cond::ConditionsDependencyHandler::conditionsMap ( ) const
inlineoverridevirtual

Accessor for the current conditons mapping.

Implements dd4hep::cond::ConditionResolver.

Definition at line 140 of file ConditionsDependencyHandler.h.

◆ detectorDescription()

dd4hep::Detector & ConditionsDependencyHandler::detectorDescription ( ) const
overridevirtual

Access to the detector description instance.

ConditionResolver implementation: Access to the detector description instance.

ConditionResolver interface implementation

Implements dd4hep::cond::ConditionResolver.

Definition at line 89 of file ConditionsDependencyHandler.cpp.

◆ do_callback()

void ConditionsDependencyHandler::do_callback ( Work dep)
protected

Internal call to trigger update callback.

Definition at line 291 of file ConditionsDependencyHandler.cpp.

◆ get() [1/7]

std::vector< dd4hep::Condition > ConditionsDependencyHandler::get ( Condition::detkey_type  key)
overridevirtual

Interface to access conditions by hash value of the DetElement (only valid at resolve!)

Implements dd4hep::cond::ConditionResolver.

Definition at line 202 of file ConditionsDependencyHandler.cpp.

◆ get() [2/7]

virtual Condition dd4hep::cond::ConditionsDependencyHandler::get ( Condition::key_type  key)
inlineoverridevirtual

ConditionResolver implementation: Interface to access conditions.

Implements dd4hep::cond::ConditionResolver.

Definition at line 148 of file ConditionsDependencyHandler.h.

◆ get() [3/7]

dd4hep::Condition ConditionsDependencyHandler::get ( Condition::key_type  key,
bool  throw_if_not 
)
overridevirtual

Interface to access conditions by hash value.

ConditionResolver implementation: Interface to access conditions.

Implements dd4hep::cond::ConditionResolver.

Definition at line 217 of file ConditionsDependencyHandler.cpp.

◆ get() [4/7]

dd4hep::Condition ConditionsDependencyHandler::get ( Condition::key_type  key,
const ConditionDependency dependency,
bool  throw_if_not 
)
overridevirtual

Interface to access conditions by hash value.

ConditionResolver implementation: Interface to access conditions.

If we are not already resolving here, we follow the normal procedure

Implements dd4hep::cond::ConditionResolver.

Definition at line 223 of file ConditionsDependencyHandler.cpp.

◆ get() [5/7]

virtual Condition dd4hep::cond::ConditionsDependencyHandler::get ( const ConditionKey key)
inlineoverridevirtual

ConditionResolver implementation: Interface to access conditions.

Implements dd4hep::cond::ConditionResolver.

Definition at line 142 of file ConditionsDependencyHandler.h.

◆ get() [6/7]

virtual Condition dd4hep::cond::ConditionsDependencyHandler::get ( const ConditionKey key,
bool  throw_if_not 
)
inlineoverridevirtual

Interface to access conditions by conditions key.

Implements dd4hep::cond::ConditionResolver.

Definition at line 145 of file ConditionsDependencyHandler.h.

◆ get() [7/7]

std::vector< dd4hep::Condition > ConditionsDependencyHandler::get ( DetElement  de)
overridevirtual

Interface to access conditions by hash value of the DetElement (only valid at resolve!)

Implements dd4hep::cond::ConditionResolver.

Definition at line 172 of file ConditionsDependencyHandler.cpp.

◆ getByItem()

std::vector< dd4hep::Condition > ConditionsDependencyHandler::getByItem ( Condition::itemkey_type  key)
overridevirtual

Interface to access conditions by hash value of the item (only valid at resolve!)

Implements dd4hep::cond::ConditionResolver.

Definition at line 178 of file ConditionsDependencyHandler.cpp.

◆ manager()

virtual Ref_t dd4hep::cond::ConditionsDependencyHandler::manager ( ) const
inlineoverridevirtual

Access to the conditions manager.

Implements dd4hep::cond::ConditionResolver.

Definition at line 136 of file ConditionsDependencyHandler.h.

◆ registerMany()

std::size_t ConditionsDependencyHandler::registerMany ( const IOV iov,
const std::vector< Condition > &  values 
)
overridevirtual

Handle multi-condition inserts by callbacks: block insertions of conditions with identical IOV.

Implements dd4hep::cond::ConditionResolver.

Definition at line 166 of file ConditionsDependencyHandler.cpp.

◆ registerOne()

bool ConditionsDependencyHandler::registerOne ( const IOV iov,
Condition  cond 
)
overridevirtual

Interface to handle multi-condition inserts by callbacks: One single insert.

Implements dd4hep::cond::ConditionResolver.

Definition at line 160 of file ConditionsDependencyHandler.cpp.

◆ requiredValidity()

virtual const IOV& dd4hep::cond::ConditionsDependencyHandler::requiredValidity ( ) const
inlineoverridevirtual

Access to pool IOV.

Implements dd4hep::cond::ConditionResolver.

Definition at line 138 of file ConditionsDependencyHandler.h.

◆ resolve()

void ConditionsDependencyHandler::resolve ( )

2nd pass: Handler callback for the second turn to resolve missing dependencies

Definition at line 109 of file ConditionsDependencyHandler.cpp.

Member Data Documentation

◆ m_block

Work* dd4hep::cond::ConditionsDependencyHandler::m_block = 0
protected

Current block work item.

Definition at line 105 of file ConditionsDependencyHandler.h.

◆ m_currentWork

Work* dd4hep::cond::ConditionsDependencyHandler::m_currentWork = 0
protected

Current item of the block.

Definition at line 107 of file ConditionsDependencyHandler.h.

◆ m_dependencies

const Dependencies& dd4hep::cond::ConditionsDependencyHandler::m_dependencies
protected

Dependency container to be resolved.

Definition at line 95 of file ConditionsDependencyHandler.h.

◆ m_iovType

const IOVType* dd4hep::cond::ConditionsDependencyHandler::m_iovType = 0
protected

Local cacheL pool's IOV type.

Definition at line 99 of file ConditionsDependencyHandler.h.

◆ m_manager

ConditionsManagerObject* dd4hep::cond::ConditionsDependencyHandler::m_manager
protected

Reference to conditions manager.

Definition at line 91 of file ConditionsDependencyHandler.h.

◆ m_pool

UserPool& dd4hep::cond::ConditionsDependencyHandler::m_pool
protected

Reference to the user pool object.

Definition at line 93 of file ConditionsDependencyHandler.h.

◆ m_state

State dd4hep::cond::ConditionsDependencyHandler::m_state = CREATED
protected

Handler's state.

Definition at line 103 of file ConditionsDependencyHandler.h.

◆ m_todo

WorkConditions dd4hep::cond::ConditionsDependencyHandler::m_todo
protected

The objects created during processing.

Definition at line 101 of file ConditionsDependencyHandler.h.

◆ m_userParam

ConditionUpdateUserContext* dd4hep::cond::ConditionsDependencyHandler::m_userParam
protected

User defined optional processing parameter.

Definition at line 97 of file ConditionsDependencyHandler.h.

◆ num_callback

size_t dd4hep::cond::ConditionsDependencyHandler::num_callback
mutable

Number of callbacks to the handler for monitoring.

Definition at line 110 of file ConditionsDependencyHandler.h.


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