#include "StandardLabels.C" void t_distribution(void) { TFile *f = new TFile("hd_root.root"); TH1D *t_all = (TH1D*)gROOT->FindObject("t_all"); TH1D *t_KK = (TH1D*)gROOT->FindObject("t_KK"); TH1D *t_PiPi = (TH1D*)gROOT->FindObject("t_PiPi"); TH1D *t_KK_coherent = (TH1D*)gROOT->FindObject("t_KK_coherent"); TH1D *t_coherent = (TH1D*)gROOT->FindObject("t_coherent"); TH1D *t_PiPi_coherent = (TH1D*)gROOT->FindObject("t_PiPi_coherent"); //gStyle->SetPadBottomMargin(0.15); //gStyle->SetPadRightMargin(0.2); t_all->Rebin(4); t_coherent->Rebin(4); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); c1->SetLogy(); t_all->SetLineColor(kRed); t_all->SetLineWidth(3); t_coherent->SetLineWidth(3); t_all->SetTitle("PYTHIA generated #pi^{+}#pi^{-}"); t_all->SetXTitle("Invariant mass W of #pi^{+}#pi^{-} (GeV)"); t_all->SetStats(0); t_all->GetYaxis()->SetRangeUser(1.0, 30000.0); t_all->Draw(); t_coherent->Draw("same"); TLegend *leg = new TLegend(0.11, 0.75, 0.5, 0.89); leg->SetFillColor(kWhite); leg->AddEntry(t_all, "all reactions, all energies"); leg->AddEntry(t_coherent, "all reactions, coherent peak"); leg->Draw(); StandardLabels1D(t_all, "0.5^{o} #leq #theta_{#pm} #leq 10^{o}", "#gamma p #rightarrow p + - (?)", "generated events only", ""); c1->SaveAs("t_distribution.pdf"); c1->SaveAs("t_distribution.png"); }