]>
Commit | Line | Data |
---|---|---|
a6edf90e | 1 | #ifndef ALIPHOSCALIBRATOR_H |
2 | #define ALIPHOSCALIBRATOR_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | ||
7 | //_________________________________________________________________________ | |
8 | // Class for performing calibration in PHOS | |
9 | // | |
10 | //*-- Author: D.Peressounko (RRC KI & SUBATECH) | |
11 | ||
12 | ||
13 | // --- ROOT system --- | |
14 | #include "TTask.h" | |
15 | #include "TObjArray.h" | |
55fe9d13 | 16 | #include "TH1F.h" |
a6edf90e | 17 | |
18 | // --- Standard library --- | |
19 | ||
20 | // --- AliRoot header files --- | |
21 | class AliPHOSConTableDB ; | |
22 | class AliPHOSDigit ; | |
23 | ||
24 | class AliPHOSCalibrator: public TTask{ | |
25 | ||
26 | public: | |
27 | AliPHOSCalibrator() ; // ctor | |
88cb7938 | 28 | AliPHOSCalibrator(const char* run, const char * title = "Default") ; |
a8c47ab6 | 29 | AliPHOSCalibrator(const AliPHOSCalibrator & ctor) : TTask(ctor) { |
cd228525 | 30 | // cpy ctor: no implementation yet |
31 | // requested by the Coding Convention | |
32 | Fatal("cpy ctor", "not implemented") ; | |
33 | } | |
34 | ||
a6edf90e | 35 | virtual ~AliPHOSCalibrator() ; // dtor |
36 | ||
37 | void AddRun(const char * filename) ; //Add one more file to handle | |
38 | ||
39 | virtual void Exec(Option_t * option) ; //Steering method | |
40 | ||
41 | void ScanPedestals(Option_t * option = "append") ; | |
42 | void CalculatePedestals(void) ; //calulates pedestals | |
43 | void ScanGains(Option_t * opt = "append") ; //calculates gains | |
44 | void CalculateGains(void) ; //calculates gains | |
45 | ||
46 | void PlotPedestal(Int_t channel) ; //plots distribution of pedestals for given channel | |
47 | void PlotPedestals(void) ; | |
48 | void PlotGain(Int_t channel) ; //Plot histo with gains for a channel | |
49 | void PlotGains() ; //Plot all gains | |
50 | ||
e957fea8 | 51 | virtual void Print() const ; |
a6edf90e | 52 | |
53 | TH1F * PedestalHisto(Int_t channel) | |
54 | {return dynamic_cast<TH1F* >(fPedHistos->At(channel)) ;} ; | |
55 | TH1F * GainHisto(Int_t channel) | |
56 | {return dynamic_cast<TH1F* >(fGainHistos->At(channel)) ;} ; | |
57 | ||
58 | ||
59 | TH1F * Pedestals(void){return fhPedestals ;} | |
60 | TH1F * Gains(void){return fhGains ;} | |
61 | ||
9b471956 | 62 | //Clean resulting histograms |
63 | void Reset(void){if(fhPedestals)fhPedestals->Reset("ICE"); | |
64 | if(fhGains)fhGains->Reset("ICE");} | |
65 | ||
66 | //Set energy of beam used to calibrate | |
67 | void SetBeamEnergy(Float_t e){fBeamEnergy = e;} | |
a6edf90e | 68 | |
69 | void SetConTableDB(const char * filename, const char * title = "Default") ; | |
70 | //Connection table to convert RawId to AbsId | |
71 | ||
72 | void SetNChan(UShort_t nch = 100) | |
73 | {fNChan = nch ; } //Sets number of channels in pedestal histos | |
74 | ||
75 | void SetNGainBins(Int_t nbin = 100) | |
76 | {fNGainBins = nbin ;} //Set number of bins in gain histograms | |
77 | ||
78 | void SetGainMax(Float_t hmax = 0.01) | |
79 | {fGainMax = hmax ;} //Set range of gain histograms | |
80 | ||
9b471956 | 81 | void ReadFromASCII(const char * filename) ; //Read gains and pedestals from ascii file |
82 | ||
83 | void WritePedestals(const char * version="v1") ; | |
a6edf90e | 84 | |
9b471956 | 85 | void ReadPedestals(const char * version="v1") ; |
a6edf90e | 86 | |
9b471956 | 87 | void WriteGains(const char * version="v1") ; |
a6edf90e | 88 | |
9b471956 | 89 | void ReadGains(const char * version="v1") ; |
a6edf90e | 90 | |
8c140292 | 91 | AliPHOSCalibrator & operator = (const AliPHOSCalibrator & /*rvalue*/){ |
cd228525 | 92 | Fatal("operator =","assigment operator is not implemented") ; |
93 | return *this ; | |
94 | } | |
95 | ||
a6edf90e | 96 | |
97 | ||
98 | private: | |
99 | void Init() ; | |
100 | ||
101 | private: | |
102 | TList * fRunList ; //list of runs to be handled | |
103 | TObjArray * fPedHistos ; //Resulting histograms of pedestals | |
104 | TObjArray * fGainHistos; //Results of Calibration | |
105 | ||
106 | TH1F * fhPedestals ; //Mean values of pedestals for different channels | |
107 | TH1F * fhPedestalsWid ; //Widths of pedestal distributions for different channels | |
108 | TH1F * fhGains ; //Final Gains from fitting procedure | |
109 | TH1F * fhGainsWid ; //Width of final gains from fit | |
110 | ||
111 | AliPHOSConTableDB * fctdb ; //!Connection map | |
112 | TString fConTableDB ; //Name of ConTableDB | |
113 | TString fConTableDBFile ; //File where ConTableDB is stored | |
114 | ||
9b471956 | 115 | Float_t fBeamEnergy ; //Calibration beam energy |
a6edf90e | 116 | Float_t fGainAcceptCorr; //Maximal deviation from mean Gain (factor) |
117 | Float_t fAcceptCorr ; //Maximal deviation of Pedestal from mean for good channel | |
118 | ||
119 | Float_t fGainMax ; //Range used in Gain histos | |
120 | Int_t fNGainBins ; //Number of bins in Gain histos | |
121 | ||
122 | Int_t fNch ; //Number of channels to calibrate | |
123 | UShort_t fNChan ; //Number of bins in pedestal histos | |
124 | ||
a6edf90e | 125 | ClassDef(AliPHOSCalibrator,1) // description |
126 | ||
127 | }; | |
128 | ||
129 | #endif // AliPHOSCALIBRATOR_H |