#include using namespace std; #include "StandardLabels.C" int GetIntegral(const char *fname, double &integral); void eff_vs_Wpipi(void) { TFile *f1 = new TFile("../OUTPUT.3/z51.root"); TH1D *mass_pip_pim_z51 = (TH1D*)gROOT->FindObject("mass_pip_pim"); TH1D *mass_pip_pim_gen_z51 = (TH1D*)gROOT->FindObject("mass_pip_pim_gen"); mass_pip_pim_z51->Rebin(4); mass_pip_pim_gen_z51->Rebin(4); mass_pip_pim_z51->Divide(mass_pip_pim_gen_z51); for(int ibin=1; ibin<=mass_pip_pim_gen_z51->GetNbinsX(); ibin++){ if(mass_pip_pim_gen_z51->GetBinContent(ibin) <2) mass_pip_pim_z51->SetBinContent(ibin, 0.0); } TFile *f1 = new TFile("../OUTPUT.3/z1.root"); TH1D *mass_pip_pim_z1 = (TH1D*)gROOT->FindObject("mass_pip_pim"); TH1D *mass_pip_pim_gen_z1 = (TH1D*)gROOT->FindObject("mass_pip_pim_gen"); mass_pip_pim_z1->Rebin(4); mass_pip_pim_gen_z1->Rebin(4); mass_pip_pim_z1->Divide(mass_pip_pim_gen_z1); for(int ibin=1; ibin<=mass_pip_pim_gen_z1->GetNbinsX(); ibin++){ if(mass_pip_pim_gen_z1->GetBinContent(ibin) <2) mass_pip_pim_z1->SetBinContent(ibin, 0.0); } TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); TH2D *axes = new TH2D("axes", "Rough efficiency vs. W_{#pi#pi}", 100, 0.26, 0.52, 100, 0.0, 0.65); axes->SetStats(0); axes->SetXTitle("W_{#pi^{+}#pi^{-}} (GeV)"); axes->SetYTitle("#pi^{+}#pi^{-} reconstruction efficiency (estimated)"); axes->Draw(); mass_pip_pim_z51->SetLineColor(kBlue); mass_pip_pim_z1->SetLineColor(kRed); mass_pip_pim_z51->SetLineWidth(3); mass_pip_pim_z1->SetLineWidth(3); mass_pip_pim_z51->Draw("same"); mass_pip_pim_z1->Draw("same"); TLegend *leg = new TLegend(0.453, 0.253, 0.711, 0.489); leg->AddEntry(mass_pip_pim_z51, "z=51cm"); leg->AddEntry(mass_pip_pim_z1, "z=1cm"); leg->Draw(); StandardLabels(axes, "100k #pi^{+}#pi^{-} events generated" , "E_{#gamma} =5.5GeV" , "vertex constraint enabled" , ""); c1->SaveAs("eff_vs_Wpipi.png"); c1->SaveAs("eff_vs_Wpipi.pdf"); }