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

Manager class for condition handles. More...

#include <ConditionsManager.h>

Inheritance diagram for dd4hep::cond::ConditionsManager:
dd4hep::Handle< ConditionsManagerObject >

Classes

class  Result
 Result of a prepare call to the conditions manager. More...
 

Public Types

typedef ConditionsManagerObject Object
 Standard object type. More...
 
typedef std::vector< IOVTypeIOVTypes
 
- Public Types inherited from dd4hep::Handle< ConditionsManagerObject >
typedef ConditionsManagerObject Object
 Extern accessible definition of the contained element type. More...
 
typedef Handle< ConditionsManagerObject > Base
 Self type: used by sub-classes. More...
 

Public Member Functions

 ConditionsManager (Detector &description)
 Initializing constructor - used only by examples. More...
 
 ConditionsManager (Detector &description, const std::string &factory)
 Initializing constructor to create a manager from the factory name. More...
 
 ConditionsManager ()=default
 Default constructor. More...
 
 ConditionsManager (Object *p)
 Constructor to be used with valid pointer to object. More...
 
 ConditionsManager (const ConditionsManager &c)=default
 Constructor to assing handle of the same type. More...
 
template<typename Q >
 ConditionsManager (const Handle< Q > &e)
 Constructor to be used assigning from different type. More...
 
 ~ConditionsManager ()=default
 Default destructor. More...
 
ConditionsManageroperator= (const ConditionsManager &c)=default
 Assignment operator. More...
 
ConditionsManagerinitialize ()
 Initialize the object after having set the properties. More...
 
DetectordetectorDescription () const
 Access the detector description. More...
 
Propertyoperator[] (const std::string &property_name) const
 Access to properties. More...
 
PropertyManagerproperties () const
 Access to the property manager. More...
 
ConditionsDataLoaderloader () const
 Access the conditions loader. More...
 
const std::vector< const IOVType * > iovTypesUsed () const
 Access the used/registered IOV types. More...
 
const IOVTypeiovType (const std::string &iov_name) const
 Access IOV by its name. More...
 
ConditionsIOVPooliovPool (const IOVType &type) const
 Access conditions multi IOV pool by iov type. More...
 
void fromString (const std::string &iov_str, IOV &iov) const
 Create IOV from string. More...
 
std::pair< bool, const IOVType * > registerIOVType (size_t iov_type, const std::string &iov_name) const
 Register new IOV type if it does not (yet) exist. More...
 
ConditionsPoolregisterIOV (const IOV &iov) const
 Register IOV with type and key. More...
 
ConditionsPoolregisterIOV (const IOVType &typ, IOV::Key key) const
 Register IOV with type and key. More...
 
ConditionsPoolregisterIOV (const std::string &iov_rep) const
 Register IOV with type and key. More...
 
bool registerUnlocked (ConditionsPool &pool, Condition cond) const
 Register new condition with the conditions store. Unlocked version, not multi-threaded. More...
 
size_t blockRegister (ConditionsPool &pool, const std::vector< Condition > &cond) const
 Register a whole block of conditions with identical IOV. More...
 
void pushUpdates () const
 Push all pending updates to the conditions store. More...
 
void adoptCleanup (ConditionsCleanup *cleaner) const
 Adopt cleanup handler. If a handler is registered, it is invoked at every "prepare" step. More...
 
void clean (const ConditionsCleanup &cleaner) const
 Invoke cache cleanup with user defined policy. More...
 
void clean (const IOVType *typ, int max_age) const
 Clean conditions, which are above the age limit. More...
 
void clear () const
 Full cleanup of all managed conditions. More...
 
std::unique_ptr< UserPoolcreateUserPool (const IOVType *iovT) const
 Create empty user pool object. More...
 
Result prepare (const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0) const
 Prepare all updates to the clients with the defined IOV. More...
 
Result load (const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0) const
 Load all updates to the clients with the defined IOV (1rst step of prepare) More...
 
Result compute (const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0) const
 Compute all derived conditions with the defined IOV (2nd step of prepare) More...
 
- Public Member Functions inherited from dd4hep::Handle< ConditionsManagerObject >
 Handle ()=default
 Default constructor. More...
 
 Handle (Handle< ConditionsManagerObject > &&element)=default
 Copy constructor. More...
 
 Handle (const Handle< ConditionsManagerObject > &element)=default
 Copy constructor. More...
 
 Handle (ConditionsManagerObject *element)
 Initializing constructor from pointer. More...
 
 Handle (Q *element)
 Initializing constructor from unrelated pointer with type checking. More...
 
 Handle (const Handle< Q > &element)
 Initializing constructor from unrelated handle with type checking. More...
 
