]>
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> | |
2f17a269 | 10 | #include <TObjArray.h> |
d81e6423 | 11 | #include "AliEMCALGeoParams.h" |
12 | class TString; | |
61917ab3 | 13 | class TTree; |
d81e6423 | 14 | |
15 | /* | |
16 | Objects of this class contain basis for absolute calibrations | |
d81e6423 | 17 | */ |
18 | ||
61917ab3 | 19 | // total calibration factor is a product of |
82d90a2f | 20 | // a) overall calibration factor [fAbsoluteCalib] |
21 | // b) individual gain factor per tower [fRelativeCalib] | |
61917ab3 | 22 | // c) time-dependent correction |
82d90a2f | 23 | // In this class we store a), b) |
61917ab3 | 24 | |
25 | // ******* internal class definition ************* | |
61917ab3 | 26 | |
27 | // 1 SuperModule's worth of info: info on where the different APDs are | |
28 | class AliEMCALSuperModuleCalibAbs : public TObject { | |
29 | ||
30 | public: | |
2f17a269 | 31 | AliEMCALSuperModuleCalibAbs(const int smNum=0) : TObject(), // just init values |
32 | fSuperModuleNum(smNum), | |
61917ab3 | 33 | fCalibMethod(0), |
34 | fCalibPass(0), | |
82d90a2f | 35 | fAbsoluteCalib(0) |
61917ab3 | 36 | { |
61917ab3 | 37 | for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) { |
38 | for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) { | |
82d90a2f | 39 | fRelativeCalib[icol][irow] = 1.0; |
61917ab3 | 40 | } |
41 | } | |
42 | } | |
43 | ||
44 | public: | |
2f17a269 | 45 | // first |
46 | void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; // | |
47 | Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; // | |
48 | void SetCalibMethod(Int_t i) { fCalibMethod = i;}; // | |
49 | Int_t GetCalibMethod() const { return fCalibMethod;}; // | |
50 | void SetCalibPass(Int_t i) { fCalibPass = i;}; // | |
51 | Int_t GetCalibPass() const { return fCalibPass;}; // | |
82d90a2f | 52 | void SetAbsoluteCalib(Float_t f) { fAbsoluteCalib = f;}; // |
53 | Float_t GetAbsoluteCalib() const { return fAbsoluteCalib;}; // | |
2f17a269 | 54 | |
55 | // third | |
82d90a2f | 56 | void SetRelativeCalib(int icol, int irow, Float_t f) { fRelativeCalib[icol][irow] = f; }; // |
57 | Float_t GetRelativeCalib(int icol, int irow) const { return fRelativeCalib[icol][irow]; }; // | |
2f17a269 | 58 | |
59 | private: | |
61917ab3 | 60 | // first: overall values for the whole SuperModule |
61 | Int_t fSuperModuleNum; // which SuperModule is this? | |
62 | Int_t fCalibMethod; // a la 0=cosmics, 1=pi0, 2=electrons,3=using ecore, | |
63 | Int_t fCalibPass; // which analysis iteration is this.. 1,2,..N | |
82d90a2f | 64 | Float_t fAbsoluteCalib; // (ADC>GeV absolute gain/conversion) |
61917ab3 | 65 | |
66 | // third: individual info for each tower | |
82d90a2f | 67 | Float_t fRelativeCalib[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // values around 1, if gains are well balanced |
61917ab3 | 68 | |
82d90a2f | 69 | ClassDef(AliEMCALSuperModuleCalibAbs, 3) // help class |
61917ab3 | 70 | }; |
71 | // ******* end of internal class definition ************* | |
72 | ||
d81e6423 | 73 | class AliEMCALCalibAbs : public TObject { |
74 | ||
75 | public: | |
76 | ||
77 | enum kProblemType {kNoLED=-999};// code in possible problems | |
78 | ||
2f17a269 | 79 | AliEMCALCalibAbs(const int nSM = AliEMCALGeoParams::fgkEMCALModules); |
d81e6423 | 80 | |
81 | // Read and Write txt I/O methods are normally not used, but are useful for | |
61917ab3 | 82 | // filling the object before it is saved in OCDB |
83 | void ReadTextCalibAbsInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
84 | void WriteTextCalibAbsInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
85 | void ReadRootCalibAbsInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
86 | void ReadTreeCalibAbsInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
87 | void WriteRootCalibAbsInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
d81e6423 | 88 | |
89 | virtual ~AliEMCALCalibAbs(); | |
90 | ||
d81e6423 | 91 | // pointer to stored info. |
d81e6423 | 92 | Int_t GetNSuperModule() const { return fNSuperModule; }; |
d81e6423 | 93 | |
94 | // - via the index in the stored array: | |
2f17a269 | 95 | virtual AliEMCALSuperModuleCalibAbs * GetSuperModuleCalibAbsId(Int_t smIndex) const |
96 | { return (AliEMCALSuperModuleCalibAbs*) fSuperModuleData[smIndex]; }; | |
97 | ||
d81e6423 | 98 | // - or via the actual SM number |
2f17a269 | 99 | virtual AliEMCALSuperModuleCalibAbs * GetSuperModuleCalibAbsNum(Int_t smNum) const; |
d81e6423 | 100 | |
101 | protected: | |
102 | ||
103 | Int_t fNSuperModule; // Number of supermodules. | |
2f17a269 | 104 | TObjArray fSuperModuleData; // SuperModule data |
d81e6423 | 105 | |
106 | private: | |
107 | ||
108 | AliEMCALCalibAbs(const AliEMCALCalibAbs &); | |
109 | AliEMCALCalibAbs &operator = (const AliEMCALCalibAbs &); | |
110 | ||
82d90a2f | 111 | ClassDef(AliEMCALCalibAbs, 4) //CalibAbs data info |
d81e6423 | 112 | }; |
113 | ||
114 | #endif |