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

The data class behind a conditions manager handle. More...

#include <Manager_Type1.h>

Inheritance diagram for dd4hep::cond::Manager_Type1:
dd4hep::cond::ConditionsManagerObject dd4hep::ObjectExtensions dd4hep::NamedObject dd4hep::PropertyConfigurable dd4hep::PropertyInterface

Public Types

typedef std::vector< ConditionsIOVPool * > TypedConditionPool
 
- Public Types inherited from dd4hep::cond::ConditionsManagerObject
typedef Condition::key_type key_type
 
typedef std::pair< ConditionsListener *, void * > Listener
 
typedef std::set< ListenerListeners
 
typedef std::unique_ptr< ConditionsDataLoaderLoader
 
typedef ConditionsManager::Result Result
 

Public Member Functions

 Manager_Type1 (Detector &description)
 Standard constructor. More...
 
virtual ~Manager_Type1 ()
 Default destructor. More...
 
void initialize ()
 Access to managed pool of typed conditions indexed by IOV-type and IOV key. More...
 
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. More...
 
virtual const std::vector< IOVType > & iovTypes () const final
 Access IOV by its type. More...
 
virtual const IOVTypeiovType (size_t iov_index) const final
 Access IOV by its type. More...
 
virtual const IOVTypeiovType (const std::string &iov_name) const final
 Access IOV by its name. More...
 
virtual ConditionsPoolregisterIOV (const IOVType &typ, IOV::Key key) final
 Register IOV with type and key. More...
 
virtual ConditionsIOVPooliovPool (const IOVType &type) const final
 Access conditions multi IOV pool by iov type. More...
 
virtual bool registerUnlocked (ConditionsPool &pool, Condition cond) final
 Register new condition with the conditions store. Unlocked version, not multi-threaded. More...
 
virtual size_t blockRegister (ConditionsPool &pool, const std::vector< Condition > &cond) const final
 Register a whole block of conditions with identical IOV. More...
 
virtual void adoptCleanup (ConditionsCleanup *cleaner) final
 Adopt cleanup handler. If a handler is registered, it is invoked at every "prepare" step. More...
 
virtual int clean (const IOVType *typ, int max_age) final
 Clean conditions, which are above the age limit. More...
 
virtual std::pair< int, int > clean (const ConditionsCleanup &cleaner) final
 Invoke cache cleanup with user defined policy. More...
 
virtual std::pair< int, int > clear () final
 Full cleanup of all managed conditions. More...
 
virtual void pushUpdates () final
 Push all pending updates to the conditions store. More...
 
virtual std::unique_ptr< UserPoolcreateUserPool (const IOVType *iovT) const
 Create empty user pool object. More...
 
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. More...
 
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) More...
 
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) More...
 
- Public Member Functions inherited from dd4hep::cond::ConditionsManagerObject
 ConditionsManagerObject (Detector &description)
 Default constructor. More...
 
virtual ~ConditionsManagerObject ()
 Default destructor. More...
 
DetectordetectorDescription () const
 Access to the detector description instance. More...
 
ConditionsDataLoaderloader () const
 Access to the data loader. More...
 
bool doLoadConditions () const
 Access to load flag. More...
 
bool doOutputUnloaded () const
 Access to flag to indicate if unloaded items should be saved to the slice (or not) More...
 
void onRegister (Condition condition)
 Listener invocation when a condition is registered to the cache. More...
 
void onRemove (Condition condition)
 Listener invocation when a condition is deregistered from the cache. More...
 
void callOnRegister (const Listener &callee, bool add)
 (Un)Registration of conditions listeners with callback when a new condition is registered More...
 
void callOnRemove (const Listener &callee, bool add)
 (Un)Registration of conditions listeners with callback when a condition is unregistered More...
 
const std::vector< const IOVType * > iovTypesUsed () const
 Access the used/registered IOV types. More...
 
void fromString (const std::string &iov_str, IOV &iov)
 Create IOV from string. More...
 
