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 */
8 /* History of cvs commits:
14 //_________________________________________________________________________
15 // Class for performing calibration in PHOS
17 //*-- Author: D.Peressounko (RRC KI & SUBATECH)
20 // --- ROOT system ---
22 #include "TObjArray.h"
25 // --- Standard library ---
27 // --- AliRoot header files ---
28 class AliPHOSConTableDB ;
31 class AliPHOSCalibrator: public TTask{
34 AliPHOSCalibrator() ; // ctor
35 AliPHOSCalibrator(const char* run, const char * title = "Default") ;
36 AliPHOSCalibrator(const AliPHOSCalibrator & ctor) : TTask(ctor) {
37 // cpy ctor: no implementation yet
38 // requested by the Coding Convention
39 Fatal("cpy ctor", "not implemented") ;
42 virtual ~AliPHOSCalibrator() ; // dtor
44 void AddRun(const char * filename) ; //Add one more file to handle
46 virtual void Exec(Option_t * option) ; //Steering method
48 void ScanPedestals(Option_t * option = "append") ;
49 void CalculatePedestals(void) ; //calulates pedestals
50 void ScanGains(Option_t * opt = "append") ; //calculates gains
51 void CalculateGains(void) ; //calculates gains
53 void PlotPedestal(Int_t channel) ; //plots distribution of pedestals for given channel
54 void PlotPedestals(void) ;
55 void PlotGain(Int_t channel) ; //Plot histo with gains for a channel
56 void PlotGains() ; //Plot all gains
58 virtual void Print(const Option_t * = "") const ;
60 TH1F * PedestalHisto(Int_t channel)
61 {return dynamic_cast<TH1F* >(fPedHistos->At(channel)) ;} ;
62 TH1F * GainHisto(Int_t channel)
63 {return dynamic_cast<TH1F* >(fGainHistos->At(channel)) ;} ;
66 TH1F * Pedestals(void){return fhPedestals ;}
67 TH1F * Gains(void){return fhGains ;}
69 //Clean resulting histograms
70 void Reset(void){if(fhPedestals)fhPedestals->Reset("ICE");
71 if(fhGains)fhGains->Reset("ICE");}
73 //Set energy of beam used to calibrate
74 void SetBeamEnergy(Float_t e){fBeamEnergy = e;}
76 void SetConTableDB(const char * filename, const char * title = "Default") ;
77 //Connection table to convert RawId to AbsId
79 void SetNChan(UShort_t nch = 100)
80 {fNChan = nch ; } //Sets number of channels in pedestal histos
82 void SetNGainBins(Int_t nbin = 100)
83 {fNGainBins = nbin ;} //Set number of bins in gain histograms
85 void SetGainMax(Float_t hmax = 0.01)
86 {fGainMax = hmax ;} //Set range of gain histograms
88 void ReadFromASCII(const char * filename) ; //Read gains and pedestals from ascii file
90 void WritePedestals(const char * version="v1") ;
92 void ReadPedestals(const char * version="v1") ;
94 void WriteGains(const char * version="v1") ;
96 void ReadGains(const char * version="v1") ;
98 AliPHOSCalibrator & operator = (const AliPHOSCalibrator & /*rvalue*/){
99 Fatal("operator =","assigment operator is not implemented") ;
109 TList * fRunList ; //list of runs to be handled
110 TObjArray * fPedHistos ; //Resulting histograms of pedestals
111 TObjArray * fGainHistos; //Results of Calibration
113 TH1F * fhPedestals ; //Mean values of pedestals for different channels
114 TH1F * fhPedestalsWid ; //Widths of pedestal distributions for different channels
115 TH1F * fhGains ; //Final Gains from fitting procedure
116 TH1F * fhGainsWid ; //Width of final gains from fit
118 AliPHOSConTableDB * fctdb ; //!Connection map
119 TString fConTableDB ; //Name of ConTableDB
120 TString fConTableDBFile ; //File where ConTableDB is stored
122 Float_t fBeamEnergy ; //Calibration beam energy
123 Float_t fGainAcceptCorr; //Maximal deviation from mean Gain (factor)
124 Float_t fAcceptCorr ; //Maximal deviation of Pedestal from mean for good channel
126 Float_t fGainMax ; //Range used in Gain histos
127 Int_t fNGainBins ; //Number of bins in Gain histos
129 Int_t fNch ; //Number of channels to calibrate
130 UShort_t fNChan ; //Number of bins in pedestal histos
132 ClassDef(AliPHOSCalibrator,1) // description
136 #endif // AliPHOSCALIBRATOR_H