1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 Checks implemented a la AliMUONQAChecker.
20 Checks the quality assurance by realzed checks on histogram content.
21 P. Christiansen, Lund, September 2009.
23 Based on AliPHOSQAChecker.
24 Checks the quality assurance by comparing with reference data.
25 P. Christiansen, Lund, January 2008.
28 // --- ROOT header files ---
31 // --- AliRoot header files ---
32 #include "AliTPCQAChecker.h"
33 #include "AliTPCQADataMakerRec.h"
35 ClassImp(AliTPCQAChecker)
37 //__________________________________________________________________
39 AliTPCQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list,
40 const AliDetectorRecoParam * /*recoParam*/)
42 /* It is important to understand the destinction between indexed tasks (AliQAv1::TASKINDEX_t) which are used in the DataMaker classes and indexed tasks (AliQAv1::ALITASK_t) whihc are used in the checker class.
44 From the AliQAChecker::Run() methods we have:
56 - AliQAv1::kTRACKSEGMENTS
57 - AliQAv1::kRECPARTICLES
62 This means that for each group of tasks the Check will be called
63 one or more times. This also mean that we cannot know what
64 histograms will be or not be there in a single call... And we
65 also do not know the position in the list of the histogram.
68 /// Check objects in list
70 AliInfo("In AliTPCQAChecker::Check");
72 if (index!=AliQAv1::kRAW&&index!=AliQAv1::kSIM&&index!=AliQAv1::kREC&&index!=AliQAv1::kESD) {
74 AliWarning(Form("Checker for task %d not implement for the moment",index));
78 Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ;
79 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
80 rv[specie] = 1.0; // All is fine
82 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
84 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
87 if (index == AliQAv1::kRAW)
88 rv[specie] = CheckRAW(specie, list[specie]);
89 if (index == AliQAv1::kSIM)
90 rv[specie] = CheckSIM(specie, list[specie]);
91 if (index == AliQAv1::kREC)
92 rv[specie] = CheckREC(specie, list[specie]);
93 if (index == AliQAv1::kESD)
94 rv[specie] = CheckESD(specie, list[specie]);
97 AliInfo(Form("Specie: %s. Task: %s. Value: %f",
98 AliRecoParam::GetEventSpecieName(specie),
99 AliQAv1::GetAliTaskName(index),
106 //______________________________________________________________________________
107 Double_t AliTPCQAChecker::CheckRAW(Int_t specie, TObjArray* list)
111 AliInfo("In AliTPCQAChecker::CheckRAW");
116 Char_t specieName[256];
117 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
119 TH1* hRawsOccupancyVsSector = static_cast<TH1*>
120 (list->FindObject(Form("%s_hRawsOccupancyVsSector",specieName)));
121 TH1* hRawsQmaxVsSector = static_cast<TH1*>
122 (list->FindObject(Form("%s_hRawsQmaxVsSector",specieName)));
123 TH1* hRawsOccupancyVsEvent = static_cast<TH1*>
124 (list->FindObject(Form("%s_hRawsOccupancyVsEvent",specieName)));
125 TH1* hRawsNclustersVsEvent = static_cast<TH1*>
126 (list->FindObject(Form("%s_hRawsNclustersVsEvent",specieName)));
128 if (!hRawsOccupancyVsSector || !hRawsQmaxVsSector ||
129 !hRawsOccupancyVsEvent || !hRawsNclustersVsEvent)
130 return -0.5; // fatal
132 if(hRawsOccupancyVsSector->GetEntries()==0) {
133 return 0.25; // error - No TPC data!
136 Int_t nBinsX = hRawsOccupancyVsSector->GetNbinsX();
137 for(Int_t i = 1; i <= nBinsX; i++) {
139 if(hRawsOccupancyVsSector->GetBinContent(i)==0)
140 return 0.75; // warning - no TPC data for at least one sector
146 //______________________________________________________________________________
147 Double_t AliTPCQAChecker::CheckSIM(Int_t specie, TObjArray* list)
149 // This method checks the QA histograms associated with simulation
153 // The digit histogram gives the ADC distribution for all sigbnals
154 // above threshold. The check is just that there are digits.
155 // Hits : The hit histograms are checked to see that they are not
156 // empty. They contain a lot of detailed information on the
157 // energyloss model (they were used to debug the AliRoot TPC use of
160 // The check methods are simple:
161 // We do not know if it is bad that histograms are missing because
162 // this will always be the case for summable digits. So this check
163 // is not possible here.
164 // If digit histogram is empty (set error)
165 // If one of the hit histograms are empty (set error)
167 AliInfo("In AliTPCQAChecker::CheckSIM");
172 Char_t specieName[256];
173 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
175 TH1* hDigits = static_cast<TH1*>
176 (list->FindObject(Form("%s_hDigitsADC",specieName)));
177 TH1* hHitsNhits = static_cast<TH1*>
178 (list->FindObject(Form("%s_hHitsNhits",specieName)));
179 TH1* hHitsElectrons = static_cast<TH1*>
180 (list->FindObject(Form("%s_hHitsElectrons",specieName)));
181 TH1* hHitsRadius = static_cast<TH1*>
182 (list->FindObject(Form("%s_hHitsRadius",specieName)));
183 TH1* histHitsPrimPerCm = static_cast<TH1*>
184 (list->FindObject(Form("%s_histHitsPrimPerCm",specieName)));
185 TH1* histHitsElectronsPerCm = static_cast<TH1*>
186 (list->FindObject(Form("%s_histHitsElectronsPerCm",specieName)));
188 // if (!(hDigits) || // digit hists
189 // !(hHitsNhits && hHitsElectrons && hHitsRadius && histHitsPrimPerCm && histHitsElectronsPerCm)) // hit hists
190 // return -0.5; // fatal
193 if(hDigits->GetEntries()==0)
194 return 0.25; // error
197 if (hHitsNhits && hHitsElectrons && hHitsRadius &&
198 histHitsPrimPerCm && histHitsElectronsPerCm) {
199 if (hHitsNhits->GetEntries()==0 || hHitsElectrons->GetEntries()==0 ||
200 hHitsRadius->GetEntries()==0 || histHitsPrimPerCm->GetEntries()==0 ||
201 histHitsElectronsPerCm->GetEntries()==0)
202 return 0.25; // error
208 //______________________________________________________________________________
209 Double_t AliTPCQAChecker::CheckREC(Int_t specie, TObjArray* list)
211 // This method checks the QA histograms associated with reconstruction
215 // The digit histogram gives the ADC distribution for all sigbnals
216 // above threshold. The check is just that there are digits.
218 // The cluster histograms are meant to give an idea about the gain
219 // from the cluster charge and to indicate iof there are rows with
220 // noise clusters, i.e., they are very visual.
222 // The check methods are simple:
223 // If there are no histogram at all (set fatal)
224 // If digit histogram is there, but there are no digits (set error)
225 // If cluster histogram is there but there are less than 1000
226 // clusters (set warning)
227 // If there are more than 1000 clusters but no clusters for either short,
228 // medium, or long pads (set error)
230 AliInfo("In AliTPCQAChecker::CheckREC");
235 Char_t specieName[256];
236 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
238 TH1* hDigits = static_cast<TH1*>
239 (list->FindObject(Form("%s_hDigitsADC",specieName)));
240 TH1* hNclustersVsRow = static_cast<TH1*>
241 (list->FindObject(Form("%s_hRecPointsRow",specieName)));
242 TH1* hQshort = static_cast<TH1*>
243 (list->FindObject(Form("%s_hRecPointsQShort",specieName)));
244 TH1* hQmedium = static_cast<TH1*>
245 (list->FindObject(Form("%s_hRecPointsQMedium",specieName)));
246 TH1* hQlong = static_cast<TH1*>
247 (list->FindObject(Form("%s_hRecPointsQLong",specieName)));
248 // The Qmax histograms are for now ignored
250 if (!hDigits && // digits missing
251 (!hNclustersVsRow || !hQshort || !hQmedium || !hQlong)) // 1 recpoint hist missing
252 return -0.5; // fatal
254 if (hDigits && hDigits->GetEntries()==0)
255 return 0.25; // error
257 if (hNclustersVsRow && hNclustersVsRow->GetEntries() < 1000) {
258 return 0.75; // warning
260 if (!hQshort || !hQlong || !hQlong)
261 return -0.5;// fatal - they should be there if the cluster vs row hist is there
262 if (hQshort->GetEntries()==0 || hQmedium->GetEntries()==0 ||
263 hQlong->GetEntries()==0)
264 return 0.25; // error
269 //______________________________________________________________________________
270 Double_t AliTPCQAChecker::CheckESD(Int_t specie, TObjArray* list)
272 // This method checks the QA histograms associated with ESDs
273 // (Note that there is aslo a globalQA which is running on all
274 // the ESD information so for now this is just a few basic
277 // The check methods are simple:
278 // If there are no histogram at all (set fatal)
281 AliInfo("In AliTPCQAChecker::CheckESD");
286 Char_t specieName[256];
287 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
289 TH1* hESDclusters = static_cast<TH1*>
290 (list->FindObject(Form("%s_hESDclusters",specieName)));
291 TH1* hESDratio = static_cast<TH1*>
292 (list->FindObject(Form("%s_hESDratio",specieName)));
293 TH1* hESDpt = static_cast<TH1*>
294 (list->FindObject(Form("%s_hESDpt",specieName)));
296 if (!hESDclusters || !hESDratio || !hESDpt)
297 return -0.5; // fatal
302 //______________________________________________________________________________
303 void AliTPCQAChecker::Init(const AliQAv1::DETECTORINDEX_t det)
305 /// intialises QA and QA checker settings
307 AliInfo("In AliTPCQAChecker::Init");
308 AliQAv1::Instance(det) ;
309 Float_t hiValue[AliQAv1::kNBIT] ;
310 Float_t lowValue[AliQAv1::kNBIT] ;
311 hiValue[AliQAv1::kINFO] = 1.00;
312 lowValue[AliQAv1::kINFO] = 0.99;
313 hiValue[AliQAv1::kWARNING] = 0.99;
314 lowValue[AliQAv1::kWARNING] = 0.50;
315 hiValue[AliQAv1::kERROR] = 0.50;
316 lowValue[AliQAv1::kERROR] = 0.00;
317 hiValue[AliQAv1::kFATAL] = 0.00;
318 lowValue[AliQAv1::kFATAL] =-1.00;
319 // SetHiLo(&hiValue[0], &lowValue[0]) ;
320 SetHiLo(hiValue, lowValue) ;
323 //______________________________________________________________________________
325 AliTPCQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
327 /// sets the QA according the return value of the Check
330 AliInfo("In AliTPCQAChecker::SetQA");
332 AliQAv1 * qa = AliQAv1::Instance(index);
334 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
336 if (value==NULL) { // No checker is implemented, set all QA to Fatal
339 AliInfo(Form("Fatal QA. Task: %s. Specie: %s",
340 AliQAv1::GetAliTaskName(index),
341 AliRecoParam::GetEventSpecieName(specie)));
342 qa->Set(AliQAv1::kFATAL, specie) ;
345 if ( value[specie] >= fLowTestValue[AliQAv1::kFATAL] &&
346 value[specie] < fUpTestValue[AliQAv1::kFATAL] ) {
349 AliInfo(Form("QA-Fatal. Task: %s. Specie: %s",
350 AliQAv1::GetAliTaskName(index),
351 AliRecoParam::GetEventSpecieName(specie)));
352 qa->Set(AliQAv1::kFATAL, specie) ;
353 } else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] &&
354 value[specie] <= fUpTestValue[AliQAv1::kERROR] ) {
357 AliInfo(Form("QA-Error. Task: %s. Specie: %s",
358 AliQAv1::GetAliTaskName(index),
359 AliRecoParam::GetEventSpecieName(specie)));
360 qa->Set(AliQAv1::kERROR, specie) ;
361 } else if (value[specie] > fLowTestValue[AliQAv1::kWARNING] &&
362 value[specie] <= fUpTestValue[AliQAv1::kWARNING]) {
365 AliInfo(Form("QA-Warning. Task: %s. Specie: %s",
366 AliQAv1::GetAliTaskName(index),
367 AliRecoParam::GetEventSpecieName(specie)));
368 qa->Set(AliQAv1::kWARNING, specie) ;
369 } else if (value[specie] > fLowTestValue[AliQAv1::kINFO] &&
370 value[specie] <= fUpTestValue[AliQAv1::kINFO] ) {
373 AliInfo(Form("QA-Info. Task: %s. Specie: %s",
374 AliQAv1::GetAliTaskName(index),
375 AliRecoParam::GetEventSpecieName(specie)));
376 qa->Set(AliQAv1::kINFO, specie) ;