1 #ifndef ALIEMCALCALIBREFERENCE_H
2 #define ALIEMCALCALIBREFERENCE_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 #include <TObjArray.h>
11 #include "AliEMCALGeoParams.h"
16 Objects of this class contain basis for reference calibrations
19 // total calibration factor is a product of
20 // a) overall calibration factor [fAbsoluteGain]
21 // b) individual gain factor per tower [fRelativeGain]
22 // c) time-dependent correction
23 // In this class we store the needed static ingredients for c)
25 // ******* internal class definition *************
26 // values per single tower
27 class AliEMCALCalibReferenceVal : public TObject {
30 AliEMCALCalibReferenceVal() : TObject(), // just init values
45 void SetHighLow(Int_t i) { fHighLow = i; }; //
46 Int_t GetHighLow() const { return fHighLow; }; //
47 void SetLEDAmp(Float_t f) { fLEDAmp = f; }; //
48 Float_t GetLEDAmp() const { return fLEDAmp; }; //
49 void SetLEDAmpRMS(Float_t f) { fLEDAmpRMS = f; }; //
50 Float_t GetLEDAmpRMS() const { return fLEDAmpRMS; }; //
53 Int_t fHighLow; // 0 (low) or 1 (high) gain, used for LEDAmp info
54 Float_t fLEDAmp; // LED amplitude
55 Float_t fLEDAmpRMS; // RMS
57 ClassDef(AliEMCALCalibReferenceVal, 1) // help class
60 // 1 SuperModule's worth of info: info on where the different APDs are
61 class AliEMCALSuperModuleCalibReference : public TObject {
64 AliEMCALSuperModuleCalibReference(const int smNum=0) : TObject(), // just init values
65 fSuperModuleNum(smNum),
68 for (int iref=0; iref<AliEMCALGeoParams::fgkEMCALLEDRefs; iref++) {
70 fLEDRefAmpRMS[iref] = 0;
71 fLEDRefHighLow[iref] = 0;
74 for (int itemp=0; itemp<AliEMCALGeoParams::fgkEMCALTempSensors; itemp++) {
75 fTemperature[itemp] = 0;
76 fTemperatureRMS[itemp] = 0;
79 for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
80 for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
81 fAPDVal[icol][irow].Init();
88 void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; //
89 Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; //
90 void SetReferenceTime(Int_t i) { fReferenceTime = i;}; //
91 Int_t GetReferenceTime() const { return fReferenceTime;}; //
94 void SetLEDRefAmp(int iLEDRef, Float_t f) { fLEDRefAmp[iLEDRef] = f;}; //
95 Float_t GetLEDRefAmp(int iLEDRef) const { return fLEDRefAmp[iLEDRef];}; //
96 void SetLEDRefAmpRMS(int iLEDRef, Float_t f) { fLEDRefAmpRMS[iLEDRef] = f;}; //
97 Float_t GetLEDRefAmpRMS(int iLEDRef) const { return fLEDRefAmpRMS[iLEDRef];}; //
98 void SetLEDRefHighLow(int iLEDRef, Int_t i) { fLEDRefHighLow[iLEDRef] = i;}; //
99 Int_t GetLEDRefHighLow(int iLEDRef) const { return fLEDRefHighLow[iLEDRef];}; //
101 void SetTemperature(int itemp, Float_t f) { fTemperature[itemp] = f;}; //
102 Float_t GetTemperature(int itemp) const { return fTemperature[itemp];}; //
103 void SetTemperatureRMS(int itemp, Float_t f) { fTemperatureRMS[itemp] = f;}; //
104 Float_t GetTemperatureRMS(int itemp) const { return fTemperatureRMS[itemp];}; //
107 AliEMCALCalibReferenceVal * GetAPDVal(int icol, int irow)
108 { return &fAPDVal[icol][irow]; };
111 // first: overall values for the whole SuperModule
112 Int_t fSuperModuleNum; // which SuperModule is this?
113 Int_t fReferenceTime; // t0, unix timestamp
115 // second: additional info for LED Reference and SM temperature
116 Float_t fLEDRefAmp[AliEMCALGeoParams::fgkEMCALLEDRefs]; // LED amplitude at t0, low gain equivalent
117 Float_t fLEDRefAmpRMS[AliEMCALGeoParams::fgkEMCALLEDRefs]; // RMS
118 Int_t fLEDRefHighLow[AliEMCALGeoParams::fgkEMCALLEDRefs]; // 0 (low) or 1 (high) gain
120 Float_t fTemperature[AliEMCALGeoParams::fgkEMCALTempSensors]; // temperature at t0
121 Float_t fTemperatureRMS[AliEMCALGeoParams::fgkEMCALTempSensors]; // RMS
123 // third: individual info for each tower
124 AliEMCALCalibReferenceVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // at t0
126 ClassDef(AliEMCALSuperModuleCalibReference, 1) // help class
128 // ******* end of internal class definition *************
130 class AliEMCALCalibReference : public TObject {
134 enum kProblemType {kNoLED=-999};// code in possible problems
136 AliEMCALCalibReference(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
138 // Read and Write txt I/O methods are normally not used, but are useful for
139 // filling the object before it is saved in OCDB
140 void ReadTextCalibReferenceInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
141 void WriteTextCalibReferenceInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
142 void ReadRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
143 void ReadTreeCalibReferenceInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
144 void WriteRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
146 virtual ~AliEMCALCalibReference();
148 // pointer to stored info.
149 Int_t GetNSuperModule() const { return fNSuperModule; };
151 // - via the index in the stored array:
152 virtual AliEMCALSuperModuleCalibReference * GetSuperModuleCalibReferenceId(Int_t smIndex) const
153 { return (AliEMCALSuperModuleCalibReference*) fSuperModuleData[smIndex]; };
155 // - or via the actual SM number
156 virtual AliEMCALSuperModuleCalibReference * GetSuperModuleCalibReferenceNum(Int_t smNum) const;
160 Int_t fNSuperModule; // Number of supermodules.
161 TObjArray fSuperModuleData; // SuperModule data
165 AliEMCALCalibReference(const AliEMCALCalibReference &);
166 AliEMCALCalibReference &operator = (const AliEMCALCalibReference &);
168 ClassDef(AliEMCALCalibReference, 1) //CalibReference data info