]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALCalibAbs.h
Adding histos for the LEGO train
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibAbs.h
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 <TObjArray.h>
11 #include "AliEMCALGeoParams.h"
12 class TString;
13 class TTree;
14
15 /*
16   Objects of this class contain basis for absolute calibrations
17 */
18
19 // total calibration factor is a product of
20 // a) overall calibration factor [fAbsoluteCalib]
21 // b) individual gain factor per tower [fRelativeCalib]
22 // c) time-dependent correction
23 // In this class we store a), b) 
24
25 // ******* internal class definition *************
26
27 // 1 SuperModule's worth of info: info on where the different APDs are
28 class AliEMCALSuperModuleCalibAbs : public TObject {
29
30  public:
31   AliEMCALSuperModuleCalibAbs(const int smNum=0) : TObject(), // just init values
32     fSuperModuleNum(smNum),
33     fCalibMethod(0),
34     fCalibPass(0),
35     fAbsoluteCalib(0)
36     {
37       for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
38         for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
39           fRelativeCalib[icol][irow] = 1.0;
40         }
41       }
42     }
43
44  public:
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;}; // 
52   void SetAbsoluteCalib(Float_t f) { fAbsoluteCalib = f;}; // 
53   Float_t GetAbsoluteCalib() const { return fAbsoluteCalib;}; // 
54
55   // third
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]; }; //
58
59  private:
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
64   Float_t fAbsoluteCalib; // (ADC>GeV absolute gain/conversion)
65   
66   // third: individual info for each tower
67   Float_t fRelativeCalib[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // values around 1, if gains are well balanced
68
69   ClassDef(AliEMCALSuperModuleCalibAbs, 3) // help class
70 };
71 // ******* end of internal class definition *************
72
73 class AliEMCALCalibAbs : public TObject {
74
75 public:
76
77   enum kProblemType {kNoLED=-999};// code in possible problems
78
79   AliEMCALCalibAbs(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
80
81   // Read and Write txt I/O methods are normally not used, but are useful for 
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
88
89   virtual ~AliEMCALCalibAbs();
90
91   // pointer to stored info.
92   Int_t GetNSuperModule() const { return fNSuperModule; }; 
93
94   // - via the index in the stored array:
95   virtual AliEMCALSuperModuleCalibAbs * GetSuperModuleCalibAbsId(Int_t smIndex) const
96    { return (AliEMCALSuperModuleCalibAbs*) fSuperModuleData[smIndex]; };
97
98   // - or via the actual SM number
99   virtual AliEMCALSuperModuleCalibAbs * GetSuperModuleCalibAbsNum(Int_t smNum) const;
100
101 protected:
102
103   Int_t           fNSuperModule; // Number of supermodules.
104   TObjArray fSuperModuleData; // SuperModule data
105
106 private:
107
108   AliEMCALCalibAbs(const AliEMCALCalibAbs &);
109   AliEMCALCalibAbs &operator = (const AliEMCALCalibAbs &);
110
111   ClassDef(AliEMCALCalibAbs, 4) //CalibAbs data info
112 };
113
114 #endif