31 int nxbins = max(1, min(500, static_cast<int>(ceil((xmax-xmin)/bin_size))));
32 int nybins = max(1, min(500, static_cast<int>(ceil((ymax-ymin)/bin_size))));
34 TFile gfile(
"t1tttt_eff.root");
36 TGraph2D* geff =
static_cast<TGraph2D*
>(gfile.Get(
"effmap"));
41 TH2D *heff = geff->GetHistogram();
43 cout<<endl<<
"Could not retrieve histogram"<<endl<<endl;
46 heff->SetTitle(
";m_{gluino} [GeV];m_{LST} [GeV]; Efficiency");
50 float hmin=200, hmax=1800;
51 vector<float> glus = {1800, 1400, 1000};
52 vector<int> colors = {1,2,4};
57 double legSingle = 0.06;
59 TLegend
leg(legX,legY-legH, legX+legW, legY);
60 leg.SetTextSize(0.05); leg.SetFillColor(0); leg.SetBorderSize(0); leg.SetFillStyle(0);
62 for(
size_t iglu=0; iglu<glus.size(); iglu++){
63 TString hname =
"histo"; hname += iglu;
64 TH1D* histo =
new TH1D(hname,
"",nbins,hmin,hmax);
65 histo->SetLineWidth(3); histo->SetLineColor(colors[iglu]);
66 histo->SetXTitle(
"m_{#tilde{g}} - m_{#chi^{0}_{1}} [GeV]");
67 histo->SetYTitle(
"Efficiency in R4 [%]");
68 for(
int bin=1; bin<
nbins; bin++){
69 float dm = histo->GetBinCenter(bin);
70 float mglu = (glus[iglu]+dm)/2.,
mlsp = (glus[iglu]-dm)/2.;
72 float eff = 100*heff->GetBinContent(heff->FindBin(mglu,
mlsp))/eff_1l;
74 histo->SetBinContent(bin, eff);
77 histos.push_back(histo);
78 leg.AddEntry(histo,
"m_{#tilde{g}} + m_{#chi^{0}_{1}} = "+
RoundNumber(glus[iglu],0)+
" GeV");
79 if(iglu==0) histos[iglu]->Draw(
"");
80 else histos[iglu]->Draw(
"same");
84 can.SaveAs(
"plots/eff_1d.pdf");
86 leg.SetX1NDC(0.56); leg.SetX2NDC(0.56+legW);
88 for(
size_t iglu=0; iglu<glus.size(); iglu++){
89 histos[iglu]->SetBinContent(0,0);
90 for(
int bin=1; bin<
nbins; bin++){
91 float dm0 = histos[iglu]->GetBinCenter(bin);
92 float dm1 = histos[iglu]->GetBinCenter(bin+1);
93 float valbin0 = histos[iglu]->GetBinContent(bin);
94 float valbin1 = histos[iglu]->GetBinContent(bin+1);
95 histos[iglu]->SetBinContent(bin, eff_step*(valbin1-valbin0)/(dm1-dm0));
96 float valbinm1 = histos[iglu]->GetBinContent(bin-1);
97 valbin0 = histos[iglu]->GetBinContent(bin);
98 histos[iglu]->SetBinContent(bin, (valbinm1+valbin0)/2);
101 histos[iglu]->SetYTitle(
"Change in efficiency [%/("+
RoundNumber(eff_step,0)+
" GeV)]");
102 histos[iglu]->SetMinimum(-0.002*eff_step);
104 if(iglu==0) histos[iglu]->Draw(
"");
105 else histos[iglu]->Draw(
"same");
109 can.SaveAs(
"plots/deff_1d.pdf");
TString RoundNumber(double num, int decimals, double denom=1.)