11 #include "TGraphAsymmErrors.h" 26 TString
filename =
"txt/limits/limits_TChiHH_lumi"+lumi+
".txt";
32 int main(
int argc,
char *argv[]){
36 PlotOpt opts(
"txt/plot_styles.txt",
"Ratio");
38 gStyle->SetGridStyle(3);
43 vector<double> vmx, vmy, vxsec, vexsec, vobs, vobsup, vobsdown;
44 vector<double> vexp, vup, vdown, v2up, v2down, vsigobs, vsigexp, zeroes, ones;
45 double maxy=-99., miny=1e99;
48 while(getline(infile, line_s)){
49 istringstream iss(line_s);
50 double pmx, pmy, pxsec, pexsec, pobs, pobsup, pobsdown, pexp, pup, pdown, p2up, p2down, sigobs, sigexp;
51 iss >> pmx >> pmy >> pxsec >> pexsec >> pobs >> pobsup >> pobsdown
52 >> pexp >> pup >> pdown >> p2up >> p2down >> sigobs >> sigexp;
56 vxsec.push_back(pxsec);
57 vexsec.push_back(pexsec);
59 vobsup.push_back(pobsup);
60 vobsdown.push_back(pobsdown);
62 vup.push_back(pup-pexp);
63 vdown.push_back(pexp-pdown);
64 v2up.push_back(p2up-pexp);
65 v2down.push_back(pexp-p2down);
66 vsigobs.push_back(sigobs);
67 vsigexp.push_back(sigexp);
70 if(miny > min(vobs.back(), 1.)) miny = min(vobs.back(), 1.);
71 if(maxy < max(vobs.back(), 1.)) maxy = max(vobs.back(), 1.);
75 if(vmx.size() <= 0)
ERROR(
"Need at least 1 model to draw limits");
76 if(vmx.size() != vmy.size()
77 || vmx.size() != vxsec.size()
78 || vmx.size() != vexsec.size()
79 || vmx.size() != vobs.size()
80 || vmx.size() != vobsup.size()
81 || vmx.size() != vobsdown.size()
82 || vmx.size() != vexp.size()
83 || vmx.size() != vup.size()
84 || vmx.size() != vdown.size()
85 || vmx.size() != v2up.size()
86 || vmx.size() != v2down.size()
87 || vmx.size() != vsigobs.size()
88 || vmx.size() != vsigexp.size())
ERROR(
"Error parsing text file. Model point not fully specified");
109 can.SetFillStyle(4000);
110 TString chi1n =
"#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
111 TString chi2n =
"#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.]{#scale[0.85]{_{2}}}";
112 TString chi1pm=
"#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{#pm}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
113 TString chii=
"#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0,#pm}}}#kern[-3.]{#scale[0.85]{_{i}}}";
114 TString chij=
"#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0,#mp}}}#kern[-3.]{#scale[0.85]{_{j}}}";
115 TString mass_ =
"m#kern[0.1]{#lower[-0.12]{_{";
116 float minh=200, maxh=1000;
117 TH1D histo(
"histo",
"", 18, minh, maxh);
119 histo.SetMaximum(4.5);
120 histo.GetYaxis()->CenterTitle(
true);
121 histo.GetXaxis()->SetLabelOffset(0.02);
122 histo.SetXTitle(
"Higgsino mass "+mass_+chi1n+
"}}} [GeV]");
123 histo.SetYTitle(
"#sigma_{excl}^{95% CL}/#sigma_{theor}");
127 line.SetLineColor(4); line.SetLineStyle(2); line.SetLineWidth(4);
130 cmslabel.SetNDC(kTRUE);
132 TGraphAsymmErrors grexp2(vmx.size(), &(vmx[0]), &(vexp[0]), &(zeroes[0]), &(zeroes[0]), &(v2down[0]), &(v2up[0]));
133 grexp2.SetLineColor(1); grexp2.SetFillColor(5); grexp2.SetLineWidth(3); grexp2.SetLineStyle(2);
134 grexp2.Draw(
"e3 same");
135 TGraphAsymmErrors grexp1(vmx.size(), &(vmx[0]), &(vexp[0]), &(zeroes[0]), &(zeroes[0]), &(vdown[0]), &(vup[0]));
136 grexp1.SetLineColor(1); grexp1.SetFillColor(3); grexp1.SetLineWidth(3); grexp1.SetLineStyle(2);
137 grexp1.Draw(
"e3 same");
138 TGraph grexp(vmx.size(), &(vmx[0]), &(vexp[0]));
139 grexp.SetLineWidth(3); grexp.SetLineStyle(2);
141 TGraph grobs(vmx.size(), &(vmx[0]), &(vobs[0]));
142 grobs.SetLineWidth(1);
146 TString cmsPrel =
"#font[62]{CMS} #scale[0.8]{#font[52]{Simulation}}";
147 TString lumiEner =
"#font[42]{"+
lumi+
" fb^{-1} (13 TeV)}"; lumiEner.ReplaceAll(
"p",
".");
148 TString ppChiChi =
"pp #rightarrow "+chii+
"#kern[0.6]{"+chij+
"} #rightarrow hh#tilde{G}#tilde{G}";
149 TString mChis = mass_+chi2n+
"}}} #approx "+mass_+chi1pm+
"}}} #approx "+mass_+chi1n+
"}}}, "+mass_+
"#tilde{G}}}} = 1 GeV";
150 cmslabel.SetTextAlign(11); cmslabel.SetTextSize(0.06);
152 cmslabel.SetTextAlign(31); cmslabel.SetTextSize(0.056);
154 line.DrawLine(minh, 1, maxh, 1);
156 cmslabel.SetTextAlign(31); cmslabel.SetTextSize(0.045);
157 cmslabel.SetTextFont(132);
162 double legX(0.54), legY(1-opts.
TopMargin()-0.04), legSingle = 0.05;
163 double legW = 0.26, legH = legSingle*4;
164 TLegend leg(legX-legW, legY-legH, legX, legY);
165 leg.SetTextSize(0.04); leg.SetFillColor(0);
166 leg.SetFillStyle(0); leg.SetBorderSize(0);
167 leg.AddEntry(&line,
"NLO+NLL",
"l");
168 leg.AddEntry(&grobs,
"\"Observed\"",
"l");
169 leg.AddEntry(&grexp1,
"Expected #pm #sigma");
170 leg.AddEntry(&grexp2,
"Expected #pm 2#sigma");
173 histo.Draw(
"axis same");
174 can.SaveAs(
"plots/higgsino_limits_lumi"+
lumi+
".pdf");
182 maxy=-99.; miny=1e99;
183 for(
size_t i = 0; i < vxsec.size(); ++i){
185 vexsec[i] *= vxsec[i];
187 vobsup[i] *= vxsec[i];
188 vobsdown[i]*= vxsec[i];
191 vdown[i] *= vxsec[i];
193 v2down[i] *= vxsec[i];
194 if(miny > min(vexp[i]-v2down[i], vxsec[i])) miny = min(vexp[i]-v2down[i], vxsec[i]);
195 if(maxy < max(vexp[i]+v2up[i], vxsec[i])) maxy = max(vexp[i]+v2up[i], vxsec[i]);
199 histo.GetXaxis()->SetLabelOffset(0.01);
200 histo.SetMinimum(miny/2.);
201 histo.SetMaximum(maxy*1.2);
202 histo.SetYTitle(
"#sigma_{excl}^{95% CL} #times BF(hh #rightarrow bbbb) [fb]");
204 TGraphAsymmErrors gexp2(vmx.size(), &(vmx[0]), &(vexp[0]), &(zeroes[0]), &(zeroes[0]), &(v2down[0]), &(v2up[0]));
205 gexp2.SetLineColor(1); gexp2.SetFillColor(5); gexp2.SetLineWidth(3); gexp2.SetLineStyle(2);
206 gexp2.Draw(
"e3 same");
207 TGraphAsymmErrors gexp1(vmx.size(), &(vmx[0]), &(vexp[0]), &(zeroes[0]), &(zeroes[0]), &(vdown[0]), &(vup[0]));
208 gexp1.SetLineColor(1); gexp1.SetFillColor(3); gexp1.SetLineWidth(3); gexp1.SetLineStyle(2);
209 gexp1.Draw(
"e3 same");
210 TGraph gexp(vmx.size(), &(vmx[0]), &(vexp[0]));
211 gexp.SetLineWidth(3); gexp.SetLineStyle(2);
213 TGraph gobs(vmx.size(), &(vmx[0]), &(vobs[0]));
214 gobs.SetLineWidth(1);
216 TGraph gxsec(vmx.size(), &(vmx[0]), &(vxsec[0]));
217 gxsec.SetLineWidth(4); gxsec.SetLineColor(4); gxsec.SetLineStyle(2);
223 leg.SetX1NDC(legX-legW); leg.SetX2NDC(legX);
227 cmslabel.SetTextAlign(11); cmslabel.SetTextSize(0.06);
229 cmslabel.SetTextAlign(31); cmslabel.SetTextSize(0.056);
233 cmslabel.SetTextAlign(11); cmslabel.SetTextSize(0.045);
234 cmslabel.SetTextFont(132);
239 histo.Draw(
"axis same");
240 can.SaveAs(
"plots/higgsino_limits_fb_lumi"+
lumi+
".pdf");
246 histo.GetXaxis()->SetLabelOffset(0.02);
248 histo.SetMaximum(3.5);
249 if(
lumi==
"40") histo.SetMaximum(4.5);
250 histo.SetYTitle(
" Expected discovery significance [#sigma]");
253 TGraph gsig(vmx.size(), &(vmx[0]), &(vsigexp[0]));
254 gsig.SetLineWidth(3); gsig.SetLineColor(4);
257 cmslabel.SetTextAlign(11); cmslabel.SetTextSize(0.06);
259 cmslabel.SetTextAlign(31); cmslabel.SetTextSize(0.056);
262 cmslabel.SetTextAlign(33); cmslabel.SetTextSize(0.045);
263 cmslabel.SetTextFont(132);
267 can.SaveAs(
"plots/higgsino_significance_lumi"+
lumi+
".pdf");
274 static struct option long_options[] = {
275 {
"model", required_argument, 0,
'm'},
276 {
"file", required_argument, 0,
'f'},
282 opt = getopt_long(argc, argv,
"f:m:", long_options, &option_index);
283 if( opt == -1)
break;
294 optname = long_options[option_index].name;
296 printf(
"Bad option! Found option name %s\n", optname.c_str());
298 printf(
"Bad option! Found option name %s\n", optname.c_str());
302 printf(
"Bad option! getopt_long returned character code 0%o\n", opt);
PlotOpt & TopMargin(double top)
void setPlotStyle(PlotOpt opts)
PlotOpt & LeftMargin(double left)
std::vector< T > ApplyPermutation(const std::vector< T > &vec, const std::vector< std::size_t > &perm)
int main(int argc, char *argv[])
PlotOpt & BottomMargin(double bottom)
void GetOptions(int argc, char *argv[])
std::vector< std::size_t > SortPermutation(const std::vector< T > &vec)
PlotOpt & RightMargin(double right)