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:
11 * Revision 1.10 2005/05/28 14:19:04 schutz
12 * Compilation warnings fixed by T.P.
17 //_________________________________________________________________________
18 // Class for performing calibration in PHOS
20 //*-- Author: D.Peressounko (RRC KI & SUBATECH)
23 // --- ROOT system ---
25 #include "TObjArray.h"
28 // --- Standard library ---
30 // --- AliRoot header files ---
31 class AliPHOSConTableDB ;
34 class AliPHOSCalibrator: public TTask{
37 AliPHOSCalibrator() ; // ctor
38 AliPHOSCalibrator(const char* run, const char * title = "Default") ;
39 AliPHOSCalibrator(const AliPHOSCalibrator & ctor);
41 virtual ~AliPHOSCalibrator() ; // dtor
43 void AddRun(const char * filename) ; //Add one more file to handle
45 virtual void Exec(Option_t * option) ; //Steering method
47 void ScanPedestals(Option_t * option = "append") ;
48 void CalculatePedestals(void) ; //calulates pedestals
49 void ScanGains(Option_t * opt = "append") ; //calculates gains
50 void CalculateGains(void) ; //calculates gains
52 void PlotPedestal(Int_t channel) ; //plots distribution of pedestals for given channel
53 void PlotPedestals(void) ;
54 void PlotGain(Int_t channel) ; //Plot histo with gains for a channel
55 void PlotGains() ; //Plot all gains
57 virtual void Print(const Option_t * = "") const ;
59 TH1F * PedestalHisto(Int_t channel)
60 {return dynamic_cast<TH1F* >(fPedHistos->At(channel)) ;} ;
61 TH1F * GainHisto(Int_t channel)
62 {return dynamic_cast<TH1F* >(fGainHistos->At(channel)) ;} ;
65 TH1F * Pedestals(void){return fhPedestals ;}
66 TH1F * Gains(void){return fhGains ;}
68 //Clean resulting histograms
69 void Reset(void){if(fhPedestals)fhPedestals->Reset("ICE");
70 if(fhGains)fhGains->Reset("ICE");}
72 //Set energy of beam used to calibrate
73 void SetBeamEnergy(Float_t e){fBeamEnergy = e;}
75 void SetConTableDB(const char * filename, const char * title = "Default") ;
76 //Connection table to convert RawId to AbsId
78 void SetNChan(UShort_t nch = 100)
79 {fNChan = nch ; } //Sets number of channels in pedestal histos
81 void SetNGainBins(Int_t nbin = 100)
82 {fNGainBins = nbin ;} //Set number of bins in gain histograms
84 void SetGainMax(Float_t hmax = 0.01)
85 {fGainMax = hmax ;} //Set range of gain histograms
87 void ReadFromASCII(const char * filename) ; //Read gains and pedestals from ascii file
89 void WritePedestals(const char * version="v1") ;
91 void ReadPedestals(const char * version="v1") ;
93 void WriteGains(const char * version="v1") ;
95 void ReadGains(const char * version="v1") ;
97 AliPHOSCalibrator & operator = (const AliPHOSCalibrator & /*rvalue*/){
98 Fatal("operator =","assigment operator is not implemented") ;
108 TList * fRunList ; //list of runs to be handled
109 TObjArray * fPedHistos ; //Resulting histograms of pedestals
110 TObjArray * fGainHistos; //Results of Calibration
112 TH1F * fhPedestals ; //Mean values of pedestals for different channels
113 TH1F * fhPedestalsWid ; //Widths of pedestal distributions for different channels
114 TH1F * fhGains ; //Final Gains from fitting procedure
115 TH1F * fhGainsWid ; //Width of final gains from fit
117 AliPHOSConTableDB * fctdb ; //!Connection map
118 TString fConTableDB ; //Name of ConTableDB
119 TString fConTableDBFile ; //File where ConTableDB is stored
121 Float_t fBeamEnergy ; //Calibration beam energy
122 Float_t fGainAcceptCorr; //Maximal deviation from mean Gain (factor)
123 Float_t fAcceptCorr ; //Maximal deviation of Pedestal from mean for good channel
125 Float_t fGainMax ; //Range used in Gain histos
126 Int_t fNGainBins ; //Number of bins in Gain histos
128 Int_t fNch ; //Number of channels to calibrate
129 UShort_t fNChan ; //Number of bins in pedestal histos
131 ClassDef(AliPHOSCalibrator,1) // description
135 #endif // AliPHOSCALIBRATOR_H