2 DrawRubensCorr(const char* fname="rubensRatio.root",
3 const char* hname = "dNdEtaCor1D_cls")
5 TFile* f = TFile::Open(fname, "READ");
7 Error("DrawRubensCorr", "%s not found", fname);
10 TH1D* h = static_cast<TH1D*>(f->Get(hname));
12 Error("DrawRubensCorr", "%s not found in %s", hname, fname);
16 gStyle->SetOptTitle(0);
17 gStyle->SetOptStat(0);
19 TCanvas* c = new TCanvas("c", "c", 800, 800);
24 c->SetRightMargin(0.03);
25 c->SetLeftMargin(0.15);
26 c->SetTopMargin(0.03);
28 h->GetXaxis()->SetTitleFont(132);
29 h->GetXaxis()->SetLabelFont(132);
30 h->GetXaxis()->SetDecimals();
31 h->GetYaxis()->SetTitleFont(132);
32 h->GetYaxis()->SetLabelFont(132);
33 h->GetYaxis()->SetDecimals();
34 h->GetYaxis()->SetTitleOffset(1.8);
35 h->SetYTitle("Clusters/Tracklets");
38 TF1* g = new TF1("g", "pol2", -2.2, 2.2);
42 Info("DrawRubensCorr", "Result of Fit:\n"
43 " chi^2/NDF = %7.4f / %2d = %7.4f\n"
44 " A = %+4.2f +/- %5.3f\n"
45 " B = %+5.3f +/- %6.4f\n"
46 " C = %+6.4f +/- %7.5f\n"
47 " f(x)=%4.2f%+5.3f*x%+6.4f*x*x",
48 g->GetChisquare(), g->GetNDF(), g->GetChisquare()/g->GetNDF(),
49 g->GetParameter(0), g->GetParError(0),
50 g->GetParameter(1), g->GetParError(1),
51 g->GetParameter(2), g->GetParError(2),
52 g->GetParameter(0), g->GetParameter(1), g->GetParameter(2));
54 TLatex* ltx = new TLatex(.2, .9, Form("f(x)=%4.2f%+5.3fx%+6.4fx^{2}",
59 ltx->SetTextFont(132);
62 c->SaveAs("rubens_corr.png");