#include "StandardLabels.C" #include "Angle.h" void tres_vs_segmentation(void) { TColor::CreateColorWheel(); gStyle->SetErrorX(0.0); int Nschemes = 6; const char* schemes[] = { "LAYERS_FINE", "LAYERS_1234_SECTORS1111", "LAYERS_22222_SECTORS11222", "LAYERS_244_SECTORS111", "LAYERS_3322_SECTORS1122", "LAYERS_334_SECTORS111" }; const char* schemes_short[] = { "FINE", "1234", "22222", "244", "3322", "334" }; // Create histograms to hold contents TH1D *tdiff500 = new TH1D("tdiff500", "", 6, 0.5, 6.5); TH1D *tdiff1000 = new TH1D("tdiff1000", "", 6, 0.5, 6.5); TH1D *tavg500 = new TH1D("tavg500", "", 6, 0.5, 6.5); TH1D *tavg1000 = new TH1D("tavg1000", "", 6, 0.5, 6.5); double p0[6], p0err[6]; double p1[6], p1err[6]; double cov[6]; // off-diagonal covariance term //--------------- tdiff ---------------- // Loop over schemes for(int ischeme=0; ischeme> seg_scheme; ifs >> angle; ifs >> p0[ischeme] >> p0err[ischeme]; ifs >> p1[ischeme] >> p1err[ischeme]; ifs >> cov[ischeme]; ifs.close(); } // Loop over all segementation schemes for(int ischeme=0; ischemeSetBinContent(ischeme+1, r500); tdiff500->SetBinError(ischeme+1, r500_err); tdiff1000->SetBinContent(ischeme+1, r1000); tdiff1000->SetBinError(ischeme+1, r1000_err); } //--------------- tavg ---------------- // Loop over schemes for(int ischeme=0; ischeme> seg_scheme; ifs >> angle; ifs >> p0[ischeme] >> p0err[ischeme]; ifs >> p1[ischeme] >> p1err[ischeme]; ifs >> cov[ischeme]; ifs.close(); } // Loop over all segementation schemes for(int ischeme=0; ischemeSetBinContent(ischeme+1, r500); tavg500->SetBinError(ischeme+1, r500_err); tavg1000->SetBinContent(ischeme+1, r1000); tavg1000->SetBinError(ischeme+1, r1000_err); } // Make plot TCanvas *c1 = new TCanvas("c1"); c1->SetGrid(); c1->SetTicks(); TH2D *axes = new TH2D("axes", "BCAL Timing resolution", 6, 0.5, 6.5, 100, 0.0, 150.0); axes->SetStats(0); axes->SetYTitle("Time resolution (ps)"); axes->SetXTitle("Segmentation Scheme"); TAxis *xaxis = axes->GetXaxis(); xaxis->SetBinLabel(1, "FINE"); xaxis->SetBinLabel(2, "LAYERS_1234"); xaxis->SetBinLabel(3, "LAYERS_22222"); xaxis->SetBinLabel(4, "LAYERS_244"); xaxis->SetBinLabel(5, "LAYERS_3322"); xaxis->SetBinLabel(6, "LAYERS_334"); axes->Draw(); tdiff500->SetMarkerStyle(22); tdiff500->SetMarkerSize(2.0); tdiff500->SetMarkerColor(kRed); tdiff500->SetLineColor(tdiff500->GetMarkerColor()); tdiff500->Draw("PE1same"); tdiff1000->SetMarkerStyle(21); tdiff1000->SetMarkerSize(2.0); tdiff1000->SetMarkerColor(kBlue); tdiff1000->SetLineColor(tdiff1000->GetMarkerColor()); tdiff1000->Draw("PE1same"); tavg500->SetMarkerStyle(26); tavg500->SetMarkerSize(2.0); tavg500->SetMarkerColor(kRed); tavg500->SetLineColor(tavg500->GetMarkerColor()); tavg500->Draw("PE1same"); tavg1000->SetMarkerStyle(25); tavg1000->SetMarkerSize(2.0); tavg1000->SetMarkerColor(kBlue); tavg1000->SetLineColor(tavg1000->GetMarkerColor()); tavg1000->Draw("PE1same"); double y_shift = tdiff500->GetBinContent(6)<80.0 ? 0.5:0.0; TLegend *leg = new TLegend(0.655, 0.169+y_shift, 0.868, 0.379+y_shift); leg->SetFillColor(kWhite); leg->AddEntry(tdiff500, "0.5 GeV #Deltat/2"); leg->AddEntry(tdiff1000, "1 GeV #Deltat/2"); leg->AddEntry(tavg500, "0.5 GeV t_{avg}"); leg->AddEntry(tavg1000, "1 GeV t_{avg}"); leg->Draw(); StandardLabels(axes, AngleStr("#theta_{#gamma}=")); c1->SaveAs("tres_vs_segmentation.png"); c1->SaveAs("tres_vs_segmentation.pdf"); }