ConditionsPoolregisterIOV (const std::string &data)
 Register IOV using new string data. More...
 
- Public Member Functions inherited from dd4hep::NamedObject
 NamedObject (const char *nam, const char *typ="")
 Initializing constructor. More...
 
 NamedObject (const std::string &nam)
 Initializing constructor. More...
 
 NamedObject (const std::string &nam, const std::string &typ)
 Initializing constructor. More...
 
 NamedObject ()=default
 Standard constructor. More...
 
 NamedObject (const NamedObject &c)=default
 Copy constructor. More...
 
 NamedObject (NamedObject &&c)=default
 Move constructor. More...
 
virtual ~NamedObject ()=default
 Default destructor. More...
 
NamedObjectoperator= (const NamedObject &c)=default
 Assignment operator. More...
 
NamedObjectoperator= (NamedObject &&c)=default
 Move assignment operator. More...
 
const char * GetName () const
 Access name. More...
 
void SetName (const char *nam)
 Set name (used by Handle) More...
 
void SetTitle (const char *tit)
 Set Title (used by Handle) More...
 
const char * GetTitle () const
 Get name (used by Handle) More...
 
- Public Member Functions inherited from dd4hep::PropertyConfigurable
 PropertyConfigurable ()
 Standard constructor. More...
 
virtual ~PropertyConfigurable ()
 Default destructor. More...
 
virtual PropertyManagerproperties () override
 Access to the properties of the object. More...
 
virtual const PropertyManagerproperties () const override
 Access to the properties of the object. More...
 
virtual bool hasProperty (const std::string &name) const override
 Check property for existence. More...
 
virtual Propertyproperty (const std::string &name) override
 Access single property. More...
 
template<typename T >
void declareProperty (const std::string &nam, T &val)
 Declare property. More...
 
template<typename T >
void declareProperty (const char *nam, T &val)
 Declare property. More...
 
- Public Member Functions inherited from dd4hep::PropertyInterface
virtual ~PropertyInterface ()=default
 Default destructor. More...
 
- Public Member Functions inherited from dd4hep::ObjectExtensions
 ObjectExtensions (const std::type_info &parent_type)
 Default constructor. More...
 
 ObjectExtensions (const ObjectExtensions &copy)=delete
 Copy constructor. More...
 
virtual ~ObjectExtensions ()
 Default destructor. More...
 
ObjectExtensionsoperator= (const ObjectExtensions &copy)=delete
 Assignment operator. More...
 
void initialize ()
 Initialize non-persistent object containers (e.g. after loading from ROOT file) More...
 
void move (ObjectExtensions &copy)
 Move extensions to target object. More...
 
void clear (bool destroy=true)
 Clear all extensions. More...
 
void copyFrom (const std::map< unsigned long long int, ExtensionEntry * > &ext, void *arg)
 Copy object extensions from another object. Hosting type must be identical! More...
 
void * addExtension (unsigned long long int key, ExtensionEntry *entry)
 Add an extension object to the detector element. More...
 
void * removeExtension (unsigned long long int key, bool destroy)
 Remove an existing extension object from the instance. More...
 
void * extension (unsigned long long int key, bool alert) const
 Access an existing extension object from the detector element. More...
 
void * extension (unsigned long long int key) const
 Access an existing extension object from the detector element. More...
 

Public Attributes

TypedConditionPool m_rawPool
 Managed pool of typed conditions indexed by IOV-type and IOV key. More...
 
int m_locked
 Public access: if locked, DetElements stay intact and are not altered. More...
 
- Public Attributes inherited from dd4hep::NamedObject
std::string name
 The object name. More...
 
std::string type
 The object type. More...
 
- Public Attributes inherited from dd4hep::ObjectExtensions
std::map< unsigned long long int, ExtensionEntry * > extensions
 The extensions object. More...
 

Protected Member Functions

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. More...
 
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. More...
 
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. More...
 
Condition __queue_update (cond::Entry *data)
 
