// This macro is to be used on a root file produced with the // event.C selector. #include "chain_fine.h" #include "chain_course.h" #include "StandardLabels.C" void Eres_vs_E_vs_theta(const char *who="fine") { gROOT->Reset(); gStyle->SetPadRightMargin(0.15); char fname[256]; sprintf(fname,"event_%s.root", who); TFile *f = new TFile(fname); TH3D *E_diff = (TH3D*)gROOT->FindObject("E_diff"); E_diff->FitSlicesZ(); TH2D *E_diff_2 = (TH2D*)gROOT->FindObject("E_diff_2"); TCanvas *c1 = new TCanvas(); c1->SetTicks(); c1->SetGrid(); char title[256]; sprintf(title, "BCAL Energy Res. (%s)", who); TH2D *axes = new TH2D("axes",title, 100, 10.0, 110.0, 100, 0.0, 3.0); axes->SetStats(0); axes->SetXTitle("#theta (degrees)"); axes->SetYTitle("Energy (GeV)"); axes->Draw(); E_diff_2->Scale(100.0); // convert to percent E_diff_2->GetZaxis()->SetRangeUser(0.0, 40.0); E_diff_2->Draw("same colz"); TLatex *l = new TLatex(125.0, 1.5, "Energy Resolution (%)"); l->SetTextAlign(22); l->SetTextAngle(270); l->Draw(); StandardLabels(axes, "20M events No cuts on primary conversion point.", "Single #gamma"); sprintf(fname,"Eres_vs_E_vs_theta_%s.png", who); c1->SaveAs(fname); sprintf(fname,"Eres_vs_E_vs_theta_%s.pdf", who); c1->SaveAs(fname); }