#include using namespace std; #include "StandardLabels.C" void acceptance_vs_theta_cm(void) { TFile *f1 = new TFile("../hd_root.root"); TH1D *theta_pip_cm_thrown = (TH1D*)gROOT->FindObject("theta_pip_cm_thrown"); TH1D *theta_pip_cm = (TH1D*)gROOT->FindObject("theta_pip_cm"); TH1D *accept = (TH1D*)theta_pip_cm->Clone("accept"); accept->Divide(theta_pip_cm_thrown); for(int ibin=1; ibin<=accept->GetNbinsX(); ibin++){ double N = theta_pip_cm_thrown->GetBinContent(ibin); double err = sqrt(N); if( N < 50.0 ){ accept->SetBinContent(ibin, 0.0); } } TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); double max = 1.05; TH2D *axes = new TH2D("axes", "#pi^{+}#pi^{-} Acceptance vs. #theta_{CM}", 100, 0.0, 180.0, 100, 0.0, max); axes->SetStats(0); axes->SetXTitle("#theta CM (degrees)"); axes->Draw(); accept->SetLineColor(kBlack); accept->SetLineWidth(3); accept->Draw("same"); StandardLabels(axes, "100k #pi^{+}#pi^{-} events generated" , "E_{#gamma} =5.5GeV" , "P4 kinematic fit done." , ""); c1->SaveAs("acceptance_vs_theta_cm.png"); c1->SaveAs("acceptance_vs_theta_cm.pdf"); }