+ //if(//AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib ||
+ // AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult ||
+ // AliRecoParam::ConvertIndex(specie) == AliRecoParam::kLowMult){
+ //AliRecoParam::ConvertIndex(specie) == AliRecoParam::kDefault ||
+
+ //check BCID
+ // Double_t qaFlag = CheckBCID(list[specie]);
+ // if(qaFlag < test[specie]) test[specie] = qaFlag;
+ //}
+
+ if(AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult ||
+ AliRecoParam::ConvertIndex(specie) == AliRecoParam::kLowMult){
+ //AliRecoParam::ConvertIndex(specie) == AliRecoParam::kDefault ||
+ //check physics
+ Double_t qaFlag = CheckRaw(list[specie]);
+ if(qaFlag < test[specie]) test[specie] = qaFlag;
+ }
+ }
+
+ if(index == AliQAv1::kESD && AliRecoParam::Convert(specie) != AliRecoParam::kCalib){
+ test[specie] = CheckESD(list[specie]);
+ }
+ }
+}
+
+//--------------------------------------------------------------------------
+//Double_t AliT0QAChecker::CheckLaser(TObjArray *listrec) const {
+//
+// return 1.0;
+//}
+
+//--------------------------------------------------------------------------
+Double_t AliT0QAChecker::CheckRaw(TObjArray *listrec) const {
+
+ //Fk Set drawing options for LED and CFD efficiencies from the raw data
+ TH1F *hCFDEffData = (TH1F*) listrec->UncheckedAt(207);//hRawTrigger
+ TH1F *hLEDEffData = (TH1F*) listrec->UncheckedAt(208);//hRawTrigger
+
+ //clean objects added at previous checks
+ EraseOldMessages((TH1*) hCFDEffData);
+ hCFDEffData->GetListOfFunctions()->Add((TH1D*) hLEDEffData->Clone());
+
+ TLegend leg(0.12,0.76,0.9,0.92," ","brNDC");
+ leg.SetFillStyle(0); leg.SetBorderSize(0); leg.SetTextSize(0.04); leg.SetNColumns(2);
+ leg.AddEntry((TH1D*) hCFDEffData,"CFD","p");
+ leg.AddEntry((TH1D*) hLEDEffData,"LED","p");
+ hCFDEffData->GetListOfFunctions()->Add((TLegend*) leg.Clone());
+
+
+ //Fk Draw CFD-mean for each PMT
+ TH2F* fhCFD = (TH2F*) listrec->UncheckedAt(210);
+ TH1F* fhCFDSubtrMean = (TH1F*) listrec->UncheckedAt(231);
+
+ EraseOldMessages((TH1*) fhCFDSubtrMean);
+ for(int ipmt=0; ipmt<24;ipmt++){
+ TH1F* hProjDummy = (TH1F*) fhCFD->ProjectionY("dummy",ipmt+1,ipmt+1);
+ Float_t mean=0.0, rms=0.0;
+ GetMeanAndRmsAroundMainMaximum(mean, rms, hProjDummy,0);
+
+ Float_t deviation = mean - fMeanCFDFromGoodRunParam[ipmt];
+
+ fhCFDSubtrMean->SetBinContent(ipmt+1,deviation);
+ fhCFDSubtrMean->SetBinError(ipmt+1,rms);
+
+ delete hProjDummy;
+ }
+ TLine linelowredCFD(0, fCFDErrorThreshold, 24, fCFDErrorThreshold);
+ linelowredCFD.SetLineColor(2);
+ linelowredCFD.SetLineStyle(3);
+ linelowredCFD.SetLineWidth(4);
+ TLine linehighredCFD(0, -fCFDErrorThreshold, 24, -fCFDErrorThreshold);
+ linehighredCFD.SetLineColor(2);
+ linehighredCFD.SetLineStyle(3);
+ linehighredCFD.SetLineWidth(4);
+ fhCFDSubtrMean->GetListOfFunctions()->Add((TLine*) linelowredCFD.Clone());
+ fhCFDSubtrMean->GetListOfFunctions()->Add((TLine*) linehighredCFD.Clone());
+
+
+
+ //Fk Draw LED-mean for each PMT
+ TH2F* fhLED = (TH2F*) listrec->UncheckedAt(211);
+ TH1F* fhLEDSubtrMean = (TH1F*) listrec->UncheckedAt(232);
+
+ EraseOldMessages((TH1*) fhLEDSubtrMean);
+ for(int ipmt=0; ipmt<24;ipmt++){
+ TH1F* hProjDummy = (TH1F*) fhLED->ProjectionY("dummy",ipmt+1,ipmt+1);
+ Float_t mean=0.0, rms=0.0;
+ GetMeanAndRmsAroundMainMaximum(mean, rms, hProjDummy,1);
+ Float_t deviation = mean - fMeanLEDFromGoodRunParam[ipmt];
+
+ fhLEDSubtrMean->SetBinContent(ipmt+1,deviation);
+ fhLEDSubtrMean->SetBinError(ipmt+1,rms);
+
+ delete hProjDummy;
+ }
+ TLine linelowredLED(0, fLEDErrorThreshold, 24, fLEDErrorThreshold);
+ linelowredLED.SetLineColor(2);
+ linelowredLED.SetLineStyle(3);
+ linelowredLED.SetLineWidth(4);
+ TLine linehighredLED(0, -fLEDErrorThreshold, 24, -fLEDErrorThreshold);
+ linehighredLED.SetLineColor(2);
+ linehighredLED.SetLineStyle(3);
+ linehighredLED.SetLineWidth(4);
+ fhLEDSubtrMean->GetListOfFunctions()->Add((TLine*) linelowredLED.Clone());
+ fhLEDSubtrMean->GetListOfFunctions()->Add((TLine*) linehighredLED.Clone());
+
+
+ //Fk Draw QTC-mean for each PMT
+ TH2F* fhQTC = (TH2F*) listrec->UncheckedAt(212);
+ TH1F* fhQTCSubtrMean = (TH1F*) listrec->UncheckedAt(233);
+
+ EraseOldMessages((TH1*) fhQTCSubtrMean);
+ for(int ipmt=0; ipmt<24;ipmt++){
+ TH1F* hProjDummy = (TH1F*) fhQTC->ProjectionY("dummy",ipmt+1,ipmt+1);
+ Float_t mean=0.0, rms=0.0;
+ GetMeanAndRmsAroundMainMaximum(mean, rms, hProjDummy,2);
+ Float_t deviation = mean - fMeanQTCFromGoodRunParam[ipmt];
+
+ fhQTCSubtrMean->SetBinContent(ipmt+1,deviation);
+ fhQTCSubtrMean->SetBinError(ipmt+1,rms);
+
+ delete hProjDummy;
+ }
+ TLine linelowredQTC(0, fQTCErrorThreshold, 24, fQTCErrorThreshold);
+ linelowredQTC.SetLineColor(2);
+ linelowredQTC.SetLineStyle(3);
+ linelowredQTC.SetLineWidth(4);
+ TLine linehighredQTC(0, -fQTCErrorThreshold, 24, -fQTCErrorThreshold);
+ linehighredQTC.SetLineColor(2);
+ linehighredQTC.SetLineStyle(3);
+ linehighredQTC.SetLineWidth(4);
+ fhQTCSubtrMean->GetListOfFunctions()->Add((TLine*) linelowredQTC.Clone());
+ fhQTCSubtrMean->GetListOfFunctions()->Add((TLine*) linehighredQTC.Clone());
+
+ //CFD and LED efficiency in range ~2000- ~3000
+ TH1F* hCFDeffSubRange = (TH1F*) listrec->UncheckedAt(237);
+ TH1F* hEffLEDSubRange = (TH1F*) listrec->UncheckedAt(238);
+ // ratio CDF eff /LEF eff in subragne
+ TH1F* hRatioCFDLEDeff = (TH1F*) listrec->UncheckedAt(239);//FK
+ EraseOldMessages((TH1*) hRatioCFDLEDeff);
+ int npmt = hRatioCFDLEDeff->GetNbinsX();
+ for(int ipmt=1;ipmt<=npmt;ipmt++){
+ Float_t c0 = hCFDeffSubRange->GetBinContent(ipmt);
+ Float_t c1 = hEffLEDSubRange->GetBinContent(ipmt);
+ if(c1){
+ hRatioCFDLEDeff->SetBinContent(ipmt,c0/c1);
+ }else{
+ hRatioCFDLEDeff->SetBinContent(ipmt,0);
+ }
+ }
+
+ TLine linelowredRatioCFDLEDeff(0, 1+fRatioCFDEffLEDEffErrorThreshold, 24, 1+fRatioCFDEffLEDEffErrorThreshold);
+ linelowredRatioCFDLEDeff.SetLineColor(2);
+ linelowredRatioCFDLEDeff.SetLineStyle(3);
+ linelowredRatioCFDLEDeff.SetLineWidth(4);
+ TLine linehighredRatioCFDLEDeff(0, 1-fRatioCFDEffLEDEffErrorThreshold, 24, 1-fRatioCFDEffLEDEffErrorThreshold);
+ linehighredRatioCFDLEDeff.SetLineColor(2);
+ linehighredRatioCFDLEDeff.SetLineStyle(3);
+ linehighredRatioCFDLEDeff.SetLineWidth(4);
+ hRatioCFDLEDeff->GetListOfFunctions()->Add((TLine*) linelowredRatioCFDLEDeff.Clone());
+ hRatioCFDLEDeff->GetListOfFunctions()->Add((TLine*) linehighredRatioCFDLEDeff.Clone());
+
+ // PERFROM CHECKS on HISTOGRAMS
+
+ //-------- triggers -----------
+ Int_t qualityFlagTrigger = kT0Info; //init quality flag for a given histogram;
+
+ TH1F *hTrigger = (TH1F*) listrec->UncheckedAt(169);//hRawTrigger
+
+ // clean objects added at previous checks
+ EraseOldMessages((TH1*) hTrigger);
+
+ if(hTrigger->Integral()>0){
+ //trigger plot does have some counts in it
+ //are Mean, ORA and ORC not empty?
+ if( hTrigger->GetBinContent(1)<0.001 || hTrigger->GetBinContent(3)<0.001 || hTrigger->GetBinContent(4)<0.001){
+ qualityFlagTrigger = kT0Error; //no entries on diagonal
+ AliDebug(AliQAv1::GetQADebugLevel(), Form("T0: too little ORA and ORC in %s", hTrigger->GetName() ));
+
+ TPaveText text(0.20,0.50,0.99,0.99,"NDC");
+ text.AddText(Form("Check ORA and ORC"));
+ text.AddText(Form("Report problem to the T0 on-call expert"));
+ text.SetBorderSize(0);
+ text.SetFillStyle(0);
+ hTrigger->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ }
+
+ }else{ //Trigger histo empty
+
+ qualityFlagTrigger = kT0Error;
+ AliDebug(AliQAv1::GetQADebugLevel(), Form("T0 histogram %s has NO entries", hTrigger->GetName() ));
+
+ TPaveText text(0.20,0.50,0.99,0.99,"NDC");
+ text.AddText(Form("NO ENTRIES!!!"));
+ text.AddText(Form("If T0 is READY report"));
+ text.AddText(Form("readout problem to the T0 on-call expert"));
+ text.SetBorderSize(0);
+ text.SetFillStyle(0);
+ hTrigger->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+
+ }
+ //---------- CFD eff/LED eff within subrange -----------
+ Int_t qualityFlagRatioCFDeffLEDeff = kT0Info; //init quality flag for a given histogram;
+ int nPMTs = hRatioCFDLEDeff->GetNbinsX();
+
+ for(int ipmt=1; ipmt<=nPMTs; ipmt++){
+ if(TMath::Abs( hRatioCFDLEDeff->GetBinContent(ipmt) -1) > fRatioCFDEffLEDEffErrorThreshold){ //mean is expected to be around 1
+ qualityFlagRatioCFDeffLEDeff = kT0Error;
+ }
+ }
+ if(qualityFlagRatioCFDeffLEDeff == kT0Error){
+ TPaveText text(0.20,0.50,0.99,0.99,"NDC");
+ text.AddText(Form("Problem with efficiency ratio CFD/LED !!!"));
+ text.AddText(Form("If T0 is READY and beam is on report"));
+ text.AddText(Form("the problem to the T0 on-call expert"));
+ text.SetBorderSize(0);
+ text.SetFillStyle(0);
+ hRatioCFDLEDeff->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ }