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>
23 #include <TParameter.h>
26 // --- AliRoot header files ---
28 #include "AliCDBManager.h"
29 #include "AliCDBEntry.h"
30 #include "AliQAThresholds.h"
31 #include "AliZDCQAChecker.h"
33 ClassImp(AliZDCQAChecker)
35 //_________________________________________________________________
36 AliZDCQAChecker::AliZDCQAChecker() :
37 AliQACheckerBase("ZDC","ZDC Quality Assurance Data Maker"),
39 fZDCQAThr_ZNCTDCRefThr(-322.7),
40 fZDCQAThr_ZPCTDCRefThr(-321.4),
41 fZDCQAThr_ZNATDCRefThr(-321.6),
42 fZDCQAThr_ZPATDCRefThr(-321.7),
43 fZDCQAThr_ZEM1TDCRefThr(-316.2),
44 fZDCQAThr_ZEM2TDCRefThr(-315.4)
49 //____________________________________________________________________________
50 void AliZDCQAChecker::Check(Double_t * test, AliQAv1::ALITASK_t index, TObjArray ** list,
51 const AliDetectorRecoParam * /*recoParam*/)
53 // Checks the QA histograms on the input list:
55 const char* taskName = AliQAv1::GetAliTaskName(index);
56 //printf("\n\tAliZDCQAChecker -> checking QA histos for task %s\n",taskName);
58 Int_t ihitHisto=0, idigHisto=0;
59 Int_t irecHisto=0, irawHisto=0, esdInd=0;
62 messages.SetOwner(kTRUE);
64 for(Int_t specie = 0; specie<AliRecoParam::kNSpecies; specie++){
66 if(!AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)))
68 //printf("\tAliZDCQAChecker -> specie %d, AliRecoParam::ConvertIndex(specie) %d, AliRecoParam::kLowMult %d, IsEventSpecieSet(specie) %d\n",
69 // specie, AliRecoParam::ConvertIndex(specie) ,AliRecoParam::kLowMult,
70 // AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)));
72 // ====================================================================
73 // Checks for p-p events
74 // ====================================================================
75 if(AliRecoParam::ConvertIndex(specie) == AliRecoParam::kLowMult){
76 if(list[specie]->GetEntries()==0){
77 AliWarning("\t The list to be checked is empty!"); // nothing to check
80 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
81 TIter next(list[specie]);
85 Float_t res=0., percentageDiff=0.30;
86 Float_t meanZNA=0., meanZNC=0., meanZPA=0., meanZPC=0.;
87 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
88 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
89 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
90 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
91 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
94 while((hdata = dynamic_cast<TH1 *>(next()))){
96 // -------------------------------------------------------------------
97 if(index == AliQAv1::kSIM){
98 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
101 if(!(strncmp(hdata->GetName(),"hHits",5))){
102 if(hdata->GetEntries()>0){
103 if(ihitHisto==0) meanZNC = hdata->GetMean();
104 else if(ihitHisto==1) meanZNA = hdata->GetMean();
105 else if(ihitHisto==2) meanZPC = hdata->GetMean();
106 else if(ihitHisto==3) meanZPA = hdata->GetMean();
107 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
108 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
109 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
110 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
111 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
112 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
113 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
114 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
117 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
119 if(TMath::Abs(meanZNC)>1.e-10){
120 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
127 if(TMath::Abs(meanZNA)>1.e-10){
128 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
135 if(TMath::Abs(meanZPC)>1.e-10){
136 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
143 if(TMath::Abs(meanZPA)>1.e-10){
144 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
154 // Check DIGIT HIGH GAIN CHAIN histos
155 else if(!(strncmp(hdata->GetName(),"hDig",4))){
156 if(hdata->GetEntries()>0){
157 if(idigHisto==0) sumADCZNC = hdata->GetMean();
158 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
159 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
160 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
161 else if(idigHisto==4) pmQZNC = hdata->GetMean();
162 else if(idigHisto==5) pmQZNA = hdata->GetMean();
163 else if(idigHisto==6) pmQZPC = hdata->GetMean();
164 else if(idigHisto==7) pmQZPA = hdata->GetMean();
165 else if(idigHisto==8) pmCZNC = hdata->GetMean();
166 else if(idigHisto==9) pmCZNA = hdata->GetMean();
167 else if(idigHisto==10) pmCZPC = hdata->GetMean();
168 else if(idigHisto==11) pmCZPA = hdata->GetMean();
171 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
173 if(TMath::Abs(sumADCZNC)>1.e-10){
174 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
181 if(TMath::Abs(sumADCZNA)>1.e-10){
182 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
189 if(TMath::Abs(sumADCZPC)>1.e-10){
190 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
197 if(TMath::Abs(sumADCZPA)>1.e-10){
198 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
209 // -------------------------------------------------------------------
210 else if(index == AliQAv1::kRAW) {
212 // Check RAW HIGH GAIN CHAIN histos
216 Bool_t iDetPM = kTRUE;
218 if(irawHisto==16) nentries = Int_t (hdata->GetEntries());
221 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
222 if((hdata->GetBinContent(ibin))>10.){
225 else if((hdata->GetBinContent(ibin))<10.){
227 if(ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18){
236 if(nentries != -99) messages.Add(new TObjString(Form("#entries %d",nentries)));
237 else messages.Add(new TObjString("#entries not known"));
240 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
241 if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
242 else if(iDetPM==kFALSE){
243 messages.Add(new TObjString("Problem with some ADC!"));
244 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
246 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
247 SetupHisto(messages, *hdata, rv);
249 else if(irawHisto==19){
250 // Reference values must be inserted in the order:
251 // ZNC, ZPC, ZNA, ZPA, ZEM1, ZEM2
252 // 2012 -> Reference values from RUN 177399
253 //Double_t refTDCs[6] = {-322.7,-321.4,-321.6,-321.7,-316.2,-315.4};
254 // 11/2012 -> QA threshold values x TDCs are read from configuration file
256 refTDCs[0] = fZDCQAThr_ZNCTDCRefThr;
257 refTDCs[1] = fZDCQAThr_ZPCTDCRefThr;
258 refTDCs[2] = fZDCQAThr_ZNATDCRefThr;
259 refTDCs[3] = fZDCQAThr_ZPATDCRefThr;
260 refTDCs[4] = fZDCQAThr_ZEM1TDCRefThr;
261 refTDCs[5] = fZDCQAThr_ZEM2TDCRefThr;
264 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
265 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<3.){
268 else if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<5.){
278 if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
279 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
280 else if(rv<1. && rv>0.75) messages.Add(new TObjString("Minor problem with TDCs"));
282 messages.Add(new TObjString("Serious problem in ZDC timing"));
283 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
285 SetupHisto(messages, *hdata, rv);
290 // -------------------------------------------------------------------
291 else if(index == AliQAv1::kREC) {
293 // Check REC HIGH GAIN CHAIN histos
294 if(hdata->GetEntries()>0){
295 if(irecHisto==0) meanZNC = hdata->GetMean();
296 else if(irecHisto==1) meanZNA = hdata->GetMean();
297 else if(irecHisto==2) meanZPC = hdata->GetMean();
298 else if(irecHisto==3) meanZPA = hdata->GetMean();
299 else if(irecHisto==4) pmQZNC = hdata->GetMean();
300 else if(irecHisto==5) pmQZNA = hdata->GetMean();
301 else if(irecHisto==6) pmQZPC = hdata->GetMean();
302 else if(irecHisto==7) pmQZPA = hdata->GetMean();
303 else if(irecHisto==8) pmCZNC = hdata->GetMean();
304 else if(irecHisto==9) pmCZNA = hdata->GetMean();
305 else if(irecHisto==10) pmCZPC = hdata->GetMean();
306 else if(irecHisto==11) pmCZPA = hdata->GetMean();
309 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
311 if(TMath::Abs(meanZNC)>1.e-10){
312 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
319 if(TMath::Abs(meanZNA)>1.e-10){
320 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
327 if(TMath::Abs(meanZPC)>1.e-10){
328 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
335 if(TMath::Abs(meanZPA)>1.e-10){
336 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
346 // -------------------------------------------------------------------
347 else if(index == AliQAv1::kESD) {
349 // Check ESD HIGH GAIN CHAIN histos
350 if(hdata->GetEntries()>0){
351 if(esdInd==0) sumADCZNC = hdata->GetMean();
352 else if(esdInd==1) sumADCZNA = hdata->GetMean();
353 else if(esdInd==2) sumADCZPC = hdata->GetMean();
354 else if(esdInd==3) sumADCZPA = hdata->GetMean();
355 else if(esdInd==6) pmQZNC = hdata->GetMean();
356 else if(esdInd==7) pmQZNA = hdata->GetMean();
357 else if(esdInd==8) pmQZPC = hdata->GetMean();
358 else if(esdInd==9) pmQZPA = hdata->GetMean();
359 else if(esdInd==10) pmCZNC = hdata->GetMean();
360 else if(esdInd==11) pmCZNA = hdata->GetMean();
361 else if(esdInd==12) pmCZPC = hdata->GetMean();
362 else if(esdInd==13) pmCZPA = hdata->GetMean();
365 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
367 if(TMath::Abs(sumADCZNC)>1.e-10){
368 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
375 if(TMath::Abs(sumADCZNA)>1.e-10){
376 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
383 if(TMath::Abs(sumADCZPC)>1.e-10){
384 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
391 if(TMath::Abs(sumADCZPA)>1.e-10){
392 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
403 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
407 else AliError("AliZDCQAChecker-> No histos!!!\n");
410 // ====================================================================
411 // Checks for A-A events
412 // ====================================================================
413 if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult) {
414 if(list[specie]->GetEntries()==0){
415 AliWarning("\t The list to be checked is empty!");
418 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\tAliZDCQAChecker-> checking QA histograms for task %s\n\n",taskName));
420 TIter next(list[specie]);
424 Float_t res=0., percentageDiff=0.10;
425 Float_t meanZNA=0., meanZNC=0., meanZPA=0., meanZPC=0.;
426 Float_t pmCZNA=0., pmCZNC=0., pmCZPA=0., pmCZPC=0.;
427 Float_t pmQZNA=0., pmQZNC=0., pmQZPA=0., pmQZPC=0.;
428 Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
429 Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
430 Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
433 while((hdata = dynamic_cast<TH1 *>(next()))){
435 //AliDebug(AliQAv1::GetQADebugLevel(), Form("\tAliZDCQAChecker-> checking histo %s",hdata->GetName()));
436 // -------------------------------------------------------------------
437 if(index == AliQAv1::kSIM){
439 if (!(strncmp(hdata->GetName(),"hHits",5))){
440 if(hdata->GetEntries()>0){
441 if(ihitHisto==0) meanZNC = hdata->GetMean();
442 else if(ihitHisto==1) meanZNA = hdata->GetMean();
443 else if(ihitHisto==2) meanZPC = hdata->GetMean();
444 else if(ihitHisto==3) meanZPA = hdata->GetMean();
445 else if(ihitHisto==4) pmQZNC = hdata->GetMean();
446 else if(ihitHisto==5) pmQZNA = hdata->GetMean();
447 else if(ihitHisto==6) pmQZPC = hdata->GetMean();
448 else if(ihitHisto==7) pmQZPA = hdata->GetMean();
449 else if(ihitHisto==8) pmCZNC = hdata->GetMean();
450 else if(ihitHisto==9) pmCZNA = hdata->GetMean();
451 else if(ihitHisto==10) pmCZPC = hdata->GetMean();
452 else if(ihitHisto==11) pmCZPA = hdata->GetMean();
455 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
456 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
458 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
459 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
466 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
467 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
475 // --- Check whether (mean PMQi - PMC)/PMC < percentageDiff
477 if(TMath::Abs(meanZNC)>1.e-10){
478 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
485 if(TMath::Abs(meanZNA)>1.e-10){
486 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
493 if(TMath::Abs(meanZPC)>1.e-10){
494 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
501 if(TMath::Abs(meanZPA)>1.e-10){
502 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
512 // Check DIGITS histos
513 else if (!(strncmp(hdata->GetName(),"hDig",4))){
514 if(hdata->GetEntries()>0){
515 if(idigHisto==0) sumADCZNC = hdata->GetMean();
516 else if(idigHisto==1) sumADCZNA = hdata->GetMean();
517 else if(idigHisto==2) sumADCZPC = hdata->GetMean();
518 else if(idigHisto==3) sumADCZPA = hdata->GetMean();
519 else if(idigHisto==4) adcQZNC = hdata->GetMean();
520 else if(idigHisto==5) adcQZNA = hdata->GetMean();
521 else if(idigHisto==6) adcQZPC = hdata->GetMean();
522 else if(idigHisto==7) adcQZPA = hdata->GetMean();
523 else if(idigHisto==8) adcCZNC = hdata->GetMean();
524 else if(idigHisto==9) adcCZNA = hdata->GetMean();
525 else if(idigHisto==10) adcCZPC = hdata->GetMean();
526 else if(idigHisto==11) adcCZPA = hdata->GetMean();
529 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
530 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
532 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
533 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
540 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
541 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
549 // --- Check whether (sumADC PMQi - PMC)/PMC < percentageDiff
551 if(TMath::Abs(sumADCZNC)>1.e-10){
552 if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
559 if(TMath::Abs(sumADCZNA)>1.e-10){
560 if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
567 if(TMath::Abs(sumADCZPC)>1.e-10){
568 if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
575 if(TMath::Abs(sumADCZPA)>1.e-10){
576 if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
587 // -------------------------------------------------------------------
588 else if(index == AliQAv1::kRAW){
590 // Check RAW HIGH GAIN CHAIN histos
594 Bool_t iDetPM = kTRUE;
596 if(irawHisto==16) nentries = Int_t (hdata->GetEntries());
599 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
600 if((hdata->GetBinContent(ibin))>10.){
603 else if((hdata->GetBinContent(ibin))<10. &&
604 (ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18)){
613 if(nentries != -99) messages.Add(new TObjString(Form("#entries %d",nentries)));
614 else messages.Add(new TObjString("#entries not known"));
617 if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
618 if(rv > 0.98) messages.Add(new TObjString("ADCs are OK!"));
619 else if(iDetPM==kFALSE){
620 messages.Add(new TObjString("Problem with ADCs!"));
621 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
623 else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
624 SetupHisto(messages, *hdata, rv);
626 else if(irawHisto==19){
627 // Reference values from RUN 137161
628 //Double_t refTDCs[6] = {-320.7,-319.0,-318.6,-319.9,-321.3,-320.8};
629 // 11/2012 -> QA threshold values x TDCs are read from configuration file
631 refTDCs[0] = fZDCQAThr_ZNCTDCRefThr;
632 refTDCs[1] = fZDCQAThr_ZPCTDCRefThr;
633 refTDCs[2] = fZDCQAThr_ZNATDCRefThr;
634 refTDCs[3] = fZDCQAThr_ZPATDCRefThr;
635 refTDCs[4] = fZDCQAThr_ZEM1TDCRefThr;
636 refTDCs[5] = fZDCQAThr_ZEM2TDCRefThr;
639 for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
640 if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<3.){
643 else if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
653 if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
654 if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
655 else if(rv<1 && rv>0.75) messages.Add(new TObjString("Minor problem with TDCs"));
657 messages.Add(new TObjString("Serious problem in ZDC timing"));
658 messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
660 SetupHisto(messages, *hdata, rv);
665 // -------------------------------------------------------------------
666 else if(index == AliQAv1::kREC){
668 // Check RAW HIGH GAIN CHAIN histos
669 if(hdata->GetEntries()>0){
670 if(irecHisto==0) meanZNC = hdata->GetMean();
671 else if(irecHisto==1) meanZNA = hdata->GetMean();
672 else if(irecHisto==2) meanZPC = hdata->GetMean();
673 else if(irecHisto==3) meanZPA = hdata->GetMean();
674 else if(irecHisto==4) pmQZNC = hdata->GetMean();
675 else if(irecHisto==5) pmQZNA = hdata->GetMean();
676 else if(irecHisto==6) pmQZPC = hdata->GetMean();
677 else if(irecHisto==7) pmQZPA = hdata->GetMean();
678 else if(irecHisto==8) pmCZNC = hdata->GetMean();
679 else if(irecHisto==9) pmCZNA = hdata->GetMean();
680 else if(irecHisto==10) pmCZPC = hdata->GetMean();
681 else if(irecHisto==11) pmCZPA = hdata->GetMean();
684 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
685 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
687 if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
688 if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
695 if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
696 if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
704 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
706 if((TMath::Abs(meanZNC)>1.e-10) && (pmCZNC>1.e-10)){
707 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
714 if((TMath::Abs(meanZNA)>1.e-10) && (pmCZNA>1.e-10)){
715 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
722 if((TMath::Abs(meanZPC)>1.e-10) && (pmCZPC>1.e-10)){
723 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
730 if((TMath::Abs(meanZPA)>1.e-10) && (pmCZPA>1.e-10)){
731 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
741 // -------------------------------------------------------------------
742 else if(index == AliQAv1::kESD){
744 // Check ESD HIGH GAIN CHAIN histos
745 if(hdata->GetEntries()>0){
746 if(esdInd==0) sumADCZNC = hdata->GetMean();
747 else if(esdInd==1) sumADCZNA = hdata->GetMean();
748 else if(esdInd==2) sumADCZPC = hdata->GetMean();
749 else if(esdInd==3) sumADCZPA = hdata->GetMean();
750 else if(esdInd==6) pmQZNC = hdata->GetMean();
751 else if(esdInd==7) pmQZNA = hdata->GetMean();
752 else if(esdInd==8) pmQZPC = hdata->GetMean();
753 else if(esdInd==9) pmQZPA = hdata->GetMean();
754 else if(esdInd==10) pmCZNC = hdata->GetMean();
755 else if(esdInd==11) pmCZNA = hdata->GetMean();
756 else if(esdInd==12) pmCZPC = hdata->GetMean();
757 else if(esdInd==13) pmCZPA = hdata->GetMean();
760 // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
761 // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
763 if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
764 if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
771 if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
772 if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
780 // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
782 if(TMath::Abs(sumADCZNC)>1.e-10){
783 if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
790 if(TMath::Abs(sumADCZNA)>1.e-10){
791 if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
798 /* if(TMath::Abs(sumADCZPC)>1.e-10){
799 if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
806 if(TMath::Abs(sumADCZPA)>1.e-10){
807 if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
819 AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
823 else AliError("\t No histos found for ZDC!!!\n");
825 } // HighMult (Pb-Pb)
826 // ====================================================================
827 // Checks for Calibration events
828 // ====================================================================
829 if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib) {
830 AliWarning(Form("\n\t No check implemented in ZDC QA for %s task in CALIBRATION events\n",taskName));
833 // ====================================================================
834 // Checks for cosmic events
835 // ====================================================================
836 else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic) {
837 AliWarning(Form("\n\t No check needed in ZDC QA for %s task in COSMIC events\n",taskName));
840 if(TMath::Abs(count)>1.e-10) test[specie] = test[specie]/count;
841 AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\t ZDC QA check result = %1.2f\n",test[specie]));
845 //___________________________________________________________________
846 void AliZDCQAChecker::SetupHisto(const TObjArray& messages, TH1& histo, Float_t& code)
849 /// Add text to histos
852 TPaveText* text = new TPaveText(0.70,0.70,0.99,0.99,"NDC");
854 TIter next(&messages);
857 while ( ( str = static_cast<TObjString*>(next()) ) ){
858 text->AddText(str->String());
861 TString defaultText = "";
866 defaultText = "Everything is fine!";
868 else if(code<1. && code>=0.85){
870 defaultText = "To be monitored in next runs";
872 else if(code<0.85 && code>=0.6){
874 defaultText = "notify the expert DURING THE DAY!";
878 defaultText = "PLEASE CALL THE EXPERT!!!!";
882 text->AddText(defaultText.Data());
883 text->SetFillColor(color);
885 //histo.SetFillStyle(1001);
886 //histo.SetFillColor(color);
888 histo.SetStats(kFALSE);
890 TList* lst = histo.GetListOfFunctions();
892 printf(" No list found\n");
895 TObject *stats = lst->FindObject("stats");
898 while ((obj = lst->First())) {
899 while(lst->Remove(obj)) { }
902 if(stats) lst->Add(stats);
907 //______________________________________________________________
908 void AliZDCQAChecker::GetThresholds()
911 // Init the online thresholds from GRP generated by AMORE
913 AliCDBManager* man = AliCDBManager::Instance();
915 AliWarning("No CDB -> ZDC TDC thresholds not read from OCDB");
919 AliCDBEntry* entry = man->Get("GRP/Calib/QAThresholds");
921 AliWarning("No ZDC TDC thresholds object");
925 TObjArray* obj = (TObjArray*) entry->GetObject();
927 AliWarning("No object inside OCDB entry GRP/Calib/QAThresholds");
931 AliQAThresholds* thresholds = (AliQAThresholds*) obj->FindObject("ZDC");
933 AliWarning("No object for ZDC thresholds inside OCDB object");
937 TParameter<float>* myParam0 = (TParameter<float>*) thresholds->GetThreshold(0);
938 fZDCQAThr_ZNCTDCRefThr = myParam0->GetVal();
940 TParameter<float>* myParam1 = (TParameter<float>*) thresholds->GetThreshold(1);
941 fZDCQAThr_ZPCTDCRefThr = myParam1->GetVal();
943 TParameter<float>* myParam2 = (TParameter<float>*) thresholds->GetThreshold(2);
944 fZDCQAThr_ZNATDCRefThr = myParam2->GetVal();
946 TParameter<float>* myParam3 = (TParameter<float>*) thresholds->GetThreshold(3);
947 fZDCQAThr_ZPATDCRefThr = myParam3->GetVal();
949 TParameter<float>* myParam4 = (TParameter<float>*) thresholds->GetThreshold(4);
950 fZDCQAThr_ZEM1TDCRefThr = myParam4->GetVal();
952 TParameter<float>* myParam5 = (TParameter<float>*) thresholds->GetThreshold(5);
953 fZDCQAThr_ZEM2TDCRefThr = myParam5->GetVal();
958 //___________________________________________________________________________________________________
959 void AliZDCQAChecker::PrintThresholds()
961 printf("\n #### ZDC QA Thresholds read from configuration file: ");
962 printf(" \t fZDCQAThr_ZNCTDCRefThr %1.2f \n",fZDCQAThr_ZNCTDCRefThr);
963 printf(" \t fZDCQAThr_ZPCTDCRefThr %1.2f \n",fZDCQAThr_ZPCTDCRefThr);
964 printf(" \t fZDCQAThr_ZNATDCRefThr %1.2f \n",fZDCQAThr_ZNATDCRefThr);
965 printf(" \t fZDCQAThr_ZPATDCRefThr %1.2f \n",fZDCQAThr_ZPATDCRefThr);
966 printf(" \t fZDCQAThr_ZEM1TDCRefThr %1.2f \n",fZDCQAThr_ZEM1TDCRefThr);
967 printf(" \t fZDCQAThr_ZEM2TDCRefThr %1.2f \n\n",fZDCQAThr_ZEM2TDCRefThr);