#include "../macros/StandardLabels.C" #include "Angle.h" void tres_diff_vs_segmentation(void) { TColor::CreateColorWheel(); 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, 60.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(); // 500 MeV diff TH1D *h = new TH1D("h", "", 6, 0.5, 6.5); h->SetBinContent(1, 38.59); h->SetBinContent(2, 41.10); h->SetBinContent(3, 41.16); h->SetBinContent(4, 42.21); h->SetBinContent(5, 39.82); h->SetBinContent(6, 39.95); h->SetMarkerStyle(22); h->SetMarkerSize(2.0); h->SetMarkerColor(kRed); h->Draw("Psame"); // 1GeV diff TH1D *h2 = new TH1D("h2", "", 6, 0.5, 6.5); h2->SetBinContent(1, 28.34); h2->SetBinContent(2, 32.08); h2->SetBinContent(3, 31.91); h2->SetBinContent(4, 34.30); h2->SetBinContent(5, 31.70); h2->SetBinContent(6, 32.01); h2->SetMarkerStyle(21); h2->SetMarkerSize(2.0); h2->SetMarkerColor(kBlue); h2->Draw("Psame"); // 500 MeV avg TH1D *h3 = new TH1D("h3", "", 6, 0.5, 6.5); h3->SetBinContent(1, 45.96); h3->SetBinContent(2, 45.81); h3->SetBinContent(3, 43.93); h3->SetBinContent(4, 52.44); h3->SetBinContent(5, 46.51); h3->SetBinContent(6, 46.58); h3->SetMarkerStyle(26); h3->SetMarkerSize(2.0); h3->SetMarkerColor(kRed); h3->Draw("Psame"); // 1GeV avg TH1D *h22 = new TH1D("h22", "", 6, 0.5, 6.5); h22->SetBinContent(1, 32.50); h22->SetBinContent(2, 35.46); h22->SetBinContent(3, 34.01); h22->SetBinContent(4, 42.00); h22->SetBinContent(5, 36.20); h22->SetBinContent(6, 36.13); h22->SetMarkerStyle(25); h22->SetMarkerSize(2.0); h22->SetMarkerColor(kBlue); h22->Draw("Psame"); TLegend *leg = new TLegend(0.655, 0.169, 0.868, 0.379); leg->SetFillColor(kWhite); h->SetLineColor(kWhite); h2->SetLineColor(kWhite); h3->SetLineColor(kWhite); h22->SetLineColor(kWhite); leg->AddEntry(h, "0.5 GeV #Deltat/2"); leg->AddEntry(h2, "1 GeV #Deltat/2"); leg->AddEntry(h3, "0.5 GeV t_{avg}"); leg->AddEntry(h22, "1 GeV t_{avg}"); leg->Draw(); StandardLabels(axes, AngleStr("#theta_{#gamma}=")); c1->SaveAs("tres_diff_vs_segmentation.png"); c1->SaveAs("tres_diff_vs_segmentation.pdf"); }