7#ifndef GlauberFitterHelper_H
8#define GlauberFitterHelper_H 1
19inline void DrawHistos(
const Fitter& fit, Bool_t isSim, Bool_t isData, Bool_t isGlauber, Bool_t isNBD) {
20 std::unique_ptr<TCanvas> c1{
new TCanvas(
"c1",
"canvas", 1500, 900)};
24 std::unique_ptr<TPad> c1_1{(TPad*) c1->GetListOfPrimitives()->FindObject(
"c1_1")};
25 std::unique_ptr<TPad> c1_2{(TPad*) c1->GetListOfPrimitives()->FindObject(
"c1_2")};
26 std::unique_ptr<TPad> c1_4{(TPad*) c1->GetListOfPrimitives()->FindObject(
"c1_4")};
32 TH1F hGlaub = fit.GetGlauberFitHisto();
33 TH1F hData = fit.GetDataHisto();
34 TH1F hNBD = fit.GetNBDHisto();
35 TH1F hNcoll = fit.GetNcollHisto();
36 TH1F hNpart = fit.GetNpartHisto();
37 TH1F hBestFit = fit.GetBestFiHisto();
39 std::unique_ptr<TFile> fOut{TFile::Open(
"glauber_qa.root",
"recreate")};
43 hNcoll.SetLineColor(2);
48 std::unique_ptr<TLegend> legSim{
new TLegend(0.6, 0.75, 0.75, 0.83)};
49 legSim->AddEntry(&hNpart,
"Npart",
"l");
50 legSim->AddEntry(&hNcoll,
"hNcoll",
"l");
62 hBestFit.SetLineColor(kRed);
63 hBestFit.Draw(
"same");
65 std::unique_ptr<TLegend> legData{
new TLegend(0.6, 0.75, 0.75, 0.83)};
66 legData->AddEntry(&hBestFit,
"Fit",
"l");
67 legData->AddEntry(&hData,
"Data",
"l");
68 legData->Draw(
"same");
85 c1->SaveAs(
"glauber.pdf");