#include <DBInterface.hh>
Public Member Functions | |
DBInterface (const std::string &folder, bool update=false) | |
Default c'tor, uses lccd::getDBInitString() to determine the db initialization, i.e. | |
DBInterface (const std::string &dbInit, const std::string &folder, bool update=false) | |
Open the database specified in dbInit. | |
virtual | ~DBInterface () |
D'tor. | |
ICondDBMgr * | condDBMgr () |
The db manager object - use for direct access to the conditions database. | |
ICondDBDataAccess * | condDataAccess () |
The db access object - use for direct access to the conditions database.. | |
ICondDBFolderMgr * | condFolderMgr () |
The folder manager - use for direct access to the conditions database.. | |
ICondDBTagMgr * | condTagMgr () |
The tag manager - use for direct access to the conditions database. | |
const std::string & | folderName () |
The folder used for this DB access. | |
void | storeCollection (LCCDTimeStamp since, LCCDTimeStamp till, lcio::LCCollection *col, const std::string &description) |
Stores the given collection in the database. | |
lcio::LCCollection * | findCollection (LCCDTimeStamp timeStamp, LCCDTimeStamp &since, LCCDTimeStamp &till, const std::string &tag="") |
Retrieves the collection for the given point in time - returns NULL if no data is found. This expects the LCIO collection type to be decoded in the object description: "LCIO_COL_TYPE: some description" - storeCollection() does this automatically. Some parameters are added to the collection: . | |
lcio::LCCollection * | findCollection (LCCDTimeStamp timeStamp, const std::string &tag="") |
Retrieves the collection for the given point in time - returns NULL if it no data is found. Same as above, except that no information on the validity interval is returned. | |
void | findCollections (ColVec &colVec, const std::string &tag="") |
Creates collections for all conditions data for the given tag and adds them to the colvec. | |
void | findCollections (ColVec &colVec, LCCDTimeStamp timeStamp) |
Creates collections for all conditions data for the given timestamp. | |
void | tagFolder (const std::string &tagName, const std::string &description="", std::string usingTagName="") |
Tag the current HEAD of the database folder as tagName. | |
void | createDBFile (const std::string &tag="") |
Creates an LCIO file with the all conditions data in the folder for the given tag. | |
void | createSimpleFile (LCCDTimeStamp timeStamp, const std::string &tag, bool allLayers=false) |
Creates an LCIO file with one event that has a collection with the conditions data for the given time stamp and tag (use "" for the current HEAD). If allLayers==true then in addition to the specified collection, all collections in the database for this timestamp are added to the event with name COLNAME_layer_LAYERNUM. | |
Protected Member Functions | |
void | init () |
Initializes the database access. | |
lcio::LCCollection * | collectionFromCondDBObject (ICondDBObject *object, const std::string &tag) |
Creates an LCColleciton from the data in the ICondDBObject. | |
Protected Attributes | |
ICondDBMgr * | _condDBmgr |
ICondDBDataAccess * | _condDataAccess |
ICondDBFolderMgr * | _condFolderMgr |
ICondDBTagMgr * | _condTagMgr |
The functionality corresponds to a subset of the ConditionsDB API for user's ( and lccd developer's) convenience. Most of the usual tasks can be handled through this interface.
If needed access to the relevant manager objects of ConditionsDB is provided.
Every DBInterface object is attached to one particular folder in a particular database.
The methods createDBFile() and createSimpleFile() can be used to produce LCIO files with conditions data as input for the corresponding conditions handlers in a reconstrcution program.
They also provide an easy way to browse the database horizontally (by tag) or vertically (by time stamp).
|
Default c'tor, uses lccd::getDBInitString() to determine the db initialization, i.e. as defined by the environment variable $LCCD_DB_INIT. In update mode the folder is created if it doesn't exist - provided the database user has the proper privileges.
|
|
Open the database specified in dbInit. In update mode the folder is created if it doesn't exist - provided the database user has the proper privileges.
|
|
Creates an LCColleciton from the data in the ICondDBObject. Adds the db parameters as described in findCollection() to the collection. |
|
Creates an LCIO file with the all conditions data in the folder for the given tag.
The collections are sorted w.r.t. their validity time intervall and attached to consecutive events. The run header holds a map of validity time intervalls to events. in the parameters DBSince and DBTill. |
|
Creates an LCIO file with one event that has a collection with the conditions data for the given time stamp and tag (use "" for the current HEAD).
The name of the file will be of the form "conddb_COLNAME_TAG_TIMESTAMP.slcio" This file can be used by the SimpleFileHandler. |
|
Retrieves the collection for the given point in time - returns NULL if no data is found.
|
|
Creates collections for all conditions data for the given timestamp.
The collections are ordered w.r.t. to the layer number in the database. |
|
Creates collections for all conditions data for the given tag and adds them to the colvec.
The collections are ordered w.r.t. to their validity time. |
|
Tag the current HEAD of the database folder as tagName.
If the argument usingTagName is provided and refers to an existing tag this tag will be duplicated as tagName. |