DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Helper to save conditions pools to ROOT. More...
#include <ConditionsRootPersistency.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... | |
ConditionsRootPersistency (const ConditionsRootPersistency ©)=delete | |
No copy constructor. More... | |
ConditionsRootPersistency (const std::string &name, const std::string &title="DD4hep conditions container") | |
Initializing constructor. More... | |
ConditionsRootPersistency () | |
Default constructor. More... | |
virtual | ~ConditionsRootPersistency () |
Default destructor. More... | |
ConditionsRootPersistency & | operator= (const ConditionsRootPersistency ©)=delete |
No assignment. More... | |
void | clear () |
Clear object content and release allocated memory. More... | |
size_t | add (const std::string &identifier, 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 &identifier, ConditionsPool &pool) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved! More... | |
size_t | add (const std::string &identifier, const UserPool &pool) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved! More... | |
size_t | add (const std::string &identifier, 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 | importUserPool (const std::string &id, const std::string &iov_type, ConditionsManager mgr) |
Load conditions user 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 (ConditionsRootPersistency, 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< ConditionsRootPersistency > | load (TFile *file, const std::string &object) |
Load conditions content from file. More... | |
static std::unique_ptr< ConditionsRootPersistency > | load (const std::string &file, const std::string &object) |
Load conditions content from file. More... | |
Public Attributes | |
persistent_type | conditionPools {} |
persistent_type | userPools {} |
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 51 of file ConditionsRootPersistency.h.
typedef std::pair<std::string,std::pair<std::pair<std::string,int>,IOV::Key> > dd4hep::cond::ConditionsRootPersistency::iov_key_type |
Definition at line 55 of file ConditionsRootPersistency.h.
typedef std::pair<std::string, pool_type> dd4hep::cond::ConditionsRootPersistency::named_pool_type |
Definition at line 54 of file ConditionsRootPersistency.h.
typedef std::list<std::pair<iov_key_type, pool_type> > dd4hep::cond::ConditionsRootPersistency::persistent_type |
Definition at line 56 of file ConditionsRootPersistency.h.
typedef std::vector<Condition> dd4hep::cond::ConditionsRootPersistency::pool_type |
Definition at line 53 of file ConditionsRootPersistency.h.
Enumerator | |
---|---|
IMPORT_ALL | |
IMPORT_EXACT | |
IMPORT_CONTAINED | |
IMPORT_CONTAINED_LOWER | |
IMPORT_CONTAINED_UPPER | |
IMPORT_EDGE_LOWER | |
IMPORT_EDGE_UPPER | |
LAST |
Definition at line 62 of file ConditionsRootPersistency.h.
|
delete |
No copy constructor.
dd4hep::cond::ConditionsRootPersistency::ConditionsRootPersistency | ( | const std::string & | name, |
const std::string & | title = "DD4hep conditions container" |
||
) |
Initializing constructor.
ConditionsRootPersistency::ConditionsRootPersistency | ( | ) |
Default constructor.
Definition at line 62 of file ConditionsRootPersistency.cpp.
|
virtual |
Default destructor.
Definition at line 72 of file ConditionsRootPersistency.cpp.
void ConditionsRootPersistency::_clear | ( | persistent_type & | pool | ) |
Clear object content and release allocated memory.
Cleanup all the stuff not useful....
Definition at line 152 of file ConditionsRootPersistency.cpp.
size_t ConditionsRootPersistency::_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 192 of file ConditionsRootPersistency.cpp.
size_t ConditionsRootPersistency::add | ( | const std::string & | identifier, |
ConditionsPool & | pool | ||
) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved!
Add conditions content to the saved. Note, that dependent conditions shall not be saved!
Definition at line 94 of file ConditionsRootPersistency.cpp.
size_t ConditionsRootPersistency::add | ( | const std::string & | identifier, |
const ConditionsIOVPool & | pool | ||
) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved!
Add conditions content to the saved. Note, that dependent conditions shall not be saved!
Definition at line 109 of file ConditionsRootPersistency.cpp.
std::size_t ConditionsRootPersistency::add | ( | const std::string & | identifier, |
const IOV & | iov, | ||
std::vector< Condition > & | conditions | ||
) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved!
Definition at line 77 of file ConditionsRootPersistency.cpp.
size_t ConditionsRootPersistency::add | ( | const std::string & | identifier, |
const UserPool & | pool | ||
) |
Add conditions content to be saved. Note, that dependent conditions shall not be saved!
Add conditions content to the saved. Note, that dependent conditions shall not be saved!
Definition at line 128 of file ConditionsRootPersistency.cpp.
dd4hep::cond::ConditionsRootPersistency::ClassDef | ( | ConditionsRootPersistency | , |
1 | |||
) |
ROOT object ClassDef.
void ConditionsRootPersistency::clear | ( | ) |
Clear object content and release allocated memory.
Cleanup all the stuff not useful....
Definition at line 163 of file ConditionsRootPersistency.cpp.
size_t dd4hep::cond::ConditionsRootPersistency::importConditionsPool | ( | const std::string & | id, |
const std::string & | iov_type, | ||
ConditionsManager | mgr | ||
) |
Load conditions pool and populate conditions manager.
size_t dd4hep::cond::ConditionsRootPersistency::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.
size_t ConditionsRootPersistency::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 261 of file ConditionsRootPersistency.cpp.
size_t ConditionsRootPersistency::importUserPool | ( | const std::string & | id, |
const std::string & | iov_type, | ||
ConditionsManager | mgr | ||
) |
Load conditions user pool and populate conditions manager.
Load ConditionsIOVPool and populate conditions manager.
Definition at line 270 of file ConditionsRootPersistency.cpp.
|
inlinestatic |
Load conditions content from file.
Definition at line 113 of file ConditionsRootPersistency.h.
|
static |
Load conditions content from file.
|
static |
Open ROOT file in read mode.
Definition at line 143 of file ConditionsRootPersistency.cpp.
|
delete |
No assignment.
int dd4hep::cond::ConditionsRootPersistency::save | ( | const std::string & | file_name | ) |
Save the data content to a root file.
int ConditionsRootPersistency::save | ( | TFile * | file | ) |
Save the data content to a root file.
Definition at line 297 of file ConditionsRootPersistency.cpp.
persistent_type dd4hep::cond::ConditionsRootPersistency::conditionPools {} |
Definition at line 58 of file ConditionsRootPersistency.h.
float dd4hep::cond::ConditionsRootPersistency::duration = 0 |
Definition at line 61 of file ConditionsRootPersistency.h.
persistent_type dd4hep::cond::ConditionsRootPersistency::iovPools {} |
Definition at line 60 of file ConditionsRootPersistency.h.
persistent_type dd4hep::cond::ConditionsRootPersistency::userPools {} |
Definition at line 59 of file ConditionsRootPersistency.h.