]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALCalibTimeDep.h
new non linearity correction from beam test
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibTimeDep.h
1 #ifndef ALIEMCALCALIBTIMEDEP_H
2 #define ALIEMCALCALIBTIMEDEP_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: AliEMCALCalibTimeDep.h $ */
8
9 /////////////////////////////////////////////////
10 // class for EMCAL time-dependence calibration //
11 /////////////////////////////////////////////////
12
13 #include "TObject.h"
14
15 class AliEMCALSensorTempArray;
16 class AliCaloCalibSignal;
17 class AliEMCALCalibTempCoeff;
18 class AliEMCALCalibReference; 
19 class AliEMCALCalibTimeDepCorrection; 
20
21 class AliEMCALCalibTimeDep : public TObject {
22
23  public:
24   AliEMCALCalibTimeDep(); //! ctor
25   AliEMCALCalibTimeDep(const AliEMCALCalibTimeDep &calibt); //! copy ctor
26   AliEMCALCalibTimeDep& operator= (const AliEMCALCalibTimeDep &calibt); //! 
27   virtual ~AliEMCALCalibTimeDep(); //! dtor
28   virtual void PrintInfo() const; 
29
30   void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);//!
31
32   // simple getters
33   Int_t GetRunNumber() const { return fRun; } // 
34   UInt_t GetStartTime() const { return fStartTime; } // 
35   UInt_t GetEndTime() const { return fEndTime; } //  
36   Double_t GetLengthOfRunInHours() const; // 
37   Double_t GetLengthOfRunInBins() const; // 
38
39   // Temperature Section
40   // access pointer to the basic temperature object: AliEMCALSensorTempArray 
41   AliEMCALSensorTempArray  * GetTempArray() const { return fTempArray; } // temperature array
42
43   // range of temperature readings/values during the run 
44   Int_t ScanTemperatureInfo(); // go through the temperature info
45   Double_t GetMinTemp() const { return fMinTemp; } //  
46   Double_t GetMaxTemp() const { return fMaxTemp; } // 
47   Double_t GetMinTempVariation() const { return fMinTempVariation; } //  
48   Double_t GetMaxTempVariation() const { return fMaxTempVariation; } // 
49   UInt_t GetMinTime() const { return fMinTime; } // 
50   UInt_t GetMaxTime() const { return fMaxTime; } // 
51   Double_t GetRangeOfTempMeasureInHours() const; //! 
52   Double_t GetRangeOfTempMeasureInDegrees() const; //! 
53
54   // basic calibration info
55   Double_t GetTemperatureSM(int imod, UInt_t timeStamp) const; // for all sensors, in a SuperModule
56   // End of Temperature Section
57
58   // control parameters
59   void SetTemperatureResolution(Double_t d) { fTemperatureResolution = d; } // value for checking at which level we care about temperature differences
60   void SetMaxTemperatureDiff(Double_t d) { fMaxTemperatureDiff = d; } 
61   void SetTimeBinsPerHour(Int_t i) { fTimeBinsPerHour = i; } // size of the time-bins we use for corrections
62   Double_t GetTemperatureResolution() const { return fTemperatureResolution; } // value for checking at which level we care about temperature differences
63   Double_t GetMaxTemperatureDiff() const { return fMaxTemperatureDiff; }
64   Int_t GetTimeBinsPerHour() const { return fTimeBinsPerHour; } // size of the time-bins we use foc corrections
65
66   void SetHighLowGainFactor(Double_t value) {fHighLowGainFactor = value;}
67   Double_t GetHighLowGainFactor() const {return fHighLowGainFactor;}
68
69   // access to other pointers
70   AliCaloCalibSignal  * GetCalibSignal() const { return fCalibSignal; } //
71   AliEMCALCalibTempCoeff  * GetCalibTempCoeff() const { return fCalibTempCoeff; } //
72   AliEMCALCalibReference  * GetCalibReference() const { return fCalibReference; } //
73
74   // storage and access of the correction info
75   Int_t CalcCorrection(); //
76   AliEMCALCalibTimeDepCorrection  * GetCalibTimeDepCorrection() 
77     const { return fCalibTimeDepCorrection; } //
78
79   Double_t GetTempCoeff(Double_t IDark, Double_t M) const; //
80
81   // for local debugging: setters of the main input pointers that are normally from OCDB
82   void SetTempArray(AliEMCALSensorTempArray  *arr) { fTempArray = arr; } // 
83   void SetCalibSignal(AliCaloCalibSignal  *obj) { fCalibSignal = obj; } // 
84   void SetCalibTempCoeff(AliEMCALCalibTempCoeff  *obj) { fCalibTempCoeff = obj; } //
85   void SetCalibReference(AliEMCALCalibReference  *obj) { fCalibReference = obj; } //
86   // basic setters, also for local debugging
87   void SetRunNumber(Int_t i) { fRun= i; } // 
88   void SetStartTime(UInt_t ui) { fStartTime = ui; } // 
89   void SetEndTime(UInt_t ui) { fEndTime = ui; } //  
90
91   Int_t GetVerbosity() const { return fVerbosity; } // debug flag 
92   void SetVerbosity(Int_t i) { fVerbosity= i; } // debug flag 
93
94  private:
95
96   void Reset(); //
97
98   void GetTemperatureInfo(); // pick up Preprocessor output
99   void GetCalibSignalInfo(); // pick up Preprocessor output
100   void GetCalibTempCoeffInfo(); // pick up OCDB info
101   void GetCalibReferenceInfo(); // pick up OCDB info
102
103   Int_t CalcLEDCorrection(Int_t nSM, Int_t nBins); // based on LED signals, and reference photodiodes
104   Int_t CalcLEDCorrectionStripBasis(Int_t nSM, Int_t nBins); // based on LED signals, and reference photodiodes
105   Int_t CalcTemperatureCorrection(Int_t nSM, Int_t nBins, Int_t binSize); // based on temperature info
106
107   //
108   Int_t fRun; // run number
109   UInt_t fStartTime; // start timestamp
110   UInt_t fEndTime; // end timestamp
111   // temperature stuff
112   Double_t fMinTemp; // min temp
113   Double_t fMaxTemp; // max temp
114   Double_t fMinTempVariation; // min temp variation, within a sensor
115   Double_t fMaxTempVariation; // max temp variation, within a sensor
116   UInt_t fMinTime; // min time
117   UInt_t fMaxTime; // max time
118   //
119   Double_t fTemperatureResolution; // value for checking at which level we care about temperature differences
120   Double_t fMaxTemperatureDiff; // value for checking that temperature sensor info seems reasonable 
121   Int_t fTimeBinsPerHour; // size of the time-bins we use for corrections
122
123   Double_t fHighLowGainFactor;     //gain factor to convert between high and low gain
124   
125   // pointers to the different used classes
126   AliEMCALSensorTempArray  *fTempArray;     // CDB class for temperature sensors
127   AliCaloCalibSignal *fCalibSignal; // LED signal info
128   AliEMCALCalibTempCoeff *fCalibTempCoeff; // Temperature Coefficient info
129   AliEMCALCalibReference *fCalibReference; // reference info
130   AliEMCALCalibTimeDepCorrection *fCalibTimeDepCorrection; // correction values
131
132   Int_t fVerbosity; // debug flag
133
134   //
135   ClassDef(AliEMCALCalibTimeDep,4)    // EMCAL time-dep Calibration data
136 };
137
138 #endif