#include "AliLog.h"
//#include "AliQAv1.h"
//#include "AliQAChecker.h"
-
+#include "AliTOFQADataMakerRec.h"
#include "AliTOFQAChecker.h"
+#include <TPaveText.h>
ClassImp(AliTOFQAChecker)
while ( (hdata = static_cast<TH1 *>(next())) ) {
if (hdata && hdata->InheritsFrom("TH1")) {
Double_t rv = 0.;
- if(hdata->GetEntries()>0)rv=1;
+
+ switch ( CheckRaws(hdata,specie) )
+ {
+ case AliQAv1::kINFO:
+ rv = 1.0;
+ break;
+ case AliQAv1::kWARNING:
+ rv = 0.75;
+ break;
+ case AliQAv1::kERROR:
+ rv = 0.25;
+ break;
+ case AliQAv1::kFATAL:
+ rv = -1.0;
+ break;
+ default:
+ //AliError("Invalid ecc value. FIXME !");
+ rv = AliQAv1::kNULLBit;
+ break;
+ }
+
AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
count[specie]++ ;
test[specie] += rv ;
test[specie] = 0.5; //upper limit value to set kWARNING flag for a task
}
else {
- test[specie] /= count[specie] ;
+ test[specie] /= count[specie] ;
}
AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test[specie])) ;
}
return *this;
}
+
+//____________________________________________________________________________
+Int_t AliTOFQAChecker::CheckRaws(TH1* histo, Int_t specie)
+{
+ /*
+ checker for RAWS
+ */
+ Int_t flag = AliQAv1::kNULLBit;
+
+ if(histo->GetEntries()>0) flag = AliQAv1::kINFO;
+
+ Double_t binWidthTOFrawTime = 2.44;
+ Float_t minTOFrawTime, maxTOFrawTime;
+ if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic){
+ minTOFrawTime=200.;//ns
+ maxTOFrawTime=300.;//ns
+ } else {
+ minTOFrawTime=200.;//ns
+ maxTOFrawTime=275.;//ns
+ }
+ Float_t minTOFrawTot = 10.;
+ Double_t maxTOFrawTot = 15.;
+ // Double_t minTOFrawTot = 200;
+ // Double_t maxTOFrawTot = 250;
+
+ TString histname = histo->GetName();
+ TPaveText text(0.65,0.5,0.9,0.75,"NDC");
+
+ if (histname.EndsWith("TOFRaws")) {
+ if (histo->GetEntries()==0) {
+ text.Clear();
+ text.AddText("No entries. IF TOF IN RUN");
+ text.AddText("Check the TOF TWiki");
+ text.SetFillColor(kYellow);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kWARNING;
+ } else {
+ Float_t multiMean = histo->GetMean();
+ Float_t lowMIntegral = histo->Integral(1,20);
+ Float_t totIntegral = histo->Integral(2, histo->GetNbinsX());
+
+ if (totIntegral==0){ //if only "0 hits per event" bin is filled -> error
+ if (histo->GetBinContent(1)>0) {
+ text.Clear();
+ text.AddText("No TOF hits for all events.");
+ text.AddText("Call TOF on-call.");
+ text.SetFillColor(kRed);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kERROR;
+ }
+ } else {
+ if (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCosmic) {
+ if (multiMean<10.){
+ text.Clear();
+ text.AddText(Form("Multiplicity within limits"));
+ text.AddText("for COSMICS: OK!!!");
+ text.SetFillColor(kGreen);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kINFO;
+ } else {
+ text.Clear();
+ text.AddText(Form("Multiplicity too high"));
+ text.AddText("for COSMICS: email TOF on-call");
+ text.SetFillColor(kYellow);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kWARNING;
+ }
+ } else {
+ if ( (AliRecoParam::ConvertIndex(specie) == AliRecoParam::kLowMult)
+ &&((lowMIntegral>0.9*totIntegral) || (multiMean>100))){
+ text.Clear();
+ text.AddText(Form("Unexpected mean value = %5.2f",multiMean));
+ text.AddText("OK for COSMICS and technical.");
+ text.AddText("Check TOF TWiki for pp.");
+ text.SetFillColor(kYellow);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kWARNING;
+ } else {
+ text.Clear();
+ text.AddText(Form("Multiplicity within limits"));
+ text.AddText(" OK!!! ");
+ text.SetFillColor(kGreen);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kINFO;
+ }
+ }
+ }
+ }
+ }
+ if (histname.EndsWith("RawsTime")) {
+ if (histo->GetEntries()==0) {
+ //AliWarning("Raw time histogram is empty");
+ text.Clear();
+ text.AddText("No entries. If TOF in the run");
+ text.AddText("check TOF TWiki");
+ text.SetFillColor(kYellow);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kWARNING;
+ } else {
+ Float_t timeMean = histo->GetMean();
+ Int_t lowBinId = TMath::Nint(200./binWidthTOFrawTime);
+ Int_t highBinId = TMath::Nint(250./binWidthTOFrawTime);
+ Float_t peakIntegral = histo->Integral(lowBinId,highBinId);
+ Float_t totIntegral = histo->Integral(1, histo->GetNbinsX());
+ if ( (timeMean > minTOFrawTime) && (timeMean < maxTOFrawTime) ) {
+ flag = AliQAv1::kINFO;
+ text.Clear();
+ text.AddText("Mean inside limits: OK!!!");
+ text.SetFillColor(kGreen);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ } else {
+ if ( (peakIntegral/totIntegral > 0.1) && (peakIntegral/totIntegral < 0.75)) {
+ AliWarning(Form("Raw time: peak/total integral = %5.2f, mean = %5.2f ns -> Check filling scheme...",peakIntegral/totIntegral,timeMean));
+ text.Clear();
+ text.AddText("If multiple peaks,");
+ text.AddText("check filling scheme.");
+ text.AddText("See TOF TWiki.");
+ text.SetFillColor(kYellow);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kWARNING;
+ } else {
+ AliWarning(Form("Raw time: peak/total integral = %5.2f, mean = %5.2f ns", peakIntegral/totIntegral,timeMean));
+ text.Clear();
+ text.AddText("Mean outside limits.");
+ text.AddText("Call TOF on-call.");
+ text.SetFillColor(kRed);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kERROR;
+ }
+ }
+ }
+ }
+
+ if (histname.EndsWith("RawsToT")) {
+ if (histo->GetEntries()==0) {
+ text.Clear();
+ text.AddText("No entries. Check TOF TWiki");
+ text.SetFillColor(kYellow);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ flag = AliQAv1::kWARNING;
+ } else {
+ Float_t timeMean = histo->GetMean();
+ if ( (timeMean > minTOFrawTot) && (timeMean < maxTOFrawTot) ) {
+ flag = AliQAv1::kINFO;
+ text.Clear();
+ text.AddText("Mean inside limits: OK!!!");
+ text.SetFillColor(kGreen);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ } else {
+ flag = AliQAv1::kERROR;
+ AliWarning(Form("ToT mean = %5.2f ns", timeMean));
+ text.Clear();
+ text.AddText("Mean outside limits.");
+ text.AddText("If NOT a technical run,");
+ text.AddText("call TOF on-call.");
+ text.SetFillColor(kRed);
+ histo->GetListOfFunctions()->Add((TPaveText*)text.Clone());
+ }
+ }
+ }
+ return flag;
+}
///////////////////////////////////////////////////////////////////////
/*
+Modified by fbellini on 01/11/2011
+- removed TLines as functions
+- changed shifters plots for 2012 DQM
+
Modified by fbellini on 01/11/2011
- added histograms for LTM monitoring
- fix for coverity
const Float_t AliTOFQADataMakerRec::fgkNbinsWidthTime=2.44;//width of bins in time plot
Float_t AliTOFQADataMakerRec::fgRangeMinTime=0.0;//range min in time plot
Float_t AliTOFQADataMakerRec::fgRangeMaxTime=620.0; //range max in time plot
-Int_t AliTOFQADataMakerRec::fgCutNmaxFiredMacropad=5;//cut on number of max fired macropad
+Int_t AliTOFQADataMakerRec::fgCutNmaxFiredMacropad=50;//cut on number of max fired macropad
const Int_t AliTOFQADataMakerRec::fgkFiredMacropadLimit=50;//cut on number of max fired macropad
// fLineExpTimeMax = new TLine(250., 0., 250., 0.);
// fLineExpTotMin = new TLine(5., 0., 5., 0.);
// fLineExpTotMax = new TLine(20., 0., 20., 0.);
- for (Int_t sm=0;sm<17;sm++){
+ /*
+ for (Int_t sm=0;sm<17;sm++){
fLineSMid[sm] = new TLine( sm+1, 0., sm+1, 91.);
}
for (Int_t sm=0;sm<22;sm++){
fLineLTMbitId[sm] = new TLine( 0., sm+1, 72. ,sm+1);
}
-
+ */
}
//____________________________________________________________________________
//
SetName((const char*)qadm.GetName()) ;
SetTitle((const char*)qadm.GetTitle());
-
+ /*
for (Int_t sm=0;sm<17;sm++){
fLineSMid[sm]=qadm.fLineSMid[sm];
}
for (Int_t sm=0;sm<22;sm++){
fLineLTMbitId[sm] = qadm.fLineLTMbitId[sm];
}
+ */
}
//__________________________________________________________________
delete fLineExpTotMin;
if (fLineExpTotMax)
delete fLineExpTotMax;
- for (Int_t sm=0;sm<17;sm++){
+ /*
+ for (Int_t sm=0;sm<17;sm++){
if (fLineSMid[sm])
delete fLineSMid[sm];
}
if (fLineLTMbitId[sm])
delete fLineLTMbitId[sm];
}
+ */
}
//----------------------------------------------------------------------------
AliTOFChannelOnlineStatusArray* AliTOFQADataMakerRec::GetCalibData()
//add lines for DQM shifter
fLineExpTimeMin = new TLine(200., 0., 200., 0.);
- fLineExpTimeMax = new TLine(250., 0., 250., 0.);
- fLineExpTotMin = new TLine(5., 0., 5., 0.);
- fLineExpTotMax = new TLine(20., 0., 20., 0.);
+ fLineExpTimeMax = new TLine(300., 0., 300., 0.);
+ fLineExpTotMin = new TLine(10., 0., 10., 0.);
+ fLineExpTotMax = new TLine(15., 0., 15., 0.);
fLineExpTimeMin->SetLineColor(kGreen);
fLineExpTimeMin->SetLineWidth(2);
fLineExpTotMax->SetLineColor(kGreen);
fLineExpTotMax->SetLineWidth(2);
- for (Int_t sm=0;sm<17;sm++){
+ /*
+ for (Int_t sm=0;sm<17;sm++){
fLineSMid[sm]->SetLineColor(kMagenta);
fLineSMid[sm]->SetLineWidth(2);
}
-
+ */
h5->GetListOfFunctions()->Add(fLineExpTimeMin);
h5->GetListOfFunctions()->Add(fLineExpTimeMax);
h10->GetListOfFunctions()->Add(fLineExpTotMin);
h10->GetListOfFunctions()->Add(fLineExpTotMax);
-
+ /*
for (Int_t sm=0;sm<17;sm++){
h16->GetListOfFunctions()->Add(fLineSMid[sm]);
h17->GetListOfFunctions()->Add(fLineSMid[sm]);
}
-
for (Int_t sm=0;sm<71;sm++){
fLineLTMid[sm]->SetLineColor(kBlack);
fLineLTMid[sm]->SetLineWidth(1);
h26->GetListOfFunctions()->Add(fLineLTMbitId[sm]);
h25->GetListOfFunctions()->Add(fLineLTMbitId[sm]);
}
-
+ */
TPaveText *phosHoleBox=new TPaveText(13,38,16,53,"b");
phosHoleBox->SetFillStyle(0);
phosHoleBox->SetFillColor(kWhite);
// h10->SetDrawOption("logy");
Add2RawsList(h0, 0, !expert, image, !saveCorr) ;
- Add2RawsList(h1, 1, expert, !image, !saveCorr) ;
- Add2RawsList(h2, 2, expert, !image, !saveCorr) ;
- Add2RawsList(h3, 3, expert, !image, !saveCorr) ;
- Add2RawsList(h4, 4, expert, !image, !saveCorr) ;
+ Add2RawsList(h1, 1, expert, !image, !saveCorr) ;
+ Add2RawsList(h2, 2, expert, !image, !saveCorr) ;
+ Add2RawsList(h3, 3, expert, !image, !saveCorr) ;
+ Add2RawsList(h4, 4, expert, !image, !saveCorr) ;
Add2RawsList(h5, 5, !expert, image, !saveCorr) ;
- Add2RawsList(h6, 6, expert, !image, !saveCorr) ;
- Add2RawsList(h7, 7, expert, !image, !saveCorr) ;
- Add2RawsList(h8, 8, expert, !image, !saveCorr) ;
- Add2RawsList(h9, 9, expert, !image, !saveCorr) ;
+ Add2RawsList(h6, 6, expert, !image, !saveCorr) ;
+ Add2RawsList(h7, 7, expert, !image, !saveCorr) ;
+ Add2RawsList(h8, 8, expert, !image, !saveCorr) ;
+ Add2RawsList(h9, 9, expert, !image, !saveCorr) ;
Add2RawsList(h10, 10, !expert, image, !saveCorr) ;
Add2RawsList(h11, 11, expert, !image, !saveCorr) ;
Add2RawsList(h12, 12, expert, !image, !saveCorr) ;
Add2RawsList(h13, 13, expert, !image, !saveCorr) ;
Add2RawsList(h14, 14, expert, !image, !saveCorr) ;
Add2RawsList(h15, 15, expert, !image, !saveCorr) ;
- Add2RawsList(h16, 16, !expert, image, !saveCorr) ;
- Add2RawsList(h17, 17, !expert, image, !saveCorr) ;
- Add2RawsList(h18, 18, expert, !image, !saveCorr) ;
- Add2RawsList(h19, 19, expert, !image, !saveCorr) ;
- Add2RawsList(h20, 20, expert, !image, !saveCorr) ;
- Add2RawsList(h21, 21, expert, !image, !saveCorr) ;
- Add2RawsList(h22, 22, !expert, image, !saveCorr) ;
- Add2RawsList(h23, 23, !expert, !image, !saveCorr) ;
- Add2RawsList(h24, 24, !expert, !image, !saveCorr) ;
- Add2RawsList(h25, 25, !expert, !image, !saveCorr) ;
- Add2RawsList(h26, 26, !expert, image, !saveCorr) ;
- Add2RawsList(h27, 27, !expert, image, !saveCorr) ;
- Add2RawsList(h28, 28, !expert, !image, !saveCorr) ;
- Add2RawsList(h29, 29, !expert, !image, !saveCorr) ;
+ Add2RawsList(h16, 16, !expert, image, !saveCorr) ;
+ Add2RawsList(h17, 17, !expert, image, !saveCorr) ;
+ Add2RawsList(h18, 18, expert, !image, !saveCorr) ;
+ Add2RawsList(h19, 19, expert, !image, !saveCorr) ;
+ Add2RawsList(h20, 20, expert, !image, !saveCorr) ;
+ Add2RawsList(h21, 21, expert, !image, !saveCorr) ;
+ Add2RawsList(h22, 22, expert, !image, !saveCorr) ;
+ Add2RawsList(h23, 23, expert, !image, !saveCorr) ;
+ Add2RawsList(h24, 24, expert, !image, !saveCorr) ;
+ Add2RawsList(h25, 25, expert, !image, !saveCorr) ;
+ Add2RawsList(h26, 26, expert, image, !saveCorr) ;
+ Add2RawsList(h27, 27, expert, !image, !saveCorr) ;
+ Add2RawsList(h28, 28, expert, !image, !saveCorr) ;
+ Add2RawsList(h29, 29, expert, !image, !saveCorr) ;
//
ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
//
// set default cut on fired macropad
//
- SetCutNmaxFiredMacropad(5);
+ SetCutNmaxFiredMacropad(50);
AliInfo(Form("Setting cut on fired macropad to default values: NfiredMacropad = %i", fgCutNmaxFiredMacropad));
return;
}