- Protected Member Functions inherited from dd4hep::cond::ConditionsManagerObject
void registerCallee (Listeners &listeners, const Listener &callee, bool add)
 Register callback listener object. More...
 

Protected Attributes

int m_maxIOVTypes
 Property: maximal number of IOV types to be handled. More...
 
std::string m_poolType
 Property: ConditionsPool constructor type (default: empty. MUST BE SET!) More...
 
std::string m_updateType
 Property: UpdatePool constructor type (default: DD4hep_ConditionsLinearUpdatePool) More...
 
std::string m_userType
 Property: UserPool constructor type (default: DD4hep_ConditionsLinearUserPool) More...
 
std::string m_loaderType
 Property: Conditions loader type (default: "multi" -> DD4hep_Conditions_multi_Loader) More...
 
std::vector< IOVTypem_iovTypes
 Collection of IOV types managed. More...
 
dd4hep_mutex_t m_updateLock
 Lock to protect the update/delayed conditions pool. More...
 
dd4hep_mutex_t m_poolLock
 Lock to protect the pool of all known conditions. More...
 
std::unique_ptr< UpdatePoolm_updatePool
 Reference to update conditions pool. More...
 
std::unique_ptr< ConditionsCleanupm_cleaner
 Reference to the default conditions cleanup object (if registered) More...
 
- Protected Attributes inherited from dd4hep::cond::ConditionsManagerObject
Detectorm_detDesc
 Reference to main detector description object. More...
 
Listeners m_onRegister
 Conditions listeners on registration of new conditions. More...
 
Listeners m_onRemove
 Conditions listeners on de-registration of new conditions. More...
 
Loader m_loader
 Reference to the data loader userd by this instance. More...
 
bool m_doLoad = true
 Property: Flag to indicate if items should be loaded (or not) More...
 
bool m_doOutputUnloaded = false
 Property: Flag to indicate if unloaded items should be saved to the slice (or not) More...
 
- Protected Attributes inherited from dd4hep::PropertyConfigurable
PropertyManager m_properties
 Property pool. More...
 

Detailed Description

The data class behind a conditions manager handle.

For convenience, the class definition is here. See ConditionsManager.cpp for the implementation.

Author
M.Frank
Version
1.0

Definition at line 45 of file Manager_Type1.h.

Member Typedef Documentation

◆ TypedConditionPool

Definition at line 49 of file Manager_Type1.h.

Constructor & Destructor Documentation

◆ Manager_Type1()

Manager_Type1::Manager_Type1 ( Detector description)

Standard constructor.

Definition at line 136 of file Manager_Type1.cpp.

◆ ~Manager_Type1()

Manager_Type1::~Manager_Type1 ( )
virtual

Default destructor.

Definition at line 151 of file Manager_Type1.cpp.

Member Function Documentation

◆ __get_checked_pool()

void Manager_Type1::__get_checked_pool ( const IOV required_validity,
std::unique_ptr< UserPool > &  user_pool 
)
protected

Register a set of new managed condition for an IOV range. Called by __load_immediate.

Helper to check iov and user pool and create user pool if not present.

Helper to check iov and user pool and create user pool if not present

Definition at line 324 of file Manager_Type1.cpp.

◆ __queue_update()

dd4hep::Condition Manager_Type1::__queue_update ( cond::Entry e)
protected

Generic interface of any concrete instance
Set a single conditions value to be managed. Requires EXTERNALLY held lock on update pool!

Set a single conditions value to be managed. Requires external lock on update pool!

Definition at line 292 of file Manager_Type1.cpp.

◆ adoptCleanup()

void Manager_Type1::adoptCleanup ( ConditionsCleanup cleaner)
finalvirtual

Adopt cleanup handler. If a handler is registered, it is invoked at every "prepare" step.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 343 of file Manager_Type1.cpp.

◆ blockRegister()

std::size_t Manager_Type1::blockRegister ( ConditionsPool pool,
const std::vector< Condition > &  cond 
) const
finalvirtual

Register a whole block of conditions with identical IOV.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 270 of file Manager_Type1.cpp.

