// --- Get top-level collection ----------------------------------
fSums = GetCollection(file, "ForwardSums");
- if (!fSums) return;
+ if (!fSums) {
+ Info("Run", "Trying old name Forward");
+ fSums = GetCollection(file, "Forward");
+ if (!fSums) return;
+ }
// --- Do the results ----------------------------------------------
fResults = GetCollection(file, "ForwardResults");
DrawTitlePage(file);
// --- Possibly make a chapter here ------------------------------
- if (what & kCentral && GetCollection(file, "CentralSums"))
+ TCollection* centralSums = GetCollection(file, "CentralSums", false);
+ if (!centralSums)
+ centralSums = GetCollection(file, "Central", false);
+ if (what & kCentral && centralSums)
MakeChapter("Forward");
// --- Set pause flag --------------------------------------------
ltx->SetTextAlign(22);
ltx->Draw();
- TCollection* fwd = GetCollection(f, "ForwardSums");
+ TCollection* fwd = fSums; // GetCollection(f, "ForwardSums");
TCollection* cen = GetCollection(f, "CentralSums");
Double_t y = .6;
kLegend = 0x10,
kGridx = 0x100,
kGridy = 0x200,
- kGridz = 0x400
+ kGridz = 0x400,
+ kSilent = 0x800
};
enum {
kLandscape = 0x100,
// THStack* tmp = static_cast<THStack*>(o->Clone());
o->Draw(options);
if (title && title[0] != '\0') o->GetHistogram()->SetTitle(title);
+ TAxis* xAxis = o->GetXaxis();
+ TH1* h = 0;
+ Int_t nBins = xAxis->GetNbins();
+ Double_t xMin = xAxis->GetXmin();
+ Double_t xMax = xAxis->GetXmax();
+ TIter next(o->GetHists());
+ while ((h = static_cast<TH1*>(next()))) {
+ TAxis* a = h->GetXaxis();
+ nBins = TMath::Max(nBins, a->GetNbins());
+ xMin = TMath::Min(xMin, a->GetXmin());
+ xMax = TMath::Max(xMax, a->GetXmax());
+ }
+ if (nBins != xAxis->GetNbins() ||
+ xMin != xAxis->GetXmin() ||
+ xMax != xAxis->GetXmax()) {
+ xAxis->Set(nBins, xMin, xMax);
+ o->GetHistogram()->Rebuild();
+ }
}
/**
* Draw an object clone
if (o.Contains("colz", TString::kIgnoreCase))
p->SetRightMargin(0.15);
if (!h) {
- Warning("DrawInPad", "Nothing to draw in pad # %s", p->GetName());
+ if (!(flags & kSilent))
+ Warning("DrawInPad", "Nothing to draw in pad # %s", p->GetName());
return;
}
if (o.Contains("text", TString::kIgnoreCase)) {
fBody->Divide(2,2);
DrawInPad(fBody, 1, GetH1(bin, "rawDist"), "", kLogy);
- DrawInPad(fBody, 1, GetH1(bin, "truthAccepted",false),"same", kLogy);
- DrawInPad(fBody, 1, GetH1(bin, "truth",false), "same", kLogy|kLegend);
+ DrawInPad(fBody, 1, GetH1(bin, "truthAccepted",false),"same",
+ kLogy|kSilent);
+ DrawInPad(fBody, 1, GetH1(bin, "truth",false), "same",
+ kLogy|kLegend|kSilent);
DrawInPad(fBody, 2, GetH1(bin, "coverage"));
DrawInPad(fBody, 3, GetH2(bin, "corr"), "colz");
- DrawInPad(fBody, 4, GetH2(bin, "response",false), "colz", kLogz);
+ DrawInPad(fBody, 4, GetH2(bin, "response",false), "colz",kLogz|kSilent);
PrintCanvas(Form("%+5.1f < #eta < %+5.1f", etaMin, etaMax));
}
fBody->Divide(2,3);
DrawInPad(fBody, 1, GetH1(bin, "rawDist"), "", kLogy);
- DrawInPad(fBody, 1, GetH1(bin, "truthAccepted", false),"same", kLogy);
- DrawInPad(fBody, 1, GetH1(bin, "truth", false),"same", kLogy|kLegend);
+ DrawInPad(fBody, 1, GetH1(bin, "truthAccepted", false),
+ "same", kSilent);
+ DrawInPad(fBody, 1, GetH1(bin, "truth", false),"same", kSilent|kLegend);
DrawInPad(fBody, 2, GetH1(bin, "coverage"));
DrawInPad(fBody, 3, GetH2(bin, "corr"), "colz");
- DrawInPad(fBody, 4, GetH2(bin, "response", false), "colz", kLogz);
- DrawInPad(fBody, 5, GetH1(bin, "triggerVertex"));
+ DrawInPad(fBody, 4, GetH2(bin, "response", false), "colz", kLogz|kSilent);
+ DrawInPad(fBody, 5, GetH1(bin, "triggerVertex", false), "", kSilent);
PrintCanvas(Form("%+5.1f < #eta < %+5.1f", etaMin, etaMax));
}
void DrawResults(TDirectory* d)
{
THStack* c = GetStack(d, "corrected");
+ if (!c) {
+ Warning("DrawResults", "Stack of corrected results not found!");
+ return;
+ }
DrawInPad(fBody, 0, c, "nostack", kLogy);
c->GetXaxis()->SetTitle("#it{N}_{ch}");
c->GetYaxis()->SetTitle("P(#it{N}_{ch})");
e->SetFillStyle(1001);
}
l->Draw();
+ if (s->GetMinimum() > -1) s->SetMinimum(-1);
PrintCanvas(" Ratios");
}
{
Printf(" Processing %s ...", measured->GetName());
// Try to get the data
- TH1* inRaw = GetH1(measured, "rawDist");
+ TH1* inRaw = GetH1(measured, "rawDist");
TH1* inTruth = GetH1(corrections, "truth");
TH1* inTruthA = GetH1(corrections, "truthAccepted");
TH1* inTrgVtx = GetH1(corrections, "triggerVertex");
Double_t r = regParam;
RooUnfold::Algorithm algo = (RooUnfold::Algorithm)method;
RooUnfold* unfolder = RooUnfold::New(algo, &matrix, inRaw, r);
- unfolder->SetVerbose(1);
+ unfolder->SetVerbose(0);
// Do the unfolding and get the result
TH1* res = unfolder->Hreco();
Double_t eta2 = static_cast<TObjString*>(tokens->At(1))->String().Atof();
tokens->Delete();
- if (TMath::Abs(eta2-eta1) > 1e3)
+ if (TMath::Abs(eta2+eta1) > 1e-3) {
// Not symmetric bin
+ // Info("Other2Stack", "bin [%f,%f] is not symmetric (%f)",
+ // eta1, eta2, TMath::Abs(eta2-eta1));
return;
+ }
Double_t aEta = TMath::Abs(eta1);
Int_t open, closed;