Handle< ConditionsManagerObject > & operator= (Handle< ConditionsManagerObject > &&element)=default
 Assignment move operator. More...
 
Handle< ConditionsManagerObject > & operator= (const Handle< ConditionsManagerObject > &element)=default
 Assignment copy operator. More...
 
bool operator== (const Handle< ConditionsManagerObject > &element) const
 Boolean operator == used for RB tree insertions. More...
 
bool operator< (const Handle< ConditionsManagerObject > &element) const
 Boolean operator < used for RB tree insertions. More...
 
bool operator> (const Handle< ConditionsManagerObject > &element) const
 Boolean operator > used for RB tree insertions. More...
 
bool isValid () const
 Check the validity of the object held by the handle. More...
 
bool operator! () const
 Check the validity of the object held by the handle. More...
 
Handle< ConditionsManagerObject > & clear ()
 Release the object held by the handle. More...
 
ConditionsManagerObject * operator-> () const
 Access the held object using the -> operator. More...
 
 operator ConditionsManagerObject & () const
 Automatic type conversion to an object references. More...
 
ConditionsManagerObject & operator* () const
 Access the held object using the * operator. More...
 
ConditionsManagerObject * ptr () const
 Access to the held object. More...
 
Q * _ptr () const
 Access to an unrelated object type. More...
 
Q * data () const
 Access to an unrelated object type. More...
 
Q & object () const
 Access to an unrelated object type. More...
 
ConditionsManagerObject * access () const
 Checked object access. Throws invalid handle runtime exception if invalid handle. More...
 
const char * name () const
 Access the object name (or "" if not supported by the object) More...
 
const char * name () const
 
const char * name () const
 
void assign (Object *n, const std::string &nam, const std::string &title)
 Assign a new named object. Note: object references must be managed by the user. More...
 
void assign (_Segmentation *s, const std::string &n, const std::string &)
 
void assign (NamedObject *p, const std::string &n, const std::string &t)
 
void destroy ()
 Destroy the underlying object (be careful here: things are not reference counted)! More...
 

Static Public Member Functions

template<typename T >
static ConditionsManager from (T &host)
 Static accessor if installed as an extension. More...
 
template<>
ConditionsManager from (Detector &host)
 Access specialization. More...
 
- Static Public Member Functions inherited from dd4hep::Handle< ConditionsManagerObject >
static void bad_assignment (const std::type_info &from, const std::type_info &to)
 Helper routine called when unrelated types are assigned. More...
 

Additional Inherited Members

- Public Attributes inherited from dd4hep::Handle< ConditionsManagerObject >
ConditionsManagerObject * m_element
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

Manager class for condition handles.

Author
M.Frank
Version
1.0

Definition at line 46 of file ConditionsManager.h.

Member Typedef Documentation

◆ IOVTypes

Definition at line 51 of file ConditionsManager.h.

◆ Object

Standard object type.

Definition at line 50 of file ConditionsManager.h.

Constructor & Destructor Documentation

◆ ConditionsManager() [1/6]

ConditionsManager::ConditionsManager ( Detector description)

Initializing constructor - used only by examples.

Default constructor.

Definition at line 163 of file ConditionsManager.cpp.

◆ ConditionsManager() [2/6]

ConditionsManager::ConditionsManager ( Detector description,
const std::string &  factory 
)

Initializing constructor to create a manager from the factory name.

Initializing constructor to create a named manager.

Definition at line 153 of file ConditionsManager.cpp.

◆ ConditionsManager() [3/6]

dd4hep::cond::ConditionsManager::ConditionsManager ( )
default

Default constructor.

◆ ConditionsManager() [4/6]

dd4hep::cond::ConditionsManager::ConditionsManager ( Object p)
inline

Constructor to be used with valid pointer to object.

Definition at line 97 of file ConditionsManager.h.

◆ ConditionsManager() [5/6]

dd4hep::cond::ConditionsManager::ConditionsManager ( const ConditionsManager c)
default

Constructor to assing handle of the same type.

◆ ConditionsManager() [6/6]

template<typename Q >
dd4hep::cond::ConditionsManager::ConditionsManager ( const Handle< Q > &  e)
inline

Constructor to be used assigning from different type.

Definition at line 103 of file ConditionsManager.h.

◆ ~ConditionsManager()

dd4hep::cond::ConditionsManager::~ConditionsManager ( )
default

Default destructor.

Member Function Documentation

◆ adoptCleanup()

void ConditionsManager::adoptCleanup ( ConditionsCleanup cleaner) const

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

Note: This may be convenient under certain circumstances, however at the expense of more flexible approaches to perform the conditions data cleanup. Any previously registered instance shall be deleted.

Definition at line 263 of file ConditionsManager.cpp.

◆ blockRegister()

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

