}
}
+namespace {
+ void FindMinMax(TH1* h, Double_t& min, Double_t& max)
+ {
+ Double_t tmin = 1e9;
+ Double_t tmax = 0;
+ for (Int_t i = 1; i <= h->GetNbinsX(); i++) {
+ Double_t c = h->GetBinContent(i);
+ if (c < 1e-8) continue;
+ tmin = TMath::Min(tmin, c);
+ tmax = TMath::Max(tmax, c);
+ }
+ min = tmin;
+ max = tmax;
+ }
+}
//____________________________________________________________________________
void
AliFMDQAChecker::MakeImage(TObjArray** list,
nImages++;
TString name(hist->GetName());
if (name.Contains("readouterrors", TString::kIgnoreCase)) continue;
- Double_t hMax = hist->GetMaximum();
+
+ // Double_t hMax = hist->GetMaximum();
// hist->GetBinContent(hist->GetMaximumBin());
- Double_t hMin = hist->GetMinimum();
+ // Double_t hMin = hist->GetMinimum();
// hist->GetBinContent(hist->GetMinimumBin());
+ Double_t hMax, hMin;
+ FindMinMax(hist, hMin, hMax);
max = TMath::Max(max, hMax);
min = TMath::Min(min, hMin);
+ AliInfoF("Min/max of %40s: %f/%f, global -> %f/%f",
+ hist->GetName(), hMin, hMax, min, max);
}
}
break ;
}
- min = TMath::Max(0.1, min);
- max = TMath::Max(1.0, max);
+ AliInfoF("Global min/max=%f/%f", min, max);
+ min = TMath::Max(1e-1, min);
+ max = TMath::Max(1e5, max);
// IF no images, go on.
if (nImages == 0) {
if(!list[specie] || list[specie]->GetEntries() <= 0 ||
nImages <= 0) continue;
- // Form the title
+ // Form the title
const Char_t * title = Form("QA_%s_%s_%s", GetName(),
AliQAv1::GetTaskName(task).Data(),
AliRecoParam::GetEventSpecieName(specie));
// Divide canvas
Int_t nx = int(nImages + .5) / 2;
Int_t ny = 2;
+ // if (fDoScale)
fImage[specie]->Divide(nx, ny, 0, 0);
+ // else fImage[specie]->Divide(nx, ny);
// Loop over histograms
// Go to sub-pad
TVirtualPad* pad = fImage[specie]->cd(++j);
pad->SetRightMargin(0.01);
+ if (!fDoScale) {
+ pad->SetLeftMargin(0.10);
+ pad->SetBottomMargin(0.10);
+ }
// Check for log scale
Int_t logOpts = 0;
if (name.Contains("readouterrors", TString::kIgnoreCase)) {
pad->SetRightMargin(0.15);
pad->SetBottomMargin(0.10);
- pad->SetTopMargin(0.02);
+ // pad->SetTopMargin(0.02);
opt="COLZ";
}
else {
pad->SetGridx();
pad->SetGridy();
- hist->SetMinimum(min);
- hist->SetMaximum(max);
-
+ if (fDoScale) {
+ hist->SetMinimum(min);
+ hist->SetMaximum(max);
+ }
+ else {
+ hist->SetMinimum();
+ hist->SetMaximum();
+ }
}
// Draw (As a copy)
hist->DrawCopy(opt);
Double_t m = proj->GetMean();
TLatex* l = new TLatex(kk, 30, Form("Mean: %f", m));
l->SetTextAngle(90);
- l->SetTextColor(m > 10 ? kRed+1 : m > 1 ? kOrange+2 :kGreen+2);
+ l->SetTextColor(m > 10 ? kRed+1 : m > .7 ? kOrange+2 :kGreen+2);
l->Draw();
}
}
if (logOpts & 0x1) insert->SetLogx();
if (logOpts & 0x2) insert->SetLogy();
if (logOpts & 0x4) insert->SetLogz();
- hist->GetXaxis()->SetRangeUser(hist->GetXaxis()->GetXmin(),
- hist->GetXaxis()->GetXmax()/8);
- hist->DrawCopy(opt);
+ hist->GetXaxis()->SetRange(1, hist->GetNbinsX()/8);
+ TH1* copy = hist->DrawCopy(opt);
+ copy->GetXaxis()->SetNdivisions(408, false);
// Restore full range
- hist->GetXaxis()->SetRangeUser(hist->GetXaxis()->GetXmin(),
- hist->GetXaxis()->GetXmax());
+ hist->GetXaxis()->SetRange(0, 0);
gStyle->SetOptTitle(1);
}
pad->cd();
RestoreLog(hist->GetYaxis(), logOpts & 0x2);
RestoreLog(hist->GetZaxis(), logOpts & 0x4);
}
- // Print to a post-script file
+ // Print to a post-script file
fImage[specie]->Print(outName, "ps");
}
}