#include "StandardLabels.C" void pt_pipi_res(void) { TFile *f = new TFile("../hd_root.root"); TH1D *post_kinfit = (TH1D*)gROOT->FindObject("pt_pipi_res"); TFile *f = new TFile("../hd_root_prekinfit.root"); TH1D *pre_kinfit = (TH1D*)gROOT->FindObject("pt_pipi_res"); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); pre_kinfit->SetLineColor(kBlue); post_kinfit->SetLineColor(kRed); pre_kinfit->SetLineWidth(2); post_kinfit->SetLineWidth(2); pre_kinfit->Fit("gaus", "", "", -0.1, +0.1); double sigma_pre = pre_kinfit->GetFunction("gaus")->GetParameter(2); post_kinfit->Fit("gaus", "", "", -0.1, +0.1); double sigma_post = post_kinfit->GetFunction("gaus")->GetParameter(2); pre_kinfit->GetFunction("gaus")->SetLineColor(kBlue); post_kinfit->GetFunction("gaus")->SetLineColor(kRed); pre_kinfit->GetFunction("gaus")->SetLineWidth(1); post_kinfit->GetFunction("gaus")->SetLineWidth(1); char pre_lab[256]; char post_lab[256]; sprintf(pre_lab, "pre-KinFit: RMS=%3.2f", pre_kinfit->GetRMS()); sprintf(post_lab, "post-KinFit: RMS=%3.2f", post_kinfit->GetRMS()); TLegend *leg = new TLegend(0.116, 0.742, 0.457, 0.877); leg->SetFillColor(kWhite); leg->AddEntry(pre_kinfit, pre_lab); leg->AddEntry(post_kinfit, post_lab); leg->Draw(); pre_kinfit->SetStats(0); pre_kinfit->GetXaxis()->SetRangeUser(-1.0, 1.0); pre_kinfit->Draw(); post_kinfit->Draw("same"); leg->Draw(); double max = pre_kinfit->GetMaximum()*1.05; int N_pre = pre_kinfit->GetEntries(); int N_post = post_kinfit->GetEntries(); sprintf(pre_lab, "pre-KinFit: Nevents=%d", N_pre); sprintf(post_lab, "post-KinFit: Nevents=%d", N_post); TLatex *lab1 = new TLatex(9.5, max*0.69, pre_lab); lab1->SetTextSize(0.035); lab1->SetTextAlign(32); lab1->Draw(); TLatex *lab2 = new TLatex(9.5, max*0.62, post_lab); lab2->SetTextSize(0.035); lab2->SetTextAlign(32); lab2->Draw(); StandardLabels1D(pre_kinfit, "100k events Primakoff #gammap#rightarrowp#pi^{+}#pi^{-}", "", "E_{#gamma}=5.5GeV (no background, #pi mass hypothesis only)"); c1->SaveAs("pt_pipi_res.pdf"); c1->SaveAs("pt_pipi_res.png"); }