]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSCalibrator.h
Geometry corrected for an overlap
[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
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"
16class TH1F ;
17
18// --- Standard library ---
19
20// --- AliRoot header files ---
21class AliPHOSConTableDB ;
22class AliPHOSDigit ;
23
24class AliPHOSCalibrator: public TTask{
25
26public:
27 AliPHOSCalibrator() ; // ctor
28 AliPHOSCalibrator(const char* run, const char * title = "Default",Bool_t toSplit = kTRUE) ;
29 virtual ~AliPHOSCalibrator() ; // dtor
30
31 void AddRun(const char * filename) ; //Add one more file to handle
32
33 virtual void Exec(Option_t * option) ; //Steering method
34
35 void ScanPedestals(Option_t * option = "append") ;
36 void CalculatePedestals(void) ; //calulates pedestals
37 void ScanGains(Option_t * opt = "append") ; //calculates gains
38 void CalculateGains(void) ; //calculates gains
39
40 void PlotPedestal(Int_t channel) ; //plots distribution of pedestals for given channel
41 void PlotPedestals(void) ;
42 void PlotGain(Int_t channel) ; //Plot histo with gains for a channel
43 void PlotGains() ; //Plot all gains
44
45 void Print(const Option_t * option) const ;
46
47 TH1F * PedestalHisto(Int_t channel)
48 {return dynamic_cast<TH1F* >(fPedHistos->At(channel)) ;} ;
49 TH1F * GainHisto(Int_t channel)
50 {return dynamic_cast<TH1F* >(fGainHistos->At(channel)) ;} ;
51
52
53 TH1F * Pedestals(void){return fhPedestals ;}
54 TH1F * Gains(void){return fhGains ;}
55
56 void SetPedestalPattern(UShort_t pattern = 257)
57 {fPedPat = pattern ;} ; //Sets trigger pattern for PEDESTAL events
58 void SetPulserPattern(UShort_t pattern = 33)
59 {fPulPat = pattern ;} ; //Sets trigger pattern for PULSER events
60 void SetLEDPattern(UShort_t pattern = 129)
61 {fLEDPat = pattern ;} ; //Sets trigger pattern for LED events
62 void SetWideBeamPattern(UShort_t pattern = 1027)
63 {fWBPat = pattern ;} ; //Sets trigger pattern for WIDE BEAM events
64 void SetNarrowBeamPattern(UShort_t pattern = 1029)
65 {fNBPat = pattern ;} ; //Sets trigger pattern for NARROW BEAM events
66
67 void SetConTableDB(const char * filename, const char * title = "Default") ;
68 //Connection table to convert RawId to AbsId
69
70 void SetNChan(UShort_t nch = 100)
71 {fNChan = nch ; } //Sets number of channels in pedestal histos
72
73 void SetNGainBins(Int_t nbin = 100)
74 {fNGainBins = nbin ;} //Set number of bins in gain histograms
75
76 void SetGainMax(Float_t hmax = 0.01)
77 {fGainMax = hmax ;} //Set range of gain histograms
78
79 void WritePedestals(const char * version="v1",
80 Int_t begValidRange = 0,
81 Int_t endValidRange = 0) ;
82
83 void ReadPedestals(const char * version="v1",
84 Int_t ValidRange = 0) ;
85
86 void WriteGains(const char * version="v1",
87 Int_t begValidRange = 0,
88 Int_t endValidRange = 0) ;
89
90 void ReadGains(const char * version="v1",
91 Int_t ValidRange = 0) ;
92
93
94
95private:
96 void Init() ;
97
98private:
99 TList * fRunList ; //list of runs to be handled
100 TObjArray * fPedHistos ; //Resulting histograms of pedestals
101 TObjArray * fGainHistos; //Results of Calibration
102
103 TH1F * fhPedestals ; //Mean values of pedestals for different channels
104 TH1F * fhPedestalsWid ; //Widths of pedestal distributions for different channels
105 TH1F * fhGains ; //Final Gains from fitting procedure
106 TH1F * fhGainsWid ; //Width of final gains from fit
107
108 AliPHOSConTableDB * fctdb ; //!Connection map
109 TString fConTableDB ; //Name of ConTableDB
110 TString fConTableDBFile ; //File where ConTableDB is stored
111
112 Float_t fGainAcceptCorr; //Maximal deviation from mean Gain (factor)
113 Float_t fAcceptCorr ; //Maximal deviation of Pedestal from mean for good channel
114
115 Float_t fGainMax ; //Range used in Gain histos
116 Int_t fNGainBins ; //Number of bins in Gain histos
117
118 Int_t fNch ; //Number of channels to calibrate
119 UShort_t fNChan ; //Number of bins in pedestal histos
120
121 UShort_t fPedPat ; //trigger pattern for PEDESTAL events
122 UShort_t fPulPat ; //trigger pattern for PULSER events
123 UShort_t fLEDPat ; //trigger pattern for LED events
124 UShort_t fWBPat ; //trigger pattern for WIDE BEAM events
125 UShort_t fNBPat ; //trigger pattern for NARROW BEAM events
126 Bool_t fToSplit ; //To split digits from header
127
128 ClassDef(AliPHOSCalibrator,1) // description
129
130};
131
132#endif // AliPHOSCALIBRATOR_H