◆ clean() [1/2]

std::pair< int, int > Manager_Type1::clean ( const ConditionsCleanup cleaner)
finalvirtual

Invoke cache cleanup with user defined policy.

Returns
pair<Number of pools cleared, Number of conditions cleaned up and removed>

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 359 of file Manager_Type1.cpp.

◆ clean() [2/2]

int Manager_Type1::clean ( const IOVType typ,
int  max_age 
)
finalvirtual

Clean conditions, which are above the age limit.

Returns
Number of conditions cleaned/removed from the IOV pool of the given type

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 348 of file Manager_Type1.cpp.

◆ clear()

std::pair< int, int > Manager_Type1::clear ( )
finalvirtual

Full cleanup of all managed conditions.

Returns
pair<Number of pools cleared, Number of conditions cleaned up and removed>

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 372 of file Manager_Type1.cpp.

◆ compute()

ConditionsManager::Result Manager_Type1::compute ( const IOV required_validity,
ConditionsSlice slice,
ConditionUpdateUserContext ctxt = 0 
)
finalvirtual

Compute all derived conditions with the defined IOV (2nd step of prepare)

Invoke auto cleanup if registered

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 534 of file Manager_Type1.cpp.

◆ createUserPool()

std::unique_ptr< UserPool > Manager_Type1::createUserPool ( const IOVType iovT) const
virtual

Create empty user pool object.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 544 of file Manager_Type1.cpp.

◆ initialize()

void Manager_Type1::initialize ( )
virtual

Access to managed pool of typed conditions indexed by IOV-type and IOV key.

Initialize object and define factories

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 156 of file Manager_Type1.cpp.

◆ iovPool()

ConditionsIOVPool * Manager_Type1::iovPool ( const IOVType type) const
finalvirtual

Access conditions multi IOV pool by iov type.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 238 of file Manager_Type1.cpp.

◆ iovType() [1/2]

const dd4hep::IOVType * Manager_Type1::iovType ( const std::string &  iov_name) const
finalvirtual

Access IOV by its name.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 208 of file Manager_Type1.cpp.

◆ iovType() [2/2]

const dd4hep::IOVType * Manager_Type1::iovType ( size_t  iov_index) const
finalvirtual

Access IOV by its type.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 198 of file Manager_Type1.cpp.

◆ iovTypes()

virtual const std::vector<IOVType>& dd4hep::cond::Manager_Type1::iovTypes ( ) const
inlinefinalvirtual

Access IOV by its type.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 125 of file Manager_Type1.h.

◆ load()

ConditionsManager::Result Manager_Type1::load ( const IOV required_validity,
ConditionsSlice slice,
ConditionUpdateUserContext ctxt = 0 
)
finalvirtual

Load all updates to the clients with the defined IOV (1rst step of prepare)

First push any pending updates and register them to pending pools...

Now update/fill the user pool

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 523 of file Manager_Type1.cpp.

◆ prepare()

ConditionsManager::Result Manager_Type1::prepare ( const IOV req_iov,
ConditionsSlice slice,
ConditionUpdateUserContext ctxt 
)
finalvirtual

Prepare all updates for the given keys to the clients with the defined IOV.

  • req_validity [IOV] Required interval of validity of the selected conditions
  • slice [] Conditions slice with load/computation recipes.
Returns

First push any pending updates and register them to pending pools...

Now update/fill the user pool

Invoke auto cleanup if registered

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 507 of file Manager_Type1.cpp.

◆ pushUpdates()

void Manager_Type1::pushUpdates ( )
finalvirtual

Push all pending updates to the conditions store.

Note: This does not yet make the new conditions availible to the clients

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 385 of file Manager_Type1.cpp.

◆ registerIOV()

ConditionsPool * Manager_Type1::registerIOV ( const IOVType typ,
IOV::Key  key 
)
finalvirtual

Register IOV with type and key.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 216 of file Manager_Type1.cpp.

◆ registerIOVType()

