2 * Draw Rubens corrections
7 * @ingroup pwglf_forward_scripts
10 DrawRubensCorr(const char* fname="rubensRatio.root",
11 const char* hname = "dNdEtaCor1D_cls")
13 TFile* f = TFile::Open(fname, "READ");
15 Error("DrawRubensCorr", "%s not found", fname);
18 TH1D* h = static_cast<TH1D*>(f->Get(hname));
20 Error("DrawRubensCorr", "%s not found in %s", hname, fname);
24 gStyle->SetOptTitle(0);
25 gStyle->SetOptStat(0);
27 TCanvas* c = new TCanvas("c", "c", 800, 800);
32 c->SetRightMargin(0.03);
33 c->SetLeftMargin(0.15);
34 c->SetTopMargin(0.03);
36 h->GetXaxis()->SetTitleFont(132);
37 h->GetXaxis()->SetLabelFont(132);
38 h->GetXaxis()->SetDecimals();
39 h->GetYaxis()->SetTitleFont(132);
40 h->GetYaxis()->SetLabelFont(132);
41 h->GetYaxis()->SetDecimals();
42 h->GetYaxis()->SetTitleOffset(1.8);
43 h->SetYTitle("Clusters/Tracklets");
46 TF1* g = new TF1("g", "pol2", -2.2, 2.2);
50 Info("DrawRubensCorr", "Result of Fit:\n"
51 " chi^2/NDF = %7.4f / %2d = %7.4f\n"
52 " A = %+4.2f +/- %5.3f\n"
53 " B = %+5.3f +/- %6.4f\n"
54 " C = %+6.4f +/- %7.5f\n"
55 " f(x)=%4.2f%+5.3f*x%+6.4f*x*x",
56 g->GetChisquare(), g->GetNDF(), g->GetChisquare()/g->GetNDF(),
57 g->GetParameter(0), g->GetParError(0),
58 g->GetParameter(1), g->GetParError(1),
59 g->GetParameter(2), g->GetParError(2),
60 g->GetParameter(0), g->GetParameter(1), g->GetParameter(2));
62 TLatex* ltx = new TLatex(.2, .9, Form("f(x)=%4.2f%+5.3fx%+6.4fx^{2}",
67 ltx->SetTextFont(132);
70 c->SaveAs("rubens_corr.png");