1 #ifndef ALIEMCALCALIBABS_H
2 #define ALIEMCALCALIBABS_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 absolute 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 a), b) and the needed static ingredients for c)
25 // ******* internal class definition *************
26 // values per single tower
27 class AliEMCALCalibAbsVal : public TObject {
30 AliEMCALCalibAbsVal() : TObject(), // just init values
49 void SetRelativeGain(Float_t f) { fRelativeGain = f; }; //
50 Float_t GetRelativeGain() const { return fRelativeGain; }; //
51 void SetHighLowRatio(Float_t f) { fHighLowRatio = f; }; //
52 Float_t GetHighLowRatio() const { return fHighLowRatio; }; //
53 void SetHighLow(Int_t i) { fHighLow = i; }; //
54 Int_t GetHighLow() const { return fHighLow; }; //
55 void SetLEDAmp(Float_t f) { fLEDAmp = f; }; //
56 Float_t GetLEDAmp() const { return fLEDAmp; }; //
57 void SetLEDAmpRMS(Float_t f) { fLEDAmpRMS = f; }; //
58 Float_t GetLEDAmpRMS() const { return fLEDAmpRMS; }; //
61 Float_t fRelativeGain; // (ADC>GeV relative gain/conversion), value around 1
62 Float_t fHighLowRatio; // value around 16 or so
63 Int_t fHighLow; // 0 (low) or 1 (high) gain, used for LEDAmp info
64 Float_t fLEDAmp; // LED amplitude
65 Float_t fLEDAmpRMS; // RMS
67 ClassDef(AliEMCALCalibAbsVal, 2) // help class
70 // 1 SuperModule's worth of info: info on where the different APDs are
71 class AliEMCALSuperModuleCalibAbs : public TObject {
74 AliEMCALSuperModuleCalibAbs(const int smNum=0) : TObject(), // just init values
75 fSuperModuleNum(smNum),
81 for (int iref=0; iref<AliEMCALGeoParams::fgkEMCALLEDRefs; iref++) {
83 fLEDRefAmpRMS[iref] = 0;
84 fLEDRefHighLowRatio[iref] = 0;
85 fLEDRefHighLow[iref] = 0;
88 for (int itemp=0; itemp<AliEMCALGeoParams::fgkEMCALTempSensors; itemp++) {
89 fTemperature[itemp] = 0;
90 fTemperatureRMS[itemp] = 0;
93 for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
94 for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
95 fAPDVal[icol][irow].Init();
102 void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; //
103 Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; //
104 void SetCalibMethod(Int_t i) { fCalibMethod = i;}; //
105 Int_t GetCalibMethod() const { return fCalibMethod;}; //
106 void SetCalibPass(Int_t i) { fCalibPass = i;}; //
107 Int_t GetCalibPass() const { return fCalibPass;}; //
108 void SetCalibTime(Int_t i) { fCalibTime = i;}; //
109 Int_t GetCalibTime() const { return fCalibTime;}; //
110 void SetAbsoluteGain(Float_t f) { fAbsoluteGain = f;}; //
111 Float_t GetAbsoluteGain() const { return fAbsoluteGain;}; //
114 void SetLEDRefAmp(int iLEDRef, Float_t f) { fLEDRefAmp[iLEDRef] = f;}; //
115 Float_t GetLEDRefAmp(int iLEDRef) const { return fLEDRefAmp[iLEDRef];}; //
116 void SetLEDRefAmpRMS(int iLEDRef, Float_t f) { fLEDRefAmpRMS[iLEDRef] = f;}; //
117 Float_t GetLEDRefAmpRMS(int iLEDRef) const { return fLEDRefAmpRMS[iLEDRef];}; //
118 void SetLEDRefHighLowRatio(int iLEDRef, Float_t f) { fLEDRefHighLowRatio[iLEDRef] = f;}; //
119 Float_t GetLEDRefHighLowRatio(int iLEDRef) const { return fLEDRefHighLowRatio[iLEDRef];}; //
120 void SetLEDRefHighLow(int iLEDRef, Int_t i) { fLEDRefHighLow[iLEDRef] = i;}; //
121 Int_t GetLEDRefHighLow(int iLEDRef) const { return fLEDRefHighLow[iLEDRef];}; //
123 void SetTemperature(int itemp, Float_t f) { fTemperature[itemp] = f;}; //
124 Float_t GetTemperature(int itemp) const { return fTemperature[itemp];}; //
125 void SetTemperatureRMS(int itemp, Float_t f) { fTemperatureRMS[itemp] = f;}; //
126 Float_t GetTemperatureRMS(int itemp) const { return fTemperatureRMS[itemp];}; //
129 AliEMCALCalibAbsVal * GetAPDVal(int icol, int irow)
130 { return &fAPDVal[icol][irow]; };
133 // first: overall values for the whole SuperModule
134 Int_t fSuperModuleNum; // which SuperModule is this?
135 Int_t fCalibMethod; // a la 0=cosmics, 1=pi0, 2=electrons,3=using ecore,
136 Int_t fCalibPass; // which analysis iteration is this.. 1,2,..N
137 Int_t fCalibTime; // t0, unix timestamp
138 Float_t fAbsoluteGain; // (ADC>GeV absolute gain/conversion)
140 // second: additional info for LED Reference and SM temperature
141 Float_t fLEDRefAmp[AliEMCALGeoParams::fgkEMCALLEDRefs]; // LED amplitude at t0, low gain equivalent
142 Float_t fLEDRefAmpRMS[AliEMCALGeoParams::fgkEMCALLEDRefs]; // RMS
143 Float_t fLEDRefHighLowRatio[AliEMCALGeoParams::fgkEMCALLEDRefs]; // value around 16 or so
144 Int_t fLEDRefHighLow[AliEMCALGeoParams::fgkEMCALLEDRefs]; // 0 (low) or 1 (high) gain
146 Float_t fTemperature[AliEMCALGeoParams::fgkEMCALTempSensors]; // temperature at t0
147 Float_t fTemperatureRMS[AliEMCALGeoParams::fgkEMCALTempSensors]; // RMS
149 // third: individual info for each tower
150 AliEMCALCalibAbsVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // at t0
152 ClassDef(AliEMCALSuperModuleCalibAbs, 2) // help class
154 // ******* end of internal class definition *************
156 class AliEMCALCalibAbs : public TObject {
160 enum kProblemType {kNoLED=-999};// code in possible problems
162 AliEMCALCalibAbs(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
164 // Read and Write txt I/O methods are normally not used, but are useful for
165 // filling the object before it is saved in OCDB
166 void ReadTextCalibAbsInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
167 void WriteTextCalibAbsInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
168 void ReadRootCalibAbsInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
169 void ReadTreeCalibAbsInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
170 void WriteRootCalibAbsInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
172 virtual ~AliEMCALCalibAbs();
174 // pointer to stored info.
175 Int_t GetNSuperModule() const { return fNSuperModule; };
177 // - via the index in the stored array:
178 virtual AliEMCALSuperModuleCalibAbs * GetSuperModuleCalibAbsId(Int_t smIndex) const
179 { return (AliEMCALSuperModuleCalibAbs*) fSuperModuleData[smIndex]; };
181 // - or via the actual SM number
182 virtual AliEMCALSuperModuleCalibAbs * GetSuperModuleCalibAbsNum(Int_t smNum) const;
186 Int_t fNSuperModule; // Number of supermodules.
187 TObjArray fSuperModuleData; // SuperModule data
191 AliEMCALCalibAbs(const AliEMCALCalibAbs &);
192 AliEMCALCalibAbs &operator = (const AliEMCALCalibAbs &);
194 ClassDef(AliEMCALCalibAbs, 3) //CalibAbs data info