]>
Commit | Line | Data |
---|---|---|
d81e6423 | 1 | #ifndef ALIEMCALCALIBABS_H |
2 | #define ALIEMCALCALIBABS_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id: $ */ | |
8 | ||
9 | #include <TObject.h> | |
10 | #include "AliEMCALGeoParams.h" | |
11 | class TString; | |
61917ab3 | 12 | class TTree; |
d81e6423 | 13 | |
14 | /* | |
15 | Objects of this class contain basis for absolute calibrations | |
d81e6423 | 16 | */ |
17 | ||
61917ab3 | 18 | // total calibration factor is a product of |
19 | // a) overall calibration factor [fAbsoluteGain] | |
20 | // b) individual gain factor per tower [fRelativeGain] | |
21 | // c) time-dependent correction | |
22 | // In this class we store a), b) and the needed static ingredients for c) | |
23 | ||
24 | // ******* internal class definition ************* | |
25 | // values per single tower | |
26 | class AliEMCALCalibAbsVal : public TObject { | |
27 | ||
28 | public: | |
29 | AliEMCALCalibAbsVal() : TObject(), // just init values | |
30 | fRelativeGain(0), | |
31 | fHighLowRatio(0), | |
32 | fHighLow(0), | |
33 | fLEDAmp(0), | |
34 | fLEDAmpRMS(0) | |
35 | { | |
36 | } | |
37 | ||
38 | void Init() { | |
39 | fRelativeGain = 0; | |
40 | fHighLowRatio = 0; | |
41 | fHighLow = 0; | |
42 | fLEDAmp = 0; | |
43 | fLEDAmpRMS = 0; | |
44 | return; | |
45 | } | |
46 | ||
47 | public: | |
48 | Float_t fRelativeGain; // (ADC>GeV relative gain/conversion), value around 1 | |
49 | Float_t fHighLowRatio; // value around 16 or so | |
50 | Int_t fHighLow; // 0 (low) or 1 (high) gain, used for LEDAmp info | |
51 | Float_t fLEDAmp; // LED amplitude | |
52 | Float_t fLEDAmpRMS; // RMS | |
53 | ||
54 | ClassDef(AliEMCALCalibAbsVal, 1) // help class | |
55 | }; | |
56 | ||
57 | // 1 SuperModule's worth of info: info on where the different APDs are | |
58 | class AliEMCALSuperModuleCalibAbs : public TObject { | |
59 | ||
60 | public: | |
61 | AliEMCALSuperModuleCalibAbs() : TObject(), // just init values | |
62 | fSuperModuleNum(0), | |
63 | fCalibMethod(0), | |
64 | fCalibPass(0), | |
65 | fCalibTime(0), | |
66 | fAbsoluteGain(0) | |
67 | { | |
68 | for (int iref=0; iref<AliEMCALGeoParams::fgkEMCALLEDRefs; iref++) { | |
69 | fLEDRefAmp[iref] = 0; | |
70 | fLEDRefAmpRMS[iref] = 0; | |
71 | fLEDRefHighLowRatio[iref] = 0; | |
72 | fLEDRefHighLow[iref] = 0; | |
73 | } | |
74 | ||
75 | for (int itemp=0; itemp<AliEMCALGeoParams::fgkEMCALTempSensors; itemp++) { | |
76 | fTemperature[itemp] = 0; | |
77 | fTemperatureRMS[itemp] = 0; | |
78 | } | |
79 | ||
80 | for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) { | |
81 | for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) { | |
82 | fAPDVal[icol][irow].Init(); | |
83 | } | |
84 | } | |
85 | } | |
86 | ||
87 | public: | |
88 | // first: overall values for the whole SuperModule | |
89 | Int_t fSuperModuleNum; // which SuperModule is this? | |
90 | Int_t fCalibMethod; // a la 0=cosmics, 1=pi0, 2=electrons,3=using ecore, | |
91 | Int_t fCalibPass; // which analysis iteration is this.. 1,2,..N | |
92 | Int_t fCalibTime; // t0, unix timestamp | |
93 | Float_t fAbsoluteGain; // (ADC>GeV absolute gain/conversion) | |
94 | ||
95 | // second: additional info for LED Reference and SM temperature | |
96 | Float_t fLEDRefAmp[AliEMCALGeoParams::fgkEMCALLEDRefs]; // LED amplitude at t0, low gain equivalent | |
97 | Float_t fLEDRefAmpRMS[AliEMCALGeoParams::fgkEMCALLEDRefs]; // RMS | |
98 | Float_t fLEDRefHighLowRatio[AliEMCALGeoParams::fgkEMCALLEDRefs]; // value around 16 or so | |
99 | Int_t fLEDRefHighLow[AliEMCALGeoParams::fgkEMCALLEDRefs]; // 0 (low) or 1 (high) gain | |
100 | ||
101 | Float_t fTemperature[AliEMCALGeoParams::fgkEMCALTempSensors]; // temperature at t0 | |
102 | Float_t fTemperatureRMS[AliEMCALGeoParams::fgkEMCALTempSensors]; // RMS | |
103 | ||
104 | // third: individual info for each tower | |
105 | AliEMCALCalibAbsVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // at t0 | |
106 | ||
107 | ClassDef(AliEMCALSuperModuleCalibAbs, 1) // help class | |
108 | }; | |
109 | // ******* end of internal class definition ************* | |
110 | ||
d81e6423 | 111 | class AliEMCALCalibAbs : public TObject { |
112 | ||
113 | public: | |
114 | ||
115 | enum kProblemType {kNoLED=-999};// code in possible problems | |
116 | ||
117 | AliEMCALCalibAbs(); | |
118 | ||
119 | // Read and Write txt I/O methods are normally not used, but are useful for | |
61917ab3 | 120 | // filling the object before it is saved in OCDB |
121 | void ReadTextCalibAbsInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
122 | void WriteTextCalibAbsInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
123 | void ReadRootCalibAbsInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
124 | void ReadTreeCalibAbsInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
125 | void WriteRootCalibAbsInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
d81e6423 | 126 | |
127 | virtual ~AliEMCALCalibAbs(); | |
128 | ||
d81e6423 | 129 | // pointer to stored info. |
d81e6423 | 130 | Int_t GetNSuperModule() const { return fNSuperModule; }; |
131 | AliEMCALSuperModuleCalibAbs * GetSuperModuleData() const { return fSuperModuleData; }; | |
132 | ||
133 | // - via the index in the stored array: | |
134 | virtual AliEMCALSuperModuleCalibAbs GetSuperModuleCalibAbsId(Int_t smIndex) const; | |
135 | // - or via the actual SM number | |
136 | virtual AliEMCALSuperModuleCalibAbs GetSuperModuleCalibAbsNum(Int_t smNum) const; | |
137 | ||
138 | protected: | |
139 | ||
140 | Int_t fNSuperModule; // Number of supermodules. | |
141 | AliEMCALSuperModuleCalibAbs *fSuperModuleData; // SuperModule data | |
142 | ||
143 | private: | |
144 | ||
145 | AliEMCALCalibAbs(const AliEMCALCalibAbs &); | |
146 | AliEMCALCalibAbs &operator = (const AliEMCALCalibAbs &); | |
147 | ||
61917ab3 | 148 | ClassDef(AliEMCALCalibAbs, 2) //CalibAbs data reader |
d81e6423 | 149 | }; |
150 | ||
151 | #endif |