]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSCalibrator.h
Removing warnings on gcc 4.3
[u/mrichter/AliRoot.git] / PHOS / AliPHOSCalibrator.h
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 /* $Id$ */
7
8 /* History of cvs commits:
9  *
10  * $Log$
11  * Revision 1.10  2005/05/28 14:19:04  schutz
12  * Compilation warnings fixed by T.P.
13  *
14  */
15
16
17 //_________________________________________________________________________
18 //  Class for performing calibration in PHOS     
19 //                  
20 //*-- Author: D.Peressounko (RRC KI & SUBATECH)
21
22
23 // --- ROOT system ---
24 #include "TTask.h"
25 #include "TObjArray.h"
26 #include "TH1F.h"  
27
28 // --- Standard library ---
29
30 // --- AliRoot header files ---
31 class AliPHOSConTableDB ;
32 class AliPHOSDigit ;
33
34 class AliPHOSCalibrator: public TTask{
35
36 public:
37   AliPHOSCalibrator() ;          // ctor
38   AliPHOSCalibrator(const char* run, const char * title = "Default") ;
39   AliPHOSCalibrator(const AliPHOSCalibrator & ctor);
40  
41   virtual ~AliPHOSCalibrator() ; // dtor
42
43   void AddRun(const char * filename) ; //Add one more file to handle
44
45   virtual void Exec(Option_t * option) ; //Steering method 
46
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
51
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
56
57   virtual void Print(const Option_t * = "") const ;
58
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)) ;} ;
63
64   
65   TH1F * Pedestals(void){return fhPedestals ;}
66   TH1F * Gains(void){return fhGains ;}
67
68   //Clean resulting histograms
69   void Reset(void){if(fhPedestals)fhPedestals->Reset("ICE");
70                    if(fhGains)fhGains->Reset("ICE");}
71
72   //Set energy of beam used to calibrate
73   void SetBeamEnergy(Float_t e){fBeamEnergy = e;}
74
75   void SetConTableDB(const char * filename, const char * title = "Default") ;
76        //Connection table to convert RawId to AbsId
77
78   void SetNChan(UShort_t nch = 100)
79     {fNChan = nch ; }         //Sets number of channels in pedestal histos
80
81   void SetNGainBins(Int_t nbin = 100)
82     {fNGainBins = nbin ;}  //Set number of bins in gain histograms
83
84   void SetGainMax(Float_t hmax = 0.01)
85     {fGainMax = hmax ;}    //Set range of gain histograms
86
87   void ReadFromASCII(const char * filename) ; //Read gains and pedestals from ascii file
88
89   void WritePedestals(const char * version="v1") ;
90
91   void ReadPedestals(const char * version="v1") ;
92                       
93   void WriteGains(const char * version="v1") ;
94
95   void ReadGains(const char * version="v1") ;
96
97   AliPHOSCalibrator & operator = (const AliPHOSCalibrator & /*rvalue*/){
98     Fatal("operator =","assigment operator is not implemented") ;
99     return *this ;
100  }
101
102
103
104 private:
105   void Init() ;
106  
107 private:
108   TList  * fRunList ;          //list of runs to be handled
109   TObjArray * fPedHistos ;     //Resulting histograms of pedestals
110   TObjArray * fGainHistos;     //Results of Calibration 
111
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
116
117   AliPHOSConTableDB * fctdb ; //!Connection map
118   TString  fConTableDB ;      //Name of ConTableDB
119   TString  fConTableDBFile ;  //File where ConTableDB is stored
120
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
124
125   Float_t  fGainMax ;         //Range used in Gain histos
126   Int_t    fNGainBins ;       //Number of bins in Gain histos
127
128   Int_t    fNch ;             //Number of channels to calibrate
129   UShort_t fNChan ;           //Number of bins in pedestal histos
130
131   ClassDef(AliPHOSCalibrator,1)  // description 
132
133 };
134
135 #endif // AliPHOSCALIBRATOR_H