#include "../macros/StandardLabels.C" void Etruthdiff_with_recon_90degrees_clean(const char *who="fine") { //gROOT->Reset(); char fname[256]; sprintf(fname,"hd_root_%s.root", who); TFile *f = new TFile(fname); TTree *event = (TTree*)gROOT->FindObject("event"); TCanvas *c1 = new TCanvas(); c1->SetTicks(); c1->SetGrid(); double xmin = -5.0; // MeV double xmax = +40.0; // MeV // Legend double xlegend_shift = 0.0; if(!strcmp(who,"course"))xlegend_shift = -0.450; TLegend *leg = new TLegend(0.603+xlegend_shift, 0.498,0.852+xlegend_shift,0.841); leg->SetFillColor(kWhite); // Make plot for several different energy bins double energies[]={0.180, 0.250, 0.450, 0.650}; int colors[] = {kRed,kBlue,kGreen,kMagenta,kBlack}; int styles[] = {20, 21, 22, 23, 29}; int Nenergies = 4; TH1D* hists[100]; double ymax = 0.0; for(int i=0; iSetLineColor(colors[i]); Ediff->SetLineWidth(2); Ediff->SetMarkerColor(colors[i]); Ediff->SetMarkerStyle(styles[i]); char cut[256]; sprintf(cut, "abs(A.thrown.E()-%f)<0.02", energies[i]); event->Project(hname, "1000.0*(A.recon.p.E() - sumTruth)",cut); hists[i] = Ediff; if(Ediff->GetMaximum()>ymax)ymax = Ediff->GetMaximum(); char lab[256]; sprintf(lab, "%d MeV", (int)(1000.0*energies[i])); leg->AddEntry(Ediff, lab); } TH2D *axes = new TH2D("axes", "BCAL measured energy diff. for #theta=90^{o}", 100, xmin, xmax, 100, 0.0, ymax*1.05); axes->SetStats(0); axes->SetXTitle("E_{recon}-#SigmaE_{truth hits} (MeV)"); axes->Draw(); for(unsigned int j=0; jDraw("same"); leg->Draw(); StandardLabels(axes, "1M events No cuts on primary conversion point.", "Single #gamma at 90^{o}", who); sprintf(fname,"Etruthdiff_with_recon_90degrees_clean_%s.png", who); c1->SaveAs(fname); sprintf(fname,"Etruthdiff_with_recon_90degrees_clean_%s.pdf", who); c1->SaveAs(fname); }