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