During simulation: fill STU region w/ non null time sums
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibPulser.h
CommitLineData
467a4b25 1#ifndef ALITPCCALIBPULSER_H
2#define ALITPCCALIBPULSER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
3cd27a08 6/////////////////////////////////////////////////////////////////////////////////////////
7// //
8// Implementation of the TPC pulser calibration //
9// //
10/////////////////////////////////////////////////////////////////////////////////////////
e47beb2b 11
3cd27a08 12#include <TVectorT.h>
880c3382 13#include "AliTPCCalibRawBase.h"
3fe25c38 14#include <TObjArray.h>
467a4b25 15class TH2S;
ac940b58 16class TH2F;
467a4b25 17class TTreeSRedirector;
18class AliTPCCalPad;
19class AliTPCROC;
20class AliTPCCalROC;
21class AliTPCParam;
22class AliRawReader;
23class AliTPCRawStream;
ac940b58 24class TMap;
04049c81 25
467a4b25 26struct eventHeaderStruct;
27
880c3382 28class AliTPCCalibPulser : public AliTPCCalibRawBase {
467a4b25 29
30public:
880c3382 31 AliTPCCalibPulser();
32 AliTPCCalibPulser(const AliTPCCalibPulser &sig);
33 AliTPCCalibPulser(const TMap *config);
34 virtual ~AliTPCCalibPulser();
35
36 void Reset();
37
38 AliTPCCalibPulser& operator = (const AliTPCCalibPulser &source);
39
40
41 virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
42 const Int_t iTimeBin, const Float_t signal);
43 virtual void Analyse();
04049c81 44 //
880c3382 45 AliTPCCalROC* GetCalRocT0 (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
46 AliTPCCalROC* GetCalRocQ (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
47 AliTPCCalROC* GetCalRocRMS(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
48 AliTPCCalROC* GetCalRocOutliers(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
49
50 const TObjArray* GetCalPadT0() const { return &fCalRocArrayT0; } // get calibration object
51 const TObjArray* GetCalPadQ() const { return &fCalRocArrayQ; } // get calibration object
52 const TObjArray* GetCalPadRMS() const{ return &fCalRocArrayRMS;} // get calibration object
53 const TObjArray* GetCalPadOutliers() const { return &fCalRocArrayOutliers;} // get calibration object
54
55 TH2S* GetHistoQ (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
56 TH2S* GetHistoT0 (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
57 TH2S* GetHistoRMS(Int_t sector, Bool_t force=kFALSE); // get refernce histogram
58
59 TH2F* GetHistoTSec(); // mean abs time distribution histogram
60
61 Float_t GetMeanTimeSector(Int_t sector) const {return fVMeanTimeSector[sector];}
62 const TVectorF* GetMeanTimeSectorArray() const {return &fVMeanTimeSector;}
63
64 Short_t GetDebugLevel() const { return fDebugLevel; }
467a4b25 65 //
880c3382 66 void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the pulser signal is expected
467a4b25 67 //
880c3382 68 void SetRangeRefQ (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsQ = nBins; fXminQ = xMin; fXmaxQ = xMax; } //Set range for Q reference histograms
69 void SetRangeRefT0 (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsT0 = nBins; fXminT0 = xMin; fXmaxT0 = xMax; } //Set range for T0 reference histograms
70 void SetRangeRefRMS(Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsRMS = nBins; fXminRMS = xMin; fXmaxRMS = xMax; } //Set range for T0 reference histograms
71 void SetRangePeakIntegral(Int_t minus, Int_t plus) { fPeakIntMinus=minus; fPeakIntPlus=plus;}
72
73 void SetDebugLevel(Short_t debug=1){ fDebugLevel = debug;}
74
75 void SetIsZeroSuppressed(Bool_t zs=kTRUE){ fIsZeroSuppressed=zs;}
76
7442bceb 77 void SetPedestalDatabase(AliTPCCalPad * const pedestalTPC, AliTPCCalPad * const padNoiseTPC) {fPedestalTPC = pedestalTPC; fPadNoiseTPC = padNoiseTPC;}
78 void SetOutliers(AliTPCCalPad * const outliers) {fOutliers = outliers;}
880c3382 79
80 Bool_t GetIsZeroSupperssed() const { return fIsZeroSuppressed; }
81
82 Float_t GetPeakIntegralMinus() const {return fPeakIntMinus;}
83 Float_t GetPeakIntegralPlus() const {return fPeakIntPlus;}
84
7442bceb 85 void Merge(AliTPCCalibPulser * const sig);
86 virtual Long64_t Merge(TCollection * const list);
87
880c3382 88 //
89 // Test functions
90 TObjArray* TestBinning();
91
7442bceb 92protected:
93 virtual void ResetEvent();
94 virtual void EndEvent();
95
467a4b25 96private:
467a4b25 97 // reference histogram ranges
880c3382 98 Int_t fNbinsT0; // Number of bins for T0 reference histogram
99 Float_t fXminT0; // xmin of T0 reference histogram
100 Float_t fXmaxT0; // xmax of T0 reference histogram
101 Int_t fNbinsQ; // Number of bins for T0 reference histogram
102 Float_t fXminQ; // xmin of T0 reference histogram
103 Float_t fXmaxQ; // xmax of T0 reference histogram
104 Int_t fNbinsRMS; // Number of bins for T0 reference histogram
105 Float_t fXminRMS; // xmin of T0 reference histogram
106 Float_t fXmaxRMS; // xmax of T0 reference histogram
107 Int_t fPeakIntMinus; // Peak integral range for COG determination. Bins used before max bin
108 Int_t fPeakIntPlus; // Peak integral range for COG determination. Bins used after max bin
109
110 Bool_t fIsZeroSuppressed; // if data is zero suppressed
111
112 Int_t fLastSector; //! Last sector processed
113
114 AliTPCParam *fParam; //! TPC information
115
116 AliTPCCalPad *fPedestalTPC; //! Pedestal Information
117 AliTPCCalPad *fPadNoiseTPC; //! Pad noise Information whole TPC
118 AliTPCCalPad *fOutliers; //! Outlier information. Those will not be used for calculating the T0
119 AliTPCCalROC *fPedestalROC; //! Pedestal Information for current ROC
120 AliTPCCalROC *fPadNoiseROC; //! Pad noise Information for current ROC
121
122 TObjArray fCalRocArrayT0; // Array of AliTPCCalROC class for Time0 calibration
123 TObjArray fCalRocArrayQ; // Array of AliTPCCalROC class for Charge calibration
124 TObjArray fCalRocArrayRMS; // Array of AliTPCCalROC class for signal width calibration
125 TObjArray fCalRocArrayOutliers; // Array of AliTPCCalROC class for signal outliers
126
127 TObjArray fHistoQArray; // Calibration histograms for Charge distribution
128 TObjArray fHistoT0Array; // Calibration histograms for Time0 distribution
129 TObjArray fHistoRMSArray; // Calibration histograms for signal width distribution
130
131 TH2F *fHMeanTimeSector; // Timing distribution per sector
132 TVectorF fVMeanTimeSector; // Mean time per sector from analysis of fHMeanTimeSector
133
134 TObjArray fPadTimesArrayEvent; //! Pad Times for the event, before mean Time0 corrections
135 TObjArray fPadQArrayEvent; //! Charge for the event, only needed for debugging streamer
136 TObjArray fPadRMSArrayEvent; //! Signal width for the event, only needed for debugging streamer
137 TObjArray fPadPedestalArrayEvent; //! Signal width for the event, only needed for debugging streamer
138
139 Int_t fCurrentChannel; //! current channel processed
140 Int_t fCurrentSector; //! current sector processed
141 Int_t fCurrentRow; //! current row processed
142 Int_t fCurrentPad; //! current pad processed
143 Float_t fMaxPadSignal; //! maximum bin of current pad
144 Int_t fMaxTimeBin; //! time bin with maximum value
145 TVectorF fPadSignal; //! signal of current Pad
146 Float_t fPadPedestal; //! Pedestal Value of current pad
147 Float_t fPadNoise; //! Noise Value of current pad
148
149 TVectorF fVTime0Offset; //! Time0 Offset from preprocessing for each sector;
150 TVectorF fVTime0OffsetCounter; //! Time0 Offset from preprocessing for each sector;
151
152
153 void FindPedestal(Float_t part=.6);
154 void FindPulserSignal(TVectorD &param, Float_t &qSum);
155
156 TH2S* GetHisto(Int_t sector, TObjArray *arr,
157 Int_t nbinsY, Float_t ymin, Float_t ymax,
158 const Char_t *type, Bool_t force);
159
160
161 AliTPCCalROC* GetCalRoc(Int_t sector, TObjArray* arr, Bool_t force) const;
162
163 TVectorF* GetPadTimesEvent(Int_t sector, Bool_t force=kFALSE);
164
165 Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad);
166
880c3382 167 void ResetPad();
168 void ProcessPad();
169
170
171 //debug
172 TVectorF* GetPadInfoEvent(Int_t sector, TObjArray *arr, Bool_t force=kFALSE);
173 TVectorF* GetPadQEvent(Int_t sector, Bool_t force=kFALSE);
174 TVectorF* GetPadRMSEvent(Int_t sector, Bool_t force=kFALSE);
175 TVectorF* GetPadPedestalEvent(Int_t sector, Bool_t force=kFALSE);
c3066940 176
880c3382 177
178 ClassDef(AliTPCCalibPulser,5) //Implementation of the TPC pulser calibration
467a4b25 179};
180
181
182
183#endif
184