#include "StandardLabels.C" void elasticity_pipi(void) { TColor::CreateColorWheel(); TFile *f = new TFile("hd_root.root"); TTree *kinfo = (TTree*)gROOT->FindObject("kinfo"); TH1D *elasticity = new TH1D("elasticity", "", 200, 0.0, 1.0); TH1D *elasticity_pipi = (TH1D*)elasticity->Clone("elasticity_pipi"); TH1D *elasticity_pipi_exclusive = (TH1D*)elasticity->Clone("elasticity_pipi_exclusive"); TH1D *elasticity_KK = (TH1D*)elasticity->Clone("elasticity_KK"); TH1D *elasticity_KK_pion_assumpiton = (TH1D*)elasticity->Clone("elasticity_KK_pion_assumpiton"); kinfo->Project("elasticity", "(Epm-Ebaryon)/Egamma"); kinfo->Project("elasticity_pipi", "(Epm-Ebaryon)/Egamma", "isPiPi_inclusive==1"); kinfo->Project("elasticity_pipi_exclusive", "(Epm-Ebaryon)/Egamma", "isPiPi_exclusive==1"); kinfo->Project("elasticity_KK", "(Epm-Ebaryon)/Egamma", "isKK==1"); kinfo->Project("elasticity_KK_pion_assumpiton", "Epipi/Egamma", "isKK==1"); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); c1->SetLogy(); elasticity->SetStats(0); elasticity->SetLineColor(kRed); elasticity_pipi->SetLineColor(kBlue); elasticity_pipi_exclusive->SetLineColor(kMagenta); elasticity_KK->SetLineColor(kOrange); elasticity_KK_pion_assumpiton->SetLineColor(kGreen); elasticity->Draw(); elasticity_pipi->Draw("same"); elasticity_pipi_exclusive->Draw("same"); elasticity_KK->Draw("same"); elasticity_KK_pion_assumpiton->Draw("same"); TLegend *leg = new TLegend(0.11, 0.5, 0.65, 0.85); leg->SetFillColor(kWhite); leg->AddEntry(elasticity, "All +/- pairs"); leg->AddEntry(elasticity_pipi, "inclusive #pi^{+}#pi^{-}"); leg->AddEntry(elasticity_pipi_exclusive, "exclusive #pi^{+}#pi^{-}"); leg->AddEntry(elasticity_KK, "inclusive K^{+}K^{-}"); leg->AddEntry(elasticity_KK_pion_assumpiton, "inclusive K^{+}K^{-} with pion assumption"); leg->Draw(); //StandardLabels1D(elasticity, "0.5^{o} #leq #theta_{#pm} #leq 10^{o}", "#gamma p #rightarrow p #pi^{+} #pi^{-} (?)", "generated events only", ""); StandardLabels1D(elasticity, "", "", "generated events only", ""); c1->SaveAs("elasticity_pipi.pdf"); c1->SaveAs("elasticity_pipi.png"); }