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