// WARNING: This script seems to only work the first // time it is run. Subsequent invocations cause empty // histos. Restart ROOT before re-running! #include "chain_fine.h" #include "chain_course.h" #include "StandardLabels.C" void theta_res(void) { gROOT->Reset(); int max_events = 1000000; TChain *fine = chain_fine("event"); TChain *course = chain_course("event"); TCanvas *c1 = new TCanvas(); c1->SetTicks(); TH1D *thetares_fine = new TH1D("thetares_fine", "", 600, -30.0, 30.0); TH1D *thetares_course = new TH1D("thetares_course", "", 600, -30.0, 30.0); TCut cut1("E.thrown.E()>0.1 && E.thrown.E()<0.15"); fine->Project("thetares_fine","(E.recon.p.Theta()-E.thrown.Theta())*57.3",cut1,"",max_events); course->Project("thetares_course","(E.recon.p.Theta()-E.thrown.Theta())*57.3",cut1,"",max_events); thetares_fine->SetLineColor(kRed); thetares_fine->SetLineWidth(2); thetares_course->SetLineColor(kBlue); thetares_course->SetLineWidth(2); thetares_fine->SetTitle("BCAL Polar angle Resolution"); thetares_fine->SetXTitle("#theta_{rec}-#theta_{gen}(deg.)"); thetares_fine->SetYTitle("Events/0.1 deg."); thetares_fine->SetStats(0); thetares_fine->Draw(); thetares_course->Draw("same"); //TH2D *axes = new TH2D("axes","BCAL Reconstruction Efficiency", 100, 0.0, 110.0, 100, 0.0, 1.05); //thetares_fine->SetStats(0); //thetares_fine->SetXTitle("#theta_{rec}-#theta_{gen} (degrees)"); //axes->SetYTitle("Events/0.1 deg."); //axes->Draw(); TLegend *leg = new TLegend(0.564,0.680, 0.883, 0.872); leg->SetFillColor(kWhite); leg->AddEntry(thetares_fine,"Fine Segmentation"); leg->AddEntry(thetares_course,"Course Segmentation"); leg->Draw(); char str[256]; sprintf(str,"%d events No cuts on primary conversion point.", fine->GetEntries(cut1)); StandardLabels1D(thetares_fine, "100MeV #leq E #leq 150MeV 10^{o}#leq#theta#leq110^{o}", "Single #gamma", str); c1->SaveAs("theta_res.png"); c1->SaveAs("theta_res.pdf"); }