+ // -------------------------------------------------------------------
+ else if(index == AliQAv1::kRAW){
+ //
+ // Check RAW HIGH GAIN CHAIN histos
+ if(hdata->GetEntries()>0){
+ if(irawHisto==0) sumADCZNC = hdata->GetMean();
+ else if(irawHisto==1) sumADCZNA = hdata->GetMean();
+ else if(irawHisto==2) sumADCZPC = hdata->GetMean();
+ else if(irawHisto==3) sumADCZPA = hdata->GetMean();
+ else if(irawHisto==6) adcQZNC = hdata->GetMean();
+ else if(irawHisto==7) adcQZNA = hdata->GetMean();
+ else if(irawHisto==8) adcQZPC = hdata->GetMean();
+ else if(irawHisto==9) adcQZPA = hdata->GetMean();
+ else if(irawHisto==10) adcCZNC = hdata->GetMean();
+ else if(irawHisto==11) adcCZNA = hdata->GetMean();
+ else if(irawHisto==12) adcCZPC = hdata->GetMean();
+ else if(irawHisto==13) adcCZPA = hdata->GetMean();
+ }
+ //
+ // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
+ // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
+ if(irawHisto==3){
+ if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
+ if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
+ if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ }
+ // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
+ if(irawHisto==13){
+ if(TMath::Abs(sumADCZNC)>1.e-10){
+ if((TMath::Abs(adcQZNC-adcCZNC)/adcCZNC)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZNA)>1.e-10){
+ if((TMath::Abs(adcQZNA-adcCZNA)/adcCZNA)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZPC)>1.e-10){
+ if((TMath::Abs(adcQZPC-adcCZPC)/adcCZPC)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZPA)>1.e-10){
+ if((TMath::Abs(adcQZPA-adcCZPA)/adcCZPA)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ }
+ irawHisto++;
+ }
+ // -------------------------------------------------------------------
+ else if(index == AliQAv1::kREC){
+ //
+ // Check RAW HIGH GAIN CHAIN histos
+ if(hdata->GetEntries()>0){
+ if(irecHisto==0) meanZNC = hdata->GetMean();
+ else if(irecHisto==1) meanZNA = hdata->GetMean();
+ else if(irecHisto==2) meanZPC = hdata->GetMean();
+ else if(irecHisto==3) meanZPA = hdata->GetMean();
+ else if(irecHisto==4) pmQZNC = hdata->GetMean();
+ else if(irecHisto==5) pmQZNA = hdata->GetMean();
+ else if(irecHisto==6) pmQZPC = hdata->GetMean();
+ else if(irecHisto==7) pmQZPA = hdata->GetMean();
+ else if(irecHisto==8) pmCZNC = hdata->GetMean();
+ else if(irecHisto==9) pmCZNA = hdata->GetMean();
+ else if(irecHisto==10) pmCZPC = hdata->GetMean();
+ else if(irecHisto==11) pmCZPA = hdata->GetMean();
+ }
+ //
+ // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
+ // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
+ if(irecHisto==3){
+ if(TMath::Abs(meanZNC)>1.e-10 && TMath::Abs(meanZNA)>1.e-10){
+ if((2*TMath::Abs(meanZNC-meanZNA)/(meanZNA+meanZNC))<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(meanZPC)>1.e-10 && TMath::Abs(meanZPA)>1.e-10){
+ if((TMath::Abs(meanZPC-meanZPA)/(meanZPA+meanZPC))<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ }
+ // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
+ if(irecHisto==11){
+ if(TMath::Abs(meanZNC)>1.e-10){
+ if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(meanZNA)>1.e-10){
+ if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(meanZPC)>1.e-10){
+ if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(meanZPA)>1.e-10){
+ if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ }
+ irecHisto++;
+ }
+ // -------------------------------------------------------------------
+ else if(index == AliQAv1::kESD){
+ //
+ // Check ESD HIGH GAIN CHAIN histos
+ if(hdata->GetEntries()>0){
+ if(esdInd==2) sumADCZNC = hdata->GetMean();
+ else if(esdInd==3) sumADCZNA = hdata->GetMean();
+ else if(esdInd==4) sumADCZPC = hdata->GetMean();
+ else if(esdInd==5) sumADCZPA = hdata->GetMean();
+ else if(esdInd==8) pmQZNC = hdata->GetMean();
+ else if(esdInd==9) pmQZNA = hdata->GetMean();
+ else if(esdInd==10) pmQZPC = hdata->GetMean();
+ else if(esdInd==11) pmQZPA = hdata->GetMean();
+ else if(esdInd==12) pmCZNC = hdata->GetMean();
+ else if(esdInd==13) pmCZNA = hdata->GetMean();
+ else if(esdInd==14) pmCZPC = hdata->GetMean();
+ else if(esdInd==15) pmCZPA = hdata->GetMean();
+ }
+ //
+ // --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
+ // --- and 2*|Mean ZPA - Mean ZPC|/(Mean ZPA + Mean ZPC) < 2*percentageDiff
+ if(esdInd==5){
+ if(TMath::Abs(sumADCZNC)>1.e-10 && TMath::Abs(sumADCZNA)>1.e-10){
+ if((2*TMath::Abs(sumADCZNC-sumADCZNA)/(sumADCZNA+sumADCZNC))<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZPC)>1.e-10 && TMath::Abs(sumADCZPA)>1.e-10){
+ if((TMath::Abs(sumADCZPC-sumADCZPA)/(sumADCZPA+sumADCZPC))<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ }
+ // --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
+ if(esdInd==15){
+ if(TMath::Abs(sumADCZNC)>1.e-10){
+ if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZNA)>1.e-10){
+ if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZPC)>1.e-10){
+ if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ if(TMath::Abs(sumADCZPA)>1.e-10){
+ if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
+ res=1.;
+ else
+ res=.5;
+ test[specie] += res;
+ count++;
+ }
+ }
+ esdInd++;
+ }
+ else {
+ AliWarning(Form("\n\t No ZDC QA for %s task\n",taskName));
+ return ;
+ }
+ }//if(hdata)
+ else AliError("\t No histos found for ZDC!!!\n");
+ }
+ } // HighMult (Pb-Pb)
+ // ====================================================================
+ // Checks for Calibration events
+ // ====================================================================
+ else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib) {
+ AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
+ return ;
+ } // Calibration
+ // ====================================================================
+ // Checks for cosmic events
+ // ====================================================================
+ else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic) {
+ AliWarning(Form("\n\t No check implemented in ZDC QA for %s task\n",taskName));
+ return ;
+ } // Cosmic
+ if(TMath::Abs(count)>1.e-10) test[specie] = test[specie]/count;
+ AliDebug(AliQAv1::GetQADebugLevel(), Form("\n\t ZDC QA check result = %1.2f\n",test[specie]));
+ } // Loop on species