#include using namespace std; #include "StandardLabels.C" void 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(2); mass_pip_pim_gen_z51->Rebin(2); 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(2); mass_pip_pim_gen_z1->Rebin(2); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); double max = mass_pip_pim_gen_z51->GetMaximum()*1.05; TH2D *axes = new TH2D("axes", "W_{#pi#pi}", 100, 0.26, 0.52, 100, 0.0, max); axes->SetStats(0); axes->SetXTitle("W_{#pi^{+}#pi^{-}} (GeV)"); axes->Draw(); mass_pip_pim_gen_z51->SetLineColor(kBlack); mass_pip_pim_z51->SetLineColor(kBlue); mass_pip_pim_z1->SetLineColor(kRed); mass_pip_pim_gen_z51->SetLineWidth(3); mass_pip_pim_z51->SetLineWidth(3); mass_pip_pim_z1->SetLineWidth(3); mass_pip_pim_gen_z51->Draw("same"); mass_pip_pim_z51->Draw("same"); mass_pip_pim_z1->Draw("same"); TLegend *leg = new TLegend(0.591, 0.591, 0.848, 0.827); leg->AddEntry(mass_pip_pim_gen_z51, "generated"); leg->AddEntry(mass_pip_pim_z51, "z=51cm (recon)"); leg->AddEntry(mass_pip_pim_z1, "z=1cm (recon)"); leg->Draw(); StandardLabels(axes, "100k #pi^{+}#pi^{-} events generated" , "E_{#gamma} =5.5GeV" , "vertex constraint enabled" , ""); c1->SaveAs("Wpipi.png"); c1->SaveAs("Wpipi.pdf"); }