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

Main condition object handle. More...

#include <Conditions.h>

Inheritance diagram for dd4hep::Condition:
dd4hep::Handle< detail::ConditionObject >

Classes

class  Processor
 Abstract base for processing callbacks to conditions objects. More...
 

Public Types

enum  StringFlags {
  WITH_IOV = 1<<0, WITH_ADDRESS = 1<<1, WITH_TYPE = 1<<2, WITH_COMMENT = 1<<4,
  WITH_DATATYPE = 1<<5, WITH_DATA = 1<<6, NO_NAME = 1<<20, NONE
}
 Flags to steer the conditions conversion to string. More...
 
enum  ConditionState {
  INACTIVE = 0, ACTIVE = 1<<0, CHECKED = 1<<2, DERIVED = 1<<3,
  ONSTACK = 1<<4, TEMPERATURE = 1<<5, TEMPERATURE_DERIVED = 1<<6|DERIVED, PRESSURE = 1<<7,
  PRESSURE_DERIVED = 1<<8|DERIVED, ALIGNMENT_DELTA = 1<<9, ALIGNMENT_DERIVED = 1<<10|DERIVED, USER_FLAGS_FIRST = 1<<16,
  USER_FLAGS_LAST = 1<<31
}
 Flags to indicate the conditions type ans state. More...
 
enum  ConditionItemRangeKeys { FIRST_ITEM_KEY = 0x0U, LAST_ITEM_KEY = ~0x0U }
 Flags to indicate conditions item ranges (low word of the conditions key) More...
 
enum  ConditionDetectorRangeKeys { FIRST_DET_KEY = 0x0U, LAST_DET_KEY = ~0x0U }
 Flags to indicate conditions detector ranges (high word of the conditions key) More...
 
typedef unsigned long long int key_type
 Forward definition of the key type. More...
 
typedef unsigned int detkey_type
 High part of the key identifies the detector element. More...
 
typedef unsigned int itemkey_type
 Low part of the key identifies the item identifier. More...
 
typedef unsigned int mask_type
 Forward definition of the object properties. More...
 
- Public Types inherited from dd4hep::Handle< detail::ConditionObject >
typedef detail::ConditionObject Object
 Extern accessible definition of the contained element type. More...
 
typedef Handle< detail::ConditionObjectBase
 Self type: used by sub-classes. More...
 

Public Member Functions

 Condition ()=default
 Default constructor. More...
 
 Condition (Condition &&c)=default
 Move constructor. More...
 
 Condition (const Condition &c)=default
 Copy constructor. More...
 
 Condition (Object *p)
 Initializing constructor. More...
 
template<typename Q >
 Condition (const Handle< Q > &e)
 Constructor to be used when reading the already parsed object. More...
 
 Condition (key_type hash_key)
 Initializing constructor for a pure, undecorated conditions object. More...
 
 Condition (const std::string &name, const std::string &type)
 Initializing constructor for a pure, undecorated conditions object. More...
 
 Condition (const std::string &name, const std::string &type, size_t memory)
 Initializing constructor for a pure, undecorated conditions object with payload buffer. More...
 
Conditionoperator= (Condition &&c)=default
 Assignment move operator. More...
 
Conditionoperator= (const Condition &c)=default
 Assignment copy operator. More...
 
std::string str (int with_data=WITH_IOV|WITH_ADDRESS|WITH_DATATYPE) const
 Output method. More...
 
int dataType () const
 Access the data type. More...
 
const IOVTypeiovType () const
 Access the IOV type. More...
 
const IOViov () const
 Access the IOV block. More...
 
key_type key () const
 Hash identifier. More...
 
detkey_type detector_key () const
 DetElement part of the identifier. More...
 
itemkey_type item_key () const
 Item part of the identifier. More...
 
const std::string & type () const
 Access the type field of the condition. More...
 
const std::string & value () const
 Access the value field of the condition as a string. More...
 
const std::string & comment () const
 Access the comment field of the condition. More...
 
const std::string & address () const
 Access the address string [e.g. database identifier]. More...
 
mask_type flags () const
 Flag operations: Get condition flags. More...
 
void setFlag (mask_type option)
 Flag operations: Set a conditons flag. More...
 
void unFlag (mask_type option)
 Flag operations: UN-Set a conditons flag. More...
 
