#include "StandardLabels.C" void phi_pipi(void) { TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); TFile *f = new TFile("generated.root"); TTree *thrown_tree = (TTree*)gROOT->FindObject("thrown_tree"); TH1D *lo = new TH1D("lo","0.28Project("lo","180.0+phi_pipi*57.3" , "0.28Project("mid","180.0+phi_pipi*57.3", "0.32Project("hi","180.0+phi_pipi*57.3" , "0.36GetEntries("0.28GetEntries("0.32GetEntries("0.36Scale(Nlo/Nmid); hi->Scale(Nlo/Nhi); lo->SetLineColor(kBlue); mid->SetLineColor(kGreen); hi->SetLineColor(kRed); //lo->SetFillColor(kBlue); //mid->SetFillColor(kGreen); //hi->SetFillColor(kRed); double max = lo->GetMaximum()*1.05; TH2D *axes = new TH2D("axes", "Azimuthal distribution of #pi^{+}#pi^{-} system in Lab frame", 100, 0.0, 360.0, 100, 0.0, max); axes->SetStats(0); axes->SetXTitle("#phi_{#pi#pi} (degrees)"); axes->Draw(); lo->SetLineWidth(3); mid->SetLineWidth(3); hi->SetLineWidth(3); lo->Draw("same"); mid->Draw("same"); hi->Draw("same"); TLegend *leg = new TLegend(0.190, 0.686, 0.420, 0.886); leg->SetFillColor(kWhite); leg->AddEntry(lo, ".28 < W_{#pi#pi} < .32"); leg->AddEntry(mid, ".32 < W_{#pi#pi} < .36"); leg->AddEntry(hi, ".36 < W_{#pi#pi} < .40"); leg->Draw(); //StandardLabels(axes, "Generated values", "","#phi_{#pi#pi} measured realtive to +x axis in #pi#pi CM frame"); c1->SaveAs("phi_pipi.png"); c1->SaveAs("phi_pipi.pdf"); c1->SaveAs("phi_pipi.eps"); }