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