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

Helper to save conditions pools to ROOT. More...

#include <ConditionsTreePersistency.h>

Inheritance diagram for dd4hep::cond::ConditionsTreePersistency:
TNamed

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< Conditionpool_type
 
typedef std::pair< std::string, pool_typenamed_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 &copy)=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...
 
ConditionsTreePersistencyoperator= (const ConditionsTreePersistency &copy)=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< ConditionsTreePersistencyload (TFile *file, const std::string &object)
 Load conditions content from file. More...
 
static std::unique_ptr< ConditionsTreePersistencyload (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}
 

Detailed Description

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.

Author
M.Frank
Version
1.0

Definition at line 127 of file ConditionsTreePersistency.h.

Member Typedef Documentation

◆ iov_key_type

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.

◆ named_pool_type

Definition at line 130 of file ConditionsTreePersistency.h.

◆ persistent_type

Definition at line 132 of file ConditionsTreePersistency.h.

◆ pool_type

Definition at line 129 of file ConditionsTreePersistency.h.

Member Enumeration Documentation

◆ ImportStrategy

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.

Constructor & Destructor Documentation

◆ ConditionsTreePersistency() [1/3]

dd4hep::cond::ConditionsTreePersistency::ConditionsTreePersistency ( const ConditionsTreePersistency copy)
delete

No copy constructor.

◆ ConditionsTreePersistency() [2/3]

dd4hep::cond::ConditionsTreePersistency::ConditionsTreePersistency ( const std::string &  name,
const std::string &  title = "DD4hep conditions container" 
)

Initializing constructor.

◆ ConditionsTreePersistency() [3/3]

ConditionsTreePersistency::ConditionsTreePersistency ( )

Default constructor.

Definition at line 61 of file ConditionsTreePersistency.cpp.

◆ ~ConditionsTreePersistency()

ConditionsTreePersistency::~ConditionsTreePersistency ( )
virtual

Default destructor.

Definition at line 71 of file ConditionsTreePersistency.cpp.

Member Function Documentation

◆ _clear()

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.

◆ _import()

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.

◆ add() [1/3]

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!

◆ add() [2/3]

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!

◆ add() [3/3]

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!

◆ ClassDef()

dd4hep::cond::ConditionsTreePersistency::ClassDef ( ConditionsTreePersistency  ,
 
)

ROOT object ClassDef.

◆ clear()

void ConditionsTreePersistency::clear ( )

Clear object content and release allocated memory.

Cleanup all the stuff not useful....

Definition at line 147 of file ConditionsTreePersistency.cpp.

◆ importConditionsPool() [1/2]

size_t dd4hep::cond::ConditionsTreePersistency::importConditionsPool ( const std::string &  id,
const std::string &  iov_type,
ConditionsManager  mgr 
)

Load conditions pool and populate conditions manager.

◆ importConditionsPool() [2/2]

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.

◆ importIOVPool()

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.

◆ load() [1/2]

static std::unique_ptr<ConditionsTreePersistency> dd4hep::cond::ConditionsTreePersistency::load ( const std::string &  file,
const std::string &  object 
)
inlinestatic

Load conditions content from file.

Definition at line 187 of file ConditionsTreePersistency.h.

◆ load() [2/2]

static std::unique_ptr<ConditionsTreePersistency> dd4hep::cond::ConditionsTreePersistency::load ( TFile *  file,
const std::string &  object 
)
static

Load conditions content from file.

◆ openFile()

TFile * ConditionsTreePersistency::openFile ( const std::string &  fname)
static

Open ROOT file in read mode.

Definition at line 127 of file ConditionsTreePersistency.cpp.

◆ operator=()

ConditionsTreePersistency& dd4hep::cond::ConditionsTreePersistency::operator= ( const ConditionsTreePersistency copy)
delete

No assignment.

◆ save() [1/2]

int dd4hep::cond::ConditionsTreePersistency::save ( const std::string &  file_name)

Save the data content to a root file.

◆ save() [2/2]

int ConditionsTreePersistency::save ( TFile *  file)

Save the data content to a root file.

Definition at line 272 of file ConditionsTreePersistency.cpp.

Member Data Documentation

◆ conditionPools

persistent_type dd4hep::cond::ConditionsTreePersistency::conditionPools {}

Definition at line 134 of file ConditionsTreePersistency.h.

◆ duration

float dd4hep::cond::ConditionsTreePersistency::duration {0}

Definition at line 136 of file ConditionsTreePersistency.h.

◆ iovPools

persistent_type dd4hep::cond::ConditionsTreePersistency::iovPools {}

Definition at line 135 of file ConditionsTreePersistency.h.


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