#include <emcCalibrationData.h>
Inherits emcManageable.
Inheritance diagram for emcCalibrationData:
First implementation : 31-Jan-2001. Author : L. Aphecetche (aphecetc@in2p3.fr)
This class can be used to store various flavours of calibration, e.g. Initial Calibrations, Mip Corrections, and so on. It has been designed to be (hopefully) easily extendable to new flavours (types).
It is characterized by a type, a positive number (and the range of valid numbers : [0-range]) and a validity period (2 timestamps).
For every "channel", it stores 2 arrays : one for value, and the other for the associated error on those values. The length of those arrays is called hereafter the dimension. The meaning of the index (i.e. what is a "channel") of those arrays is let to the user : depending on the type, user should know what it is about (e.g. sector towers or PHENIX-wide towers or even a single per-run number). The range is used by the plugin that handles this class to know the maximum number of such objects it could have to store at the same time.
Only predefined types of calibration data can be used. Those types are identified by the enum EType below. The GetTypeName() method can be used to retrieve a human-readable name from this type.
By now, only 2 differents types are defined :
(1) kIniCal : for initial sector-wide calibrations. Dimension=3 (i.e. 3 values and 3 errors per channel), Range=8 (i.e. 8 sectors), channel=sector tower,
(2) kTofSectorOffset : run-by-run sector t0s Dimension=5 Range=8 channel=1 (phenix sector)
How to add new types :
a) Add an enum value (AFTER the already present ones) b) Edit the SetTypeAndSize() method to set the range and dimension for the new type. c) Edit the GetTypeName(EType type) method to return a name from the new type. d) In the DataManager_plugins package, have a look at the emcOMCalibrationData plugin to see if it can handle automatically the new type or not (this depends basically on the dimension : 3 and 1 are already handled. If you want other dimensions, you'll have to edit the plugin code (basically adding a new low-level Pdbcal class). See the Read and Write methods, those are the only ones that should be changed.
Definition at line 48 of file emcCalibrationData.h.
Public Types | |
enum | EType { kUnknown = 0, kIniCal = 1, kTofSectorOffset = 5 } |
Public Member Functions | |
emcCalibrationData (EType type=kUnknown, size_t number=0, size_t size=0) | |
Default ctor. | |
virtual | ~emcCalibrationData () |
const char * | GetCategory (void) const |
Category of the object = GAIN,PED,HL,etc. | |
const PHTimeStamp & | GetEndValTime (void) const |
size_t | GetDimension (void) const |
float | GetError (size_t index, size_t dim=0) const |
size_t | GetNumber (void) const |
size_t | GetRange (void) const |
size_t | GetSize (void) const |
const PHTimeStamp & | GetStartValTime (void) const |
EType | GetType (void) const |
const char * | GetTypeName (void) const |
float | GetValue (size_t index, size_t dim=0) const |
virtual bool | IsValid (const PHTimeStamp &when) const |
Tells if this object is still valid at that time. | |
void | Print (int level=0) const |
virtual void | Reset (void) |
Reset the object. | |
bool | Set (size_t index, float value, float error, size_t dim=0) |
void | SetTypeAndSize (EType type, size_t size) |
Set the type and the size. | |
void | SetNumber (size_t number) |
void | SetValidityPeriod (const PHTimeStamp &t1, const PHTimeStamp &t2) |
Static Public Member Functions | |
static const char * | GetTypeName (EType type) |
Static Public Attributes | |
static const float | fgInvalidFloat = -99999.9999 |
Private Attributes | |
PHTimeStamp | fStart |
PHTimeStamp | fEnd |
EType | fType |
size_t | fNumber |
float ** | fValues |
float ** | fErrors |
size_t | fSize |
size_t | fDimension |
size_t | fRange |
|
Definition at line 54 of file emcCalibrationData.h. |
|
Default ctor. The size needs not to be given if this object is to be fetched from the database, but type and number should be given then, so the relevant plugin can be used. Definition at line 10 of file emcCalibrationData.C. References fSize, fType, and SetTypeAndSize(). |
|
Definition at line 18 of file emcCalibrationData.C. References Reset(). |
|
Category of the object = GAIN,PED,HL,etc. .. This category is used to determine the top-level container of this object in the database. Implements emcManageable. Definition at line 25 of file emcCalibrationData.C. References fType, kIniCal, kTofSectorOffset, and kUnknown. |
|
Definition at line 76 of file emcCalibrationData.h. References fDimension. Referenced by emcOMCalibrationDataIniCal::Write(). |
|
Definition at line 70 of file emcCalibrationData.h. References fEnd. |
|
Definition at line 49 of file emcCalibrationData.C. References fDimension, fErrors, fgInvalidFloat, and fSize. Referenced by Print(). |
|
|
Definition at line 91 of file emcCalibrationData.h. References fRange. Referenced by emcOMCalibrationDataT< BM >::AllocateCalibrationData(). |
|
Definition at line 97 of file emcCalibrationData.h. References fSize. Referenced by emcOMCalibrationDataIniCal::Write(). |
|
Definition at line 103 of file emcCalibrationData.h. References fStart. |
|
|
Definition at line 118 of file emcCalibrationData.h. References fType. Referenced by Print(). |
|
Definition at line 63 of file emcCalibrationData.C. References kIniCal, kTofSectorOffset, and kUnknown. |
|
Definition at line 87 of file emcCalibrationData.C. References fDimension, fgInvalidFloat, fSize, and fValues. Referenced by PbScSector::BuildFromDB(), PbGlSector::BuildFromDB(), emcCalibrationDataHelper::initECalAtT0(), Print(), and emcOMCalibrationDataIniCal::Write(). |
|
Tells if this object is still valid at that time.
Reimplemented from emcManageable. Definition at line 101 of file emcCalibrationData.C. |
|
Definition at line 111 of file emcCalibrationData.C. References fDimension, fEnd, fNumber, fSize, fStart, fType, GetError(), GetTypeName(), GetValue(), and j. |
|
Reset the object.
Reimplemented from emcManageable. Definition at line 139 of file emcCalibrationData.C. References fErrors, fSize, and fValues. Referenced by emcOMIniCalConstruction::Read(), SetTypeAndSize(), and ~emcCalibrationData(). |
|
Definition at line 167 of file emcCalibrationData.C. References fDimension, fErrors, fSize, and fValues. |
|
Definition at line 147 of file emcCalibrationData.h. References fNumber. |
|
Set the type and the size. Those 2 are set together, as it can be that if you change the type you'll change the dimension, and then the internal structures will have to be re-allocated to reflect the changes. This method erases the object (Reset). Definition at line 183 of file emcCalibrationData.C. References fDimension, fErrors, fRange, fSize, fType, fValues, j, kIniCal, kTofSectorOffset, and Reset(). Referenced by emcCalibrationData(), and emcOMCalibrationDataTofSectorOffset::Read(). |
|
Definition at line 153 of file emcCalibrationData.h. |
|
Definition at line 170 of file emcCalibrationData.h. Referenced by GetDimension(), GetError(), GetValue(), Print(), Set(), and SetTypeAndSize(). |
|
Definition at line 164 of file emcCalibrationData.h. Referenced by GetEndValTime(), IsValid(), Print(), and SetValidityPeriod(). |
|
Definition at line 168 of file emcCalibrationData.h. Referenced by GetError(), Reset(), Set(), and SetTypeAndSize(). |
|
Definition at line 160 of file emcCalibrationData.h. Referenced by GetError(), and GetValue(). |
|
Definition at line 166 of file emcCalibrationData.h. Referenced by GetNumber(), Print(), and SetNumber(). |
|
Definition at line 171 of file emcCalibrationData.h. Referenced by GetRange(), and SetTypeAndSize(). |
|
Definition at line 169 of file emcCalibrationData.h. Referenced by emcCalibrationData(), GetError(), GetSize(), GetValue(), Print(), Reset(), Set(), and SetTypeAndSize(). |
|
Definition at line 163 of file emcCalibrationData.h. Referenced by GetStartValTime(), IsValid(), Print(), and SetValidityPeriod(). |
|
Definition at line 165 of file emcCalibrationData.h. Referenced by emcCalibrationData(), GetCategory(), GetType(), GetTypeName(), Print(), and SetTypeAndSize(). |
|
Definition at line 167 of file emcCalibrationData.h. Referenced by GetValue(), Reset(), Set(), and SetTypeAndSize(). |