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