DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Helper to save conditions pools to ROOT. More...
#include <ConditionsTreePersistency.h>
Public Types | |
enum | ImportStrategy { IMPORT_ALL = 1<<0, IMPORT_EXACT = 1<<1, IMPORT_CONTAINED = 1<<2, IMPORT_CONTAINED_LOWER = 1<<3, IMPORT_CONTAINED_UPPER = 1<<4, IMPORT_EDGE_LOWER = 1<<5, IMPORT_EDGE_UPPER = 1<<6, LAST } |
typedef std::vector< Condition > | pool_type |
typedef std::pair< std::string, pool_type > | named_pool_type |
typedef std::pair< std::string, std::pair< std::pair< std::string, int >, IOV::Key > > | iov_key_type |
typedef std::list< std::pair< iov_key_type, pool_type > > | persistent_type |
Public Member Functions | |
size_t | _import (ImportStrategy strategy, persistent_type &pers, const std::string &id, const std::string &iov_type, const IOV::Key &iov_key, ConditionsManager mgr) |
Load ConditionsIOVPool and populate conditions manager. More... | |
void | _clear (persistent_type &pool) |
Clear object content and release allocated memory. More... | |
ConditionsTreePersistency (const ConditionsTreePersistency ©)=delete | |
No copy constructor. More... | |
ConditionsTreePersistency (const std::string &name, const std::string &title="DD4hep conditions container") | |
Initializing constructor. More... | |
ConditionsTreePersistency () | |
Default constructor. More... | |
virtual | ~ConditionsTreePersistency () |
Default destructor. More... | |
ConditionsTreePersistency & | operator= (const ConditionsTreePersistency ©)=delete |
No assignment. More... | |
void | clear () |
Clear object content and release allocated memory. More... | |
size_t | add (const std::string &tag, const IOV &iov, std::vector< Condition > &conditions) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved! More... | |
size_t | add (const std::string &tag, ConditionsPool &pool) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved! More... | |
size_t | add (const std::string &tag, const ConditionsIOVPool &pool) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved! More... | |
size_t | importIOVPool (const std::string &id, const std::string &iov_type, ConditionsManager mgr) |
Load conditions IOV pool and populate conditions manager. More... | |
size_t | importConditionsPool (const std::string &id, const std::string &iov_type, ConditionsManager mgr) |
Load conditions pool and populate conditions manager. More... | |
size_t | importConditionsPool (ImportStrategy strategy, const std::string &id, const std::string &iov_type, const IOV::Key &key, ConditionsManager mgr) |
Load conditions pool and populate conditions manager. Allow tro be selective also for the key. More... | |
int | save (TFile *file) |
Save the data content to a root file. More... | |
int | save (const std::string &file_name) |
Save the data content to a root file. More... | |
ClassDef (ConditionsTreePersistency, 1) | |
ROOT object ClassDef. More... | |
Static Public Member Functions | |
static TFile * | openFile (const std::string &fname) |
Open ROOT file in read mode. More... | |
static std::unique_ptr< ConditionsTreePersistency > | load (TFile *file, const std::string &object) |
Load conditions content from file. More... | |
static std::unique_ptr< ConditionsTreePersistency > | load (const std::string &file, const std::string &object) |
Load conditions content from file. More... | |
Public Attributes | |
persistent_type | conditionPools {} |
persistent_type | iovPools {} |
float | duration {0} |
Helper to save conditions pools to ROOT.
This is a rathr simplistic persistency mechanism for conditions. It is not suited to actually store and retrieve individual conditions by key. Though it is rather efficient to store and retrive entire conditions snapshots of the conditions store implemented by DDCond. It e.g. allows to fast load the conditions store for HLT applications, of which we know it takes ages to populate it from a database.
Definition at line 127 of file ConditionsTreePersistency.h.
typedef std::pair<std::string,std::pair<std::pair<std::string,int>,IOV::Key> > dd4hep::cond::ConditionsTreePersistency::iov_key_type |
Definition at line 131 of file ConditionsTreePersistency.h.
typedef std::pair<std::string, pool_type> dd4hep::cond::ConditionsTreePersistency::named_pool_type |
Definition at line 130 of file ConditionsTreePersistency.h.
typedef std::list<std::pair<iov_key_type, pool_type> > dd4hep::cond::ConditionsTreePersistency::persistent_type |
Definition at line 132 of file ConditionsTreePersistency.h.
typedef std::vector<Condition> dd4hep::cond::ConditionsTreePersistency::pool_type |
Definition at line 129 of file ConditionsTreePersistency.h.
Enumerator | |
---|---|
IMPORT_ALL | |
IMPORT_EXACT | |
IMPORT_CONTAINED | |
IMPORT_CONTAINED_LOWER | |
IMPORT_CONTAINED_UPPER | |
IMPORT_EDGE_LOWER | |
IMPORT_EDGE_UPPER | |
LAST |
Definition at line 137 of file ConditionsTreePersistency.h.
|
delete |
No copy constructor.
dd4hep::cond::ConditionsTreePersistency::ConditionsTreePersistency | ( | const std::string & | name, |
const std::string & | title = "DD4hep conditions container" |
||
) |
Initializing constructor.
ConditionsTreePersistency::ConditionsTreePersistency | ( | ) |
Default constructor.
Definition at line 61 of file ConditionsTreePersistency.cpp.
|
virtual |
Default destructor.
Definition at line 71 of file ConditionsTreePersistency.cpp.
void ConditionsTreePersistency::_clear | ( | persistent_type & | pool | ) |
Clear object content and release allocated memory.
Cleanup all the stuff not useful....
Definition at line 136 of file ConditionsTreePersistency.cpp.
std::size_t ConditionsTreePersistency::_import | ( | ImportStrategy | strategy, |
persistent_type & | pers, | ||
const std::string & | id, | ||
const std::string & | iov_type, | ||
const IOV::Key & | iov_key, | ||
ConditionsManager | mgr | ||
) |
Load ConditionsIOVPool and populate conditions manager.
Load ConditionsPool(s) and populate conditions manager.
Definition at line 175 of file ConditionsTreePersistency.cpp.
size_t dd4hep::cond::ConditionsTreePersistency::add | ( | const std::string & | tag, |
ConditionsPool & | pool | ||
) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved!
size_t dd4hep::cond::ConditionsTreePersistency::add | ( | const std::string & | tag, |
const ConditionsIOVPool & | pool | ||
) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved!
size_t dd4hep::cond::ConditionsTreePersistency::add | ( | const std::string & | tag, |
const IOV & | iov, | ||
std::vector< Condition > & | conditions | ||
) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved!
dd4hep::cond::ConditionsTreePersistency::ClassDef | ( | ConditionsTreePersistency | , |
1 | |||
) |
ROOT object ClassDef.
void ConditionsTreePersistency::clear | ( | ) |
Clear object content and release allocated memory.
Cleanup all the stuff not useful....
Definition at line 147 of file ConditionsTreePersistency.cpp.
size_t dd4hep::cond::ConditionsTreePersistency::importConditionsPool | ( | const std::string & | id, |
const std::string & | iov_type, | ||
ConditionsManager | mgr | ||
) |
Load conditions pool and populate conditions manager.
size_t dd4hep::cond::ConditionsTreePersistency::importConditionsPool | ( | ImportStrategy | strategy, |
const std::string & | id, | ||
const std::string & | iov_type, | ||
const IOV::Key & | key, | ||
ConditionsManager | mgr | ||
) |
Load conditions pool and populate conditions manager. Allow tro be selective also for the key.
std::size_t ConditionsTreePersistency::importIOVPool | ( | const std::string & | id, |
const std::string & | iov_type, | ||
ConditionsManager | mgr | ||
) |
Load conditions IOV pool and populate conditions manager.
Load ConditionsIOVPool and populate conditions manager.
Definition at line 245 of file ConditionsTreePersistency.cpp.
|
inlinestatic |
Load conditions content from file.
Definition at line 187 of file ConditionsTreePersistency.h.
|
static |
Load conditions content from file.
|
static |
Open ROOT file in read mode.
Definition at line 127 of file ConditionsTreePersistency.cpp.
|
delete |
No assignment.
int dd4hep::cond::ConditionsTreePersistency::save | ( | const std::string & | file_name | ) |
Save the data content to a root file.
int ConditionsTreePersistency::save | ( | TFile * | file | ) |
Save the data content to a root file.
Definition at line 272 of file ConditionsTreePersistency.cpp.
persistent_type dd4hep::cond::ConditionsTreePersistency::conditionPools {} |
Definition at line 134 of file ConditionsTreePersistency.h.
float dd4hep::cond::ConditionsTreePersistency::duration {0} |
Definition at line 136 of file ConditionsTreePersistency.h.
persistent_type dd4hep::cond::ConditionsTreePersistency::iovPools {} |
Definition at line 135 of file ConditionsTreePersistency.h.