Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
+ Int_t nentries = -99;
while((hdata = dynamic_cast<TH1 *>(next()))){
if(hdata){
Bool_t iDetPM = kTRUE;
// --- Checks
- if(irawHisto==22){
+ if(irawHisto==16) nentries = Int_t (hdata->GetEntries());
+ if(irawHisto==18){
Float_t resADC=0.;
for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
if((hdata->GetBinContent(ibin))>10.){
res=1.;
}
- else if((hdata->GetBinContent(ibin))<10. &&
- (ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18)){
+ else if((hdata->GetBinContent(ibin))<10.){
res=0.5;
- iDetPM = kFALSE;
+ if(ibin==1 || ibin==6 || ibin==11 || ibin==12 || ibin==13 || ibin==18){
+ iDetPM = kFALSE;
+ }
}
//
resADC += res;
test[specie] += res;
count++;
}
+ if(nentries != -99) messages.Add(new TObjString(Form("#entries %d",nentries)));
+ else messages.Add(new TObjString("#entries not known"));
+ //
Float_t rv=1.;
if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
else if(iDetPM==kFALSE){
- messages.Add(new TObjString("Problem with ADCs!"));
- messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
+ messages.Add(new TObjString("Problem with some ADC!"));
+ messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
}
else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
SetupHisto(messages, *hdata, rv);
}
- else if(irawHisto==23){
- Double_t refTDCs[6] = {-83.0,-78.1,-80.2,-79.3,-81.0,-80.9};
+ else if(irawHisto==19){
+ // Reference values from RUN 145456
+ Double_t refTDCs[6] = {-322.5,-319.1,-320.9,-319.2,-319.7,-319.2};
Float_t resTDC=0.;
for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
- if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
+ if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<3.){
res=1.;
}
- else{
- res=0.5;
+ else if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<5.){
+ res=0.8;
}
+ else res=0.5;
//
resTDC += res;
test[specie] += res;
Float_t rv=1.;
if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
- else if(rv<1 && rv>0.9) messages.Add(new TObjString("Minor problem with TDCs"));
+ else if(rv<1. && rv>0.75) messages.Add(new TObjString("Minor problem with TDCs"));
else{
messages.Add(new TObjString("Serious problem in ZDC timing"));
- messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
+ messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
}
SetupHisto(messages, *hdata, rv);
}
- else if(irawHisto==26){
- Double_t yZNC=hdata->GetBinContent(2);
- Double_t yZNA=hdata->GetBinContent(4);
- if(TMath::Abs(yZNC)<0.4 && TMath::Abs(yZNA)<0.4) res=1.;
- else res=0.7;
- test[specie] += res;
- count++;
- //
- if(res == 1.) messages.Add(new TObjString("ZN positions are OK!"));
- else{
- messages.Add(new TObjString("Problem in ZN positions!"));
- messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
- }
- SetupHisto(messages, *hdata, res);
- }
irawHisto++;
}
//
// 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();
+ if(esdInd==0) sumADCZNC = hdata->GetMean();
+ else if(esdInd==1) sumADCZNA = hdata->GetMean();
+ else if(esdInd==2) sumADCZPC = hdata->GetMean();
+ else if(esdInd==3) sumADCZPA = hdata->GetMean();
+ else if(esdInd==6) pmQZNC = hdata->GetMean();
+ else if(esdInd==7) pmQZNA = hdata->GetMean();
+ else if(esdInd==8) pmQZPC = hdata->GetMean();
+ else if(esdInd==9) pmQZPA = hdata->GetMean();
+ else if(esdInd==10) pmCZNC = hdata->GetMean();
+ else if(esdInd==11) pmCZNA = hdata->GetMean();
+ else if(esdInd==12) pmCZPC = hdata->GetMean();
+ else if(esdInd==13) pmCZPA = hdata->GetMean();
}
//
// --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
// ====================================================================
// Checks for A-A events
// ====================================================================
- else if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult) {
+ if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kHighMult) {
if(list[specie]->GetEntries()==0){
AliWarning("\t The list to be checked is empty!");
return ;
Float_t sumADCZNA=0., sumADCZNC=0., sumADCZPA=0., sumADCZPC=0.;
Float_t adcCZNA=0., adcCZNC=0., adcCZPA=0., adcCZPC=0.;
Float_t adcQZNA=0., adcQZNC=0., adcQZPA=0., adcQZPC=0.;
+ Int_t nentries=-99;
while((hdata = dynamic_cast<TH1 *>(next()))){
if(hdata){
Bool_t iDetPM = kTRUE;
// --- Checks
- if(irawHisto==22){
+ if(irawHisto==16) nentries = Int_t (hdata->GetEntries());
+ if(irawHisto==18){
Float_t resADC=0.;
for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
if((hdata->GetBinContent(ibin))>10.){
test[specie] += res;
count++;
}
+ if(nentries != -99) messages.Add(new TObjString(Form("#entries %d",nentries)));
+ else messages.Add(new TObjString("#entries not known"));
+ //
Float_t rv=1.;
if(hdata->GetNbinsX() != 0) rv = resADC/hdata->GetNbinsX();
- if(rv == 1.) messages.Add(new TObjString("ADCs are OK!"));
+ if(rv > 0.98) messages.Add(new TObjString("ADCs are OK!"));
else if(iDetPM==kFALSE){
messages.Add(new TObjString("Problem with ADCs!"));
- messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
+ messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
}
else if(iDetPM==kTRUE) messages.Add(new TObjString("Minor problem with ADCs"));
SetupHisto(messages, *hdata, rv);
}
- else if(irawHisto==23){
- Double_t refTDCs[6] = {-83.0,-78.1,-80.2,-79.3,-81.0,-80.9};
+ else if(irawHisto==19){
+ // Reference values from RUN 137161
+ Double_t refTDCs[6] = {-320.7,-319.0,-318.6,-319.9,-321.3,-320.8};
Float_t resTDC=0.;
for(int ibin=1; ibin<=hdata->GetNbinsX(); ibin++){
- if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
+ if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<3.){
res=1.;
}
- else{
- res=0.5;
+ else if(TMath::Abs((hdata->GetBinContent(ibin))-refTDCs[ibin-1])<4.){
+ res=0.8;
}
+ else res=0.5;
//
resTDC += res;
test[specie] += res;
Float_t rv=1.;
if(hdata->GetNbinsX() != 0) rv = resTDC/hdata->GetNbinsX();
if(rv == 1.) messages.Add(new TObjString("TDCs are OK!"));
- else if(rv<1 && rv>0.9) messages.Add(new TObjString("Minor problem with TDCs"));
+ else if(rv<1 && rv>0.75) messages.Add(new TObjString("Minor problem with TDCs"));
else{
messages.Add(new TObjString("Serious problem in ZDC timing"));
- messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
+ messages.Add(new TObjString("IF THIS IS A PHYSICS RUN"));
}
SetupHisto(messages, *hdata, rv);
}
- else if(irawHisto==26){
- Double_t yZNC=hdata->GetBinContent(2);
- Double_t yZNA=hdata->GetBinContent(4);
- if(TMath::Abs(yZNC)<0.4 && TMath::Abs(yZNA)<0.4) res=1.;
- else res=0.5;
- test[specie] += res;
- count++;
- //
- printf(" yZNC = %1.2f yZNA = %1.2f -> res %1.2f\n",yZNC, yZNA,res);
- if(res == 1.) messages.Add(new TObjString("ZN positions are OK!"));
- else{
- messages.Add(new TObjString("Problem in ZN positions!"));
- messages.Add(new TObjString("IF THIS IS NOT A TECHNICAL RUN"));
- }
- SetupHisto(messages, *hdata, res);
- }
irawHisto++;
}
}
// --- Check whether (sum PMQi - PMC)/PMC < percentageDiff
if(irecHisto==11){
- if(TMath::Abs(meanZNC)>1.e-10){
+ if((TMath::Abs(meanZNC)>1.e-10) && (pmCZNC>1.e-10)){
if((TMath::Abs(pmQZNC-pmCZNC)/pmCZNC)<percentageDiff)
res=1.;
else
test[specie] += res;
count++;
}
- if(TMath::Abs(meanZNA)>1.e-10){
+ if((TMath::Abs(meanZNA)>1.e-10) && (pmCZNA>1.e-10)){
if((TMath::Abs(pmQZNA-pmCZNA)/pmCZNA)<percentageDiff)
res=1.;
else
test[specie] += res;
count++;
}
- if(TMath::Abs(meanZPC)>1.e-10){
+ if((TMath::Abs(meanZPC)>1.e-10) && (pmCZPC>1.e-10)){
if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
res=1.;
else
test[specie] += res;
count++;
}
- if(TMath::Abs(meanZPA)>1.e-10){
+ if((TMath::Abs(meanZPA)>1.e-10) && (pmCZPA>1.e-10)){
if((TMath::Abs(pmQZPA-pmCZPA)/pmCZPA)<percentageDiff)
res=1.;
else
//
// 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();
+ if(esdInd==0) sumADCZNC = hdata->GetMean();
+ else if(esdInd==1) sumADCZNA = hdata->GetMean();
+ else if(esdInd==2) sumADCZPC = hdata->GetMean();
+ else if(esdInd==3) sumADCZPA = hdata->GetMean();
+ else if(esdInd==6) pmQZNC = hdata->GetMean();
+ else if(esdInd==7) pmQZNA = hdata->GetMean();
+ else if(esdInd==8) pmQZPC = hdata->GetMean();
+ else if(esdInd==9) pmQZPA = hdata->GetMean();
+ else if(esdInd==10) pmCZNC = hdata->GetMean();
+ else if(esdInd==11) pmCZNA = hdata->GetMean();
+ else if(esdInd==12) pmCZPC = hdata->GetMean();
+ else if(esdInd==13) pmCZPA = hdata->GetMean();
}
//
// --- Check whether 2*|Mean ZNA - Mean ZNC|/(Mean ZNA + Mean ZNC) < percentageDiff
test[specie] += res;
count++;
}
- if(TMath::Abs(sumADCZPC)>1.e-10){
+/* if(TMath::Abs(sumADCZPC)>1.e-10){
if((TMath::Abs(pmQZPC-pmCZPC)/pmCZPC)<percentageDiff)
res=1.;
else
test[specie] += res;
count++;
}
+*/
}
esdInd++;
}
// ====================================================================
// 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));
+ if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib) {
+ AliWarning(Form("\n\t No check implemented in ZDC QA for %s task in CALIBRATION events\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));
+ AliWarning(Form("\n\t No check needed in ZDC QA for %s task in COSMIC events\n",taskName));
return ;
} // Cosmic
if(TMath::Abs(count)>1.e-10) test[specie] = test[specie]/count;
/// Add text to histos
//
- Double_t y1 = 0.97 - (messages.GetLast()+2)*0.075;
- TPaveText* text = new TPaveText(0.6,y1,0.99,0.99,"NDC");
+ TPaveText* text = new TPaveText(0.70,0.70,0.99,0.99,"NDC");
TIter next(&messages);
TObjString* str;
color = kGreen;
defaultText = "Everything is fine!";
}
- else if(code<1. && code>=0.9){
+ else if(code<1. && code>=0.85){
color = kYellow;
defaultText = "To be monitored in next runs";
}
- else if(code<0.9 && code>=0.6){
+ else if(code<0.85 && code>=0.6){
color = kOrange;
defaultText = "notify the expert DURING THE DAY!";
}
- else{
+ else if(code<0.6){
color = kRed;
- defaultText = "CALL THE EXPERT!!!!";
+ defaultText = "PLEASE CALL THE EXPERT!!!!";
}
//histo.SetFillColor(color);
histo.SetStats(kFALSE);
-
- histo.GetListOfFunctions()->Add(text);
+
+ TList* lst = histo.GetListOfFunctions();
+ if(lst){
+ TObject *stats = lst->FindObject("stats");
+ lst->Remove(stats);
+ TObject *obj;
+ while ((obj = lst->First())) {
+ while(lst->Remove(obj)) { }
+ delete obj;
+ }
+ if(stats) lst->Add(stats);
+ lst->Add(text);
+ }
}