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::ConditionsRootPersistency Class Reference

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

#include <ConditionsRootPersistency.h>

Inheritance diagram for dd4hep::cond::ConditionsRootPersistency:
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...
 
 ConditionsRootPersistency (const ConditionsRootPersistency &copy)=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...
 
ConditionsRootPersistencyoperator= (const ConditionsRootPersistency &copy)=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< ConditionsRootPersistencyload (TFile *file, const std::string &object)
 Load conditions content from file. More...
 
static std::unique_ptr< ConditionsRootPersistencyload (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
 

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 51 of file ConditionsRootPersistency.h.

Member Typedef Documentation

◆ iov_key_type

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.

◆ named_pool_type

Definition at line 54 of file ConditionsRootPersistency.h.

◆ persistent_type

Definition at line 56 of file ConditionsRootPersistency.h.

◆ pool_type

Definition at line 53 of file ConditionsRootPersistency.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 62 of file ConditionsRootPersistency.h.

Constructor & Destructor Documentation

◆ ConditionsRootPersistency() [1/3]

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

No copy constructor.

◆ ConditionsRootPersistency() [2/3]

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

Initializing constructor.

◆ ConditionsRootPersistency() [3/3]

ConditionsRootPersistency::ConditionsRootPersistency ( )

Default constructor.

Definition at line 62 of file ConditionsRootPersistency.cpp.

◆ ~ConditionsRootPersistency()

ConditionsRootPersistency::~ConditionsRootPersistency ( )
virtual

Default destructor.

Definition at line 72 of file ConditionsRootPersistency.cpp.

Member Function Documentation

◆ _clear()

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.

◆ _import()

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.

◆ add() [1/4]

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.

◆ add() [2/4]

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.

◆ add() [3/4]

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.

◆ add() [4/4]

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.

◆ ClassDef()

dd4hep::cond::ConditionsRootPersistency::ClassDef ( ConditionsRootPersistency  ,
 
)

ROOT object ClassDef.

◆ clear()

void ConditionsRootPersistency::clear ( )

Clear object content and release allocated memory.

Cleanup all the stuff not useful....

Definition at line 163 of file ConditionsRootPersistency.cpp.

◆ importConditionsPool() [1/2]

size_t dd4hep::cond::ConditionsRootPersistency::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::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.

◆ importIOVPool()

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.

◆ importUserPool()

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.

◆ load() [1/2]

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

Load conditions content from file.

Definition at line 113 of file ConditionsRootPersistency.h.

◆ load() [2/2]

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

Load conditions content from file.

◆ openFile()

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

Open ROOT file in read mode.

Definition at line 143 of file ConditionsRootPersistency.cpp.

◆ operator=()

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

No assignment.

◆ save() [1/2]

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

Save the data content to a root file.

◆ save() [2/2]

int ConditionsRootPersistency::save ( TFile *  file)

Save the data content to a root file.

Definition at line 297 of file ConditionsRootPersistency.cpp.

Member Data Documentation

◆ conditionPools

persistent_type dd4hep::cond::ConditionsRootPersistency::conditionPools {}

Definition at line 58 of file ConditionsRootPersistency.h.

◆ duration

float dd4hep::cond::ConditionsRootPersistency::duration = 0

Definition at line 61 of file ConditionsRootPersistency.h.

◆ iovPools

persistent_type dd4hep::cond::ConditionsRootPersistency::iovPools {}

Definition at line 60 of file ConditionsRootPersistency.h.

◆ userPools

persistent_type dd4hep::cond::ConditionsRootPersistency::userPools {}

Definition at line 59 of file ConditionsRootPersistency.h.


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