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 **************************************************************************/
17 /// \class AliTPCQAChecker
18 /// \brief Checks implemented a la AliMUONQAChecker.
20 /// Checks the quality assurance by realzed checks on histogram content.
22 /// Based on AliPHOSQAChecker.
23 /// Checks the quality assurance by comparing with reference data.
25 /// \author P. Christiansen, Lund
26 /// \date January 2008 - September 2009.
28 // --- ROOT header files ---
31 // --- AliRoot header files ---
32 #include "AliTPCQAChecker.h"
33 #include "AliTPCQADataMakerRec.h"
36 ClassImp(AliTPCQAChecker)
40 //__________________________________________________________________
41 AliTPCQAChecker& AliTPCQAChecker::operator = (const AliTPCQAChecker &checker)
45 this->~AliTPCQAChecker();
46 new(this) AliTPCQAChecker(checker);
50 //__________________________________________________________________
52 AliTPCQAChecker::Check(Double_t * rv, AliQAv1::ALITASK_t index, TObjArray ** list,
53 const AliDetectorRecoParam * /*recoParam*/)
55 /// 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.
57 /// From the AliQAChecker::Run() methods we have:
63 /// - AliQAv1::kSDIGITS
64 /// - AliQAv1::kDIGITS
67 /// - AliQAv1::kDIGITSR
68 /// - AliQAv1::kRECPOINTS
69 /// - AliQAv1::kTRACKSEGMENTS
70 /// - AliQAv1::kRECPARTICLES
75 /// This means that for each group of tasks the Check will be called
76 /// one or more times. This also mean that we cannot know what
77 /// histograms will be or not be there in a single call... And we
78 /// also do not know the position in the list of the histogram.
80 /// Check objects in list
82 AliInfo("In AliTPCQAChecker::Check");
84 if (index!=AliQAv1::kRAW&&index!=AliQAv1::kSIM&&index!=AliQAv1::kREC&&index!=AliQAv1::kESD) {
86 AliWarning(Form("Checker for task %d not implement for the moment",index));
90 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
91 rv[specie] = 1.0; // All is fine
93 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
95 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
98 if (index == AliQAv1::kRAW)
99 rv[specie] = CheckRAW(specie, list[specie]);
100 if (index == AliQAv1::kSIM)
101 rv[specie] = CheckSIM(specie, list[specie]);
102 if (index == AliQAv1::kREC)
103 rv[specie] = CheckREC(specie, list[specie]);
104 if (index == AliQAv1::kESD)
105 rv[specie] = CheckESD(specie, list[specie]);
108 AliInfo(Form("Specie: %s. Task: %s. Value: %f",
109 AliRecoParam::GetEventSpecieName(specie),
110 AliQAv1::GetAliTaskName(index),
115 //______________________________________________________________________________
116 Double_t AliTPCQAChecker::CheckRAW(Int_t specie, TObjArray* list)
121 AliInfo("In AliTPCQAChecker::CheckRAW");
126 TH1* hRawsOccupancyVsSector = static_cast<TH1*>
127 (list->FindObject(Form("%s_hRawsOccupancyVsSector",AliRecoParam::GetEventSpecieName(specie))));
128 TH1* hRawsQmaxVsSector = static_cast<TH1*>
129 (list->FindObject(Form("%s_hRawsQmaxVsSector",AliRecoParam::GetEventSpecieName(specie))));
131 if (!hRawsOccupancyVsSector || !hRawsQmaxVsSector)
132 return -0.5; // fatal
134 if(hRawsOccupancyVsSector->GetEntries()==0) {
135 return 0.25; // error - No TPC data!
138 Int_t nBinsX = hRawsOccupancyVsSector->GetNbinsX();
139 for(Int_t i = 1; i <= nBinsX; i++) {
141 if(hRawsOccupancyVsSector->GetBinContent(i)==0)
142 return 0.75; // warning - no TPC data for at least one sector
148 //______________________________________________________________________________
149 Double_t AliTPCQAChecker::CheckSIM(Int_t specie, TObjArray* list)
151 /// This method checks the QA histograms associated with simulation
155 /// The digit histogram gives the ADC distribution for all sigbnals
156 /// above threshold. The check is just that there are digits.
157 /// Hits : The hit histograms are checked to see that they are not
158 /// empty. They contain a lot of detailed information on the
159 /// energyloss model (they were used to debug the AliRoot TPC use of
162 /// The check methods are simple:
163 /// We do not know if it is bad that histograms are missing because
164 /// this will always be the case for summable digits. So this check
165 /// is not possible here.
166 /// If digit histogram is empty (set error)
167 /// If one of the hit histograms are empty (set error)
170 AliInfo("In AliTPCQAChecker::CheckSIM");
175 TH1* hDigits = static_cast<TH1*>
176 (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
177 TH1* hHitsNhits = static_cast<TH1*>
178 (list->FindObject(Form("%s_hHitsNhits",AliRecoParam::GetEventSpecieName(specie))));
179 TH1* hHitsElectrons = static_cast<TH1*>
180 (list->FindObject(Form("%s_hHitsElectrons",AliRecoParam::GetEventSpecieName(specie))));
181 TH1* hHitsRadius = static_cast<TH1*>
182 (list->FindObject(Form("%s_hHitsRadius",AliRecoParam::GetEventSpecieName(specie))));
183 TH1* histHitsPrimPerCm = static_cast<TH1*>
184 (list->FindObject(Form("%s_histHitsPrimPerCm",AliRecoParam::GetEventSpecieName(specie))));
185 TH1* histHitsElectronsPerCm = static_cast<TH1*>
186 (list->FindObject(Form("%s_histHitsElectronsPerCm",AliRecoParam::GetEventSpecieName(specie))));
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)
231 AliInfo("In AliTPCQAChecker::CheckREC");
236 TH1* hDigits = static_cast<TH1*>
237 (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
238 TH1* hNclustersVsRow = static_cast<TH1*>
239 (list->FindObject(Form("%s_hRecPointsRow",AliRecoParam::GetEventSpecieName(specie))));
240 TH1* hQshort = static_cast<TH1*>
241 (list->FindObject(Form("%s_hRecPointsQShort",AliRecoParam::GetEventSpecieName(specie))));
242 TH1* hQmedium = static_cast<TH1*>
243 (list->FindObject(Form("%s_hRecPointsQMedium",AliRecoParam::GetEventSpecieName(specie))));
244 TH1* hQlong = static_cast<TH1*>
245 (list->FindObject(Form("%s_hRecPointsQLong",AliRecoParam::GetEventSpecieName(specie))));
246 // The Qmax histograms are for now ignored
248 if (!hDigits && // digits missing
249 (!hNclustersVsRow || !hQshort || !hQmedium || !hQlong)) // 1 recpoint hist missing
250 return -0.5; // fatal
252 if (hDigits && hDigits->GetEntries()==0)
253 return 0.25; // error
255 if (hNclustersVsRow && hNclustersVsRow->GetEntries() < 1000) {
256 return 0.75; // warning
258 if (!hQshort || !hQlong || !hQlong)
259 return -0.5;// fatal - they should be there if the cluster vs row hist is there
260 if (hQshort->GetEntries()==0 || hQmedium->GetEntries()==0 ||
261 hQlong->GetEntries()==0)
262 return 0.25; // error
267 //______________________________________________________________________________
268 Double_t AliTPCQAChecker::CheckESD(Int_t specie, TObjArray* list)
270 /// This method checks the QA histograms associated with ESDs
271 /// (Note that there is aslo a globalQA which is running on all
272 /// the ESD information so for now this is just a few basic
275 /// The check methods are simple:
276 /// If there are no histogram at all (set fatal)
279 AliInfo("In AliTPCQAChecker::CheckESD");
284 TH1* hESDclusters = static_cast<TH1*>
285 (list->FindObject(Form("%s_hESDclusters",AliRecoParam::GetEventSpecieName(specie))));
286 TH1* hESDratio = static_cast<TH1*>
287 (list->FindObject(Form("%s_hESDratio",AliRecoParam::GetEventSpecieName(specie))));
288 TH1* hESDpt = static_cast<TH1*>
289 (list->FindObject(Form("%s_hESDpt",AliRecoParam::GetEventSpecieName(specie))));
291 if (!hESDclusters || !hESDratio || !hESDpt)
292 return -0.5; // fatal
297 //______________________________________________________________________________
298 void AliTPCQAChecker::Init(const AliQAv1::DETECTORINDEX_t det)
300 /// intialises QA and QA checker settings
303 AliInfo("In AliTPCQAChecker::Init");
304 AliQAv1::Instance(det) ;
305 Float_t hiValue[AliQAv1::kNBIT] ;
306 Float_t lowValue[AliQAv1::kNBIT] ;
307 hiValue[AliQAv1::kINFO] = 1.00;
308 lowValue[AliQAv1::kINFO] = 0.99;
309 hiValue[AliQAv1::kWARNING] = 0.99;
310 lowValue[AliQAv1::kWARNING] = 0.50;
311 hiValue[AliQAv1::kERROR] = 0.50;
312 lowValue[AliQAv1::kERROR] = 0.00;
313 hiValue[AliQAv1::kFATAL] = 0.00;
314 lowValue[AliQAv1::kFATAL] =-1.00;
315 // SetHiLo(&hiValue[0], &lowValue[0]) ;
316 SetHiLo(hiValue, lowValue) ;
319 //______________________________________________________________________________
321 AliTPCQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
323 /// sets the QA according the return value of the Check
326 AliInfo("In AliTPCQAChecker::SetQA");
328 AliQAv1 * qa = AliQAv1::Instance(index);
330 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
332 if (value==NULL) { // No checker is implemented, set all QA to Fatal
335 AliInfo(Form("Fatal QA. Task: %s. Specie: %s",
336 AliQAv1::GetAliTaskName(index),
337 AliRecoParam::GetEventSpecieName(specie)));
338 qa->Set(AliQAv1::kFATAL, specie) ;
341 if ( value[specie] >= fLowTestValue[AliQAv1::kFATAL] &&
342 value[specie] < fUpTestValue[AliQAv1::kFATAL] ) {
345 AliInfo(Form("QA-Fatal. Task: %s. Specie: %s",
346 AliQAv1::GetAliTaskName(index),
347 AliRecoParam::GetEventSpecieName(specie)));
348 qa->Set(AliQAv1::kFATAL, specie) ;
349 } else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] &&
350 value[specie] <= fUpTestValue[AliQAv1::kERROR] ) {
353 AliInfo(Form("QA-Error. Task: %s. Specie: %s",
354 AliQAv1::GetAliTaskName(index),
355 AliRecoParam::GetEventSpecieName(specie)));
356 qa->Set(AliQAv1::kERROR, specie) ;
357 } else if (value[specie] > fLowTestValue[AliQAv1::kWARNING] &&
358 value[specie] <= fUpTestValue[AliQAv1::kWARNING]) {
361 AliInfo(Form("QA-Warning. Task: %s. Specie: %s",
362 AliQAv1::GetAliTaskName(index),
363 AliRecoParam::GetEventSpecieName(specie)));
364 qa->Set(AliQAv1::kWARNING, specie) ;
365 } else if (value[specie] > fLowTestValue[AliQAv1::kINFO] &&
366 value[specie] <= fUpTestValue[AliQAv1::kINFO] ) {
369 AliInfo(Form("QA-Info. Task: %s. Specie: %s",
370 AliQAv1::GetAliTaskName(index),
371 AliRecoParam::GetEventSpecieName(specie)));
372 qa->Set(AliQAv1::kINFO, specie) ;