bool testFlag (mask_type option) const
 Flag operations: Test for a given a conditons flag. More...
 
OpaqueDataBlockdata () const
 Access the opaque data block. More...
 
const std::type_info & typeInfo () const
 Access to the type information. More...
 
const BasicGrammardescriptor () const
 Access to the grammar type. More...
 
bool is_bound () const
 Check if object is already bound.... More...
 
template<typename T , typename... Args>
T & construct (Args... args)
 Construct conditions object and bind the data. More...
 
template<typename T >
T & bind ()
 Bind the data of the conditions object to a given format. More...
 
template<typename T >
T & bind (const std::string &val)
 Bind the data of the conditions object to a given format and fill data from string representation. More...
 
template<typename T >
T & get ()
 Generic getter. Specify the exact type, not a polymorph type. More...
 
template<typename T >
const T & get () const
 Generic getter (const version). Specify the exact type, not a polymorph type. More...
 
template<typename T >
T & as ()
 Generic getter. Resolves polymorph types. It is mandatory that the datatype is polymorph! More...
 
template<typename T >
const T & as () const
 Generic getter (const version). Resolves polymorph types. It is mandatory that the datatype is polymorph! More...
 
- Public Member Functions inherited from dd4hep::Handle< detail::ConditionObject >
 Handle ()=default
 Default constructor. More...
 
 Handle (Handle< detail::ConditionObject > &&element)=default
 Copy constructor. More...
 
 Handle (const Handle< detail::ConditionObject > &element)=default
 Copy constructor. More...
 
 Handle (detail::ConditionObject *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< detail::ConditionObject > & operator= (Handle< detail::ConditionObject > &&element)=default
 Assignment move operator. More...
 
Handle< detail::ConditionObject > & operator= (const Handle< detail::ConditionObject > &element)=default
 Assignment copy operator. More...
 
bool operator== (const Handle< detail::ConditionObject > &element) const
 Boolean operator == used for RB tree insertions. More...
 
bool operator< (const Handle< detail::ConditionObject > &element) const
 Boolean operator < used for RB tree insertions. More...
 
bool operator> (const Handle< detail::ConditionObject > &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< detail::ConditionObject > & clear ()
 Release the object held by the handle. More...
 
detail::ConditionObjectoperator-> () const
 Access the held object using the -> operator. More...
 
 operator detail::ConditionObject & () const
 Automatic type conversion to an object references. More...
 
detail::ConditionObjectoperator* () const
 Access the held object using the * operator. More...
 
detail::ConditionObjectptr () 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...
 
detail::ConditionObjectaccess () 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

static int haveInventory (int value=-1)
 Allow to trace condition names from keys for debugging. More...
 
- Static Public Member Functions inherited from dd4hep::Handle< detail::ConditionObject >
static void bad_assignment (const std::type_info &from, const std::type_info &to)
 Helper routine called when unrelated types are assigned. More...
 

Static Public Attributes

static constexpr unsigned long long int FIRST_KEY = 0x0ULL
 Flags to indicate global conditions ranges. More...
 
static constexpr unsigned long long int LAST_KEY = ~0x0ULL
 

Additional Inherited Members

- Public Attributes inherited from dd4hep::Handle< detail::ConditionObject >
detail::ConditionObjectm_element
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

Main condition object handle.

This objects allows access to the data block and the interval of validity for a single condition.

Note: Conditions may be shared between several DetElement objects. Hence, the back-link to the DetElement structure cannot be set - it would be ambiguous.

Author
M.Frank
Version
1.0

Definition at line 51 of file Conditions.h.

Member Typedef Documentation

◆ detkey_type

typedef unsigned int dd4hep::Condition::detkey_type

High part of the key identifies the detector element.

Definition at line 56 of file Conditions.h.

◆ itemkey_type

typedef unsigned int dd4hep::Condition::itemkey_type

Low part of the key identifies the item identifier.

Definition at line 58 of file Conditions.h.

◆ key_type

typedef unsigned long long int dd4hep::Condition::key_type

Forward definition of the key type.

Definition at line 54 of file Conditions.h.

◆ mask_type

typedef unsigned int dd4hep::Condition::mask_type

Forward definition of the object properties.

Definition at line 60 of file Conditions.h.

Member Enumeration Documentation

◆ ConditionDetectorRangeKeys

Flags to indicate conditions detector ranges (high word of the conditions key)

Enumerator
FIRST_DET_KEY 
LAST_DET_KEY 

Definition at line 99 of file Conditions.h.

◆ ConditionItemRangeKeys

Flags to indicate conditions item ranges (low word of the conditions key)

Enumerator
FIRST_ITEM_KEY 
LAST_ITEM_KEY 

Definition at line 94 of file Conditions.h.

◆ ConditionState

Flags to indicate the conditions type ans state.

Enumerator
INACTIVE 
ACTIVE 
CHECKED 
DERIVED 
ONSTACK 
TEMPERATURE 
TEMPERATURE_DERIVED 
PRESSURE 
PRESSURE_DERIVED 
ALIGNMENT_DELTA 
ALIGNMENT_DERIVED 
USER_FLAGS_FIRST 
USER_FLAGS_LAST 

Definition at line 75 of file Conditions.h.

◆ StringFlags

Flags to steer the conditions conversion to string.

Enumerator
WITH_IOV 
WITH_ADDRESS 
WITH_TYPE 
WITH_COMMENT 
WITH_DATATYPE 
WITH_DATA 
NO_NAME 
NONE 

Definition at line 64 of file Conditions.h.

Constructor & Destructor Documentation

◆ Condition() [1/8]

dd4hep::Condition::Condition ( )
default

Default constructor.

◆ Condition() [2/8]

dd4hep::Condition::Condition ( Condition &&  c)
default

Move constructor.

◆ Condition() [3/8]

dd4hep::Condition::Condition ( const Condition c)
default

Copy constructor.

◆ Condition() [4/8]

dd4hep::Condition::Condition ( Object p)

Initializing constructor.

◆ Condition() [5/8]

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

Constructor to be used when reading the already parsed object.

Definition at line 242 of file Conditions.h.

◆ Condition() [6/8]

Condition::Condition ( key_type  hash_key)

Initializing constructor for a pure, undecorated conditions object.

Definition at line 65 of file Conditions.cpp.

◆ Condition() [7/8]

Condition::Condition ( const std::string &  name,
const std::string &  type 
)

Initializing constructor for a pure, undecorated conditions object.

Definition at line 77 of file Conditions.cpp.

◆ Condition() [8/8]

Condition::Condition ( const std::string &  name,
const std::string &  type,
size_t  memory 
)

Initializing constructor for a pure, undecorated conditions object with payload buffer.

Definition at line 85 of file Conditions.cpp.

Member Function Documentation

◆ address()

const std::string & Condition::address ( ) const

Access the address string [e.g. database identifier].

Definition at line 160 of file Conditions.cpp.

◆ as() [1/2]

template<typename T >
T & dd4hep::Condition::as
inline

Generic getter. Resolves polymorph types. It is mandatory that the datatype is polymorph!

Generic getter. Specify the exact type, not a polymorph type.

Definition at line 266 of file Conditions.h.

◆ as() [2/2]

template<typename T >
const T & dd4hep::Condition::as
inline

Generic getter (const version). Resolves polymorph types. It is mandatory that the datatype is polymorph!

Generic getter (const version). Specify the exact type, not a polymorph type.

Definition at line 270 of file Conditions.h.

◆ bind() [1/2]

template<typename T >
T & dd4hep::Condition::bind
inline

Bind the data of the conditions object to a given format.

Bind the data of the conditions object to a given format.

Note: The type definition is possible exactly once. Any further rebindings MUST match the identical type.

Definition at line 250 of file Conditions.h.

◆ bind() [2/2]

template<typename T >
T & dd4hep::Condition::bind ( const std::string &  val)
inline

Bind the data of the conditions object to a given format and fill data from string representation.

Set and bind the data of the conditions object to a given format.

Note: The type definition is possible exactly once. Any further rebindings MUST match the identical type.

Definition at line 254 of file Conditions.h.

◆ comment()

const std::string & Condition::comment ( ) const

Access the comment field of the condition.

Definition at line 155 of file Conditions.cpp.

◆ construct()

template<typename T , typename... Args>
T & dd4hep::Condition::construct ( Args...  args)

Construct conditions object and bind the data.

Construct conditions object and bind the data

Note: The type definition is possible exactly once. Any further rebindings MUST match the identical type.

Definition at line 246 of file Conditions.h.

◆ data()

dd4hep::OpaqueDataBlock & Condition::data ( ) const

Access the opaque data block.

Access the IOV block.

Conditions meta-data and handling of the data binding

Definition at line 129 of file Conditions.cpp.

◆ dataType()

int Condition::dataType ( ) const

Access the data type.

Data block (bound type)

Definition at line 124 of file Conditions.cpp.

◆ descriptor()

const dd4hep::BasicGrammar & Condition::descriptor ( ) const

Access to the grammar type.

Definition at line 206 of file Conditions.cpp.

◆ detector_key()

Condition::detkey_type Condition::detector_key ( ) const

DetElement part of the identifier.

Definition at line 176 of file Conditions.cpp.

◆ flags()

Condition::mask_type Condition::flags ( ) const

Flag operations: Get condition flags.

Flag operations: Get flags.

Definition at line 186 of file Conditions.cpp.

◆ get() [1/2]

template<typename T >
T & dd4hep::Condition::get
inline

Generic getter. Specify the exact type, not a polymorph type.

Definition at line 258 of file Conditions.h.

◆ get() [2/2]

template<typename T >
const T & dd4hep::Condition::get
inline

Generic getter (const version). Specify the exact type, not a polymorph type.

Definition at line 262 of file Conditions.h.

◆ haveInventory()

static int dd4hep::Condition::haveInventory ( int  value = -1)
static

Allow to trace condition names from keys for debugging.

◆ iov()

const dd4hep::IOV & Condition::iov ( ) const

Access the IOV block.

Definition at line 139 of file Conditions.cpp.

◆ iovType()

const dd4hep::IOVType & Condition::iovType ( ) const

Access the IOV type.

Interval of validity

Definition at line 134 of file Conditions.cpp.

◆ is_bound()

bool dd4hep::Condition::is_bound ( ) const
inline

Check if object is already bound....

Definition at line 205 of file Conditions.h.

◆ item_key()

Condition::itemkey_type Condition::item_key ( ) const

Item part of the identifier.

Definition at line 181 of file Conditions.cpp.

◆ key()

Condition::key_type Condition::key ( ) const

Hash identifier.

Conditions identification using integer keys.

Definition at line 171 of file Conditions.cpp.

◆ operator=() [1/2]

Condition& dd4hep::Condition::operator= ( Condition &&  c)
default

Assignment move operator.

◆ operator=() [2/2]

Condition& dd4hep::Condition::operator= ( const Condition c)
default

Assignment copy operator.

◆ setFlag()

void Condition::setFlag ( mask_type  option)

Flag operations: Set a conditons flag.

Definition at line 191 of file Conditions.cpp.

◆ str()

std::string Condition::str ( int  with_data = WITH_IOV|WITH_ADDRESS|WITH_DATATYPE) const

Output method.

Definition at line 95 of file Conditions.cpp.

◆ testFlag()

bool Condition::testFlag ( mask_type  option) const

Flag operations: Test for a given a conditons flag.

Definition at line 201 of file Conditions.cpp.

◆ type()

const std::string & Condition::type ( ) const

Access the type field of the condition.

Direct data items in string form

Definition at line 145 of file Conditions.cpp.

◆ typeInfo()

const std::type_info & Condition::typeInfo ( ) const

Access to the type information.

Definition at line 166 of file Conditions.cpp.

◆ unFlag()

void Condition::unFlag ( mask_type  option)

Flag operations: UN-Set a conditons flag.

Definition at line 196 of file Conditions.cpp.

◆ value()

const std::string & Condition::value ( ) const

Access the value field of the condition as a string.

Definition at line 150 of file Conditions.cpp.

Member Data Documentation

◆ FIRST_KEY

constexpr unsigned long long int dd4hep::Condition::FIRST_KEY = 0x0ULL
staticconstexpr

Flags to indicate global conditions ranges.

Definition at line 104 of file Conditions.h.

◆ LAST_KEY

constexpr unsigned long long int dd4hep::Condition::LAST_KEY = ~0x0ULL
static

Definition at line 104 of file Conditions.h.


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