]>
Commit | Line | Data |
---|---|---|
75d8233f | 1 | #ifndef ALITPCCALIBCE_H |
2 | #define ALITPCCALIBCE_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 Central Electrode calibration // | |
9 | // // | |
10 | //////////////////////////////////////////////////////////////////////////////////////// | |
11 | ||
75d8233f | 12 | #include <TVectorT.h> |
13 | class TObjArray; | |
14 | class TH1S; | |
15 | class TH2S; | |
16 | class TH1F; | |
17 | class TTreeSRedirector; | |
18 | class AliTPCCalPad; | |
19 | class AliTPCROC; | |
20 | class AliTPCCalROC; | |
21 | class AliTPCParam; | |
22 | class AliRawReader; | |
23 | class AliTPCRawStream; | |
24 | class TGraph; | |
25 | struct eventHeaderStruct; | |
26 | ||
27 | class AliTPCCalibCE : public TObject { | |
28 | ||
29 | public: | |
30 | AliTPCCalibCE(); | |
31 | AliTPCCalibCE(const AliTPCCalibCE &sig); | |
32 | virtual ~AliTPCCalibCE(); | |
33 | ||
34 | AliTPCCalibCE& operator = (const AliTPCCalibCE &source); | |
35 | ||
36 | ||
37 | Bool_t ProcessEvent(AliTPCRawStream *rawStream); | |
38 | Bool_t ProcessEvent(AliRawReader *rawReader); | |
39 | Bool_t ProcessEvent(eventHeaderStruct *event); | |
40 | ||
41 | 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 | void Analyse(); | |
44 | // | |
3cd27a08 | 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 | |
75d8233f | 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 | ||
3cd27a08 | 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 | |
75d8233f | 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 | TH1S* GetHistoTmean(Int_t sector, Bool_t force=kFALSE); // get refernce histogram | |
60 | ||
7fb602b1 | 61 | //needed here to merge ClibCE objects |
62 | TObjArray* GetParamArrayPol1(Int_t sector, Bool_t force=kFALSE); | |
63 | TObjArray* GetParamArrayPol2(Int_t sector, Bool_t force=kFALSE); | |
64 | ||
65 | // TObjArray* GetTMeanArrayEvent(){ return &fTMeanArrayEvent; } | |
66 | // TObjArray* GetQMeanArrayEvent(){ return &fQMeanArrayEvent; } | |
67 | TVectorF* GetTMeanEvents(Int_t sector, Bool_t force=kFALSE); | |
68 | TVectorF* GetQMeanEvents(Int_t sector, Bool_t force=kFALSE); | |
69 | ||
70 | TVectorD* GetEventTimes() { return &fVEventTime; } | |
71 | TVectorD* GetEventIds() { return &fVEventNumber; } | |
72 | ||
75d8233f | 73 | Short_t GetDebugLevel() const { return fDebugLevel; } |
74 | // | |
75 | void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the pulser signal is expected | |
76 | // | |
77 | void SetRangeRefQ (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsQ = nBins; fXminQ = xMin; fXmaxQ = xMax; } //Set range for Q reference histograms | |
78 | void SetRangeRefT0 (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsT0 = nBins; fXminT0 = xMin; fXmaxT0 = xMax; } //Set range for T0 reference histograms | |
79 | void SetRangeRefRMS(Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsRMS = nBins; fXminRMS = xMin; fXmaxRMS = xMax; } //Set range for T0 reference histograms | |
80 | // | |
7fb602b1 | 81 | void SetTimeStampEvent(Double_t timestamp){ fTimeStamp = timestamp; } |
82 | void SetRunNumber(Double_t eventnumber){ fRunNumber = eventnumber; } | |
83 | ||
84 | void SetEventInfo(Double_t runNumber, Double_t timestamp, Double_t eventId){ fRunNumber=runNumber; fTimeStamp=timestamp; fEventId=eventId;} | |
75d8233f | 85 | |
86 | void SetOldRCUformat(Bool_t format=kTRUE){ fOldRCUformat = format; } | |
87 | ||
88 | void SetDebugLevel(Short_t debug=1){ fDebugLevel = debug;} | |
89 | ||
bf57d87d | 90 | void SetPedestalDatabase(AliTPCCalPad *pedestalTPC, AliTPCCalPad *padNoiseTPC) {fPedestalTPC = pedestalTPC; fPadNoiseTPC = padNoiseTPC;} |
91 | ||
75d8233f | 92 | Int_t GetFirstTimeBin() const { return fFirstTimeBin; } |
93 | Int_t GetLastTimeBin() const { return fLastTimeBin; } | |
94 | ||
3cd27a08 | 95 | Int_t GetNeventsProcessed() const { return fNevents; } |
75d8233f | 96 | |
7fb602b1 | 97 | void Merge(AliTPCCalibCE *ce); |
98 | ||
75d8233f | 99 | TGraph *MakeGraphTimeCE(Int_t sector, Int_t xVariable=0, Int_t fitType=0, Int_t fitParameter=0); |
100 | ||
101 | void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE); | |
102 | ||
bf57d87d | 103 | private: |
75d8233f | 104 | Int_t fFirstTimeBin; // First Time bin needed for analysis |
105 | Int_t fLastTimeBin; // Last Time bin needed for analysis | |
106 | ||
107 | // reference histogram ranges | |
108 | Int_t fNbinsT0; // Number of bins for T0 reference histogram | |
109 | Float_t fXminT0; // xmin of T0 reference histogram | |
110 | Float_t fXmaxT0; // xmax of T0 reference histogram | |
111 | Int_t fNbinsQ; // Number of bins for T0 reference histogram | |
112 | Float_t fXminQ; // xmin of T0 reference histogram | |
113 | Float_t fXmaxQ; // xmax of T0 reference histogram | |
114 | Int_t fNbinsRMS; // Number of bins for T0 reference histogram | |
115 | Float_t fXminRMS; // xmin of T0 reference histogram | |
116 | Float_t fXmaxRMS; // xmax of T0 reference histogram | |
117 | ||
118 | Int_t fLastSector; //! Last sector processed | |
119 | ||
120 | Bool_t fOldRCUformat; //! Should we use the old RCU format for data reading | |
121 | ||
122 | AliTPCROC *fROC; //! ROC information | |
123 | AliTPCParam *fParam; //! TPC information | |
124 | ||
125 | AliTPCCalPad *fPedestalTPC; //! Pedestal Information whole TPC | |
126 | AliTPCCalPad *fPadNoiseTPC; //! Pad noise Information whole TPC | |
127 | AliTPCCalROC *fPedestalROC; //! Pedestal Information for current ROC | |
128 | AliTPCCalROC *fPadNoiseROC; //! Pad noise Information for current ROC | |
75d8233f | 129 | |
130 | TObjArray fCalRocArrayT0; // Array of AliTPCCalROC class for Time0 calibration | |
131 | TObjArray fCalRocArrayQ; // Array of AliTPCCalROC class for Charge calibration | |
132 | TObjArray fCalRocArrayRMS; // Array of AliTPCCalROC class for signal width calibration | |
133 | TObjArray fCalRocArrayOutliers; // Array of AliTPCCalROC class for signal outliers | |
134 | ||
135 | TObjArray fHistoQArray; // Calibration histograms for Charge distribution | |
136 | TObjArray fHistoT0Array; // Calibration histograms for Time0 distribution | |
137 | TObjArray fHistoRMSArray; // Calibration histograms for signal width distribution | |
138 | ||
139 | TObjArray fHistoTmean; //! Calibration histograms of the mean CE position for all sectors | |
140 | ||
75d8233f | 141 | TObjArray fParamArrayEventPol1; // Store mean arrival time parameters for each sector event by event from global plane fit |
142 | TObjArray fParamArrayEventPol2; // Store mean arrival time parameters for each sector event by event from global parabola fit | |
bf57d87d | 143 | TObjArray fTMeanArrayEvent; // Store mean arrival time for each sector event by event |
144 | TObjArray fQMeanArrayEvent; // Store mean arrival Charge for each sector event by event | |
75d8233f | 145 | TVectorD fVEventTime; // Timestamps of the events |
146 | TVectorD fVEventNumber; // Eventnumbers of the events | |
147 | Int_t fNevents; // Event counter | |
7fb602b1 | 148 | Double_t fTimeStamp; //! Timestamp of the current event |
149 | Double_t fEventId; //! Event Id of the current event | |
150 | Double_t fRunNumber; //! Run Number of the current event | |
151 | Double_t fOldRunNumber; //! Old Run Number | |
75d8233f | 152 | |
153 | TObjArray fPadTimesArrayEvent; //! Pad Times for the event, before mean Time0 corrections | |
154 | TObjArray fPadQArrayEvent; //! Charge for the event, only needed for debugging streamer | |
155 | TObjArray fPadRMSArrayEvent; //! Signal width for the event, only needed for debugging streamer | |
156 | TObjArray fPadPedestalArrayEvent; //! Signal width for the event, only needed for debugging streamer | |
157 | ||
158 | Int_t fCurrentChannel; //! current channel processed | |
159 | Int_t fCurrentSector; //! current sector processed | |
160 | Int_t fCurrentRow; //! current row processed | |
161 | Float_t fMaxPadSignal; //! maximum bin of current pad | |
162 | Int_t fMaxTimeBin; //! time bin with maximum value | |
163 | TVectorF fPadSignal; //! signal of current Pad | |
164 | Float_t fPadPedestal; //! Pedestal Value of current pad | |
165 | Float_t fPadNoise; //! Noise Value of current pad | |
166 | ||
167 | TVectorD fVTime0Offset; //! Time0 Offset for each sector; | |
168 | TVectorD fVTime0OffsetCounter; //! Time0 Offset counter for each sector; | |
bf57d87d | 169 | TVectorD fVMeanQ; //! Mean Q for each sector; |
170 | TVectorD fVMeanQCounter; //! Mean Q counter for each sector; | |
75d8233f | 171 | //debugging |
3cd27a08 | 172 | // Int_t fEvent; |
75d8233f | 173 | TTreeSRedirector *fDebugStreamer; //! debug streamer |
174 | ||
3cd27a08 | 175 | Short_t fDebugLevel; // debug level |
75d8233f | 176 | //! debugging |
177 | ||
178 | void FindPedestal(Float_t part=.6); | |
179 | void FindCESignal(TVectorD ¶m, Float_t &qSum, const TVectorF maxima); | |
180 | void FindLocalMaxima(TVectorF &maxima); | |
3cd27a08 | 181 | Bool_t IsPeak(Int_t pos, Int_t tminus, Int_t tplus) const; |
75d8233f | 182 | |
183 | TH2S* GetHisto(Int_t sector, TObjArray *arr, | |
184 | Int_t nbinsY, Float_t ymin, Float_t ymax, | |
185 | Char_t *type, Bool_t force); | |
186 | TH1S* GetHisto(Int_t sector, TObjArray *arr, | |
187 | Char_t *type, Bool_t force); | |
188 | ||
3cd27a08 | 189 | AliTPCCalROC* GetCalRoc(Int_t sector, TObjArray* arr, Bool_t force) const; |
75d8233f | 190 | |
3cd27a08 | 191 | TVectorF* GetVectSector(Int_t sector, TObjArray *arr, UInt_t size, Bool_t force=kFALSE) const; |
75d8233f | 192 | TVectorF* GetPadTimesEvent(Int_t sector, Bool_t force=kFALSE); |
193 | ||
3cd27a08 | 194 | TObjArray* GetParamArray(Int_t sector, TObjArray *arr, Bool_t force=kFALSE) const; |
75d8233f | 195 | |
196 | void ResetEvent(); | |
197 | void ResetPad(); | |
198 | void ProcessPad(); | |
199 | void EndEvent(); | |
200 | ||
201 | ||
202 | //debug | |
75d8233f | 203 | TVectorF* GetPadQEvent(Int_t sector, Bool_t force=kFALSE); |
204 | TVectorF* GetPadRMSEvent(Int_t sector, Bool_t force=kFALSE); | |
205 | TVectorF* GetPadPedestalEvent(Int_t sector, Bool_t force=kFALSE); | |
206 | ||
7fb602b1 | 207 | ClassDef(AliTPCCalibCE,2) //Implementation of the TPC Central Electrode calibration |
208 | ||
75d8233f | 209 | }; |
210 | ||
211 | ||
212 | ||
213 | #endif | |
214 |