emcCalibrationData Class Reference

#include <emcCalibrationData.h>

Inherits emcManageable.

Inheritance diagram for emcCalibrationData:

Inheritance graph
[legend]
List of all members.

Detailed Description

Generic class for storing EMCAL calibration data.

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


Member Enumeration Documentation

enum emcCalibrationData::EType
 

Enumerator:
kUnknown 
kIniCal 
kTofSectorOffset 

Definition at line 54 of file emcCalibrationData.h.


Constructor & Destructor Documentation

emcCalibrationData::emcCalibrationData EType  type = kUnknown,
size_t  number = 0,
size_t  size = 0
 

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().

emcCalibrationData::~emcCalibrationData  )  [virtual]
 

Definition at line 18 of file emcCalibrationData.C.

References Reset().


Member Function Documentation

const char * emcCalibrationData::GetCategory void   )  const [virtual]
 

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.

size_t emcCalibrationData::GetDimension void   )  const [inline]
 

Definition at line 76 of file emcCalibrationData.h.

References fDimension.

Referenced by emcOMCalibrationDataIniCal::Write().

const PHTimeStamp& emcCalibrationData::GetEndValTime void   )  const [inline]
 

Definition at line 70 of file emcCalibrationData.h.

References fEnd.

float emcCalibrationData::GetError size_t  index,
size_t  dim = 0
const
 

Definition at line 49 of file emcCalibrationData.C.

References fDimension, fErrors, fgInvalidFloat, and fSize.

Referenced by Print().

size_t emcCalibrationData::GetNumber void   )  const [inline]
 

Definition at line 85 of file emcCalibrationData.h.

References fNumber.

Referenced by emcOMCalibrationDataT< BM >::AllocateCalibrationData(), convertSector(), emcOMCalibrationDataT< BM >::FreeCalibrationData(), emcOMCalibrationDataT< BM >::GetCalibrationData(), emcOMIniCalConstruction::Read(), emcOMCalibrationDataTofSectorOffset::Read(), emcOMCalibrationDataT< BM >::Read(), emcOMCalibrationDataIniCal::Read(), and emcOMCalibrationDataIniCal::Write().

size_t emcCalibrationData::GetRange void   )  const [inline]
 

Definition at line 91 of file emcCalibrationData.h.

References fRange.

Referenced by emcOMCalibrationDataT< BM >::AllocateCalibrationData().

size_t emcCalibrationData::GetSize void   )  const [inline]
 

Definition at line 97 of file emcCalibrationData.h.

References fSize.

Referenced by emcOMCalibrationDataIniCal::Write().

const PHTimeStamp& emcCalibrationData::GetStartValTime void   )  const [inline]
 

Definition at line 103 of file emcCalibrationData.h.

References fStart.

EType emcCalibrationData::GetType void   )  const [inline]
 

Definition at line 109 of file emcCalibrationData.h.

References fType.

Referenced by emcOMCalibrationDataT< BM >::AllocateCalibrationData(), emcOMCalibrationDataT< BM >::FreeCalibrationData(), emcOMCalibrationDataT< BM >::GetCalibrationData(), emcOMIniCalConstruction::Read(), emcOMCalibrationDataTofSectorOffset::Read(), emcOMCalibrationDataT< BM >::Read(), and emcOMCalibrationDataTofSectorOffset::Write().

const char* emcCalibrationData::GetTypeName void   )  const [inline]
 

Definition at line 118 of file emcCalibrationData.h.

References fType.

Referenced by Print().

const char * emcCalibrationData::GetTypeName EType  type  )  [static]
 

Definition at line 63 of file emcCalibrationData.C.

References kIniCal, kTofSectorOffset, and kUnknown.

float emcCalibrationData::GetValue size_t  index,
size_t  dim = 0
const
 

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().

bool emcCalibrationData::IsValid const PHTimeStamp &  when  )  const [virtual]
 

Tells if this object is still valid at that time.

Returns:
false by default. Must be overriden.

Reimplemented from emcManageable.

Definition at line 101 of file emcCalibrationData.C.

References fEnd, and fStart.

void emcCalibrationData::Print int  level = 0  )  const
 

Definition at line 111 of file emcCalibrationData.C.

References fDimension, fEnd, fNumber, fSize, fStart, fType, GetError(), GetTypeName(), GetValue(), and j.

void emcCalibrationData::Reset void   )  [virtual]
 

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().

bool emcCalibrationData::Set size_t  index,
float  value,
float  error,
size_t  dim = 0
 

Definition at line 167 of file emcCalibrationData.C.

References fDimension, fErrors, fSize, and fValues.

void emcCalibrationData::SetNumber size_t  number  )  [inline]
 

Definition at line 147 of file emcCalibrationData.h.

References fNumber.

void emcCalibrationData::SetTypeAndSize EType  type,
size_t  size
 

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().

void emcCalibrationData::SetValidityPeriod const PHTimeStamp &  t1,
const PHTimeStamp &  t2
[inline]
 

Definition at line 153 of file emcCalibrationData.h.

References fEnd, and fStart.


Member Data Documentation

size_t emcCalibrationData::fDimension [private]
 

Definition at line 170 of file emcCalibrationData.h.

Referenced by GetDimension(), GetError(), GetValue(), Print(), Set(), and SetTypeAndSize().

PHTimeStamp emcCalibrationData::fEnd [private]
 

Definition at line 164 of file emcCalibrationData.h.

Referenced by GetEndValTime(), IsValid(), Print(), and SetValidityPeriod().

float** emcCalibrationData::fErrors [private]
 

Definition at line 168 of file emcCalibrationData.h.

Referenced by GetError(), Reset(), Set(), and SetTypeAndSize().

const float emcCalibrationData::fgInvalidFloat = -99999.9999 [static]
 

Definition at line 160 of file emcCalibrationData.h.

Referenced by GetError(), and GetValue().

size_t emcCalibrationData::fNumber [private]
 

Definition at line 166 of file emcCalibrationData.h.

Referenced by GetNumber(), Print(), and SetNumber().

size_t emcCalibrationData::fRange [private]
 

Definition at line 171 of file emcCalibrationData.h.

Referenced by GetRange(), and SetTypeAndSize().

size_t emcCalibrationData::fSize [private]
 

Definition at line 169 of file emcCalibrationData.h.

Referenced by emcCalibrationData(), GetError(), GetSize(), GetValue(), Print(), Reset(), Set(), and SetTypeAndSize().

PHTimeStamp emcCalibrationData::fStart [private]
 

Definition at line 163 of file emcCalibrationData.h.

Referenced by GetStartValTime(), IsValid(), Print(), and SetValidityPeriod().

EType emcCalibrationData::fType [private]
 

Definition at line 165 of file emcCalibrationData.h.

Referenced by emcCalibrationData(), GetCategory(), GetType(), GetTypeName(), Print(), and SetTypeAndSize().

float** emcCalibrationData::fValues [private]
 

Definition at line 167 of file emcCalibrationData.h.

Referenced by GetValue(), Reset(), Set(), and SetTypeAndSize().


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