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)
38 //__________________________________________________________________
39 AliTPCQAChecker& AliTPCQAChecker::operator = (const AliTPCQAChecker &checker)
42 this->~AliTPCQAChecker();
43 new(this) AliTPCQAChecker(checker);
47 //__________________________________________________________________
49 AliTPCQAChecker::Check(Double_t * rv, AliQAv1::ALITASK_t index, TObjArray ** list,
50 const AliDetectorRecoParam * /*recoParam*/)
52 /* 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.
54 From the AliQAChecker::Run() methods we have:
66 - AliQAv1::kTRACKSEGMENTS
67 - AliQAv1::kRECPARTICLES
72 This means that for each group of tasks the Check will be called
73 one or more times. This also mean that we cannot know what
74 histograms will be or not be there in a single call... And we
75 also do not know the position in the list of the histogram.
78 /// Check objects in list
80 AliInfo("In AliTPCQAChecker::Check");
82 if (index!=AliQAv1::kRAW&&index!=AliQAv1::kSIM&&index!=AliQAv1::kREC&&index!=AliQAv1::kESD) {
84 AliWarning(Form("Checker for task %d not implement for the moment",index));
88 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
89 rv[specie] = 1.0; // All is fine
91 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
93 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
96 if (index == AliQAv1::kRAW)
97 rv[specie] = CheckRAW(specie, list[specie]);
98 if (index == AliQAv1::kSIM)
99 rv[specie] = CheckSIM(specie, list[specie]);
100 if (index == AliQAv1::kREC)
101 rv[specie] = CheckREC(specie, list[specie]);
102 if (index == AliQAv1::kESD)
103 rv[specie] = CheckESD(specie, list[specie]);
106 AliInfo(Form("Specie: %s. Task: %s. Value: %f",
107 AliRecoParam::GetEventSpecieName(specie),
108 AliQAv1::GetAliTaskName(index),
113 //______________________________________________________________________________
114 Double_t AliTPCQAChecker::CheckRAW(Int_t specie, TObjArray* list)
118 AliInfo("In AliTPCQAChecker::CheckRAW");
123 TH1* hRawsOccupancyVsSector = static_cast<TH1*>
124 (list->FindObject(Form("%s_hRawsOccupancyVsSector",AliRecoParam::GetEventSpecieName(specie))));
125 TH1* hRawsQmaxVsSector = static_cast<TH1*>
126 (list->FindObject(Form("%s_hRawsQmaxVsSector",AliRecoParam::GetEventSpecieName(specie))));
128 if (!hRawsOccupancyVsSector || !hRawsQmaxVsSector)
129 return -0.5; // fatal
131 if(hRawsOccupancyVsSector->GetEntries()==0) {
132 return 0.25; // error - No TPC data!
135 Int_t nBinsX = hRawsOccupancyVsSector->GetNbinsX();
136 for(Int_t i = 1; i <= nBinsX; i++) {
138 if(hRawsOccupancyVsSector->GetBinContent(i)==0)
139 return 0.75; // warning - no TPC data for at least one sector
145 //______________________________________________________________________________
146 Double_t AliTPCQAChecker::CheckSIM(Int_t specie, TObjArray* list)
148 // This method checks the QA histograms associated with simulation
152 // The digit histogram gives the ADC distribution for all sigbnals
153 // above threshold. The check is just that there are digits.
154 // Hits : The hit histograms are checked to see that they are not
155 // empty. They contain a lot of detailed information on the
156 // energyloss model (they were used to debug the AliRoot TPC use of
159 // The check methods are simple:
160 // We do not know if it is bad that histograms are missing because
161 // this will always be the case for summable digits. So this check
162 // is not possible here.
163 // If digit histogram is empty (set error)
164 // If one of the hit histograms are empty (set error)
166 AliInfo("In AliTPCQAChecker::CheckSIM");
171 TH1* hDigits = static_cast<TH1*>
172 (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
173 TH1* hHitsNhits = static_cast<TH1*>
174 (list->FindObject(Form("%s_hHitsNhits",AliRecoParam::GetEventSpecieName(specie))));
175 TH1* hHitsElectrons = static_cast<TH1*>
176 (list->FindObject(Form("%s_hHitsElectrons",AliRecoParam::GetEventSpecieName(specie))));
177 TH1* hHitsRadius = static_cast<TH1*>
178 (list->FindObject(Form("%s_hHitsRadius",AliRecoParam::GetEventSpecieName(specie))));
179 TH1* histHitsPrimPerCm = static_cast<TH1*>
180 (list->FindObject(Form("%s_histHitsPrimPerCm",AliRecoParam::GetEventSpecieName(specie))));
181 TH1* histHitsElectronsPerCm = static_cast<TH1*>
182 (list->FindObject(Form("%s_histHitsElectronsPerCm",AliRecoParam::GetEventSpecieName(specie))));
184 // if (!(hDigits) || // digit hists
185 // !(hHitsNhits && hHitsElectrons && hHitsRadius && histHitsPrimPerCm && histHitsElectronsPerCm)) // hit hists
186 // return -0.5; // fatal
189 if(hDigits->GetEntries()==0)
190 return 0.25; // error
193 if (hHitsNhits && hHitsElectrons && hHitsRadius &&
194 histHitsPrimPerCm && histHitsElectronsPerCm) {
195 if (hHitsNhits->GetEntries()==0 || hHitsElectrons->GetEntries()==0 ||
196 hHitsRadius->GetEntries()==0 || histHitsPrimPerCm->GetEntries()==0 ||
197 histHitsElectronsPerCm->GetEntries()==0)
198 return 0.25; // error
204 //______________________________________________________________________________
205 Double_t AliTPCQAChecker::CheckREC(Int_t specie, TObjArray* list)
207 // This method checks the QA histograms associated with reconstruction
211 // The digit histogram gives the ADC distribution for all sigbnals
212 // above threshold. The check is just that there are digits.
214 // The cluster histograms are meant to give an idea about the gain
215 // from the cluster charge and to indicate iof there are rows with
216 // noise clusters, i.e., they are very visual.
218 // The check methods are simple:
219 // If there are no histogram at all (set fatal)
220 // If digit histogram is there, but there are no digits (set error)
221 // If cluster histogram is there but there are less than 1000
222 // clusters (set warning)
223 // If there are more than 1000 clusters but no clusters for either short,
224 // medium, or long pads (set error)
226 AliInfo("In AliTPCQAChecker::CheckREC");
231 TH1* hDigits = static_cast<TH1*>
232 (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
233 TH1* hNclustersVsRow = static_cast<TH1*>
234 (list->FindObject(Form("%s_hRecPointsRow",AliRecoParam::GetEventSpecieName(specie))));
235 TH1* hQshort = static_cast<TH1*>
236 (list->FindObject(Form("%s_hRecPointsQShort",AliRecoParam::GetEventSpecieName(specie))));
237 TH1* hQmedium = static_cast<TH1*>
238 (list->FindObject(Form("%s_hRecPointsQMedium",AliRecoParam::GetEventSpecieName(specie))));
239 TH1* hQlong = static_cast<TH1*>
240 (list->FindObject(Form("%s_hRecPointsQLong",AliRecoParam::GetEventSpecieName(specie))));
241 // The Qmax histograms are for now ignored
243 if (!hDigits && // digits missing
244 (!hNclustersVsRow || !hQshort || !hQmedium || !hQlong)) // 1 recpoint hist missing
245 return -0.5; // fatal
247 if (hDigits && hDigits->GetEntries()==0)
248 return 0.25; // error
250 if (hNclustersVsRow && hNclustersVsRow->GetEntries() < 1000) {
251 return 0.75; // warning
253 if (!hQshort || !hQlong || !hQlong)
254 return -0.5;// fatal - they should be there if the cluster vs row hist is there
255 if (hQshort->GetEntries()==0 || hQmedium->GetEntries()==0 ||
256 hQlong->GetEntries()==0)
257 return 0.25; // error
262 //______________________________________________________________________________
263 Double_t AliTPCQAChecker::CheckESD(Int_t specie, TObjArray* list)
265 // This method checks the QA histograms associated with ESDs
266 // (Note that there is aslo a globalQA which is running on all
267 // the ESD information so for now this is just a few basic
270 // The check methods are simple:
271 // If there are no histogram at all (set fatal)
274 AliInfo("In AliTPCQAChecker::CheckESD");
279 TH1* hESDclusters = static_cast<TH1*>
280 (list->FindObject(Form("%s_hESDclusters",AliRecoParam::GetEventSpecieName(specie))));
281 TH1* hESDratio = static_cast<TH1*>
282 (list->FindObject(Form("%s_hESDratio",AliRecoParam::GetEventSpecieName(specie))));
283 TH1* hESDpt = static_cast<TH1*>
284 (list->FindObject(Form("%s_hESDpt",AliRecoParam::GetEventSpecieName(specie))));
286 if (!hESDclusters || !hESDratio || !hESDpt)
287 return -0.5; // fatal
292 //______________________________________________________________________________
293 void AliTPCQAChecker::Init(const AliQAv1::DETECTORINDEX_t det)
295 /// intialises QA and QA checker settings
297 AliInfo("In AliTPCQAChecker::Init");
298 AliQAv1::Instance(det) ;
299 Float_t hiValue[AliQAv1::kNBIT] ;
300 Float_t lowValue[AliQAv1::kNBIT] ;
301 hiValue[AliQAv1::kINFO] = 1.00;
302 lowValue[AliQAv1::kINFO] = 0.99;
303 hiValue[AliQAv1::kWARNING] = 0.99;
304 lowValue[AliQAv1::kWARNING] = 0.50;
305 hiValue[AliQAv1::kERROR] = 0.50;
306 lowValue[AliQAv1::kERROR] = 0.00;
307 hiValue[AliQAv1::kFATAL] = 0.00;
308 lowValue[AliQAv1::kFATAL] =-1.00;
309 // SetHiLo(&hiValue[0], &lowValue[0]) ;
310 SetHiLo(hiValue, lowValue) ;
313 //______________________________________________________________________________
315 AliTPCQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
317 /// sets the QA according the return value of the Check
320 AliInfo("In AliTPCQAChecker::SetQA");
322 AliQAv1 * qa = AliQAv1::Instance(index);
324 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
326 if (value==NULL) { // No checker is implemented, set all QA to Fatal
329 AliInfo(Form("Fatal QA. Task: %s. Specie: %s",
330 AliQAv1::GetAliTaskName(index),
331 AliRecoParam::GetEventSpecieName(specie)));
332 qa->Set(AliQAv1::kFATAL, specie) ;
335 if ( value[specie] >= fLowTestValue[AliQAv1::kFATAL] &&
336 value[specie] < fUpTestValue[AliQAv1::kFATAL] ) {
339 AliInfo(Form("QA-Fatal. Task: %s. Specie: %s",
340 AliQAv1::GetAliTaskName(index),
341 AliRecoParam::GetEventSpecieName(specie)));
342 qa->Set(AliQAv1::kFATAL, specie) ;
343 } else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] &&
344 value[specie] <= fUpTestValue[AliQAv1::kERROR] ) {
347 AliInfo(Form("QA-Error. Task: %s. Specie: %s",
348 AliQAv1::GetAliTaskName(index),
349 AliRecoParam::GetEventSpecieName(specie)));
350 qa->Set(AliQAv1::kERROR, specie) ;
351 } else if (value[specie] > fLowTestValue[AliQAv1::kWARNING] &&
352 value[specie] <= fUpTestValue[AliQAv1::kWARNING]) {
355 AliInfo(Form("QA-Warning. Task: %s. Specie: %s",
356 AliQAv1::GetAliTaskName(index),
357 AliRecoParam::GetEventSpecieName(specie)));
358 qa->Set(AliQAv1::kWARNING, specie) ;
359 } else if (value[specie] > fLowTestValue[AliQAv1::kINFO] &&
360 value[specie] <= fUpTestValue[AliQAv1::kINFO] ) {
363 AliInfo(Form("QA-Info. Task: %s. Specie: %s",
364 AliQAv1::GetAliTaskName(index),
365 AliRecoParam::GetEventSpecieName(specie)));
366 qa->Set(AliQAv1::kINFO, specie) ;