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.;
77 while((hdata = dynamic_cast<TH1 *>(next()))){
79 // -------------------------------------------------------------------
80 if(index == AliQAv1::kSIM){
81 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
84 if(!(strncmp(hdata->GetName(),"hHits",5))){
85 if(hdata->GetEntries()>0){
86 if(ihitHisto==0) meanZNC = hdata->GetMean();
87 else if(ihitHisto==1) meanZNA = hdata->GetMean();
88 else if(ihitHisto==2) meanZPC = hdata->GetMean();
89 else if(ihitHisto==3) meanZPA = hdata->GetMean();
90 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
91 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
92 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
93 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
94 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
95 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
96 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
97 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
100 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
102 if(TMath::Abs(meanZNC)>1.e-10){
103 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
110 if(TMath::Abs(meanZNA)>1.e-10){
111 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
118 if(TMath::Abs(meanZPC)>1.e-10){
119 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
126 if(TMath::Abs(meanZPA)>1.e-10){
127 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
137 // Check DIGIT HIGH GAIN CHAIN histos
138 else if(!(strncmp(hdata->GetName(),"hDig",4))){
139 if(hdata->GetEntries()>0){
140 if(idigHisto==0) sumADCZNC = hdata->GetMean();
141 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
142 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
143 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
144 else if(idigHisto==4) pmQZNC = hdata->GetMean();
145 else if(idigHisto==5) pmQZNA = hdata->GetMean();
146 else if(idigHisto==6) pmQZPC = hdata->GetMean();
147 else if(idigHisto==7) pmQZPA = hdata->GetMean();
148 else if(idigHisto==8) pmCZNC = hdata->GetMean();
149 else if(idigHisto==9) pmCZNA = hdata->GetMean();
150 else if(idigHisto==10) pmCZPC = hdata->GetMean();
151 else if(idigHisto==11) pmCZPA = hdata->GetMean();
154 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
156 if(TMath::Abs(sumADCZNC)>1.e-10){
157 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
164 if(TMath::Abs(sumADCZNA)>1.e-10){
165 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
172 if(TMath::Abs(sumADCZPC)>1.e-10){
173 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
180 if(TMath::Abs(sumADCZPA)>1.e-10){
181 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
192 // -------------------------------------------------------------------
193 else if(index == AliQAv1::kRAW) {
195 // Check RAW HIGH GAIN CHAIN histos
199 Bool_t iDetPM = kTRUE;
203 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
204 if((hdata->GetBinContent(ibin))>10.){
207 else if((hdata->GetBinContent(ibin))<10. &&
208 (ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18)){
218 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
219 if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
220 else if(iDetPM==kFALSE){
221 messages.Add(new TObjString("Problem with ADCs!"));
222 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
224 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
225 SetupHisto(messages, *hdata, rv);
227 else if(irawHisto==23){
228 Double_t refTDCs[6] = {-83.0,-78.1,-80.2,-79.3,-81.0,-80.9};
230 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
231 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
243 if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
244 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
245 else if(rv<1 && rv>0.9) messages.Add(new TObjString("Minor problem with TDCs"));
247 messages.Add(new TObjString("Serious problem in ZDC timing"));
248 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
250 SetupHisto(messages, *hdata, rv);
252 else if(irawHisto==26){
253 Double_t yZNC=hdata->GetBinContent(2);
254 Double_t yZNA=hdata->GetBinContent(4);
255 if(TMath::Abs(yZNC)<0.4 && TMath::Abs(yZNA)<0.4) res=1.;
260 if(res == 1.) messages.Add(new TObjString("ZN positions are OK!"));
262 messages.Add(new TObjString("Problem in ZN positions!"));
263 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
265 SetupHisto(messages, *hdata, res);
270 // -------------------------------------------------------------------
271 else if(index == AliQAv1::kREC) {
273 // Check REC HIGH GAIN CHAIN histos
274 if(hdata->GetEntries()>0){
275 if(irecHisto==0) meanZNC = hdata->GetMean();
276 else if(irecHisto==1) meanZNA = hdata->GetMean();
277 else if(irecHisto==2) meanZPC = hdata->GetMean();
278 else if(irecHisto==3) meanZPA = hdata->GetMean();
279 else if(irecHisto==4) pmQZNC = hdata->GetMean();
280 else if(irecHisto==5) pmQZNA = hdata->GetMean();
281 else if(irecHisto==6) pmQZPC = hdata->GetMean();
282 else if(irecHisto==7) pmQZPA = hdata->GetMean();
283 else if(irecHisto==8) pmCZNC = hdata->GetMean();
284 else if(irecHisto==9) pmCZNA = hdata->GetMean();
285 else if(irecHisto==10) pmCZPC = hdata->GetMean();
286 else if(irecHisto==11) pmCZPA = hdata->GetMean();
289 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
291 if(TMath::Abs(meanZNC)>1.e-10){
292 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
299 if(TMath::Abs(meanZNA)>1.e-10){
300 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
307 if(TMath::Abs(meanZPC)>1.e-10){
308 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
315 if(TMath::Abs(meanZPA)>1.e-10){
316 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
326 // -------------------------------------------------------------------
327 else if(index == AliQAv1::kESD) {
329 // Check ESD HIGH GAIN CHAIN histos
330 if(hdata->GetEntries()>0){
331 if(esdInd==2) sumADCZNC = hdata->GetMean();
332 else if(esdInd==3) sumADCZNA = hdata->GetMean();
333 else if(esdInd==4) sumADCZPC = hdata->GetMean();
334 else if(esdInd==5) sumADCZPA = hdata->GetMean();
335 else if(esdInd==8) pmQZNC = hdata->GetMean();
336 else if(esdInd==9) pmQZNA = hdata->GetMean();
337 else if(esdInd==10) pmQZPC = hdata->GetMean();
338 else if(esdInd==11) pmQZPA = hdata->GetMean();
339 else if(esdInd==12) pmCZNC = hdata->GetMean();
340 else if(esdInd==13) pmCZNA = hdata->GetMean();
341 else if(esdInd==14) pmCZPC = hdata->GetMean();
342 else if(esdInd==15) pmCZPA = hdata->GetMean();
345 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
347 if(TMath::Abs(sumADCZNC)>1.e-10){
348 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
355 if(TMath::Abs(sumADCZNA)>1.e-10){
356 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
363 if(TMath::Abs(sumADCZPC)>1.e-10){
364 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
371 if(TMath::Abs(sumADCZPA)>1.e-10){
372 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
383 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
387 else AliError("AliZDCQAChecker-> No histos!!!\n");
390 // ====================================================================
391 // Checks for A-A events
392 // ====================================================================
393 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult) {
394 if(list[specie]->GetEntries()==0){
395 AliWarning("\t The list to be checked is empty!");
398 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
400 TIter next(list[specie]);
404 Float_t res=0., percentageDiff=0.10;
405 Float_t meanZNA=0., meanZNC=0., meanZPA=0., meanZPC=0.;
406 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
407 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
408 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
409 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
410 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
412 while((hdata = dynamic_cast<TH1 *>(next()))){
414 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
415 // -------------------------------------------------------------------
416 if(index == AliQAv1::kSIM){
418 if (!(strncmp(hdata->GetName(),"hHits",5))){
419 if(hdata->GetEntries()>0){
420 if(ihitHisto==0) meanZNC = hdata->GetMean();
421 else if(ihitHisto==1) meanZNA = hdata->GetMean();
422 else if(ihitHisto==2) meanZPC = hdata->GetMean();
423 else if(ihitHisto==3) meanZPA = hdata->GetMean();
424 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
425 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
426 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
427 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
428 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
429 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
430 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
431 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
434 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
435 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
437 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
438 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
445 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
446 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
454 // --- Check whether (mean PMQi - PMC)/PMC < percentageDiff
456 if(TMath::Abs(meanZNC)>1.e-10){
457 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
464 if(TMath::Abs(meanZNA)>1.e-10){
465 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
472 if(TMath::Abs(meanZPC)>1.e-10){
473 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
480 if(TMath::Abs(meanZPA)>1.e-10){
481 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
491 // Check DIGITS histos
492 else if (!(strncmp(hdata->GetName(),"hDig",4))){
493 if(hdata->GetEntries()>0){
494 if(idigHisto==0) sumADCZNC = hdata->GetMean();
495 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
496 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
497 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
498 else if(idigHisto==4) adcQZNC = hdata->GetMean();
499 else if(idigHisto==5) adcQZNA = hdata->GetMean();
500 else if(idigHisto==6) adcQZPC = hdata->GetMean();
501 else if(idigHisto==7) adcQZPA = hdata->GetMean();
502 else if(idigHisto==8) adcCZNC = hdata->GetMean();
503 else if(idigHisto==9) adcCZNA = hdata->GetMean();
504 else if(idigHisto==10) adcCZPC = hdata->GetMean();
505 else if(idigHisto==11) adcCZPA = hdata->GetMean();
508 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
509 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
511 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
512 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
519 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
520 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
528 // --- Check whether (sumADC PMQi - PMC)/PMC < percentageDiff
530 if(TMath::Abs(sumADCZNC)>1.e-10){
531 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
538 if(TMath::Abs(sumADCZNA)>1.e-10){
539 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
546 if(TMath::Abs(sumADCZPC)>1.e-10){
547 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
554 if(TMath::Abs(sumADCZPA)>1.e-10){
555 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
566 // -------------------------------------------------------------------
567 else if(index == AliQAv1::kRAW){
569 // Check RAW HIGH GAIN CHAIN histos
573 Bool_t iDetPM = kTRUE;
577 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
578 if((hdata->GetBinContent(ibin))>10.){
581 else if((hdata->GetBinContent(ibin))<10. &&
582 (ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18)){
592 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
593 if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
594 else if(iDetPM==kFALSE){
595 messages.Add(new TObjString("Problem with ADCs!"));
596 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
598 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
599 SetupHisto(messages, *hdata, rv);
601 else if(irawHisto==23){
602 Double_t refTDCs[6] = {-83.0,-78.1,-80.2,-79.3,-81.0,-80.9};
604 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
605 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
617 if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
618 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
619 else if(rv<1 && rv>0.9) messages.Add(new TObjString("Minor problem with TDCs"));
621 messages.Add(new TObjString("Serious problem in ZDC timing"));
622 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
624 SetupHisto(messages, *hdata, rv);
626 else if(irawHisto==26){
627 Double_t yZNC=hdata->GetBinContent(2);
628 Double_t yZNA=hdata->GetBinContent(4);
629 if(TMath::Abs(yZNC)<0.4 && TMath::Abs(yZNA)<0.4) res=1.;
634 printf(" yZNC = %1.2f yZNA = %1.2f -> res %1.2f\n",yZNC, yZNA,res);
635 if(res == 1.) messages.Add(new TObjString("ZN positions are OK!"));
637 messages.Add(new TObjString("Problem in ZN positions!"));
638 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
640 SetupHisto(messages, *hdata, res);
645 // -------------------------------------------------------------------
646 else if(index == AliQAv1::kREC){
648 // Check RAW HIGH GAIN CHAIN histos
649 if(hdata->GetEntries()>0){
650 if(irecHisto==0) meanZNC = hdata->GetMean();
651 else if(irecHisto==1) meanZNA = hdata->GetMean();
652 else if(irecHisto==2) meanZPC = hdata->GetMean();
653 else if(irecHisto==3) meanZPA = hdata->GetMean();
654 else if(irecHisto==4) pmQZNC = hdata->GetMean();
655 else if(irecHisto==5) pmQZNA = hdata->GetMean();
656 else if(irecHisto==6) pmQZPC = hdata->GetMean();
657 else if(irecHisto==7) pmQZPA = hdata->GetMean();
658 else if(irecHisto==8) pmCZNC = hdata->GetMean();
659 else if(irecHisto==9) pmCZNA = hdata->GetMean();
660 else if(irecHisto==10) pmCZPC = hdata->GetMean();
661 else if(irecHisto==11) pmCZPA = hdata->GetMean();
664 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
665 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
667 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
668 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
675 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
676 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
684 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
686 if(TMath::Abs(meanZNC)>1.e-10){
687 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
694 if(TMath::Abs(meanZNA)>1.e-10){
695 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
702 if(TMath::Abs(meanZPC)>1.e-10){
703 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
710 if(TMath::Abs(meanZPA)>1.e-10){
711 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
721 // -------------------------------------------------------------------
722 else if(index == AliQAv1::kESD){
724 // Check ESD HIGH GAIN CHAIN histos
725 if(hdata->GetEntries()>0){
726 if(esdInd==2) sumADCZNC = hdata->GetMean();
727 else if(esdInd==3) sumADCZNA = hdata->GetMean();
728 else if(esdInd==4) sumADCZPC = hdata->GetMean();
729 else if(esdInd==5) sumADCZPA = hdata->GetMean();
730 else if(esdInd==8) pmQZNC = hdata->GetMean();
731 else if(esdInd==9) pmQZNA = hdata->GetMean();
732 else if(esdInd==10) pmQZPC = hdata->GetMean();
733 else if(esdInd==11) pmQZPA = hdata->GetMean();
734 else if(esdInd==12) pmCZNC = hdata->GetMean();
735 else if(esdInd==13) pmCZNA = hdata->GetMean();
736 else if(esdInd==14) pmCZPC = hdata->GetMean();
737 else if(esdInd==15) pmCZPA = hdata->GetMean();
740 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
741 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
743 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
744 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
751 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
752 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
760 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
762 if(TMath::Abs(sumADCZNC)>1.e-10){
763 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
770 if(TMath::Abs(sumADCZNA)>1.e-10){
771 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
778 if(TMath::Abs(sumADCZPC)>1.e-10){
779 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
786 if(TMath::Abs(sumADCZPA)>1.e-10){
787 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
798 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
802 else AliError("\t No histos found for ZDC!!!\n");
804 } // HighMult (Pb-Pb)
805 // ====================================================================
806 // Checks for Calibration events
807 // ====================================================================
808 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib) {
809 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
812 // ====================================================================
813 // Checks for cosmic events
814 // ====================================================================
815 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic) {
816 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
819 if(TMath::Abs(count)>1.e-10) test[specie] = test[specie]/count;
820 AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\t ZDC QA check result = %1.2f\n",test[specie]));
824 //___________________________________________________________________
825 void AliZDCQAChecker::SetupHisto(const TObjArray& messages, TH1& histo, Float_t& code)
828 /// Add text to histos
831 Double_t y1 = 0.97 - (messages.GetLast()+2)*0.075;
832 TPaveText* text = new TPaveText(0.6,y1,0.99,0.99,"NDC");
834 TIter next(&messages);
837 while ( ( str = static_cast<TObjString*>(next()) ) ){
838 text->AddText(str->String());
841 TString defaultText = "";
846 defaultText = "Everything is fine!";
848 else if(code<1. && code>=0.9){
850 defaultText = "To be monitored in next runs";
852 else if(code<0.9 && code>=0.6){
854 defaultText = "notify the expert DURING THE DAY!";
858 defaultText = "CALL THE EXPERT!!!!";
862 text->AddText(defaultText.Data());
863 text->SetFillColor(color);
865 //histo.SetFillStyle(1001);
866 //histo.SetFillColor(color);
868 histo.SetStats(kFALSE);
870 histo.GetListOfFunctions()->Add(text);