Register a whole block of conditions with identical IOV.

Definition at line 249 of file ConditionsManager.cpp.

◆ clean() [1/2]

void ConditionsManager::clean ( const ConditionsCleanup cleaner) const

Invoke cache cleanup with user defined policy.

Definition at line 273 of file ConditionsManager.cpp.

◆ clean() [2/2]

void ConditionsManager::clean ( const IOVType typ,
int  max_age 
) const

Clean conditions, which are above the age limit.

Definition at line 268 of file ConditionsManager.cpp.

◆ clear()

void ConditionsManager::clear ( ) const

Full cleanup of all managed conditions.

Definition at line 278 of file ConditionsManager.cpp.

◆ compute()

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

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

Definition at line 301 of file ConditionsManager.cpp.

◆ createUserPool()

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

Create empty user pool object.

Definition at line 283 of file ConditionsManager.cpp.

◆ detectorDescription()

dd4hep::Detector & ConditionsManager::detectorDescription ( ) const

Access the detector description.

Definition at line 173 of file ConditionsManager.cpp.

◆ from() [1/2]

template<>
ConditionsManager dd4hep::cond::ConditionsManager::from ( Detector host)
static

Access specialization.

Definition at line 37 of file ConditionsManager.cpp.

◆ from() [2/2]

template<typename T >
static ConditionsManager dd4hep::cond::ConditionsManager::from ( T &  host)
static

Static accessor if installed as an extension.

Note:

There may very well be several instances of a conditions manager. Do not think this is a sort of 'static constructor'. This would be a big mistake!.

◆ fromString()

void ConditionsManager::fromString ( const std::string &  iov_str,
IOV iov 
) const

Create IOV from string.

Definition at line 244 of file ConditionsManager.cpp.

◆ initialize()

ConditionsManager & ConditionsManager::initialize ( )

Initialize the object after having set the properties.

Definition at line 167 of file ConditionsManager.cpp.

◆ iovPool()

ConditionsIOVPool * ConditionsManager::iovPool ( const IOVType type) const

Access conditions multi IOV pool by iov type.

Definition at line 204 of file ConditionsManager.cpp.

◆ iovType()

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

Access IOV by its name.

Definition at line 199 of file ConditionsManager.cpp.

◆ iovTypesUsed()

const std::vector< const dd4hep::IOVType * > ConditionsManager::iovTypesUsed ( ) const

Access the used/registered IOV types.

Definition at line 209 of file ConditionsManager.cpp.

◆ load()

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

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

Definition at line 295 of file ConditionsManager.cpp.

◆ loader()

ConditionsDataLoader & ConditionsManager::loader ( ) const

Access the conditions loader.

Definition at line 188 of file ConditionsManager.cpp.

◆ operator=()

ConditionsManager& dd4hep::cond::ConditionsManager::operator= ( const ConditionsManager c)
default

Assignment operator.

◆ operator[]()

dd4hep::Property & ConditionsManager::operator[] ( const std::string &  property_name) const

Access to properties.

Definition at line 183 of file ConditionsManager.cpp.

◆ prepare()

ConditionsManager::Result ConditionsManager::prepare ( const IOV required_validity,
ConditionsSlice slice,
ConditionUpdateUserContext ctxt = 0 
) const

Prepare all updates to the clients with the defined IOV.

Definition at line 289 of file ConditionsManager.cpp.

◆ properties()

dd4hep::PropertyManager & ConditionsManager::properties ( ) const

Access to the property manager.

Definition at line 178 of file ConditionsManager.cpp.

◆ pushUpdates()

void ConditionsManager::pushUpdates ( ) const

Push all pending updates to the conditions store.

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

Definition at line 259 of file ConditionsManager.cpp.

◆ registerIOV() [1/3]

ConditionsPool * ConditionsManager::registerIOV ( const IOV iov) const

Register IOV with type and key.

Definition at line 231 of file ConditionsManager.cpp.

◆ registerIOV() [2/3]

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

Register IOV with type and key.

Definition at line 239 of file ConditionsManager.cpp.

◆ registerIOV() [3/3]

ConditionsPool * ConditionsManager::registerIOV ( const std::string &  iov_rep) const

Register IOV with type and key.

Definition at line 220 of file ConditionsManager.cpp.

◆ registerIOVType()

std::pair< bool, const dd4hep::IOVType * > ConditionsManager::registerIOVType ( size_t  iov_type,
const std::string &  iov_name 
) const

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.

Definition at line 194 of file ConditionsManager.cpp.

◆ registerUnlocked()

bool ConditionsManager::registerUnlocked ( ConditionsPool pool,
Condition  cond 
) const

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

Definition at line 254 of file ConditionsManager.cpp.


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