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.){
209 if(ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18){
219 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
220 if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
221 else if(iDetPM==kFALSE){
222 messages.Add(new TObjString("Problem with ADCs!"));
223 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL"));
224 messages.Add(new TObjString("OR A STANDALONE_PEDESTAL RUN"));
226 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
227 SetupHisto(messages, *hdata, rv);
229 else if(irawHisto==23){
230 Double_t refTDCs = -329.5;
232 for(int ibin=5; ibin<=6; ibin++){
233 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs)<2.){
236 else if((TMath::Abs((hdata->GetBinContent(ibin))-refTDCs)>=2.) &&
237 (TMath::Abs((hdata->GetBinContent(ibin))-refTDCs)<=3.)){
249 if(hdata->GetNbinsX() != 0) rv = resTDC/2;
250 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
251 else if(rv<1 && rv>=0.9) messages.Add(new TObjString("Minor problem with TDCs"));
253 messages.Add(new TObjString("Serious problem in ZDC timing"));
254 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
255 messages.Add(new TObjString("OR A STANDALONE_PEDESTAL RUN"));
257 SetupHisto(messages, *hdata, rv);
262 // -------------------------------------------------------------------
263 else if(index == AliQAv1::kREC) {
265 // Check REC HIGH GAIN CHAIN histos
266 if(hdata->GetEntries()>0){
267 if(irecHisto==0) meanZNC = hdata->GetMean();
268 else if(irecHisto==1) meanZNA = hdata->GetMean();
269 else if(irecHisto==2) meanZPC = hdata->GetMean();
270 else if(irecHisto==3) meanZPA = hdata->GetMean();
271 else if(irecHisto==4) pmQZNC = hdata->GetMean();
272 else if(irecHisto==5) pmQZNA = hdata->GetMean();
273 else if(irecHisto==6) pmQZPC = hdata->GetMean();
274 else if(irecHisto==7) pmQZPA = hdata->GetMean();
275 else if(irecHisto==8) pmCZNC = hdata->GetMean();
276 else if(irecHisto==9) pmCZNA = hdata->GetMean();
277 else if(irecHisto==10) pmCZPC = hdata->GetMean();
278 else if(irecHisto==11) pmCZPA = hdata->GetMean();
281 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
283 if(TMath::Abs(meanZNC)>1.e-10){
284 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
291 if(TMath::Abs(meanZNA)>1.e-10){
292 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
299 if(TMath::Abs(meanZPC)>1.e-10){
300 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
307 if(TMath::Abs(meanZPA)>1.e-10){
308 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
318 // -------------------------------------------------------------------
319 else if(index == AliQAv1::kESD) {
321 // Check ESD HIGH GAIN CHAIN histos
322 if(hdata->GetEntries()>0){
323 if(esdInd==2) sumADCZNC = hdata->GetMean();
324 else if(esdInd==3) sumADCZNA = hdata->GetMean();
325 else if(esdInd==4) sumADCZPC = hdata->GetMean();
326 else if(esdInd==5) sumADCZPA = hdata->GetMean();
327 else if(esdInd==8) pmQZNC = hdata->GetMean();
328 else if(esdInd==9) pmQZNA = hdata->GetMean();
329 else if(esdInd==10) pmQZPC = hdata->GetMean();
330 else if(esdInd==11) pmQZPA = hdata->GetMean();
331 else if(esdInd==12) pmCZNC = hdata->GetMean();
332 else if(esdInd==13) pmCZNA = hdata->GetMean();
333 else if(esdInd==14) pmCZPC = hdata->GetMean();
334 else if(esdInd==15) pmCZPA = hdata->GetMean();
337 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
339 if(TMath::Abs(sumADCZNC)>1.e-10){
340 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
347 if(TMath::Abs(sumADCZNA)>1.e-10){
348 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
355 if(TMath::Abs(sumADCZPC)>1.e-10){
356 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
363 if(TMath::Abs(sumADCZPA)>1.e-10){
364 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
375 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
379 else AliError("AliZDCQAChecker-> No histos!!!\n");
382 // ====================================================================
383 // Checks for A-A events
384 // ====================================================================
385 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult) {
386 if(list[specie]->GetEntries()==0){
387 AliWarning("\t The list to be checked is empty!");
390 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
392 TIter next(list[specie]);
396 Float_t res=0., percentageDiff=0.10;
397 Float_t meanZNA=0., meanZNC=0., meanZPA=0., meanZPC=0.;
398 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
399 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
400 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
401 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
402 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
404 while((hdata = dynamic_cast<TH1 *>(next()))){
406 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
407 // -------------------------------------------------------------------
408 if(index == AliQAv1::kSIM){
410 if (!(strncmp(hdata->GetName(),"hHits",5))){
411 if(hdata->GetEntries()>0){
412 if(ihitHisto==0) meanZNC = hdata->GetMean();
413 else if(ihitHisto==1) meanZNA = hdata->GetMean();
414 else if(ihitHisto==2) meanZPC = hdata->GetMean();
415 else if(ihitHisto==3) meanZPA = hdata->GetMean();
416 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
417 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
418 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
419 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
420 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
421 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
422 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
423 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
426 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
427 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
429 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
430 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
437 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
438 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
446 // --- Check whether (mean PMQi - PMC)/PMC < percentageDiff
448 if(TMath::Abs(meanZNC)>1.e-10){
449 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
456 if(TMath::Abs(meanZNA)>1.e-10){
457 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
464 if(TMath::Abs(meanZPC)>1.e-10){
465 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
472 if(TMath::Abs(meanZPA)>1.e-10){
473 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
483 // Check DIGITS histos
484 else if (!(strncmp(hdata->GetName(),"hDig",4))){
485 if(hdata->GetEntries()>0){
486 if(idigHisto==0) sumADCZNC = hdata->GetMean();
487 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
488 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
489 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
490 else if(idigHisto==4) adcQZNC = hdata->GetMean();
491 else if(idigHisto==5) adcQZNA = hdata->GetMean();
492 else if(idigHisto==6) adcQZPC = hdata->GetMean();
493 else if(idigHisto==7) adcQZPA = hdata->GetMean();
494 else if(idigHisto==8) adcCZNC = hdata->GetMean();
495 else if(idigHisto==9) adcCZNA = hdata->GetMean();
496 else if(idigHisto==10) adcCZPC = hdata->GetMean();
497 else if(idigHisto==11) adcCZPA = hdata->GetMean();
500 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
501 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
503 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
504 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
511 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
512 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
520 // --- Check whether (sumADC PMQi - PMC)/PMC < percentageDiff
522 if(TMath::Abs(sumADCZNC)>1.e-10){
523 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
530 if(TMath::Abs(sumADCZNA)>1.e-10){
531 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
538 if(TMath::Abs(sumADCZPC)>1.e-10){
539 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
546 if(TMath::Abs(sumADCZPA)>1.e-10){
547 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
558 // -------------------------------------------------------------------
559 else if(index == AliQAv1::kRAW){
561 // Check RAW HIGH GAIN CHAIN histos
565 Bool_t iDetPM = kTRUE;
569 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
570 if((hdata->GetBinContent(ibin))>10.){
573 else if((hdata->GetBinContent(ibin))<10. &&
574 (ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18)){
584 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
585 if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
586 else if(iDetPM==kFALSE){
587 messages.Add(new TObjString("Problem with ADCs!"));
588 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
590 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
591 SetupHisto(messages, *hdata, rv);
593 else if(irawHisto==23){
594 Double_t refTDCs[6] = {-83.0,-78.1,-80.2,-79.3,-81.0,-80.9};
596 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
597 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
609 if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
610 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
611 else if(rv<1 && rv>0.9) messages.Add(new TObjString("Minor problem with TDCs"));
613 messages.Add(new TObjString("Serious problem in ZDC timing"));
614 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
616 SetupHisto(messages, *hdata, rv);
618 else if(irawHisto==26){
619 Double_t yZNC=hdata->GetBinContent(2);
620 Double_t yZNA=hdata->GetBinContent(4);
621 if(TMath::Abs(yZNC)<0.4 && TMath::Abs(yZNA)<0.4) res=1.;
626 printf(" yZNC = %1.2f yZNA = %1.2f -> res %1.2f\n",yZNC, yZNA,res);
627 if(res == 1.) messages.Add(new TObjString("ZN positions are OK!"));
629 messages.Add(new TObjString("Problem in ZN positions!"));
630 messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
632 SetupHisto(messages, *hdata, res);
637 // -------------------------------------------------------------------
638 else if(index == AliQAv1::kREC){
640 // Check RAW HIGH GAIN CHAIN histos
641 if(hdata->GetEntries()>0){
642 if(irecHisto==0) meanZNC = hdata->GetMean();
643 else if(irecHisto==1) meanZNA = hdata->GetMean();
644 else if(irecHisto==2) meanZPC = hdata->GetMean();
645 else if(irecHisto==3) meanZPA = hdata->GetMean();
646 else if(irecHisto==4) pmQZNC = hdata->GetMean();
647 else if(irecHisto==5) pmQZNA = hdata->GetMean();
648 else if(irecHisto==6) pmQZPC = hdata->GetMean();
649 else if(irecHisto==7) pmQZPA = hdata->GetMean();
650 else if(irecHisto==8) pmCZNC = hdata->GetMean();
651 else if(irecHisto==9) pmCZNA = hdata->GetMean();
652 else if(irecHisto==10) pmCZPC = hdata->GetMean();
653 else if(irecHisto==11) pmCZPA = hdata->GetMean();
656 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
657 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
659 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
660 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
667 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
668 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
676 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
678 if(TMath::Abs(meanZNC)>1.e-10){
679 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
686 if(TMath::Abs(meanZNA)>1.e-10){
687 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
694 if(TMath::Abs(meanZPC)>1.e-10){
695 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
702 if(TMath::Abs(meanZPA)>1.e-10){
703 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
713 // -------------------------------------------------------------------
714 else if(index == AliQAv1::kESD){
716 // Check ESD HIGH GAIN CHAIN histos
717 if(hdata->GetEntries()>0){
718 if(esdInd==2) sumADCZNC = hdata->GetMean();
719 else if(esdInd==3) sumADCZNA = hdata->GetMean();
720 else if(esdInd==4) sumADCZPC = hdata->GetMean();
721 else if(esdInd==5) sumADCZPA = hdata->GetMean();
722 else if(esdInd==8) pmQZNC = hdata->GetMean();
723 else if(esdInd==9) pmQZNA = hdata->GetMean();
724 else if(esdInd==10) pmQZPC = hdata->GetMean();
725 else if(esdInd==11) pmQZPA = hdata->GetMean();
726 else if(esdInd==12) pmCZNC = hdata->GetMean();
727 else if(esdInd==13) pmCZNA = hdata->GetMean();
728 else if(esdInd==14) pmCZPC = hdata->GetMean();
729 else if(esdInd==15) pmCZPA = hdata->GetMean();
732 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
733 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
735 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
736 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
743 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
744 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
752 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
754 if(TMath::Abs(sumADCZNC)>1.e-10){
755 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
762 if(TMath::Abs(sumADCZNA)>1.e-10){
763 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
770 if(TMath::Abs(sumADCZPC)>1.e-10){
771 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
778 if(TMath::Abs(sumADCZPA)>1.e-10){
779 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
790 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
794 else AliError("\t No histos found for ZDC!!!\n");
796 } // HighMult (Pb-Pb)
797 // ====================================================================
798 // Checks for Calibration events
799 // ====================================================================
800 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib) {
801 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
804 // ====================================================================
805 // Checks for cosmic events
806 // ====================================================================
807 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic) {
808 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
811 if(TMath::Abs(count)>1.e-10) test[specie] = test[specie]/count;
812 AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\t ZDC QA check result = %1.2f\n",test[specie]));
816 //___________________________________________________________________
817 void AliZDCQAChecker::SetupHisto(const TObjArray& messages, TH1& histo, Float_t& code)
820 /// Add text to histos
823 TPaveText* text = new TPaveText(0.70,0.70,0.99,0.99,"NDC");
825 TIter next(&messages);
828 while ( ( str = static_cast<TObjString*>(next()) ) ){
829 text->AddText(str->String());
832 TString defaultText = "";
837 defaultText = "Everything is fine!";
839 else if(code<1. && code>=0.9){
841 defaultText = "To be monitored in next runs";
843 else if(code<0.9 && code>=0.6){
845 defaultText = "notify the expert DURING THE DAY!";
849 defaultText = "CALL THE EXPERT!!!!";
853 text->AddText(defaultText.Data());
854 text->SetFillColor(color);
856 //histo.SetFillStyle(1001);
857 //histo.SetFillColor(color);
859 histo.SetStats(kFALSE);
861 histo.GetListOfFunctions()->Add(text);