// 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 eff_vs_E_vs_theta(const char *who="fine") { gROOT->Reset(); char fname[256]; sprintf(fname,"event_%s.root", who); TFile *f = new TFile(fname); TH3D *eff_numerator = (TH3D*)gROOT->FindObject("eff_numerator"); TH2D *eff_denominator = (TH2D*)gROOT->FindObject("eff_denominator"); TCanvas *c1 = new TCanvas(); c1->SetTicks(); c1->SetGrid(); char title[256]; sprintf(title, "BCAL Recon. Efficiency (%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(); // Make plot for several different cuts on number of sigma double sigmas[]={1.0, 3.0, 5.0, 10.0, 1000.0}; int Nsigmas = 5; TAxis *zaxis = eff_numerator->GetZaxis(); for(int i=0; iFindBin(sigmas[i]); zaxis->SetRange(0, max_bin); TH2D *eff = (TH2D*)eff_numerator->Project3D("yx"); eff->Divide(eff_denominator); axes->Draw(); eff->Draw("same colz"); c1->Update(); char lab[256]; sprintf(lab,"Cut on E_{recon} within %2.1f#sigma of 5.5%% #times #sqrt{E_{thrown}}", sigmas[i]); StandardLabels(axes, "20M events No cuts on primary conversion point.", "Single #gamma", lab); sprintf(fname,"eff_vs_E_vs_theta_%dsigma_%s.png", (int)sigmas[i], who); c1->SaveAs(fname); sprintf(fname,"eff_vs_E_vs_theta_%dsigma_%s.pdf", (int)sigmas[i], who); c1->SaveAs(fname); } }