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 TH1* hRawsOccupancyVsSector = static_cast<TH1*>
114 (list->FindObject(Form("%s_hRawsOccupancyVsSector",AliRecoParam::GetEventSpecieName(specie))));
115 TH1* hRawsQmaxVsSector = static_cast<TH1*>
116 (list->FindObject(Form("%s_hRawsQmaxVsSector",AliRecoParam::GetEventSpecieName(specie))));
118 if (!hRawsOccupancyVsSector || !hRawsQmaxVsSector)
119 return -0.5; // fatal
121 if(hRawsOccupancyVsSector->GetEntries()==0) {
122 return 0.25; // error - No TPC data!
125 Int_t nBinsX = hRawsOccupancyVsSector->GetNbinsX();
126 for(Int_t i = 1; i <= nBinsX; i++) {
128 if(hRawsOccupancyVsSector->GetBinContent(i)==0)
129 return 0.75; // warning - no TPC data for at least one sector
135 //______________________________________________________________________________
136 Double_t AliTPCQAChecker::CheckSIM(Int_t specie, TObjArray* list)
138 // This method checks the QA histograms associated with simulation
142 // The digit histogram gives the ADC distribution for all sigbnals
143 // above threshold. The check is just that there are digits.
144 // Hits : The hit histograms are checked to see that they are not
145 // empty. They contain a lot of detailed information on the
146 // energyloss model (they were used to debug the AliRoot TPC use of
149 // The check methods are simple:
150 // We do not know if it is bad that histograms are missing because
151 // this will always be the case for summable digits. So this check
152 // is not possible here.
153 // If digit histogram is empty (set error)
154 // If one of the hit histograms are empty (set error)
156 AliInfo("In AliTPCQAChecker::CheckSIM");
161 TH1* hDigits = static_cast<TH1*>
162 (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
163 TH1* hHitsNhits = static_cast<TH1*>
164 (list->FindObject(Form("%s_hHitsNhits",AliRecoParam::GetEventSpecieName(specie))));
165 TH1* hHitsElectrons = static_cast<TH1*>
166 (list->FindObject(Form("%s_hHitsElectrons",AliRecoParam::GetEventSpecieName(specie))));
167 TH1* hHitsRadius = static_cast<TH1*>
168 (list->FindObject(Form("%s_hHitsRadius",AliRecoParam::GetEventSpecieName(specie))));
169 TH1* histHitsPrimPerCm = static_cast<TH1*>
170 (list->FindObject(Form("%s_histHitsPrimPerCm",AliRecoParam::GetEventSpecieName(specie))));
171 TH1* histHitsElectronsPerCm = static_cast<TH1*>
172 (list->FindObject(Form("%s_histHitsElectronsPerCm",AliRecoParam::GetEventSpecieName(specie))));
174 // if (!(hDigits) || // digit hists
175 // !(hHitsNhits && hHitsElectrons && hHitsRadius && histHitsPrimPerCm && histHitsElectronsPerCm)) // hit hists
176 // return -0.5; // fatal
179 if(hDigits->GetEntries()==0)
180 return 0.25; // error
183 if (hHitsNhits && hHitsElectrons && hHitsRadius &&
184 histHitsPrimPerCm && histHitsElectronsPerCm) {
185 if (hHitsNhits->GetEntries()==0 || hHitsElectrons->GetEntries()==0 ||
186 hHitsRadius->GetEntries()==0 || histHitsPrimPerCm->GetEntries()==0 ||
187 histHitsElectronsPerCm->GetEntries()==0)
188 return 0.25; // error
194 //______________________________________________________________________________
195 Double_t AliTPCQAChecker::CheckREC(Int_t specie, TObjArray* list)
197 // This method checks the QA histograms associated with reconstruction
201 // The digit histogram gives the ADC distribution for all sigbnals
202 // above threshold. The check is just that there are digits.
204 // The cluster histograms are meant to give an idea about the gain
205 // from the cluster charge and to indicate iof there are rows with
206 // noise clusters, i.e., they are very visual.
208 // The check methods are simple:
209 // If there are no histogram at all (set fatal)
210 // If digit histogram is there, but there are no digits (set error)
211 // If cluster histogram is there but there are less than 1000
212 // clusters (set warning)
213 // If there are more than 1000 clusters but no clusters for either short,
214 // medium, or long pads (set error)
216 AliInfo("In AliTPCQAChecker::CheckREC");
221 TH1* hDigits = static_cast<TH1*>
222 (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
223 TH1* hNclustersVsRow = static_cast<TH1*>
224 (list->FindObject(Form("%s_hRecPointsRow",AliRecoParam::GetEventSpecieName(specie))));
225 TH1* hQshort = static_cast<TH1*>
226 (list->FindObject(Form("%s_hRecPointsQShort",AliRecoParam::GetEventSpecieName(specie))));
227 TH1* hQmedium = static_cast<TH1*>
228 (list->FindObject(Form("%s_hRecPointsQMedium",AliRecoParam::GetEventSpecieName(specie))));
229 TH1* hQlong = static_cast<TH1*>
230 (list->FindObject(Form("%s_hRecPointsQLong",AliRecoParam::GetEventSpecieName(specie))));
231 // The Qmax histograms are for now ignored
233 if (!hDigits && // digits missing
234 (!hNclustersVsRow || !hQshort || !hQmedium || !hQlong)) // 1 recpoint hist missing
235 return -0.5; // fatal
237 if (hDigits && hDigits->GetEntries()==0)
238 return 0.25; // error
240 if (hNclustersVsRow && hNclustersVsRow->GetEntries() < 1000) {
241 return 0.75; // warning
243 if (!hQshort || !hQlong || !hQlong)
244 return -0.5;// fatal - they should be there if the cluster vs row hist is there
245 if (hQshort->GetEntries()==0 || hQmedium->GetEntries()==0 ||
246 hQlong->GetEntries()==0)
247 return 0.25; // error
252 //______________________________________________________________________________
253 Double_t AliTPCQAChecker::CheckESD(Int_t specie, TObjArray* list)
255 // This method checks the QA histograms associated with ESDs
256 // (Note that there is aslo a globalQA which is running on all
257 // the ESD information so for now this is just a few basic
260 // The check methods are simple:
261 // If there are no histogram at all (set fatal)
264 AliInfo("In AliTPCQAChecker::CheckESD");
269 TH1* hESDclusters = static_cast<TH1*>
270 (list->FindObject(Form("%s_hESDclusters",AliRecoParam::GetEventSpecieName(specie))));
271 TH1* hESDratio = static_cast<TH1*>
272 (list->FindObject(Form("%s_hESDratio",AliRecoParam::GetEventSpecieName(specie))));
273 TH1* hESDpt = static_cast<TH1*>
274 (list->FindObject(Form("%s_hESDpt",AliRecoParam::GetEventSpecieName(specie))));
276 if (!hESDclusters || !hESDratio || !hESDpt)
277 return -0.5; // fatal
282 //______________________________________________________________________________
283 void AliTPCQAChecker::Init(const AliQAv1::DETECTORINDEX_t det)
285 /// intialises QA and QA checker settings
287 AliInfo("In AliTPCQAChecker::Init");
288 AliQAv1::Instance(det) ;
289 Float_t hiValue[AliQAv1::kNBIT] ;
290 Float_t lowValue[AliQAv1::kNBIT] ;
291 hiValue[AliQAv1::kINFO] = 1.00;
292 lowValue[AliQAv1::kINFO] = 0.99;
293 hiValue[AliQAv1::kWARNING] = 0.99;
294 lowValue[AliQAv1::kWARNING] = 0.50;
295 hiValue[AliQAv1::kERROR] = 0.50;
296 lowValue[AliQAv1::kERROR] = 0.00;
297 hiValue[AliQAv1::kFATAL] = 0.00;
298 lowValue[AliQAv1::kFATAL] =-1.00;
299 // SetHiLo(&hiValue[0], &lowValue[0]) ;
300 SetHiLo(hiValue, lowValue) ;
303 //______________________________________________________________________________
305 AliTPCQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
307 /// sets the QA according the return value of the Check
310 AliInfo("In AliTPCQAChecker::SetQA");
312 AliQAv1 * qa = AliQAv1::Instance(index);
314 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
316 if (value==NULL) { // No checker is implemented, set all QA to Fatal
319 AliInfo(Form("Fatal QA. Task: %s. Specie: %s",
320 AliQAv1::GetAliTaskName(index),
321 AliRecoParam::GetEventSpecieName(specie)));
322 qa->Set(AliQAv1::kFATAL, specie) ;
325 if ( value[specie] >= fLowTestValue[AliQAv1::kFATAL] &&
326 value[specie] < fUpTestValue[AliQAv1::kFATAL] ) {
329 AliInfo(Form("QA-Fatal. Task: %s. Specie: %s",
330 AliQAv1::GetAliTaskName(index),
331 AliRecoParam::GetEventSpecieName(specie)));
332 qa->Set(AliQAv1::kFATAL, specie) ;
333 } else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] &&
334 value[specie] <= fUpTestValue[AliQAv1::kERROR] ) {
337 AliInfo(Form("QA-Error. Task: %s. Specie: %s",
338 AliQAv1::GetAliTaskName(index),
339 AliRecoParam::GetEventSpecieName(specie)));
340 qa->Set(AliQAv1::kERROR, specie) ;
341 } else if (value[specie] > fLowTestValue[AliQAv1::kWARNING] &&
342 value[specie] <= fUpTestValue[AliQAv1::kWARNING]) {
345 AliInfo(Form("QA-Warning. Task: %s. Specie: %s",
346 AliQAv1::GetAliTaskName(index),
347 AliRecoParam::GetEventSpecieName(specie)));
348 qa->Set(AliQAv1::kWARNING, specie) ;
349 } else if (value[specie] > fLowTestValue[AliQAv1::kINFO] &&
350 value[specie] <= fUpTestValue[AliQAv1::kINFO] ) {
353 AliInfo(Form("QA-Info. Task: %s. Specie: %s",
354 AliQAv1::GetAliTaskName(index),
355 AliRecoParam::GetEventSpecieName(specie)));
356 qa->Set(AliQAv1::kINFO, specie) ;