JANA2
JCalibrationCCDB Class Reference

Descendant of JCalibration class which allow to use CCDB as JANA calibration source. More...

#include <JCalibrationCCDB.h>

Inheritance diagram for JCalibrationCCDB:
Collaboration diagram for JCalibrationCCDB:

Public Member Functions

 JCalibrationCCDB (ccdb::Calibration *calib, string url, int32_t run, string context="default")
 Constructor. More...
 
virtual ~JCalibrationCCDB ()
 destructor
 
virtual const char * className (void)
 gets a className
 
ccdb::Calibration * GetCCDBCalibObj (void)
 gets pointer to underlying ccdb::Calibration object
 
void Lock (void)
 lock mutex used when accessing CCDB
 
void Unlock (void)
 unlock mutex used when accessing CCDB
 
bool GetCalib (string namepath, map< string, string > &svals, uint64_t event_number=0)
 get calibration constants More...
 
bool GetCalib (string namepath, vector< string > &svals, uint64_t event_number=0)
 get calibration constants More...
 
bool GetCalib (string namepath, vector< map< string, string > > &vsvals, uint64_t event_number=0)
 get calibration constants More...
 
bool GetCalib (string namepath, vector< vector< string > > &vsvals, uint64_t event_number=0)
 get calibration constants More...
 
void GetListOfNamepaths (vector< string > &namepaths)
 GetListOfNamepaths. More...
 
- Public Member Functions inherited from JCalibration
 JCalibration (string url, int run, string context="default")
 
virtual bool PutCalib (string namepath, int32_t run_min, int32_t run_max, uint64_t event_min, uint64_t event_max, string &author, map< string, string > &svals, string comment="")
 
virtual bool PutCalib (string namepath, int32_t run_min, int32_t run_max, uint64_t event_min, uint64_t event_max, string &author, vector< map< string, string > > &svals, string comment="")
 
virtual void GetEventBoundaries (vector< uint64_t > &event_boundaries)
 User-callable access to event boundaries. More...
 
template<class T >
bool Get (string namepath, map< string, T > &vals, uint64_t event_number=0)
 
template<class T >
bool Get (string namepath, vector< T > &vals, uint64_t event_number=0)
 
template<class T >
bool Get (string namepath, vector< map< string, T > > &vals, uint64_t event_number=0)
 
template<class T >
bool Get (string namepath, vector< vector< T > > &vals, uint64_t event_number=0)
 
template<class T >
bool Put (string namepath, int32_t run_min, int32_t run_max, uint64_t event_min, uint64_t event_max, string &author, map< string, T > &vals, const string &comment="")
 
template<class T >
bool Put (string namepath, int32_t run_min, int32_t run_max, uint64_t event_min, uint64_t event_max, string &author, vector< T > &vals, const string &comment="")
 
template<class T >
bool Put (string namepath, int32_t run_min, int32_t run_max, uint64_t event_min, uint64_t event_max, string &author, vector< map< string, T > > &vals, const string &comment="")
 
template<class T >
bool Put (string namepath, int32_t run_min, int32_t run_max, uint64_t event_min, uint64_t event_max, string &author, vector< vector< T > > &vals, const string &comment="")
 
template<class T >
bool Get (string namepath, const T *&vals, uint64_t event_number=0)
 
const int32_t & GetRun (void) const
 
const string & GetContext (void) const
 
const string & GetURL (void) const
 
void GetAccesses (map< string, vector< string > > &accesses)
 
string GetVariation (void)
 
containerType_t GetContainerType (string typeid_name)
 
void DumpCalibrationsToFiles (string basedir="./")
 
void WriteCalibFileVector (string dir, string fname, string pathname)
 
void WriteCalibFileMap (string dir, string fname, string pathname)
 
void WriteCalibFileVectorVector (string dir, string fname, string pathname)
 
void WriteCalibFileVectorMap (string dir, string fname, string pathname)
 

Static Public Member Functions

static const char * static_className (void)
 gets a className static version of function
 
- Static Public Member Functions inherited from JCalibration
static const char * static_className (void)
 

Additional Inherited Members

- Public Types inherited from JCalibration
enum  containerType_t {
  kUnknownType,
  kVector,
  kMap,
  kVectorVector,
  kVectorMap
}
 
- Protected Member Functions inherited from JCalibration
template<typename T >
containerType_t TrycontainerType (string typeid_name)
 
virtual void RetrieveEventBoundaries (void)
 Optional for DBs that support event-level boundaries.
 
- Protected Attributes inherited from JCalibration
int32_t run_number
 
pthread_mutex_t accesses_mutex
 
pthread_mutex_t stored_mutex
 
pthread_mutex_t boundaries_mutex
 

Detailed Description

Descendant of JCalibration class which allow to use CCDB as JANA calibration source.

Constructor & Destructor Documentation

JCalibrationCCDB::JCalibrationCCDB ( ccdb::Calibration *  calib,
string  url,
int32_t  run,
string  context = "default" 
)
inline

Constructor.

[in] url - connection string. like mysql://... [in] run - run number [in] context - variation

Member Function Documentation

bool JCalibrationCCDB::GetCalib ( string  namepath,
map< string, string > &  svals,
uint64_t  event_number = 0 
)
inlinevirtual

get calibration constants

[in] namepath - full resource string [out] svals - data to be returned [in] event_number - optional parameter of event number

Returns
true if constants were read

Implements JCalibration.

bool JCalibrationCCDB::GetCalib ( string  namepath,
vector< string > &  svals,
uint64_t  event_number = 0 
)
inlinevirtual

get calibration constants

[in] namepath - full resource string [out] svals - data to be returned [in] event_number - optional parameter of event number

Returns
true if constants were read

The CCDB method corresponding to this one treats constants stored as a single column but many rows as an error and throws an exception if it is detected. The message in the exception suggests using a vector<vector<T> > instead. Thus, we do that here and convert if necessary into a 1-D vector.

It is worth noting that back in May 2014 a similar issue was addressed in the CCDB code itself when the method filling a map<string, string> was used. Fixing this one in CCDB also will require coordinated releases of CCDB and JANA. We choose to handle it here in order to avoid that.

Implements JCalibration.

bool JCalibrationCCDB::GetCalib ( string  namepath,
vector< map< string, string > > &  vsvals,
uint64_t  event_number = 0 
)
inlinevirtual

get calibration constants

[in] namepath - full resource string [out] vsvals - data to be returned [in] event_number - optional parameter of event number

Returns
true if constants were read

Implements JCalibration.

bool JCalibrationCCDB::GetCalib ( string  namepath,
vector< vector< string > > &  vsvals,
uint64_t  event_number = 0 
)
inlinevirtual

get calibration constants

[in] namepath - full resource string [out] vsvals - data to be returned [in] event_number - optional parameter of event number

Returns
true if constants were read

Implements JCalibration.

void JCalibrationCCDB::GetListOfNamepaths ( vector< string > &  namepaths)
inlinevirtual

GetListOfNamepaths.

[in] vector<string> & namepaths

Returns
void

Implements JCalibration.


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