std::pair< bool, const dd4hep::IOVType * > Manager_Type1::registerIOVType ( size_t  iov_index,
const std::string &  iov_name 
)
finalvirtual

Register new IOV type if it does not (yet) exist.

Returns (false,pointer) if IOV existed and (true,pointer) if new IOV was registered to the manager.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 175 of file Manager_Type1.cpp.

◆ registerUnlocked()

bool Manager_Type1::registerUnlocked ( ConditionsPool pool,
Condition  cond 
)
finalvirtual

Register new condition with the conditions store. Unlocked version, not multi-threaded.

Implements dd4hep::cond::ConditionsManagerObject.

Definition at line 243 of file Manager_Type1.cpp.

◆ select()

bool Manager_Type1::select ( Condition::key_type  key,
const IOV req_validity,
RangeConditions conditions 
)
protected

Retrieve a condition set given a Detector Element and the conditions name according to their validity.

Definition at line 408 of file Manager_Type1.cpp.

◆ select_range()

bool Manager_Type1::select_range ( Condition::key_type  key,
const IOV req_validity,
RangeConditions conditions 
)
protected

Retrieve a condition set given a Detector Element and the conditions name according to their validity.

Definition at line 425 of file Manager_Type1.cpp.

Member Data Documentation

◆ m_cleaner

std::unique_ptr<ConditionsCleanup> dd4hep::cond::Manager_Type1::m_cleaner
protected

Reference to the default conditions cleanup object (if registered)

Definition at line 77 of file Manager_Type1.h.

◆ m_iovTypes

std::vector<IOVType> dd4hep::cond::Manager_Type1::m_iovTypes
protected

Collection of IOV types managed.

Definition at line 67 of file Manager_Type1.h.

◆ m_loaderType

std::string dd4hep::cond::Manager_Type1::m_loaderType
protected

Property: Conditions loader type (default: "multi" -> DD4hep_Conditions_multi_Loader)

Definition at line 64 of file Manager_Type1.h.

◆ m_locked

int dd4hep::cond::Manager_Type1::m_locked

Public access: if locked, DetElements stay intact and are not altered.

Definition at line 83 of file Manager_Type1.h.

◆ m_maxIOVTypes

int dd4hep::cond::Manager_Type1::m_maxIOVTypes
protected

Property: maximal number of IOV types to be handled.

Generic interface of any concrete instance

Definition at line 56 of file Manager_Type1.h.

◆ m_poolLock

dd4hep_mutex_t dd4hep::cond::Manager_Type1::m_poolLock
protected

Lock to protect the pool of all known conditions.

Definition at line 73 of file Manager_Type1.h.

◆ m_poolType

std::string dd4hep::cond::Manager_Type1::m_poolType
protected

Property: ConditionsPool constructor type (default: empty. MUST BE SET!)

Definition at line 58 of file Manager_Type1.h.

◆ m_rawPool

TypedConditionPool dd4hep::cond::Manager_Type1::m_rawPool

Managed pool of typed conditions indexed by IOV-type and IOV key.

Definition at line 81 of file Manager_Type1.h.

◆ m_updateLock

dd4hep_mutex_t dd4hep::cond::Manager_Type1::m_updateLock
protected

Lock to protect the update/delayed conditions pool.

Specialized interface only used by this implementation

Definition at line 71 of file Manager_Type1.h.

◆ m_updatePool

std::unique_ptr<UpdatePool> dd4hep::cond::Manager_Type1::m_updatePool
protected

Reference to update conditions pool.

Definition at line 75 of file Manager_Type1.h.

◆ m_updateType

std::string dd4hep::cond::Manager_Type1::m_updateType
protected

Property: UpdatePool constructor type (default: DD4hep_ConditionsLinearUpdatePool)

Definition at line 60 of file Manager_Type1.h.

◆ m_userType

std::string dd4hep::cond::Manager_Type1::m_userType
protected

Property: UserPool constructor type (default: DD4hep_ConditionsLinearUserPool)

Definition at line 62 of file Manager_Type1.h.


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