]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALCalibTempCoeff.h
change order of bookkeeping events
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibTempCoeff.h
1 #ifndef ALIEMCALCALIBTEMPCOEFF_H
2 #define ALIEMCALCALIBTEMPCOEFF_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 temperature-dependence coefficients
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 factors needed for c)
24
25 // ******* internal class definition *************
26
27 // 1 SuperModule's worth of info: info on where the different APDs are
28 class AliEMCALSuperModuleCalibTempCoeff : public TObject {
29
30  public:
31   AliEMCALSuperModuleCalibTempCoeff(const int smNum=0) : TObject(), // just init values
32     fSuperModuleNum(smNum)
33     {
34       for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
35         for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
36           fTC[icol][irow] = 1.0;
37           fSrc[icol][irow] = 0;
38         }
39       }
40     }
41
42  public:
43
44   void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; // 
45   Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; // 
46   void SetTC(int icol, int irow, Float_t f) { fTC[icol][irow] = f; }; //
47   Float_t GetTC(int icol, int irow) const { return fTC[icol][irow]; }; //
48   void SetSrc(int icol, int irow, Int_t i) { fSrc[icol][irow] = i; }; //
49   Int_t GetSrc(int icol, int irow) const { return fSrc[icol][irow]; }; //
50
51  private:
52   Int_t fSuperModuleNum; // which SuperModule is this?
53   // individual info for each tower
54   Float_t fTC[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // Temperature Coefficient values (nominally around 2% change per deg C)
55   Int_t fSrc[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // from DarkCurrent, or LED or ..
56
57   ClassDef(AliEMCALSuperModuleCalibTempCoeff, 1) // help class
58 };
59 // ******* end of internal class definition *************
60
61 class AliEMCALCalibTempCoeff : public TObject {
62
63 public:
64
65   enum kSrcType {kDarkCurrent=0, kLED=1};// code in possible sources
66
67   AliEMCALCalibTempCoeff(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
68
69   // Read and Write txt I/O methods are normally not used, but are useful for 
70   // filling the object before it is saved in OCDB 
71   void ReadTextCalibTempCoeffInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCalModules
72   void WriteTextCalibTempCoeffInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCalModules
73   void ReadRootCalibTempCoeffInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCalModules
74   void ReadTreeCalibTempCoeffInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCalModules
75   void WriteRootCalibTempCoeffInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCalModules
76
77   virtual ~AliEMCALCalibTempCoeff();
78
79   // pointer to stored info.
80   Int_t GetNSuperModule() const { return fNSuperModule; }; 
81
82   // - via the index in the stored array:
83   virtual AliEMCALSuperModuleCalibTempCoeff * GetSuperModuleCalibTempCoeffId(Int_t smIndex) const
84    { return (AliEMCALSuperModuleCalibTempCoeff*) fSuperModuleData[smIndex]; };
85
86   // - or via the actual SM number
87   virtual AliEMCALSuperModuleCalibTempCoeff * GetSuperModuleCalibTempCoeffNum(Int_t smNum) const;
88
89 protected:
90
91   Int_t           fNSuperModule; // Number of supermodules.
92   TObjArray fSuperModuleData; // SuperModule data
93
94 private:
95
96   AliEMCALCalibTempCoeff(const AliEMCALCalibTempCoeff &);
97   AliEMCALCalibTempCoeff &operator = (const AliEMCALCalibTempCoeff &);
98
99   ClassDef(AliEMCALCalibTempCoeff, 1) //CalibTempCoeff data info
100 };
101
102 #endif