AliRoot Core  3dc7879 (3dc7879)
AliEMCALCalibReference.h
Go to the documentation of this file.
1 #ifndef ALIEMCALCALIBREFERENCE_H
2 #define ALIEMCALCALIBREFERENCE_H
3 
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 #include <TObject.h>
8 #include <TObjArray.h>
9 #include "AliEMCALGeoParams.h"
10 class TString;
11 class TTree;
12 
13 // ******* internal class definition *************
14 
26 
27 class AliEMCALCalibReferenceVal : public TObject
28 {
29 
30  public:
31 
33  AliEMCALCalibReferenceVal() : TObject(), // just init values
34  fHighLow(0),
35  fLEDAmp(0),
36  fLEDAmpRMS(0)
37  { }
38 
39  void Init() {
40  fHighLow = 0;
41  fLEDAmp = 0;
42  fLEDAmpRMS = 0;
43  return;
44  }
45 
46  public:
47 
48  void SetHighLow(Int_t i) { fHighLow = i ; }
49  Int_t GetHighLow() const { return fHighLow ; }
50 
51  void SetLEDAmp(Float_t f) { fLEDAmp = f ; }
52  Float_t GetLEDAmp() const { return fLEDAmp ; }
53 
54  void SetLEDAmpRMS(Float_t f) { fLEDAmpRMS = f ; }
55  Float_t GetLEDAmpRMS() const { return fLEDAmpRMS ; }
56 
57  private:
58  Int_t fHighLow ;
59  Float_t fLEDAmp ;
60  Float_t fLEDAmpRMS;
61 
63  ClassDef(AliEMCALCalibReferenceVal, 1) ;
65 
66 };
67 
80 
81 class AliEMCALSuperModuleCalibReference : public TObject
82 {
83 
84  public:
85 
88  AliEMCALSuperModuleCalibReference(const int smNum=0) : TObject(),
89  fSuperModuleNum(smNum),
90  fReferenceTime(0)
91  { for (int iref=0; iref<AliEMCALGeoParams::fgkEMCALLEDRefs; iref++)
92  { fLEDRefAmp[iref] = 0; fLEDRefAmpRMS[iref] = 0; fLEDRefHighLow[iref] = 0; }
93  for (int itemp=0; itemp<AliEMCALGeoParams::fgkEMCALTempSensors; itemp++)
94  { fTemperature[itemp] = 0; fTemperatureRMS[itemp] = 0; }
95  for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
96  for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
97  fAPDVal[icol][irow].Init(); } } }
98 
99  public:
100 
101  // first
102  void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i ; }
103  Int_t GetSuperModuleNum() const { return fSuperModuleNum ; }
104  void SetReferenceTime(Int_t i) { fReferenceTime = i ; }
105  Int_t GetReferenceTime() const { return fReferenceTime ; }
106 
107  // second
108  void SetLEDRefAmp (int iLEDRef, Float_t f) { fLEDRefAmp[iLEDRef] = f ; }
109  Float_t GetLEDRefAmp (int iLEDRef) const { return fLEDRefAmp[iLEDRef] ; }
110  void SetLEDRefAmpRMS (int iLEDRef, Float_t f) { fLEDRefAmpRMS[iLEDRef] = f ; }
111  Float_t GetLEDRefAmpRMS (int iLEDRef) const { return fLEDRefAmpRMS[iLEDRef] ; }
112  void SetLEDRefHighLow(int iLEDRef, Int_t i) { fLEDRefHighLow[iLEDRef] = i ; }
113  Int_t GetLEDRefHighLow(int iLEDRef) const { return fLEDRefHighLow[iLEDRef] ; }
114 
115  void SetTemperature (int itemp, Float_t f) { fTemperature[itemp] = f ; }
116  Float_t GetTemperature (int itemp) const { return fTemperature[itemp] ; }
117  void SetTemperatureRMS(int itemp, Float_t f) { fTemperatureRMS[itemp] = f ; }
118  Float_t GetTemperatureRMS(int itemp) const { return fTemperatureRMS[itemp] ; }
119 
120  // third
121  AliEMCALCalibReferenceVal * GetAPDVal(int icol, int irow)
122  { return &fAPDVal[icol][irow]; }
123 
124  private:
125 
126  // first: overall values for the whole SuperModule
128  Int_t fReferenceTime ;
129 
130  // second: additional info for LED Reference and SM temperature
131  Float_t fLEDRefAmp [AliEMCALGeoParams::fgkEMCALLEDRefs] ;
132  Float_t fLEDRefAmpRMS [AliEMCALGeoParams::fgkEMCALLEDRefs] ;
133  Int_t fLEDRefHighLow [AliEMCALGeoParams::fgkEMCALLEDRefs] ;
134 
135  Float_t fTemperature [AliEMCALGeoParams::fgkEMCALTempSensors] ;
136  Float_t fTemperatureRMS[AliEMCALGeoParams::fgkEMCALTempSensors] ;
137 
138  // third: individual info for each tower
140 
142  ClassDef(AliEMCALSuperModuleCalibReference, 1) ;
144 
145 };
146 // ******* end of internal class definition *************
147 
165 
166 class AliEMCALCalibReference : public TObject
167 {
168 
169 public:
170 
171  enum kProblemType {kNoLED=-999};
172 
174 
175  // Read and Write txt I/O methods are normally not used, but are useful for
176  // filling the object before it is saved in OCDB
177  void ReadTextCalibReferenceInfo (Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE);
178  void WriteTextCalibReferenceInfo(const TString &txtFileName , Bool_t swapSides=kFALSE);
179  void ReadRootCalibReferenceInfo (const TString &rootFileName, Bool_t swapSides=kFALSE);
180  void ReadTreeCalibReferenceInfo (TTree *tree, Bool_t swapSides=kFALSE);
181  void WriteRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE);
182 
183  virtual ~AliEMCALCalibReference();
184 
185  // pointer to stored info.
186  Int_t GetNSuperModule() const { return fNSuperModule; }
187 
188  // - via the index in the stored array:
190  { return (AliEMCALSuperModuleCalibReference*) fSuperModuleData[smIndex]; }
191 
192  // - or via the actual SM number
193  virtual AliEMCALSuperModuleCalibReference * GetSuperModuleCalibReferenceNum(Int_t smNum) const;
194 
195 protected:
196 
197  Int_t fNSuperModule ;
199 
200 private:
201 
203  AliEMCALCalibReference &operator = (const AliEMCALCalibReference &);
204 
206  ClassDef(AliEMCALCalibReference, 1) ;
208 
209 };
210 
211 #endif // ALIEMCALCALIBREFERENCE_H
Container of calibration reference values container per single APD.
Float_t fLEDAmp
LED amplitude.
#define TObjArray
static const int fgkEMCALRows
Number of rows per module for EMCAL.
void SetLEDRefAmp(int iLEDRef, Float_t f)
void SetLEDRefAmpRMS(int iLEDRef, Float_t f)
static const int fgkEMCALLEDRefs
Number of LEDs (reference/monitors) per module for EMCAL; one per StripModule.
Int_t fSuperModuleNum
which SuperModule is this?
Container of calibration reference values container per SM.
void SetLEDRefHighLow(int iLEDRef, Int_t i)
Float_t GetLEDRefAmpRMS(int iLEDRef) const
virtual AliEMCALSuperModuleCalibReference * GetSuperModuleCalibReferenceId(Int_t smIndex) const
Float_t GetTemperatureRMS(int itemp) const
Int_t fHighLow
0 (low) or 1 (high) gain, used for LEDAmp info
TTree * tree
Int_t GetLEDRefHighLow(int iLEDRef) const
Container of reference calibrations.
TF1 * f
Definition: interpolTest.C:21
static const int fgkEMCALCols
Number of columns per module for EMCAL.
Int_t fNSuperModule
Number of supermodules.
void SetTemperature(int itemp, Float_t f)
static const int fgkEMCALModules
Number of modules, 12 for EMCal + 8 for DCAL.
static const int fgkEMCALTempSensors
Number Temperature sensors per module for EMCAL.
AliEMCALSuperModuleCalibReference(const int smNum=0)
TObjArray fSuperModuleData
SuperModule data.
Float_t GetLEDRefAmp(int iLEDRef) const
Float_t GetTemperature(int itemp) const
void SetTemperatureRMS(int itemp, Float_t f)
AliEMCALCalibReferenceVal * GetAPDVal(int icol, int irow)