]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ZDC/AliZDCQAChecker.cxx
Cosmetics
[u/mrichter/AliRoot.git] / ZDC / AliZDCQAChecker.cxx
CommitLineData
075a0e70 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16
17// --- ROOT system ---
075a0e70 18#include <TH1F.h>
075a0e70 19#include <TIterator.h>
fdc38bb2 20#include <TString.h>
075a0e70 21
22// --- Standard library ---
23
24// --- AliRoot header files ---
25#include "AliLog.h"
075a0e70 26#include "AliZDCQAChecker.h"
27
28ClassImp(AliZDCQAChecker)
29
075a0e70 30//____________________________________________________________________________
a42ceb0e 31void AliZDCQAChecker::Check(Double_t * test, AliQAv1::ALITASK_t index, TObjArray ** list,
486788fc 32 const AliDetectorRecoParam * /*recoParam*/)
075a0e70 33{
57acd2d2 34 // Checks the QA histograms on the input list:
35 //
4e25ac79 36 const char* taskName = AliQAv1::GetAliTaskName(index);
f5e4ee59 37 printf("\n\tAliZDCQAChecker -> checking QA histos for task %s\n",taskName);
57acd2d2 38 //
f5e4ee59 39 for(Int_t specie = 0; specie<AliRecoParam::kNSpecies; specie++){
a42ceb0e 40 Int_t count = 0;
c2bb665a 41 //printf("\tAliZDCQAChecker -> specie %d\n\n",specie);
f5e4ee59 42
43 if(!AliQAv1::Instance()->IsEventSpecieSet(specie)) continue;
57acd2d2 44 // ====================================================================
45 // Checks for p-p events
46 // ====================================================================
f5e4ee59 47 if(specie == AliRecoParam::kLowMult){
57acd2d2 48 if(list[specie]->GetEntries()==0){
213a7d34 49 AliWarning("\t The list to be checked is empty!"); // nothing to check
a42ceb0e 50 return ;
12b9729c 51 }
5379c4a3 52 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
57acd2d2 53 TIter next(list[specie]);
a42ceb0e 54 count = 0;
57acd2d2 55 TH1 * hdata;
213a7d34 56 Float_t res=0., percentageDiff=0.15;
57acd2d2 57 while((hdata = dynamic_cast<TH1 *>(next()))){
58 if(hdata){
59 // -------------------------------------------------------------------
4e25ac79 60 if(index == AliQAv1::kSIM){
5379c4a3 61 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
57acd2d2 62 // Check HITS histos
213a7d34 63 Float_t sumZNA=0., sumZNC=0., sumZPA=0., sumZPC=0.;
64 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
65 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
66 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
67 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
68 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
69 Int_t ihitHisto=0, idigHisto=0;
70 //
71 if(!(strncmp(hdata->GetName(),"hHits",5))){
57acd2d2 72 if(hdata->GetEntries()>0){
213a7d34 73 if(ihitHisto==0) sumZNC = hdata->GetMean();
74 else if(ihitHisto==1) sumZNA = hdata->GetMean();
75 else if(ihitHisto==2) sumZPC = hdata->GetMean();
76 else if(ihitHisto==3) sumZPA = hdata->GetMean();
77 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
78 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
79 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
80 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
81 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
82 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
83 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
84 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
85 }
86 //
87 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
88 if(ihitHisto==11){
89 if(sumZNC!=0){
90 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
91 res=1.;
92 else
93 res=.5;
94 test[specie] += res;
a42ceb0e 95 count++;
213a7d34 96 }
97 if(sumZNA!=0){
98 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
99 res=1.;
100 else percentageDiff=
101 res=.5;
102 test[specie] += res;
a42ceb0e 103 count++;
213a7d34 104 }
105 if(sumZPC!=0){
106 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
107 res=1.;
108 else
109 res=.5;
110 test[specie] += res;
a42ceb0e 111 count++;
213a7d34 112 }
113 if(sumZPA!=0){
114 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
115 res=1.;
116 else
117 res=.5;
118 test[specie] += res;
a42ceb0e 119 count++;
213a7d34 120 }
121 }
122 ihitHisto++;
fdc38bb2 123 }
213a7d34 124 // Check DIGIT HIGH GAIN CHAIN histos
125 else if(!(strncmp(hdata->GetName(),"hDig",4))){
126 if(hdata->GetEntries()>0){
127 if(idigHisto==0) sumADCZNC = hdata->GetMean();
128 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
129 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
130 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
131 else if(idigHisto==4) pmQZNC = hdata->GetMean();
132 else if(idigHisto==5) pmQZNA = hdata->GetMean();
133 else if(idigHisto==6) pmQZPC = hdata->GetMean();
134 else if(idigHisto==7) pmQZPA = hdata->GetMean();
135 else if(idigHisto==8) pmCZNC = hdata->GetMean();
136 else if(idigHisto==9) pmCZNA = hdata->GetMean();
137 else if(idigHisto==10) pmCZPC = hdata->GetMean();
138 else if(idigHisto==11) pmCZPA = hdata->GetMean();
139 }
140 //
141 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
142 if(idigHisto==11){
143 if(sumADCZNC!=0){
144 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
145 res=1.;
146 else
147 res=.5;
148 test[specie] += res;
a42ceb0e 149 count++;
213a7d34 150 }
151 if(sumADCZNA!=0){
152 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
153 res=1.;
154 else
155 res=.5;
156 test[specie] += res;
a42ceb0e 157 count++;
213a7d34 158 }
159 if(sumADCZPC!=0){
160 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
161 res=1.;
162 else
163 res=.5;
164 test[specie] += res;
a42ceb0e 165 count++;
213a7d34 166 }
167 if(sumADCZPA!=0){
168 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
169 res=1.;
170 else
171 res=.5;
172 test[specie] += res;
a42ceb0e 173 count++;
213a7d34 174 }
175 }
176 idigHisto++;
fdc38bb2 177 }
213a7d34 178 }
179 // -------------------------------------------------------------------
180 else if(index == AliQAv1::kRAW) {
181 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
182 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
183 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
184 Int_t irawHisto=0;
185 //
186 // Check RAW HIGH GAIN CHAIN histos
187 if(hdata->GetEntries()>0){
188 if(irawHisto==0) sumADCZNC = hdata->GetMean();
189 else if(irawHisto==1) sumADCZNA = hdata->GetMean();
190 else if(irawHisto==2) sumADCZPC = hdata->GetMean();
191 else if(irawHisto==3) sumADCZPA = hdata->GetMean();
796c8b58 192 else if(irawHisto==6) adcQZNC = hdata->GetMean();
193 else if(irawHisto==7) adcQZNA = hdata->GetMean();
194 else if(irawHisto==8) adcQZPC = hdata->GetMean();
195 else if(irawHisto==9) adcQZPA = hdata->GetMean();
196 else if(irawHisto==10) adcCZNC = hdata->GetMean();
197 else if(irawHisto==11) adcCZNA = hdata->GetMean();
198 else if(irawHisto==12) adcCZPC = hdata->GetMean();
199 else if(irawHisto==13) adcCZPA = hdata->GetMean();
213a7d34 200 }
201 //
202 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
203 if(irawHisto==11){
204 if(sumADCZNC!=0){
205 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
206 res=1.;
207 else
208 res=.5;
209 test[specie] += res;
a42ceb0e 210 count++;
213a7d34 211 }
212 if(sumADCZNA!=0){
213 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
214 res=1.;
215 else
216 res=.5;
217 test[specie] += res;
a42ceb0e 218 count++;
213a7d34 219 }
220 if(sumADCZPC!=0){
221 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
222 res=1.;
223 else
224 res=.5;
225 test[specie] += res;
a42ceb0e 226 count++;
213a7d34 227 }
228 if(sumADCZPA!=0){
229 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
230 res=1.;
231 else
232 res=.5;
233 test[specie] += res;
a42ceb0e 234 count++;
213a7d34 235 }
236 }
237 irawHisto++;
238 }
239 // -------------------------------------------------------------------
f5e4ee59 240 else if(index == AliQAv1::kREC) {
241 Float_t sumZNA=0., sumZNC=0., sumZPA=0., sumZPC=0.;
242 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
243 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
244 Int_t irecHisto=0;
245 //
246 // Check REC HIGH GAIN CHAIN histos
247 if(hdata->GetEntries()>0){
248 if(irecHisto==0) sumZNC = hdata->GetMean();
249 else if(irecHisto==1) sumZNA = hdata->GetMean();
250 else if(irecHisto==2) sumZPC = hdata->GetMean();
251 else if(irecHisto==3) sumZPA = hdata->GetMean();
252 else if(irecHisto==4) pmQZNC = hdata->GetMean();
253 else if(irecHisto==5) pmQZNA = hdata->GetMean();
254 else if(irecHisto==6) pmQZPC = hdata->GetMean();
255 else if(irecHisto==7) pmQZPA = hdata->GetMean();
256 else if(irecHisto==8) pmCZNC = hdata->GetMean();
257 else if(irecHisto==9) pmCZNA = hdata->GetMean();
258 else if(irecHisto==10) pmCZPC = hdata->GetMean();
259 else if(irecHisto==11) pmCZPA = hdata->GetMean();
260 }
261 //
262 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
263 if(irecHisto==11){
264 if(sumZNC!=0){
265 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
266 res=1.;
267 else
268 res=.5;
269 test[specie] += res;
a42ceb0e 270 count++;
f5e4ee59 271 }
272 if(sumZNA!=0){
273 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
274 res=1.;
275 else
276 res=.5;
277 test[specie] += res;
a42ceb0e 278 count++;
f5e4ee59 279 }
280 if(sumZPC!=0){
281 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
282 res=1.;
283 else
284 res=.5;
285 test[specie] += res;
a42ceb0e 286 count++;
f5e4ee59 287 }
288 if(sumZPA!=0){
289 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
290 res=1.;
291 else
292 res=.5;
293 test[specie] += res;
a42ceb0e 294 count++;
f5e4ee59 295 }
296 }
297 irecHisto++;
298 }
299 // -------------------------------------------------------------------
213a7d34 300 else if(index == AliQAv1::kESD) {
301 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
302 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
303 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
304 Int_t esdInd=0;
305 //
306 // Check ESD HIGH GAIN CHAIN histos
57acd2d2 307 if(hdata->GetEntries()!=0){
213a7d34 308 if(esdInd==2) sumADCZNC = hdata->GetMean();
309 else if(esdInd==3) sumADCZNA = hdata->GetMean();
310 else if(esdInd==4) sumADCZPC = hdata->GetMean();
311 else if(esdInd==5) sumADCZPA = hdata->GetMean();
796c8b58 312 else if(esdInd==8) pmQZNC = hdata->GetMean();
313 else if(esdInd==9) pmQZNA = hdata->GetMean();
314 else if(esdInd==10) pmQZPC = hdata->GetMean();
315 else if(esdInd==11) pmQZPA = hdata->GetMean();
316 else if(esdInd==12) pmCZNC = hdata->GetMean();
317 else if(esdInd==13) pmCZNA = hdata->GetMean();
318 else if(esdInd==14) pmCZPC = hdata->GetMean();
319 else if(esdInd==15) pmCZPA = hdata->GetMean();
213a7d34 320 }
321 //
322 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
323 if(esdInd==13){
324 if(sumADCZNC!=0){
325 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
326 res=1.;
327 else
328 res=.5;
329 test[specie] += res;
a42ceb0e 330 count++;
213a7d34 331 }
332 if(sumADCZNA!=0){
333 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
334 res=1.;
335 else
336 res=.5;
337 test[specie] += res;
a42ceb0e 338 count++;
213a7d34 339 }
340 if(sumADCZPC!=0){
341 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
342 res=1.;
343 else
344 res=.5;
345 test[specie] += res;
a42ceb0e 346 count++;
213a7d34 347 }
348 if(sumADCZPA!=0){
349 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
350 res=1.;
351 else
352 res=.5;
353 test[specie] += res;
a42ceb0e 354 count++;
213a7d34 355 }
fdc38bb2 356 }
57acd2d2 357 esdInd++;
213a7d34 358 }
359 else {
57acd2d2 360 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
a42ceb0e 361 return ;
57acd2d2 362 }
213a7d34 363 }//if(hdata)
364 else AliError("AliZDCQAChecker-> No histos!!!\n");
075a0e70 365 }
213a7d34 366 } // LowMult (p-p)
57acd2d2 367 // ====================================================================
368 // Checks for A-A events
369 // ====================================================================
213a7d34 370 else if (specie == AliRecoParam::kHighMult) {
57acd2d2 371 if(list[specie]->GetEntries()==0){
213a7d34 372 AliWarning("\t The list to be checked is empty!");
a42ceb0e 373 return ;
57acd2d2 374 }
5379c4a3 375 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
213a7d34 376 //
57acd2d2 377 TIter next(list[specie]);
a42ceb0e 378 count = 0;
57acd2d2 379 TH1 * hdata;
213a7d34 380 Float_t res=0., percentageDiff=0.10;
57acd2d2 381 while((hdata = dynamic_cast<TH1 *>(next()))){
382 if(hdata){
5379c4a3 383 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
57acd2d2 384 // -------------------------------------------------------------------
4e25ac79 385 if(index == AliQAv1::kSIM){
213a7d34 386 Float_t meanZNA=0., meanZNC=0., meanZPA=0., meanZPC=0.;
387 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
388 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
389 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
390 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
391 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
392 Int_t hitInd=0, digInd=0;
393 // Check HITS histos
394 if (!(strncmp(hdata->GetName(),"hHits",5))){
395 if(hdata->GetEntries()>0){
396 if(hitInd==0) meanZNC = hdata->GetMean();
397 else if(hitInd==1) meanZNA = hdata->GetMean();
398 else if(hitInd==2) meanZPC = hdata->GetMean();
399 else if(hitInd==3) meanZPA = hdata->GetMean();
400 else if(hitInd==4) pmQZNC = hdata->GetMean();
401 else if(hitInd==5) pmQZNA = hdata->GetMean();
402 else if(hitInd==6) pmQZPC = hdata->GetMean();
403 else if(hitInd==7) pmQZPA = hdata->GetMean();
404 else if(hitInd==8) pmCZNC = hdata->GetMean();
405 else if(hitInd==9) pmCZNA = hdata->GetMean();
406 else if(hitInd==10) pmCZPC = hdata->GetMean();
407 else if(hitInd==11) pmCZPA = hdata->GetMean();
408 }
409 //
410 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
411 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
412 if(hitInd==3){
413 if(meanZNC!=0 && meanZNA!=0){
414 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
415 res=1.;
416 else
417 res=.5;
418 test[specie] += res;
a42ceb0e 419 count++;
213a7d34 420 }
421 if(meanZPC!=0 && meanZPA!=0){
422 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
423 res=1.;
424 else
425 res=.5;
426 test[specie] += res;
a42ceb0e 427 count++;
213a7d34 428 }
57acd2d2 429 }
213a7d34 430 // --- Check whether (mean PMQi - PMC)/PMC < percentageDiff
431 if(hitInd==11){
432 if(meanZNC!=0){
433 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
57acd2d2 434 res=1.;
435 else
213a7d34 436 res=.5;
57acd2d2 437 test[specie] += res;
a42ceb0e 438 count++;
213a7d34 439 }
440 if(meanZNA!=0){
441 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
57acd2d2 442 res=1.;
443 else
213a7d34 444 res=.5;
57acd2d2 445 test[specie] += res;
a42ceb0e 446 count++;
213a7d34 447 }
448 if(meanZPC!=0){
449 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
57acd2d2 450 res=1.;
451 else
213a7d34 452 res=.5;
57acd2d2 453 test[specie] += res;
a42ceb0e 454 count++;
213a7d34 455 }
456 if(meanZPA!=0){
457 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
57acd2d2 458 res=1.;
459 else
213a7d34 460 res=.5;
57acd2d2 461 test[specie] += res;
a42ceb0e 462 count++;
213a7d34 463 }
464 }
465 hitInd++;
fdc38bb2 466 }
213a7d34 467 // Check DIGITS histos
468 else if (!(strncmp(hdata->GetName(),"hDig",4))){
469 if(hdata->GetEntries()>0){
470 if(digInd==0) sumADCZNC = hdata->GetMean();
471 else if(digInd==1) sumADCZNA = hdata->GetMean();
472 else if(digInd==2) sumADCZPC = hdata->GetMean();
473 else if(digInd==3) sumADCZPA = hdata->GetMean();
474 else if(digInd==4) adcQZNC = hdata->GetMean();
475 else if(digInd==5) adcQZNA = hdata->GetMean();
476 else if(digInd==6) adcQZPC = hdata->GetMean();
477 else if(digInd==7) adcQZPA = hdata->GetMean();
478 else if(digInd==8) adcCZNC = hdata->GetMean();
479 else if(digInd==9) adcCZNA = hdata->GetMean();
480 else if(digInd==10) adcCZPC = hdata->GetMean();
481 else if(digInd==11) adcCZPA = hdata->GetMean();
482 }
483 //
484 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
485 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
486 if(digInd==3){
487 if(sumADCZNC!=0 && sumADCZNA!=0){
488 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
57acd2d2 489 res=1.;
490 else
491 res=.5;
492 test[specie] += res;
a42ceb0e 493 count++;
213a7d34 494 }
495 if(sumADCZPC!=0 && sumADCZPA!=0){
496 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
57acd2d2 497 res=1.;
498 else
499 res=.5;
500 test[specie] += res;
a42ceb0e 501 count++;
213a7d34 502 }
57acd2d2 503 }
213a7d34 504 // --- Check whether (sumADC PMQi - PMC)/PMC < percentageDiff
505 if(digInd==11){
506 if(sumADCZNC!=0){
507 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
57acd2d2 508 res=1.;
509 else
213a7d34 510 res=.5;
57acd2d2 511 test[specie] += res;
a42ceb0e 512 count++;
213a7d34 513 }
514 if(sumADCZNA!=0){
515 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
57acd2d2 516 res=1.;
517 else
213a7d34 518 res=.5;
57acd2d2 519 test[specie] += res;
a42ceb0e 520 count++;
213a7d34 521 }
522 if(sumADCZPC!=0){
523 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
57acd2d2 524 res=1.;
525 else
213a7d34 526 res=.5;
57acd2d2 527 test[specie] += res;
a42ceb0e 528 count++;
213a7d34 529 }
530 if(sumADCZPA!=0){
531 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
57acd2d2 532 res=1.;
533 else
213a7d34 534 res=.5;
57acd2d2 535 test[specie] += res;
a42ceb0e 536 count++;
213a7d34 537 }
538 }
539 digInd++;
fdc38bb2 540 }
541 }
213a7d34 542 // -------------------------------------------------------------------
543 else if(index == AliQAv1::kRAW){
544 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
545 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
546 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
547 Int_t rawInd=0;
548 //
549 // Check RAW HIGH GAIN CHAIN histos
550 if(hdata->GetEntries()>0){
551 if(rawInd==0) sumADCZNC = hdata->GetMean();
552 else if(rawInd==1) sumADCZNA = hdata->GetMean();
553 else if(rawInd==2) sumADCZPC = hdata->GetMean();
554 else if(rawInd==3) sumADCZPA = hdata->GetMean();
555 else if(rawInd==4) adcQZNC = hdata->GetMean();
556 else if(rawInd==5) adcQZNA = hdata->GetMean();
557 else if(rawInd==6) adcQZPC = hdata->GetMean();
558 else if(rawInd==7) adcQZPA = hdata->GetMean();
559 else if(rawInd==8) adcCZNC = hdata->GetMean();
560 else if(rawInd==9) adcCZNA = hdata->GetMean();
561 else if(rawInd==10) adcCZPC = hdata->GetMean();
562 else if(rawInd==11) adcCZPA = hdata->GetMean();
563 }
564 //
565 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
566 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
567 if(rawInd==3){
568 if(sumADCZNC!=0 && sumADCZNA!=0){
569 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
570 res=1.;
571 else
572 res=.5;
573 test[specie] += res;
a42ceb0e 574 count++;
213a7d34 575 }
576 if(sumADCZPC!=0 && sumADCZPA!=0){
577 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
578 res=1.;
579 else
580 res=.5;
581 test[specie] += res;
a42ceb0e 582 count++;
213a7d34 583 }
584 }
585 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
586 if(rawInd==11){
587 if(sumADCZNC!=0){
588 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
589 res=1.;
590 else
591 res=.5;
592 test[specie] += res;
a42ceb0e 593 count++;
213a7d34 594 }
595 if(sumADCZNA!=0){
596 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
597 res=1.;
598 else
599 res=.5;
600 test[specie] += res;
a42ceb0e 601 count++;
213a7d34 602 }
603 if(sumADCZPC!=0){
604 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
605 res=1.;
606 else
607 res=.5;
608 test[specie] += res;
a42ceb0e 609 count++;
213a7d34 610 }
611 if(sumADCZPA!=0){
612 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
613 res=1.;
614 else
615 res=.5;
616 test[specie] += res;
a42ceb0e 617 count++;
213a7d34 618 }
619 }
620 rawInd++;
621 }
622 // -------------------------------------------------------------------
f5e4ee59 623 else if(index == AliQAv1::kREC){
624 Float_t sumZNA=0., sumZNC=0., sumZPA=0., sumZPC=0.;
625 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
626 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
627 Int_t recInd=0;
628 //
629 // Check RAW HIGH GAIN CHAIN histos
630 if(hdata->GetEntries()>0){
631 if(recInd==0) sumZNC = hdata->GetMean();
632 else if(recInd==1) sumZNA = hdata->GetMean();
633 else if(recInd==2) sumZPC = hdata->GetMean();
634 else if(recInd==3) sumZPA = hdata->GetMean();
635 else if(recInd==4) pmQZNC = hdata->GetMean();
636 else if(recInd==5) pmQZNA = hdata->GetMean();
637 else if(recInd==6) pmQZPC = hdata->GetMean();
638 else if(recInd==7) pmQZPA = hdata->GetMean();
639 else if(recInd==8) pmCZNC = hdata->GetMean();
640 else if(recInd==9) pmCZNA = hdata->GetMean();
641 else if(recInd==10) pmCZPC = hdata->GetMean();
642 else if(recInd==11) pmCZPA = hdata->GetMean();
643 }
644 //
645 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
646 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
647 if(recInd==3){
648 if(sumZNC!=0 && sumZNA!=0){
649 if((2*TMath::Abs(sumZNC-sumZNA)/(sumZNA+sumZNC))<percentageDiff)
650 res=1.;
651 else
652 res=.5;
653 test[specie] += res;
a42ceb0e 654 count++;
f5e4ee59 655 }
656 if(sumZPC!=0 && sumZPA!=0){
657 if((TMath::Abs(sumZPC-sumZPA)/(sumZPA+sumZPC))<percentageDiff)
658 res=1.;
659 else
660 res=.5;
661 test[specie] += res;
a42ceb0e 662 count++;
f5e4ee59 663 }
664 }
665 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
666 if(recInd==11){
667 if(sumZNC!=0){
668 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
669 res=1.;
670 else
671 res=.5;
672 test[specie] += res;
a42ceb0e 673 count++;
f5e4ee59 674 }
675 if(sumZNA!=0){
676 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
677 res=1.;
678 else
679 res=.5;
680 test[specie] += res;
a42ceb0e 681 count++;
f5e4ee59 682 }
683 if(sumZPC!=0){
684 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
685 res=1.;
686 else
687 res=.5;
688 test[specie] += res;
a42ceb0e 689 count++;
f5e4ee59 690 }
691 if(sumZPA!=0){
692 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
693 res=1.;
694 else
695 res=.5;
696 test[specie] += res;
a42ceb0e 697 count++;
f5e4ee59 698 }
699 }
700 recInd++;
701 }
702 // -------------------------------------------------------------------
213a7d34 703 else if(index == AliQAv1::kESD){
704 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
705 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
706 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
707 Int_t esdInd=0;
708 //
709 // Check ESD HIGH GAIN CHAIN histos
710 if(hdata->GetEntries()!=0){
711 if(esdInd==2) sumADCZNC = hdata->GetMean();
712 else if(esdInd==3) sumADCZNA = hdata->GetMean();
713 else if(esdInd==4) sumADCZPC = hdata->GetMean();
714 else if(esdInd==5) sumADCZPA = hdata->GetMean();
715 else if(esdInd==6) pmQZNC = hdata->GetMean();
716 else if(esdInd==7) pmQZNA = hdata->GetMean();
717 else if(esdInd==8) pmQZPC = hdata->GetMean();
718 else if(esdInd==9) pmQZPA = hdata->GetMean();
719 else if(esdInd==10) pmCZNC = hdata->GetMean();
720 else if(esdInd==11) pmCZNA = hdata->GetMean();
721 else if(esdInd==12) pmCZPC = hdata->GetMean();
722 else if(esdInd==13) pmCZPA = hdata->GetMean();
723 }
724 //
725 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
726 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
727 if(esdInd==5){
728 if(sumADCZNC!=0 && sumADCZNA!=0){
729 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
730 res=1.;
731 else
732 res=.5;
733 test[specie] += res;
a42ceb0e 734 count++;
213a7d34 735 }
736 if(sumADCZPC!=0 && sumADCZPA!=0){
737 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
738 res=1.;
739 else
740 res=.5;
741 test[specie] += res;
a42ceb0e 742 count++;
213a7d34 743 }
744 }
745 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
746 if(esdInd==13){
747 if(sumADCZNC!=0){
748 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
749 res=1.;
750 else
751 res=.5;
752 test[specie] += res;
a42ceb0e 753 count++;
213a7d34 754 }
755 if(sumADCZNA!=0){
756 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
757 res=1.;
758 else
759 res=.5;
760 test[specie] += res;
a42ceb0e 761 count++;
213a7d34 762 }
763 if(sumADCZPC!=0){
764 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
765 res=1.;
766 else
767 res=.5;
768 test[specie] += res;
a42ceb0e 769 count++;
213a7d34 770 }
771 if(sumADCZPA!=0){
772 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
773 res=1.;
774 else
775 res=.5;
776 test[specie] += res;
a42ceb0e 777 count++;
213a7d34 778 }
779 }
780 esdInd++;
781 }
782 else {
783 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
a42ceb0e 784 return ;
213a7d34 785 }
786 }//if(hdata)
787 else AliError("\t No histos found for ZDC!!!\n");
788 }
789 } // HighMult (Pb-Pb)
f5e4ee59 790 // ====================================================================
791 // Checks for Calibration events
792 // ====================================================================
793 else if (specie == AliRecoParam::kCalib) {
794 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
a42ceb0e 795 return ;
f5e4ee59 796 } // Calibration
797 // ====================================================================
798 // Checks for cosmic events
799 // ====================================================================
800 else if (specie == AliRecoParam::kCosmic) {
801 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
a42ceb0e 802 return ;
f5e4ee59 803 } // Cosmic
a42ceb0e 804 if(count!=0) test[specie] = test[specie]/count;
213a7d34 805 AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\t ZDC QA check result = %1.2f\n",test[specie]));
a42ceb0e 806 } // Loop on species
075a0e70 807}