#include using namespace std; #include "StandardLabels.C" void pip_theta_cm_res(void) { TFile *f1 = new TFile("../hd_root.root"); TH1D *theta_pip_cm_res = (TH1D*)gROOT->FindObject("theta_pip_cm_res"); theta_pip_cm_res->Fit("gaus"); theta_pip_cm_res->GetFunction("gaus")->SetLineColor(kRed); double sigma = theta_pip_cm_res->GetFunction("gaus")->GetParameter(2); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); double max = theta_pip_cm_res->GetMaximum()*1.05; TH2D *axes = new TH2D("axes", "#pi^{+} #theta_{CM} resolution", 100, -400.0, +400.0, 100, 0.0, max); axes->SetStats(0); axes->SetXTitle("#delta#theta CM (mrad)"); axes->Draw(); theta_pip_cm_res->SetFillColor(kYellow); theta_pip_cm_res->SetLineColor(kBlack); theta_pip_cm_res->SetLineWidth(2); theta_pip_cm_res->Draw("same"); char str[256]; sprintf(str, "#sigma=%3.0f mrad", sigma); TLatex *lab = new TLatex(200.0, max/2.0, str); lab->SetTextAlign(22); lab->SetTextSize(0.04); lab->Draw(); StandardLabels(axes, "100k #pi^{+}#pi^{-} events generated" , "E_{#gamma} =5.5GeV" , "P4 kinematic fit done." , ""); c1->SaveAs("pip_theta_cm_res.png"); c1->SaveAs("pip_theta_cm_res.pdf"); }