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(Double_t * rv, 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 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
79 rv[specie] = 1.0; // All is fine
81 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
83 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
86 if (index == AliQAv1::kRAW)
87 rv[specie] = CheckRAW(specie, list[specie]);
88 if (index == AliQAv1::kSIM)
89 rv[specie] = CheckSIM(specie, list[specie]);
90 if (index == AliQAv1::kREC)
91 rv[specie] = CheckREC(specie, list[specie]);
92 if (index == AliQAv1::kESD)
93 rv[specie] = CheckESD(specie, list[specie]);
96 AliInfo(Form("Specie: %s. Task: %s. Value: %f",
97 AliRecoParam::GetEventSpecieName(specie),
98 AliQAv1::GetAliTaskName(index),
103 //______________________________________________________________________________
104 Double_t AliTPCQAChecker::CheckRAW(Int_t specie, TObjArray* list)
108 AliInfo("In AliTPCQAChecker::CheckRAW");
113 Char_t specieName[256];
114 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
116 TH1* hRawsOccupancyVsSector = static_cast<TH1*>
117 (list->FindObject(Form("%s_hRawsOccupancyVsSector",specieName)));
118 TH1* hRawsQmaxVsSector = static_cast<TH1*>
119 (list->FindObject(Form("%s_hRawsQmaxVsSector",specieName)));
121 if (!hRawsOccupancyVsSector || !hRawsQmaxVsSector)
122 return -0.5; // fatal
124 if(hRawsOccupancyVsSector->GetEntries()==0) {
125 return 0.25; // error - No TPC data!
128 Int_t nBinsX = hRawsOccupancyVsSector->GetNbinsX();
129 for(Int_t i = 1; i <= nBinsX; i++) {
131 if(hRawsOccupancyVsSector->GetBinContent(i)==0)
132 return 0.75; // warning - no TPC data for at least one sector
138 //______________________________________________________________________________
139 Double_t AliTPCQAChecker::CheckSIM(Int_t specie, TObjArray* list)
141 // This method checks the QA histograms associated with simulation
145 // The digit histogram gives the ADC distribution for all sigbnals
146 // above threshold. The check is just that there are digits.
147 // Hits : The hit histograms are checked to see that they are not
148 // empty. They contain a lot of detailed information on the
149 // energyloss model (they were used to debug the AliRoot TPC use of
152 // The check methods are simple:
153 // We do not know if it is bad that histograms are missing because
154 // this will always be the case for summable digits. So this check
155 // is not possible here.
156 // If digit histogram is empty (set error)
157 // If one of the hit histograms are empty (set error)
159 AliInfo("In AliTPCQAChecker::CheckSIM");
164 Char_t specieName[256];
165 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
167 TH1* hDigits = static_cast<TH1*>
168 (list->FindObject(Form("%s_hDigitsADC",specieName)));
169 TH1* hHitsNhits = static_cast<TH1*>
170 (list->FindObject(Form("%s_hHitsNhits",specieName)));
171 TH1* hHitsElectrons = static_cast<TH1*>
172 (list->FindObject(Form("%s_hHitsElectrons",specieName)));
173 TH1* hHitsRadius = static_cast<TH1*>
174 (list->FindObject(Form("%s_hHitsRadius",specieName)));
175 TH1* histHitsPrimPerCm = static_cast<TH1*>
176 (list->FindObject(Form("%s_histHitsPrimPerCm",specieName)));
177 TH1* histHitsElectronsPerCm = static_cast<TH1*>
178 (list->FindObject(Form("%s_histHitsElectronsPerCm",specieName)));
180 // if (!(hDigits) || // digit hists
181 // !(hHitsNhits && hHitsElectrons && hHitsRadius && histHitsPrimPerCm && histHitsElectronsPerCm)) // hit hists
182 // return -0.5; // fatal
185 if(hDigits->GetEntries()==0)
186 return 0.25; // error
189 if (hHitsNhits && hHitsElectrons && hHitsRadius &&
190 histHitsPrimPerCm && histHitsElectronsPerCm) {
191 if (hHitsNhits->GetEntries()==0 || hHitsElectrons->GetEntries()==0 ||
192 hHitsRadius->GetEntries()==0 || histHitsPrimPerCm->GetEntries()==0 ||
193 histHitsElectronsPerCm->GetEntries()==0)
194 return 0.25; // error
200 //______________________________________________________________________________
201 Double_t AliTPCQAChecker::CheckREC(Int_t specie, TObjArray* list)
203 // This method checks the QA histograms associated with reconstruction
207 // The digit histogram gives the ADC distribution for all sigbnals
208 // above threshold. The check is just that there are digits.
210 // The cluster histograms are meant to give an idea about the gain
211 // from the cluster charge and to indicate iof there are rows with
212 // noise clusters, i.e., they are very visual.
214 // The check methods are simple:
215 // If there are no histogram at all (set fatal)
216 // If digit histogram is there, but there are no digits (set error)
217 // If cluster histogram is there but there are less than 1000
218 // clusters (set warning)
219 // If there are more than 1000 clusters but no clusters for either short,
220 // medium, or long pads (set error)
222 AliInfo("In AliTPCQAChecker::CheckREC");
227 Char_t specieName[256];
228 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
230 TH1* hDigits = static_cast<TH1*>
231 (list->FindObject(Form("%s_hDigitsADC",specieName)));
232 TH1* hNclustersVsRow = static_cast<TH1*>
233 (list->FindObject(Form("%s_hRecPointsRow",specieName)));
234 TH1* hQshort = static_cast<TH1*>
235 (list->FindObject(Form("%s_hRecPointsQShort",specieName)));
236 TH1* hQmedium = static_cast<TH1*>
237 (list->FindObject(Form("%s_hRecPointsQMedium",specieName)));
238 TH1* hQlong = static_cast<TH1*>
239 (list->FindObject(Form("%s_hRecPointsQLong",specieName)));
240 // The Qmax histograms are for now ignored
242 if (!hDigits && // digits missing
243 (!hNclustersVsRow || !hQshort || !hQmedium || !hQlong)) // 1 recpoint hist missing
244 return -0.5; // fatal
246 if (hDigits && hDigits->GetEntries()==0)
247 return 0.25; // error
249 if (hNclustersVsRow && hNclustersVsRow->GetEntries() < 1000) {
250 return 0.75; // warning
252 if (!hQshort || !hQlong || !hQlong)
253 return -0.5;// fatal - they should be there if the cluster vs row hist is there
254 if (hQshort->GetEntries()==0 || hQmedium->GetEntries()==0 ||
255 hQlong->GetEntries()==0)
256 return 0.25; // error
261 //______________________________________________________________________________
262 Double_t AliTPCQAChecker::CheckESD(Int_t specie, TObjArray* list)
264 // This method checks the QA histograms associated with ESDs
265 // (Note that there is aslo a globalQA which is running on all
266 // the ESD information so for now this is just a few basic
269 // The check methods are simple:
270 // If there are no histogram at all (set fatal)
273 AliInfo("In AliTPCQAChecker::CheckESD");
278 Char_t specieName[256];
279 sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
281 TH1* hESDclusters = static_cast<TH1*>
282 (list->FindObject(Form("%s_hESDclusters",specieName)));
283 TH1* hESDratio = static_cast<TH1*>
284 (list->FindObject(Form("%s_hESDratio",specieName)));
285 TH1* hESDpt = static_cast<TH1*>
286 (list->FindObject(Form("%s_hESDpt",specieName)));
288 if (!hESDclusters || !hESDratio || !hESDpt)
289 return -0.5; // fatal
294 //______________________________________________________________________________
295 void AliTPCQAChecker::Init(const AliQAv1::DETECTORINDEX_t det)
297 /// intialises QA and QA checker settings
299 AliInfo("In AliTPCQAChecker::Init");
300 AliQAv1::Instance(det) ;
301 Float_t hiValue[AliQAv1::kNBIT] ;
302 Float_t lowValue[AliQAv1::kNBIT] ;
303 hiValue[AliQAv1::kINFO] = 1.00;
304 lowValue[AliQAv1::kINFO] = 0.99;
305 hiValue[AliQAv1::kWARNING] = 0.99;
306 lowValue[AliQAv1::kWARNING] = 0.50;
307 hiValue[AliQAv1::kERROR] = 0.50;
308 lowValue[AliQAv1::kERROR] = 0.00;
309 hiValue[AliQAv1::kFATAL] = 0.00;
310 lowValue[AliQAv1::kFATAL] =-1.00;
311 // SetHiLo(&hiValue[0], &lowValue[0]) ;
312 SetHiLo(hiValue, lowValue) ;
315 //______________________________________________________________________________
317 AliTPCQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
319 /// sets the QA according the return value of the Check
322 AliInfo("In AliTPCQAChecker::SetQA");
324 AliQAv1 * qa = AliQAv1::Instance(index);
326 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
328 if (value==NULL) { // No checker is implemented, set all QA to Fatal
331 AliInfo(Form("Fatal QA. Task: %s. Specie: %s",
332 AliQAv1::GetAliTaskName(index),
333 AliRecoParam::GetEventSpecieName(specie)));
334 qa->Set(AliQAv1::kFATAL, specie) ;
337 if ( value[specie] >= fLowTestValue[AliQAv1::kFATAL] &&
338 value[specie] < fUpTestValue[AliQAv1::kFATAL] ) {
341 AliInfo(Form("QA-Fatal. Task: %s. Specie: %s",
342 AliQAv1::GetAliTaskName(index),
343 AliRecoParam::GetEventSpecieName(specie)));
344 qa->Set(AliQAv1::kFATAL, specie) ;
345 } else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] &&
346 value[specie] <= fUpTestValue[AliQAv1::kERROR] ) {
349 AliInfo(Form("QA-Error. Task: %s. Specie: %s",
350 AliQAv1::GetAliTaskName(index),
351 AliRecoParam::GetEventSpecieName(specie)));
352 qa->Set(AliQAv1::kERROR, specie) ;
353 } else if (value[specie] > fLowTestValue[AliQAv1::kWARNING] &&
354 value[specie] <= fUpTestValue[AliQAv1::kWARNING]) {
357 AliInfo(Form("QA-Warning. Task: %s. Specie: %s",
358 AliQAv1::GetAliTaskName(index),
359 AliRecoParam::GetEventSpecieName(specie)));
360 qa->Set(AliQAv1::kWARNING, specie) ;
361 } else if (value[specie] > fLowTestValue[AliQAv1::kINFO] &&
362 value[specie] <= fUpTestValue[AliQAv1::kINFO] ) {
365 AliInfo(Form("QA-Info. Task: %s. Specie: %s",
366 AliQAv1::GetAliTaskName(index),
367 AliRecoParam::GetEventSpecieName(specie)));
368 qa->Set(AliQAv1::kINFO, specie) ;