1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 // --- ROOT system ---
19 #include <TIterator.h>
21 #include <TPaveText.h>
22 #include <TObjArray.h>
25 // --- Standard library ---
27 // --- AliRoot header files ---
29 #include "AliZDCQAChecker.h"
31 ClassImp(AliZDCQAChecker)
33 //____________________________________________________________________________
34 void AliZDCQAChecker::Check(Double_t * test, AliQAv1::ALITASK_t index, TObjArray ** list,
35 const AliDetectorRecoParam * /*recoParam*/)
37 // Checks the QA histograms on the input list:
39 const char* taskName = AliQAv1::GetAliTaskName(index);
40 //printf("\n\tAliZDCQAChecker -> checking QA histos for task %s\n",taskName);
42 Int_t ihitHisto=0, idigHisto=0;
43 Int_t irecHisto=0, irawHisto=0, esdInd=0;
46 messages.SetOwner(kTRUE);
48 for(Int_t specie = 0; specie<AliRecoParam::kNSpecies; specie++){
50 if(!AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)))
52 //printf("\tAliZDCQAChecker -> specie %d, AliRecoParam::ConvertIndex(specie) %d, AliRecoParam::kLowMult %d, IsEventSpecieSet(specie) %d\n",
53 // specie, AliRecoParam::ConvertIndex(specie) ,AliRecoParam::kLowMult,
54 // AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)));
56 // ====================================================================
57 // Checks for p-p events
58 // ====================================================================
59 if(AliRecoParam::ConvertIndex(specie) == AliRecoParam::kLowMult){
60 if(list[specie]->GetEntries()==0){
61 AliWarning("\t The list to be checked is empty!"); // nothing to check
64 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
65 TIter next(list[specie]);
69 Float_t res=0., percentageDiff=0.30;
70 Float_t meanZNA=0., meanZNC=0., meanZPA=0., meanZPC=0.;
71 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
72 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
73 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
74 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
75 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
78 while((hdata = dynamic_cast<TH1 *>(next()))){
80 // -------------------------------------------------------------------
81 if(index == AliQAv1::kSIM){
82 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
85 if(!(strncmp(hdata->GetName(),"hHits",5))){
86 if(hdata->GetEntries()>0){
87 if(ihitHisto==0) meanZNC = hdata->GetMean();
88 else if(ihitHisto==1) meanZNA = hdata->GetMean();
89 else if(ihitHisto==2) meanZPC = hdata->GetMean();
90 else if(ihitHisto==3) meanZPA = hdata->GetMean();
91 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
92 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
93 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
94 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
95 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
96 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
97 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
98 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
101 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
103 if(TMath::Abs(meanZNC)>1.e-10){
104 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
111 if(TMath::Abs(meanZNA)>1.e-10){
112 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
119 if(TMath::Abs(meanZPC)>1.e-10){
120 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
127 if(TMath::Abs(meanZPA)>1.e-10){
128 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
138 // Check DIGIT HIGH GAIN CHAIN histos
139 else if(!(strncmp(hdata->GetName(),"hDig",4))){
140 if(hdata->GetEntries()>0){
141 if(idigHisto==0) sumADCZNC = hdata->GetMean();
142 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
143 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
144 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
145 else if(idigHisto==4) pmQZNC = hdata->GetMean();
146 else if(idigHisto==5) pmQZNA = hdata->GetMean();
147 else if(idigHisto==6) pmQZPC = hdata->GetMean();
148 else if(idigHisto==7) pmQZPA = hdata->GetMean();
149 else if(idigHisto==8) pmCZNC = hdata->GetMean();
150 else if(idigHisto==9) pmCZNA = hdata->GetMean();
151 else if(idigHisto==10) pmCZPC = hdata->GetMean();
152 else if(idigHisto==11) pmCZPA = hdata->GetMean();
155 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
157 if(TMath::Abs(sumADCZNC)>1.e-10){
158 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
165 if(TMath::Abs(sumADCZNA)>1.e-10){
166 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
173 if(TMath::Abs(sumADCZPC)>1.e-10){
174 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
181 if(TMath::Abs(sumADCZPA)>1.e-10){
182 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
193 // -------------------------------------------------------------------
194 else if(index == AliQAv1::kRAW) {
196 // Check RAW HIGH GAIN CHAIN histos
200 Bool_t iDetPM = kTRUE;
202 if(irawHisto==16) nentries = Int_t (hdata->GetEntries());
205 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
206 if((hdata->GetBinContent(ibin))>10.){
209 else if((hdata->GetBinContent(ibin))<10.){
211 if(ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18){
220 if(nentries != -99) messages.Add(new TObjString(Form("#entries %d",nentries)));
221 else messages.Add(new TObjString("#entries not known"));
224 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
225 if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
226 else if(iDetPM==kFALSE){
227 messages.Add(new TObjString("Problem with some ADC!"));
228 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
230 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
231 SetupHisto(messages, *hdata, rv);
233 else if(irawHisto==19){
234 // Reference values must be inserted in the order:
235 // ZNC, ZPC, ZNA, ZPA, ZEM1, ZEM2
236 // Reference values from RUN 145456
237 //Double_t refTDCs[6] = {-322.5,-319.1,-320.9,-319.2,-319.7,-319.2};
238 // 2012 -> Reference values from RUN 177399
239 Double_t refTDCs[6] = {-322.7,-321.4,-321.6,-321.7,-316.2,-315.4};
241 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
242 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<3.){
245 else if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<5.){
255 if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
256 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
257 else if(rv<1. && rv>0.75) messages.Add(new TObjString("Minor problem with TDCs"));
259 messages.Add(new TObjString("Serious problem in ZDC timing"));
260 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
262 SetupHisto(messages, *hdata, rv);
267 // -------------------------------------------------------------------
268 else if(index == AliQAv1::kREC) {
270 // Check REC HIGH GAIN CHAIN histos
271 if(hdata->GetEntries()>0){
272 if(irecHisto==0) meanZNC = hdata->GetMean();
273 else if(irecHisto==1) meanZNA = hdata->GetMean();
274 else if(irecHisto==2) meanZPC = hdata->GetMean();
275 else if(irecHisto==3) meanZPA = hdata->GetMean();
276 else if(irecHisto==4) pmQZNC = hdata->GetMean();
277 else if(irecHisto==5) pmQZNA = hdata->GetMean();
278 else if(irecHisto==6) pmQZPC = hdata->GetMean();
279 else if(irecHisto==7) pmQZPA = hdata->GetMean();
280 else if(irecHisto==8) pmCZNC = hdata->GetMean();
281 else if(irecHisto==9) pmCZNA = hdata->GetMean();
282 else if(irecHisto==10) pmCZPC = hdata->GetMean();
283 else if(irecHisto==11) pmCZPA = hdata->GetMean();
286 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
288 if(TMath::Abs(meanZNC)>1.e-10){
289 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
296 if(TMath::Abs(meanZNA)>1.e-10){
297 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
304 if(TMath::Abs(meanZPC)>1.e-10){
305 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
312 if(TMath::Abs(meanZPA)>1.e-10){
313 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
323 // -------------------------------------------------------------------
324 else if(index == AliQAv1::kESD) {
326 // Check ESD HIGH GAIN CHAIN histos
327 if(hdata->GetEntries()>0){
328 if(esdInd==0) sumADCZNC = hdata->GetMean();
329 else if(esdInd==1) sumADCZNA = hdata->GetMean();
330 else if(esdInd==2) sumADCZPC = hdata->GetMean();
331 else if(esdInd==3) sumADCZPA = hdata->GetMean();
332 else if(esdInd==6) pmQZNC = hdata->GetMean();
333 else if(esdInd==7) pmQZNA = hdata->GetMean();
334 else if(esdInd==8) pmQZPC = hdata->GetMean();
335 else if(esdInd==9) pmQZPA = hdata->GetMean();
336 else if(esdInd==10) pmCZNC = hdata->GetMean();
337 else if(esdInd==11) pmCZNA = hdata->GetMean();
338 else if(esdInd==12) pmCZPC = hdata->GetMean();
339 else if(esdInd==13) pmCZPA = hdata->GetMean();
342 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
344 if(TMath::Abs(sumADCZNC)>1.e-10){
345 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
352 if(TMath::Abs(sumADCZNA)>1.e-10){
353 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
360 if(TMath::Abs(sumADCZPC)>1.e-10){
361 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
368 if(TMath::Abs(sumADCZPA)>1.e-10){
369 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
380 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
384 else AliError("AliZDCQAChecker-> No histos!!!\n");
387 // ====================================================================
388 // Checks for A-A events
389 // ====================================================================
390 if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult) {
391 if(list[specie]->GetEntries()==0){
392 AliWarning("\t The list to be checked is empty!");
395 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
397 TIter next(list[specie]);
401 Float_t res=0., percentageDiff=0.10;
402 Float_t meanZNA=0., meanZNC=0., meanZPA=0., meanZPC=0.;
403 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
404 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
405 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
406 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
407 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
410 while((hdata = dynamic_cast<TH1 *>(next()))){
412 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
413 // -------------------------------------------------------------------
414 if(index == AliQAv1::kSIM){
416 if (!(strncmp(hdata->GetName(),"hHits",5))){
417 if(hdata->GetEntries()>0){
418 if(ihitHisto==0) meanZNC = hdata->GetMean();
419 else if(ihitHisto==1) meanZNA = hdata->GetMean();
420 else if(ihitHisto==2) meanZPC = hdata->GetMean();
421 else if(ihitHisto==3) meanZPA = hdata->GetMean();
422 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
423 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
424 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
425 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
426 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
427 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
428 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
429 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
432 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
433 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
435 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
436 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
443 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
444 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
452 // --- Check whether (mean PMQi - PMC)/PMC < percentageDiff
454 if(TMath::Abs(meanZNC)>1.e-10){
455 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
462 if(TMath::Abs(meanZNA)>1.e-10){
463 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
470 if(TMath::Abs(meanZPC)>1.e-10){
471 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
478 if(TMath::Abs(meanZPA)>1.e-10){
479 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
489 // Check DIGITS histos
490 else if (!(strncmp(hdata->GetName(),"hDig",4))){
491 if(hdata->GetEntries()>0){
492 if(idigHisto==0) sumADCZNC = hdata->GetMean();
493 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
494 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
495 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
496 else if(idigHisto==4) adcQZNC = hdata->GetMean();
497 else if(idigHisto==5) adcQZNA = hdata->GetMean();
498 else if(idigHisto==6) adcQZPC = hdata->GetMean();
499 else if(idigHisto==7) adcQZPA = hdata->GetMean();
500 else if(idigHisto==8) adcCZNC = hdata->GetMean();
501 else if(idigHisto==9) adcCZNA = hdata->GetMean();
502 else if(idigHisto==10) adcCZPC = hdata->GetMean();
503 else if(idigHisto==11) adcCZPA = hdata->GetMean();
506 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
507 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
509 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
510 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
517 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
518 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
526 // --- Check whether (sumADC PMQi - PMC)/PMC < percentageDiff
528 if(TMath::Abs(sumADCZNC)>1.e-10){
529 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
536 if(TMath::Abs(sumADCZNA)>1.e-10){
537 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
544 if(TMath::Abs(sumADCZPC)>1.e-10){
545 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
552 if(TMath::Abs(sumADCZPA)>1.e-10){
553 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
564 // -------------------------------------------------------------------
565 else if(index == AliQAv1::kRAW){
567 // Check RAW HIGH GAIN CHAIN histos
571 Bool_t iDetPM = kTRUE;
573 if(irawHisto==16) nentries = Int_t (hdata->GetEntries());
576 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
577 if((hdata->GetBinContent(ibin))>10.){
580 else if((hdata->GetBinContent(ibin))<10. &&
581 (ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18)){
590 if(nentries != -99) messages.Add(new TObjString(Form("#entries %d",nentries)));
591 else messages.Add(new TObjString("#entries not known"));
594 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
595 if(rv > 0.98) messages.Add(new TObjString("ADCs are OK!"));
596 else if(iDetPM==kFALSE){
597 messages.Add(new TObjString("Problem with ADCs!"));
598 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
600 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
601 SetupHisto(messages, *hdata, rv);
603 else if(irawHisto==19){
604 // Reference values from RUN 137161
605 Double_t refTDCs[6] = {-320.7,-319.0,-318.6,-319.9,-321.3,-320.8};
607 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
608 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<3.){
611 else if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
621 if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
622 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
623 else if(rv<1 && rv>0.75) messages.Add(new TObjString("Minor problem with TDCs"));
625 messages.Add(new TObjString("Serious problem in ZDC timing"));
626 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
628 SetupHisto(messages, *hdata, rv);
633 // -------------------------------------------------------------------
634 else if(index == AliQAv1::kREC){
636 // Check RAW HIGH GAIN CHAIN histos
637 if(hdata->GetEntries()>0){
638 if(irecHisto==0) meanZNC = hdata->GetMean();
639 else if(irecHisto==1) meanZNA = hdata->GetMean();
640 else if(irecHisto==2) meanZPC = hdata->GetMean();
641 else if(irecHisto==3) meanZPA = hdata->GetMean();
642 else if(irecHisto==4) pmQZNC = hdata->GetMean();
643 else if(irecHisto==5) pmQZNA = hdata->GetMean();
644 else if(irecHisto==6) pmQZPC = hdata->GetMean();
645 else if(irecHisto==7) pmQZPA = hdata->GetMean();
646 else if(irecHisto==8) pmCZNC = hdata->GetMean();
647 else if(irecHisto==9) pmCZNA = hdata->GetMean();
648 else if(irecHisto==10) pmCZPC = hdata->GetMean();
649 else if(irecHisto==11) pmCZPA = hdata->GetMean();
652 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
653 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
655 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
656 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
663 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
664 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
672 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
674 if((TMath::Abs(meanZNC)>1.e-10) && (pmCZNC>1.e-10)){
675 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
682 if((TMath::Abs(meanZNA)>1.e-10) && (pmCZNA>1.e-10)){
683 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
690 if((TMath::Abs(meanZPC)>1.e-10) && (pmCZPC>1.e-10)){
691 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
698 if((TMath::Abs(meanZPA)>1.e-10) && (pmCZPA>1.e-10)){
699 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
709 // -------------------------------------------------------------------
710 else if(index == AliQAv1::kESD){
712 // Check ESD HIGH GAIN CHAIN histos
713 if(hdata->GetEntries()>0){
714 if(esdInd==0) sumADCZNC = hdata->GetMean();
715 else if(esdInd==1) sumADCZNA = hdata->GetMean();
716 else if(esdInd==2) sumADCZPC = hdata->GetMean();
717 else if(esdInd==3) sumADCZPA = hdata->GetMean();
718 else if(esdInd==6) pmQZNC = hdata->GetMean();
719 else if(esdInd==7) pmQZNA = hdata->GetMean();
720 else if(esdInd==8) pmQZPC = hdata->GetMean();
721 else if(esdInd==9) pmQZPA = hdata->GetMean();
722 else if(esdInd==10) pmCZNC = hdata->GetMean();
723 else if(esdInd==11) pmCZNA = hdata->GetMean();
724 else if(esdInd==12) pmCZPC = hdata->GetMean();
725 else if(esdInd==13) pmCZPA = hdata->GetMean();
728 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
729 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
731 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
732 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
739 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
740 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
748 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
750 if(TMath::Abs(sumADCZNC)>1.e-10){
751 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
758 if(TMath::Abs(sumADCZNA)>1.e-10){
759 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
766 /* if(TMath::Abs(sumADCZPC)>1.e-10){
767 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
774 if(TMath::Abs(sumADCZPA)>1.e-10){
775 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
787 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
791 else AliError("\t No histos found for ZDC!!!\n");
793 } // HighMult (Pb-Pb)
794 // ====================================================================
795 // Checks for Calibration events
796 // ====================================================================
797 if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib) {
798 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task in CALIBRATION events\n",taskName));
801 // ====================================================================
802 // Checks for cosmic events
803 // ====================================================================
804 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic) {
805 AliWarning(Form("\n\t No check needed in ZDC QA for %s task in COSMIC events\n",taskName));
808 if(TMath::Abs(count)>1.e-10) test[specie] = test[specie]/count;
809 AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\t ZDC QA check result = %1.2f\n",test[specie]));
813 //___________________________________________________________________
814 void AliZDCQAChecker::SetupHisto(const TObjArray& messages, TH1& histo, Float_t& code)
817 /// Add text to histos
820 TPaveText* text = new TPaveText(0.70,0.70,0.99,0.99,"NDC");
822 TIter next(&messages);
825 while ( ( str = static_cast<TObjString*>(next()) ) ){
826 text->AddText(str->String());
829 TString defaultText = "";
834 defaultText = "Everything is fine!";
836 else if(code<1. && code>=0.85){
838 defaultText = "To be monitored in next runs";
840 else if(code<0.85 && code>=0.6){
842 defaultText = "notify the expert DURING THE DAY!";
846 defaultText = "PLEASE CALL THE EXPERT!!!!";
850 text->AddText(defaultText.Data());
851 text->SetFillColor(color);
853 //histo.SetFillStyle(1001);
854 //histo.SetFillColor(color);
856 histo.SetStats(kFALSE);
858 TList* lst = histo.GetListOfFunctions();
860 printf(" No list found\n");
863 TObject *stats = lst->FindObject("stats");
866 while ((obj = lst->First())) {
867 while(lst->Remove(obj)) { }
870 if(stats) lst->Add(stats);