]>
Commit | Line | Data |
---|---|---|
1 | /************************************************************************** | |
2 | * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ||
17 | /* $Id: $ */ | |
18 | ||
19 | /* | |
20 | Based on AliPHOSQADataMaker | |
21 | Produces the data needed to calculate the quality assurance. | |
22 | All data must be mergeable objects. | |
23 | P. Christiansen, Lund, January 2008 | |
24 | ||
25 | Updated June 2010: | |
26 | ================== | |
27 | ||
28 | The "beautification" of the online DQM histograms have been moved to | |
29 | an amore macro. | |
30 | ||
31 | The per event RAW histograms have been modified in AliTPCdataQA and | |
32 | the copies have therefore also been modified here. | |
33 | ||
34 | The AliTPCdataQA can now be configured a bit from here: time bin | |
35 | range (extended default range to 1-1000, event range at start: | |
36 | 0-100000, 1000 events per bin). (At least the parameters are not | |
37 | hardcoded:-) | |
38 | ||
39 | Implementation: | |
40 | =============== | |
41 | ||
42 | For the QA of the RAW data we use the class, AliTPCdataQA, from the | |
43 | existing TPC Calibration framework (which is more advanced than the | |
44 | standard QA framework) and extract the histograms at the end. The | |
45 | Analyse method of the AliTPCdataQA class is called in the method, | |
46 | EndOfDetectorCycle, and there also: 1d histogram(s) are projected | |
47 | and added to the QA list. | |
48 | */ | |
49 | ||
50 | #include "AliTPCQADataMakerRec.h" | |
51 | ||
52 | // --- ROOT system --- | |
53 | #include <TClonesArray.h> | |
54 | #include <TString.h> | |
55 | #include <TSystem.h> | |
56 | #include <TBox.h> | |
57 | #include <TLine.h> | |
58 | #include <TAxis.h> | |
59 | ||
60 | // --- Standard library --- | |
61 | ||
62 | // --- AliRoot header files --- | |
63 | #include "AliQAChecker.h" | |
64 | #include "AliESDEvent.h" | |
65 | #include "AliESDtrack.h" | |
66 | #include "AliLog.h" | |
67 | #include "AliTPCCalPad.h" | |
68 | #include "AliTPCCalROC.h" | |
69 | #include "AliTPCClustersRow.h" | |
70 | #include "AliTPCclusterMI.h" | |
71 | #include "AliSimDigits.h" | |
72 | ||
73 | ||
74 | ClassImp(AliTPCQADataMakerRec) | |
75 | ||
76 | //____________________________________________________________________________ | |
77 | AliTPCQADataMakerRec::AliTPCQADataMakerRec() : | |
78 | AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTPC), | |
79 | "TPC Rec Quality Assurance Data Maker"), | |
80 | fTPCdataQA(NULL), | |
81 | fRawMaxEvents(100000), | |
82 | fRawEventsPerBin(1000), | |
83 | fRawFirstTimeBin(1), | |
84 | fRawLastTimeBin(1000) | |
85 | { | |
86 | // ctor | |
87 | fTPCdataQA = new AliTPCdataQA*[AliRecoParam::kNSpecies] ; | |
88 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) | |
89 | fTPCdataQA[specie] = NULL ; | |
90 | ||
91 | for(Int_t i = 0; i < 6; i++) | |
92 | fMapping[i] = 0; | |
93 | } | |
94 | ||
95 | //____________________________________________________________________________ | |
96 | AliTPCQADataMakerRec::AliTPCQADataMakerRec(const AliTPCQADataMakerRec& qadm) : | |
97 | AliQADataMakerRec(), | |
98 | fTPCdataQA(NULL), | |
99 | fRawMaxEvents(qadm.GetRawMaxEvents()), | |
100 | fRawEventsPerBin(qadm.GetRawEventsPerBin()), | |
101 | fRawFirstTimeBin(qadm.GetRawFirstTimeBin()), | |
102 | fRawLastTimeBin(qadm.GetRawLastTimeBin()) | |
103 | { | |
104 | //copy ctor | |
105 | // Does not copy the calibration object, instead InitRaws have to be | |
106 | // called again | |
107 | SetName((const char*)qadm.GetName()) ; | |
108 | SetTitle((const char*)qadm.GetTitle()); | |
109 | ||
110 | fTPCdataQA = new AliTPCdataQA*[AliRecoParam::kNSpecies] ; | |
111 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) | |
112 | fTPCdataQA[specie] = NULL ; | |
113 | ||
114 | for(Int_t i = 0; i < 6; i++) | |
115 | fMapping[i] = 0; | |
116 | ||
117 | // | |
118 | // Associate class histogram objects to the copies in the list | |
119 | // Could also be done with the indexes | |
120 | // | |
121 | ||
122 | } | |
123 | ||
124 | //__________________________________________________________________ | |
125 | AliTPCQADataMakerRec& AliTPCQADataMakerRec::operator = (const AliTPCQADataMakerRec& qadm ) | |
126 | { | |
127 | // Equal operator. | |
128 | this->~AliTPCQADataMakerRec(); | |
129 | new(this) AliTPCQADataMakerRec(qadm); | |
130 | return *this; | |
131 | } | |
132 | ||
133 | //__________________________________________________________________ | |
134 | AliTPCQADataMakerRec::~AliTPCQADataMakerRec() | |
135 | { | |
136 | // Destructor | |
137 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) | |
138 | if ( fTPCdataQA[specie] != NULL ) | |
139 | delete fTPCdataQA[specie] ; | |
140 | delete[] fTPCdataQA; | |
141 | ||
142 | for(Int_t i = 0; i < 6; i++) | |
143 | delete fMapping[i]; | |
144 | } | |
145 | ||
146 | //____________________________________________________________________________ | |
147 | void AliTPCQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) | |
148 | { | |
149 | //Detector specific actions at end of cycle | |
150 | ||
151 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
152 | if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) | |
153 | continue ; | |
154 | if(fTPCdataQA[specie] != NULL) { // do the final step of the QA for Raw data | |
155 | ||
156 | fTPCdataQA[specie]->Analyse(); // 31/1-08 Analyse is now protected against | |
157 | // RAW data files with no TPC data | |
158 | ||
159 | SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; | |
160 | TH1F * histRawsOccupancy = (TH1F*)GetRawsData(kRawsOccupancy) ; | |
161 | TH1F * histRawsOccupancyVsSector = (TH1F*)GetRawsData(kRawsOccupancyVsSector) ; | |
162 | TH1F * histRawsNClustersPerEventVsSector = (TH1F*)GetRawsData(kRawsNClustersPerEventVsSector) ; | |
163 | TH1F * histRawsQVsSector = (TH1F*)GetRawsData(kRawsQVsSector) ; | |
164 | TH1F * histRawsQmaxVsSector = (TH1F*)GetRawsData(kRawsQmaxVsSector) ; | |
165 | TH1F * histRawsOccupancyVsEvent = (TH1F*)GetRawsData(kRawsOccupancyVsEvent) ; | |
166 | TH1F * histRawsNclustersVsEvent = (TH1F*)GetRawsData(kRawsNclustersVsEvent) ; | |
167 | if ( !histRawsOccupancy || | |
168 | !histRawsOccupancyVsSector || | |
169 | !histRawsNClustersPerEventVsSector || | |
170 | !histRawsQVsSector || | |
171 | !histRawsQmaxVsSector || | |
172 | !histRawsOccupancyVsEvent || | |
173 | !histRawsNclustersVsEvent ) { | |
174 | AliError("Something very wrong here, corrupted memory ?????. Please check\n") ; | |
175 | continue ; | |
176 | } | |
177 | ||
178 | //Add2RawsList(fTPCdataQA, 0); | |
179 | // get the histograms and add them to the output | |
180 | // 31/8-08 Histogram is only added if the Calibration class | |
181 | // receives TPC data | |
182 | const Int_t eventCounter = fTPCdataQA[specie]->GetEventCounter(); | |
183 | if(eventCounter>0) { // some TPC data has been processed | |
184 | ||
185 | // Reset histograms and refill them | |
186 | histRawsOccupancy->Reset(); | |
187 | histRawsOccupancyVsSector->Reset(); | |
188 | histRawsNClustersPerEventVsSector->Reset(); | |
189 | histRawsQVsSector->Reset(); | |
190 | histRawsQmaxVsSector->Reset(); | |
191 | ||
192 | TH1F* hNormOcc = new TH1F("hNormOcc", 0, 72, 0, 72); | |
193 | hNormOcc->Sumw2(); | |
194 | TH1F* hNormNclusters = new TH1F("hNormNclusters", 0, 72, 0, 72); | |
195 | hNormNclusters->Sumw2(); | |
196 | ||
197 | for (Int_t iSec = 0; iSec < 72; iSec++) { | |
198 | ||
199 | AliTPCCalROC* occupancyROC = | |
200 | fTPCdataQA[specie]->GetNoThreshold()->GetCalROC(iSec); | |
201 | AliTPCCalROC* nclusterROC = | |
202 | fTPCdataQA[specie]->GetNLocalMaxima()->GetCalROC(iSec); | |
203 | AliTPCCalROC* qROC = | |
204 | fTPCdataQA[specie]->GetMeanCharge()->GetCalROC(iSec); | |
205 | AliTPCCalROC* qmaxROC = | |
206 | fTPCdataQA[specie]->GetMaxCharge()->GetCalROC(iSec); | |
207 | ||
208 | const Int_t nRows = occupancyROC->GetNrows(); | |
209 | for (Int_t iRow = 0; iRow < nRows; iRow++) { | |
210 | ||
211 | const Int_t nPads = occupancyROC->GetNPads(iRow); | |
212 | for (Int_t iPad = 0; iPad < nPads; iPad++) { | |
213 | ||
214 | histRawsOccupancy->Fill(occupancyROC->GetValue(iRow, iPad)); | |
215 | hNormOcc->Fill(iSec); | |
216 | histRawsOccupancyVsSector | |
217 | ->Fill(iSec, occupancyROC->GetValue(iRow, iPad)); | |
218 | ||
219 | const Int_t nClusters = TMath::Nint(nclusterROC->GetValue(iRow, iPad)); | |
220 | ||
221 | if(nClusters>0) { | |
222 | ||
223 | hNormNclusters->Fill(iSec,nClusters); | |
224 | histRawsNClustersPerEventVsSector->Fill(iSec, nClusters); | |
225 | histRawsQVsSector->Fill(iSec, | |
226 | nClusters*qROC->GetValue(iRow, iPad)); | |
227 | histRawsQmaxVsSector->Fill(iSec, | |
228 | nClusters*qmaxROC->GetValue(iRow, iPad)); | |
229 | } | |
230 | } | |
231 | } | |
232 | } // end loop over sectors | |
233 | ||
234 | // update event histograms - copy info from TPDdataQA histos | |
235 | const TH1F* hQAOccVsEvent = fTPCdataQA[specie]->GetHistOccupancyVsEvent(); | |
236 | const TH1F* hQANclVsEvent = fTPCdataQA[specie]->GetHistNclustersVsEvent(); | |
237 | ||
238 | // In case the histogram limits have changed we have to update | |
239 | // them here | |
240 | if(histRawsOccupancy->GetXaxis()->GetXmax()!= | |
241 | hQAOccVsEvent->GetXaxis()->GetXmax()) { | |
242 | ||
243 | histRawsOccupancyVsEvent->GetXaxis()->Set(histRawsOccupancyVsEvent->GetXaxis()->GetNbins(), hQAOccVsEvent->GetXaxis()->GetXmin(), hQAOccVsEvent->GetXaxis()->GetXmax()); | |
244 | ||
245 | histRawsNclustersVsEvent->GetXaxis()->Set(histRawsOccupancyVsEvent->GetXaxis()->GetNbins(), hQANclVsEvent->GetXaxis()->GetXmin(), hQANclVsEvent->GetXaxis()->GetXmax()); | |
246 | } | |
247 | ||
248 | // reset the number of entries | |
249 | histRawsOccupancyVsEvent->SetEntries(0); | |
250 | histRawsNclustersVsEvent->SetEntries(0); | |
251 | ||
252 | // the two event histograms should have the same number of bins | |
253 | const Int_t nBins = hQAOccVsEvent->GetXaxis()->GetNbins(); | |
254 | for(Int_t bin = 1; bin <= nBins; bin++) { | |
255 | ||
256 | histRawsOccupancyVsEvent->SetBinContent(bin, hQAOccVsEvent->GetBinContent(bin)); | |
257 | histRawsNclustersVsEvent->SetBinContent(bin, hQANclVsEvent->GetBinContent(bin)); | |
258 | } | |
259 | ||
260 | // Normalize histograms | |
261 | histRawsOccupancyVsSector->Divide(hNormOcc); | |
262 | histRawsNClustersPerEventVsSector->Scale(1.0/Float_t(eventCounter)); | |
263 | histRawsQVsSector->Divide(hNormNclusters); | |
264 | histRawsQmaxVsSector->Divide(hNormNclusters); | |
265 | delete hNormOcc; | |
266 | delete hNormNclusters; | |
267 | ||
268 | } | |
269 | } | |
270 | } | |
271 | AliQAChecker::Instance()->Run(AliQAv1::kTPC, task, list) ; | |
272 | } | |
273 | ||
274 | ||
275 | //____________________________________________________________________________ | |
276 | void AliTPCQADataMakerRec::InitESDs() | |
277 | { | |
278 | //create ESDs histograms in ESDs subdir | |
279 | const Bool_t expert = kTRUE ; | |
280 | const Bool_t image = kTRUE ; | |
281 | ||
282 | TH1F * histESDclusters = | |
283 | new TH1F("hESDclusters", "N TPC clusters per track; N clusters; Counts", | |
284 | 160, 0, 160); | |
285 | histESDclusters->Sumw2(); | |
286 | Add2ESDsList(histESDclusters, KClusters, !expert, image); | |
287 | ||
288 | TH1F * histESDratio = | |
289 | new TH1F("hESDratio", "Ratio: TPC clusters / findable; Ratio: cluster/findable; Counts", | |
290 | 100, 0, 1); | |
291 | histESDratio->Sumw2(); | |
292 | Add2ESDsList(histESDratio, kRatio, !expert, image); | |
293 | ||
294 | TH1F * histESDpt = | |
295 | new TH1F("hESDpt", "P_{T} distribution; p_{T} [GeV/c]; Counts", | |
296 | 50, 0, 5); | |
297 | histESDpt->Sumw2(); | |
298 | Add2ESDsList(histESDpt, kPt, !expert, image); | |
299 | } | |
300 | ||
301 | //____________________________________________________________________________ | |
302 | void AliTPCQADataMakerRec::InitRaws() | |
303 | { | |
304 | // | |
305 | // Adding the raw | |
306 | // | |
307 | ||
308 | // Modified: 7/7 - 2008 | |
309 | // Laurent Aphecetche pointed out that the mapping was read from file | |
310 | // for each event, so now we read in the map here and set if for | |
311 | // the raw data qa | |
312 | const Bool_t expert = kTRUE ; | |
313 | const Bool_t saveCorr = kTRUE ; | |
314 | const Bool_t image = kTRUE ; | |
315 | ||
316 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
317 | ||
318 | // It might happen that we will be in this method a few times because | |
319 | // we create all dataQAs at the first call to this method | |
320 | if(fTPCdataQA[specie]!=0) // data QA already created | |
321 | continue; | |
322 | ||
323 | fTPCdataQA[specie] = | |
324 | new AliTPCdataQA(AliRecoParam::ConvertIndex(specie)); | |
325 | LoadMaps(); // Load Altro maps | |
326 | fTPCdataQA[specie]->SetAltroMapping(fMapping); // set Altro mapping | |
327 | fTPCdataQA[specie]->SetRangeTime(fRawFirstTimeBin, fRawLastTimeBin); // set time bin interval | |
328 | fTPCdataQA[specie]->SetMaxEvents(fRawMaxEvents); | |
329 | fTPCdataQA[specie]->SetEventsPerBin(fRawEventsPerBin); | |
330 | // Add2RawsList(fTPCdataQA, kTPCdataQ, !expert, image, !saveCorrA); // This is used by the AMORE monitoring <------- THIS WILL FAIL (YS) | |
331 | } | |
332 | ||
333 | TH1F * histRawsOccupancy = | |
334 | new TH1F("hRawsOccupancy", "Occupancy (all pads); Occupancy; Counts", | |
335 | 100, 0, 1); | |
336 | histRawsOccupancy->Sumw2(); | |
337 | Add2RawsList(histRawsOccupancy, kRawsOccupancy, expert, !image, !saveCorr); | |
338 | ||
339 | TH1F * histRawsOccupancyVsSector = | |
340 | new TH1F("hRawsOccupancyVsSector", "Occupancy vs sector; Sector; Occupancy", | |
341 | 72, 0, 72); | |
342 | histRawsOccupancyVsSector->Sumw2(); | |
343 | histRawsOccupancyVsSector->SetMarkerStyle(20); | |
344 | histRawsOccupancyVsSector->SetOption("P"); | |
345 | histRawsOccupancyVsSector->SetStats(kFALSE); | |
346 | Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, !expert, image, !saveCorr); | |
347 | ||
348 | TH1F * histRawsNClustersPerEventVsSector = | |
349 | new TH1F("hRawsNClustersPerEventVsSector", "Nclusters per event vs sector; Sector; Nclusters per event", | |
350 | 72, 0, 72); | |
351 | histRawsNClustersPerEventVsSector->Sumw2(); | |
352 | Add2RawsList(histRawsNClustersPerEventVsSector, kRawsNClustersPerEventVsSector, expert, !image, !saveCorr); | |
353 | ||
354 | TH1F * histRawsQVsSector = | |
355 | new TH1F("hRawsQVsSector", "<Q> vs sector; Sector; <Q>", | |
356 | 72, 0, 72); | |
357 | histRawsQVsSector->Sumw2(); | |
358 | Add2RawsList(histRawsQVsSector, kRawsQVsSector, expert, !image, !saveCorr); | |
359 | ||
360 | TH1F * histRawsQmaxVsSector = | |
361 | new TH1F("hRawsQmaxVsSector", "<Qmax> vs sector; Sector; <Qmax>", | |
362 | 72, 0, 72); | |
363 | histRawsQmaxVsSector->Sumw2(); | |
364 | histRawsQmaxVsSector->SetMarkerStyle(20); | |
365 | histRawsQmaxVsSector->SetOption("P"); | |
366 | histRawsQmaxVsSector->SetStats(kFALSE); | |
367 | Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, !expert, image, !saveCorr); | |
368 | ||
369 | // Get histogram information from data QA to build copy | |
370 | const TH1F* hOccHelp = fTPCdataQA[0]->GetHistOccupancyVsEvent(); | |
371 | TH1F * histRawsOccupancyVsEvent = | |
372 | CreateEventsHistCopy(hOccHelp, "hRawsOccupancyVsEvent"); | |
373 | Add2RawsList(histRawsOccupancyVsEvent, kRawsOccupancyVsEvent, expert, !image, !saveCorr); | |
374 | ||
375 | // Get histogram information from data QA to build copy | |
376 | const TH1F* hNclHelp = fTPCdataQA[0]->GetHistNclustersVsEvent(); | |
377 | TH1F * histRawsNclustersVsEvent = | |
378 | CreateEventsHistCopy(hNclHelp, "hRawsNclustersVsEvent"); | |
379 | Add2RawsList(histRawsNclustersVsEvent, kRawsNclustersVsEvent, expert, !image, !saveCorr); | |
380 | } | |
381 | ||
382 | //____________________________________________________________________________ | |
383 | void AliTPCQADataMakerRec::InitDigits() | |
384 | { | |
385 | const Bool_t expert = kTRUE ; | |
386 | const Bool_t image = kTRUE ; | |
387 | TH1F * histDigitsADC = | |
388 | new TH1F("hDigitsADC", "Digit ADC distribution; ADC; Counts", | |
389 | 1000, 0, 1000); | |
390 | histDigitsADC->Sumw2(); | |
391 | Add2DigitsList(histDigitsADC, kDigitsADC, !expert, image); | |
392 | } | |
393 | ||
394 | //____________________________________________________________________________ | |
395 | void AliTPCQADataMakerRec::InitRecPoints() | |
396 | { | |
397 | const Bool_t expert = kTRUE ; | |
398 | const Bool_t image = kTRUE ; | |
399 | ||
400 | TH1F * histRecPointsQmaxShort = | |
401 | new TH1F("hRecPointsQmaxShort", "Qmax distrbution (short pads); Qmax; Counts", | |
402 | 100, 0, 300); | |
403 | histRecPointsQmaxShort->Sumw2(); | |
404 | Add2RecPointsList(histRecPointsQmaxShort, kQmaxShort, !expert, image); | |
405 | ||
406 | TH1F * histRecPointsQmaxMedium = | |
407 | new TH1F("hRecPointsQmaxMedium", "Qmax distrbution (medium pads); Qmax; Counts", | |
408 | 100, 0, 300); | |
409 | histRecPointsQmaxMedium->Sumw2(); | |
410 | Add2RecPointsList(histRecPointsQmaxMedium, kQmaxMedium, !expert, image); | |
411 | ||
412 | TH1F * histRecPointsQmaxLong = | |
413 | new TH1F("hRecPointsQmaxLong", "Qmax distrbution (long pads); Qmax; Counts", | |
414 | 100, 0, 300); | |
415 | histRecPointsQmaxLong->Sumw2(); | |
416 | Add2RecPointsList(histRecPointsQmaxLong, kQmaxLong, !expert, image); | |
417 | ||
418 | TH1F * histRecPointsQShort = | |
419 | new TH1F("hRecPointsQShort", "Q distrbution (short pads); Q; Counts", | |
420 | 100, 0, 2000); | |
421 | histRecPointsQShort->Sumw2(); | |
422 | Add2RecPointsList(histRecPointsQShort, kQShort, !expert, image); | |
423 | ||
424 | TH1F * histRecPointsQMedium = | |
425 | new TH1F("hRecPointsQMedium", "Q distrbution (medium pads); Q; Counts", | |
426 | 100, 0, 2000); | |
427 | histRecPointsQMedium->Sumw2(); | |
428 | Add2RecPointsList(histRecPointsQMedium, kQMedium, !expert, image); | |
429 | ||
430 | TH1F * histRecPointsQLong = | |
431 | new TH1F("hRecPointsQLong", "Q distrbution (long pads); Q; Counts", | |
432 | 100, 0, 2000); | |
433 | histRecPointsQLong->Sumw2(); | |
434 | Add2RecPointsList(histRecPointsQLong, kQLong, !expert, image); | |
435 | ||
436 | TH1F * histRecPointsRow = | |
437 | new TH1F("hRecPointsRow", "Clusters per row; Row; Counts", | |
438 | 159, 0, 159); | |
439 | histRecPointsRow->Sumw2(); | |
440 | Add2RecPointsList(histRecPointsRow, kRow, !expert, image); | |
441 | } | |
442 | ||
443 | //____________________________________________________________________________ | |
444 | void AliTPCQADataMakerRec::MakeESDs(AliESDEvent * esd) | |
445 | { | |
446 | // make QA data from ESDs | |
447 | ||
448 | const Int_t nESDTracks = esd->GetNumberOfTracks(); | |
449 | Int_t nTPCtracks = 0; | |
450 | for(Int_t i = 0; i < nESDTracks; i++) { | |
451 | ||
452 | AliESDtrack * track = esd->GetTrack(i); | |
453 | ||
454 | if ((track->GetStatus() & AliESDtrack::kTPCrefit)==0) | |
455 | continue; | |
456 | ||
457 | nTPCtracks++; | |
458 | ||
459 | Int_t nTPCclusters = track->GetTPCNcls(); | |
460 | Int_t nTPCclustersFindable = track->GetTPCNclsF(); | |
461 | if ( nTPCclustersFindable<=0) continue; | |
462 | GetESDsData(KClusters)->Fill(nTPCclusters); | |
463 | GetESDsData(kRatio)->Fill(Float_t(nTPCclusters)/Float_t(nTPCclustersFindable)); | |
464 | GetESDsData(kPt)->Fill(track->Pt()); | |
465 | } | |
466 | } | |
467 | ||
468 | //____________________________________________________________________________ | |
469 | void AliTPCQADataMakerRec::MakeRaws(AliRawReader* rawReader) | |
470 | { | |
471 | // | |
472 | // To make QA for the RAW data we use the TPC Calibration framework | |
473 | // to handle the data and then in the end extract the data | |
474 | // | |
475 | ||
476 | GetRawsData(0); // dummy call to init raw data | |
477 | rawReader->Reset() ; | |
478 | if (! fTPCdataQA[AliRecoParam::AConvert(fEventSpecie)] ) { | |
479 | AliError("Something unexpected here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") ; | |
480 | } else { | |
481 | fTPCdataQA[AliRecoParam::AConvert(fEventSpecie)]->ProcessEvent(rawReader); | |
482 | } | |
483 | } | |
484 | ||
485 | //____________________________________________________________________________ | |
486 | void AliTPCQADataMakerRec::MakeDigits(TTree* digitTree) | |
487 | { | |
488 | ||
489 | TBranch* branch = digitTree->GetBranch("Segment"); | |
490 | AliSimDigits* digArray = 0; | |
491 | branch->SetAddress(&digArray); | |
492 | ||
493 | Int_t nEntries = Int_t(digitTree->GetEntries()); | |
494 | ||
495 | for (Int_t n = 0; n < nEntries; n++) { | |
496 | ||
497 | digitTree->GetEvent(n); | |
498 | ||
499 | if (digArray->First()) | |
500 | do { | |
501 | Float_t dig = digArray->CurrentDigit(); | |
502 | ||
503 | GetDigitsData(kDigitsADC)->Fill(dig); | |
504 | } while (digArray->Next()); | |
505 | } | |
506 | } | |
507 | ||
508 | //____________________________________________________________________________ | |
509 | void AliTPCQADataMakerRec::MakeRecPoints(TTree* recTree) | |
510 | { | |
511 | ||
512 | AliTPCClustersRow* clrow = 0x0; | |
513 | TBranch* branch = recTree->GetBranch("Segment"); | |
514 | branch->SetAddress(&clrow); | |
515 | TClonesArray * clarray = 0x0; | |
516 | ||
517 | const Int_t nEntries = Int_t(recTree->GetEntries()); | |
518 | for (Int_t i = 0; i < nEntries; i++) { | |
519 | ||
520 | branch->GetEntry(i); | |
521 | ||
522 | clarray = clrow->GetArray(); | |
523 | ||
524 | if (!clarray) continue; | |
525 | ||
526 | const Int_t nClusters = clarray->GetEntriesFast(); | |
527 | for (Int_t icl=0; icl < nClusters; icl++){ | |
528 | ||
529 | AliTPCclusterMI* cluster = | |
530 | (AliTPCclusterMI*)clarray->At(icl); | |
531 | ||
532 | Float_t Qmax = cluster->GetMax(); | |
533 | Float_t Q = cluster->GetQ(); | |
534 | Int_t row = cluster->GetRow(); | |
535 | ||
536 | if(cluster->GetDetector()<36) { // IROC (short pads) | |
537 | ||
538 | GetRecPointsData(kQmaxShort)->Fill(Qmax); | |
539 | GetRecPointsData(kQShort)->Fill(Q); | |
540 | } else { // OROC (medium and long pads) | |
541 | row += 63; | |
542 | if(cluster->GetRow()<64) { // medium pads | |
543 | ||
544 | GetRecPointsData(kQmaxMedium)->Fill(Qmax); | |
545 | GetRecPointsData(kQMedium)->Fill(Q); | |
546 | } else { // long pads | |
547 | ||
548 | GetRecPointsData(kQmaxLong)->Fill(Qmax); | |
549 | GetRecPointsData(kQLong)->Fill(Q); | |
550 | } | |
551 | } | |
552 | ||
553 | GetRecPointsData(kRow)->Fill(row); | |
554 | } // end loop over clusters | |
555 | } // end loop over tree | |
556 | } | |
557 | ||
558 | //____________________________________________________________________________ | |
559 | void AliTPCQADataMakerRec::LoadMaps() | |
560 | { | |
561 | TString path = gSystem->Getenv("ALICE_ROOT"); | |
562 | path += "/TPC/mapping/Patch"; | |
563 | ||
564 | for(Int_t i = 0; i < 6; i++) { | |
565 | ||
566 | if(fMapping[i]!=0) // mapping already loaded | |
567 | continue; | |
568 | TString path2 = path; | |
569 | path2 += i; | |
570 | path2 += ".data"; | |
571 | fMapping[i] = new AliTPCAltroMapping(path2.Data()); | |
572 | } | |
573 | } | |
574 | ||
575 | //____________________________________________________________________________ | |
576 | void AliTPCQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task) | |
577 | { | |
578 | // Overwrites general method for RAW data. | |
579 | // The AliTPCdataQA elements that does the internal processing are | |
580 | // in the case they have processed data deleted and new are created | |
581 | ||
582 | // Reset histograms for all tasks | |
583 | AliQADataMakerRec::ResetDetector(task); | |
584 | ||
585 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
586 | ||
587 | if ( fTPCdataQA[specie] != NULL) { // exist | |
588 | ||
589 | if(fTPCdataQA[specie]->GetEventCounter()>0) { // has processed data | |
590 | ||
591 | // old configuration | |
592 | Int_t firstTime = fTPCdataQA[specie]->GetFirstTimeBin(); | |
593 | Int_t lastTime = fTPCdataQA[specie]->GetLastTimeBin(); | |
594 | Int_t minADC = fTPCdataQA[specie]->GetAdcMin(); | |
595 | Int_t maxADC = fTPCdataQA[specie]->GetAdcMax(); | |
596 | ||
597 | //delete old | |
598 | delete fTPCdataQA[specie]; | |
599 | ||
600 | // create new | |
601 | fTPCdataQA[specie] = new AliTPCdataQA(AliRecoParam::ConvertIndex(specie)); | |
602 | // configure new | |
603 | LoadMaps(); // Load Altro maps | |
604 | fTPCdataQA[specie]->SetAltroMapping(fMapping); | |
605 | fTPCdataQA[specie]->SetRangeTime(firstTime, lastTime); | |
606 | fTPCdataQA[specie]->SetRangeAdc(minADC, maxADC); | |
607 | // Here we want to restore the default configuration because | |
608 | // the max events and events are adjusted for the last run | |
609 | fTPCdataQA[specie]->SetMaxEvents(fRawMaxEvents); | |
610 | fTPCdataQA[specie]->SetEventsPerBin(fRawEventsPerBin); | |
611 | } | |
612 | } | |
613 | } | |
614 | } | |
615 | ||
616 | //____________________________________________________________________________ | |
617 | TH1F* AliTPCQADataMakerRec::CreateEventsHistCopy(const TH1F* hist, | |
618 | const Char_t* copyName) | |
619 | { | |
620 | // This method is used to create a copy of the event histograms | |
621 | ||
622 | TH1F* histCopy = new TH1F(copyName, hist->GetTitle(), | |
623 | hist->GetXaxis()->GetNbins(), | |
624 | hist->GetXaxis()->GetXmin(), | |
625 | hist->GetXaxis()->GetXmax()); | |
626 | histCopy->GetXaxis()->SetTitle(hist->GetXaxis()->GetTitle()); | |
627 | histCopy->GetYaxis()->SetTitle(hist->GetYaxis()->GetTitle()); | |
628 | histCopy->SetMarkerStyle(20); | |
629 | histCopy->SetOption("P"); | |
630 | histCopy->SetStats(kFALSE); | |
631 | ||
632 | return histCopy; | |
633 | } |