attempt to address new coverity reports for AliCalo stuff and QA checker
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibTimeDep.h
CommitLineData
a42992b7 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
15class AliEMCALSensorTempArray;
d81e6423 16class AliCaloCalibSignal;
ed3db319 17class AliEMCALCalibTempCoeff;
82d90a2f 18class AliEMCALCalibReference;
d81e6423 19class AliEMCALCalibTimeDepCorrection;
a42992b7 20
21class 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
621ff010 28 virtual void PrintInfo() const;
a42992b7 29
30 void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);//!
31
d81e6423 32 // simple getters
716fca62 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; //
d81e6423 38
39 // Temperature Section
a42992b7 40 // access pointer to the basic temperature object: AliEMCALSensorTempArray
0ce5c45d 41 AliEMCALSensorTempArray * GetTempArray() const { return fTempArray; } // temperature array
a42992b7 42
a42992b7 43 // range of temperature readings/values during the run
d81e6423 44 Int_t ScanTemperatureInfo(); // go through the temperature info
716fca62 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; } //
0ce5c45d 51 Double_t GetRangeOfTempMeasureInHours() const; //!
52 Double_t GetRangeOfTempMeasureInDegrees() const; //!
a42992b7 53
54 // basic calibration info
d81e6423 55 Double_t GetTemperatureSM(int imod, UInt_t timeStamp) const; // for all sensors, in a SuperModule
d81e6423 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
ed3db319 60 void SetMaxTemperatureDiff(Double_t d) { fMaxTemperatureDiff = d; }
d81e6423 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
ed3db319 63 Double_t GetMaxTemperatureDiff() const { return fMaxTemperatureDiff; }
d81e6423 64 Int_t GetTimeBinsPerHour() const { return fTimeBinsPerHour; } // size of the time-bins we use foc corrections
65
82d90a2f 66 void SetHighLowGainFactor(Double_t value) {fHighLowGainFactor = value;}
67 Double_t GetHighLowGainFactor() const {return fHighLowGainFactor;}
68
d81e6423 69 // access to other pointers
70 AliCaloCalibSignal * GetCalibSignal() const { return fCalibSignal; } //
ed3db319 71 AliEMCALCalibTempCoeff * GetCalibTempCoeff() const { return fCalibTempCoeff; } //
82d90a2f 72 AliEMCALCalibReference * GetCalibReference() const { return fCalibReference; } //
d81e6423 73
74 // storage and access of the correction info
75 Int_t CalcCorrection(); //
716fca62 76 AliEMCALCalibTimeDepCorrection * GetCalibTimeDepCorrection()
d81e6423 77 const { return fCalibTimeDepCorrection; } //
78
79 Double_t GetTempCoeff(Double_t IDark, Double_t M) const; //
a42992b7 80
716fca62 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; } //
ed3db319 84 void SetCalibTempCoeff(AliEMCALCalibTempCoeff *obj) { fCalibTempCoeff = obj; } //
716fca62 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
a42992b7 94 private:
95
d81e6423 96 void Reset(); //
97
a42992b7 98 void GetTemperatureInfo(); // pick up Preprocessor output
d81e6423 99 void GetCalibSignalInfo(); // pick up Preprocessor output
ed3db319 100 void GetCalibTempCoeffInfo(); // pick up OCDB info
82d90a2f 101 void GetCalibReferenceInfo(); // pick up OCDB info
d81e6423 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
716fca62 105 Int_t CalcTemperatureCorrection(Int_t nSM, Int_t nBins, Int_t binSize); // based on temperature info
d81e6423 106
a42992b7 107 //
0ce5c45d 108 Int_t fRun; // run number
109 UInt_t fStartTime; // start timestamp
110 UInt_t fEndTime; // end timestamp
d81e6423 111 // temperature stuff
0ce5c45d 112 Double_t fMinTemp; // min temp
113 Double_t fMaxTemp; // max temp
716fca62 114 Double_t fMinTempVariation; // min temp variation, within a sensor
115 Double_t fMaxTempVariation; // max temp variation, within a sensor
0ce5c45d 116 UInt_t fMinTime; // min time
117 UInt_t fMaxTime; // max time
a42992b7 118 //
d81e6423 119 Double_t fTemperatureResolution; // value for checking at which level we care about temperature differences
ed3db319 120 Double_t fMaxTemperatureDiff; // value for checking that temperature sensor info seems reasonable
d81e6423 121 Int_t fTimeBinsPerHour; // size of the time-bins we use for corrections
122
82d90a2f 123 Double_t fHighLowGainFactor; //gain factor to convert between high and low gain
124
d81e6423 125 // pointers to the different used classes
a42992b7 126 AliEMCALSensorTempArray *fTempArray; // CDB class for temperature sensors
0ce5c45d 127 AliCaloCalibSignal *fCalibSignal; // LED signal info
ed3db319 128 AliEMCALCalibTempCoeff *fCalibTempCoeff; // Temperature Coefficient info
0ce5c45d 129 AliEMCALCalibReference *fCalibReference; // reference info
130 AliEMCALCalibTimeDepCorrection *fCalibTimeDepCorrection; // correction values
d81e6423 131
716fca62 132 Int_t fVerbosity; // debug flag
133
a42992b7 134 //
ed3db319 135 ClassDef(AliEMCALCalibTimeDep,4) // EMCAL time-dep Calibration data
a42992b7 136};
137
138#endif