ra4_stats  0341147a0dc35f80f4e12c6003afb76a38e2ed6e
limit_scan.cxx
Go to the documentation of this file.
1 #include "limit_scan.hpp"
2 
3 #include <fstream>
4 #include <sstream>
5 #include <string>
6 #include <algorithm>
7 
8 #include <unistd.h>
9 #include <getopt.h>
10 
11 #include "TCanvas.h"
12 #include "TGraph.h"
13 #include "TGraph2D.h"
14 #include "TColor.h"
15 #include "TH2D.h"
16 #include "TStyle.h"
17 #include "TLegend.h"
18 #include "TFile.h"
19 #include "TLatex.h"
20 #include "TLine.h"
21 
22 #include "utilities.hpp"
23 #include "styles.hpp"
24 #include "cross_sections.hpp"
25 
26 using namespace std;
27 
28 namespace{
29  int num_smooth_ = 4; // Number of times to smooth TH2D
30  string filename_ = "txt/t1tttt_limit_scan.txt";
31  string model_ = "T1tttt";
32 }
33 
34 int main(int argc, char *argv[]){
35  GetOptions(argc, argv);
36  styles style("2Dscan"); style.setDefaultStyle();
37 
38  if(filename_ == "") ERROR("No input file provided");
39 
40  vector<double> vmx, vmy, vxsec, vobs, vobsup, vobsdown, vexp, vup, vdown, vsigobs, vsigexp;
41  ReadPoints(vmx, vmy, vxsec, vobs, vobsup, vobsdown, vexp, vup, vdown, vsigobs, vsigexp);
42 
43  vector<double> vlim(vxsec.size());
44  for(size_t i = 0; i < vxsec.size(); ++i){
45  vlim.at(i) = vxsec.at(i) * vobs.at(i);
46  }
47 
48  TH2D hsigobs = MakeObservedSignificancePlot(vmx, vmy, vsigobs);
49  TH2D hsigexp = MakeExpectedSignificancePlot(vmx, vmy, vsigexp);
50 
51  MakeLimitPlot(vmx, vmy, vlim,
52  vobs, vobsup, vobsdown,
53  vexp, vup, vdown,
54  hsigobs, hsigexp);
55 }
56 
57 void ReadPoints(vector<double> &vmx,
58  vector<double> &vmy,
59  vector<double> &vxsec,
60  vector<double> &vobs,
61  vector<double> &vobsup,
62  vector<double> &vobsdown,
63  vector<double> &vexp,
64  vector<double> &vup,
65  vector<double> &vdown,
66  vector<double> &vsigobs,
67  vector<double> &vsigexp){
68  ifstream infile(filename_);
69  string line;
70 
71  while(getline(infile, line)){
72  istringstream iss(line);
73  double pmx, pmy, pxsec, pobs, pobsup, pobsdown, pexp, pup, pdown, sigobs, sigexp;
74  iss >> pmx >> pmy >> pxsec >> pobs >> pobsup >> pobsdown >> pexp >> pup >> pdown >> sigobs >> sigexp;
75  int mglu(pmx);
76  float xsec, exsec;
77  xsec::signalCrossSection(mglu, xsec, exsec);
78  // int factor(50), mlsp(pmy);
79  // if((mglu%factor!=0 || mlsp%factor!=0) && mglu-mlsp!=225 && mlsp!=1450) continue;
80  // if(mglu-mlsp==225 && mglu%factor!=0) continue;
81  vmx.push_back(pmx);
82  vmy.push_back(pmy);
83  if(Contains(model_, "T1") || Contains(model_, "T5")) vxsec.push_back(xsec);
84  else vxsec.push_back(pxsec);
85  vobs.push_back(pobs);
86  vobsup.push_back(pobsup);
87  vobsdown.push_back(pobsdown);
88  vexp.push_back(pexp);
89  vup.push_back(pup);
90  vdown.push_back(pdown);
91  vsigobs.push_back(sigobs);
92  vsigexp.push_back(sigexp);
93  }
94  infile.close();
95 
96  if(vmx.size() <= 2) ERROR("Need at least 3 model_s to draw scan");
97  if(vmx.size() != vmy.size()
98  || vmx.size() != vxsec.size()
99  || vmx.size() != vobs.size()
100  || vmx.size() != vobsup.size()
101  || vmx.size() != vobsdown.size()
102  || vmx.size() != vexp.size()
103  || vmx.size() != vup.size()
104  || vmx.size() != vdown.size()
105  || vmx.size() != vsigobs.size()
106  || vmx.size() != vsigexp.size()) ERROR("Error parsing text file. Model_ point not fully specified");
107 }
108 
109 TH2D MakeObservedSignificancePlot(vector<double> vmx,
110  vector<double> vmy,
111  vector<double> vobs){
113 
114  string xparticle, yparticle;
115  GetParticleNames(xparticle, yparticle);
116  string title = ";m_{"+xparticle+"} [GeV];m_{"+yparticle+"} [GeV];Observed Significance";
117 
118  TGraph2D g("", title.c_str(), vobs.size(), &vmx.at(0), &vmy.at(0), &vobs.at(0));
119 
120  double the_max = 3.;
121  for(int i = 0; i < g.GetN(); ++i){
122  double z = fabs(g.GetZ()[i]);
123  if(z>the_max) the_max = z;
124  }
125  g.SetMinimum(-the_max);
126  g.SetMaximum(the_max);
127 
128  g.SetNpx(GetNumBins(vmx, 12.5));
129  g.SetNpy(GetNumBins(vmy, 12.5));
130 
131  g.GetHistogram()->SetTitle(title.c_str());
132  g.GetHistogram()->SetTickLength(0., "Z");
133 
134  TCanvas c;
135  c.cd();
136 
137  TLatex ltitle(c.GetLeftMargin(), 1.-0.5*c.GetTopMargin(),
138  "#font[62]{CMS}#scale[0.76]{#font[52]{ Supplementary}}");
139  TLatex rtitle(1.-c.GetRightMargin(), 1.-0.5*c.GetTopMargin(),
140  "#scale[0.8]{35.9 fb^{-1} (13 TeV)}");
141  ltitle.SetNDC();
142  rtitle.SetNDC();
143  ltitle.SetTextAlign(12);
144  rtitle.SetTextAlign(32);
145  TLatex model = GetModelLabel(c.GetLeftMargin()+0.03, 1.-c.GetTopMargin()-0.03);
146 
147  g.Draw("colz");
148 
149  vector<TLine> lines;
150  for(double z = 0.; z < the_max; z+=0.5){
151  int style = min(5, static_cast<int>(2.*fabs(z))+1);
152  double width = max(1., 3.-fabs(z));
153  DrawContours(g, 1, style, width, 0, z);
154  double x1 = 1.-c.GetRightMargin()+0.0047;
155  double x2 = 1.-c.GetRightMargin()+0.05;
156  double ybot = c.GetBottomMargin();
157  double ytop = 1.-c.GetTopMargin();
158  double zpos = ybot+(ytop-ybot)*(the_max+z)/(2.*the_max);
159  lines.emplace_back(x1, zpos, x2, zpos);
160  lines.back().SetLineColor(1);
161  lines.back().SetLineStyle(style);
162  lines.back().SetLineWidth(width);
163  lines.back().SetNDC(true);
164  if(z != 0.){
165  DrawContours(g, 1, style, width, 0, -z);
166  double zneg = ybot+(ytop-ybot)*(the_max-z)/(2.*the_max);
167  lines.emplace_back(x1, zneg, x2, zneg);
168  lines.back().SetLineColor(1);
169  lines.back().SetLineStyle(style);
170  lines.back().SetLineWidth(width);
171  lines.back().SetNDC(true);
172  }
173  }
174  for(auto &l: lines){
175  l.Draw("same");
176  }
177 
178  model.Draw("same");
179  ltitle.Draw("same");
180  rtitle.Draw("same");
181 
182  c.Print((model_+"_sigobs.pdf").c_str());
183  c.Print((model_+"_sigobs.root").c_str());
184 
185  TH2D h = *g.GetHistogram();
186  h.SetTitle("Observed Significance");
187  return h;
188 }
189 
190 TH2D MakeExpectedSignificancePlot(vector<double> vmx,
191  vector<double> vmy,
192  vector<double> vobs){
193  SetupColors();
194 
195  string xparticle, yparticle;
196  GetParticleNames(xparticle, yparticle);
197  string title = ";m_{"+xparticle+"} [GeV];m_{"+yparticle+"} [GeV]; Expected Significance";
198 
199  TGraph2D g("", title.c_str(), vobs.size(), &vmx.at(0), &vmy.at(0), &vobs.at(0));
200 
201  double the_max = 0.;
202  for(int i = 0; i < g.GetN(); ++i){
203  double z = g.GetZ()[i];
204  if(z>the_max) the_max = z;
205  }
206  if(the_max > 6.) the_max = 6.;
207  g.SetMinimum(0.);
208  g.SetMaximum(the_max);
209 
210  g.SetNpx(GetNumBins(vmx, 12.5));
211  g.SetNpy(GetNumBins(vmy, 12.5));
212 
213  g.GetHistogram()->SetTitle(title.c_str());
214 
215  TCanvas c;
216  c.cd();
217 
218  TLatex ltitle(c.GetLeftMargin(), 1.-0.5*c.GetTopMargin(),
219  "#font[62]{CMS}#scale[0.76]{#font[52]{ Supplementary}}");
220  TLatex rtitle(1.-c.GetRightMargin(), 1.-0.5*c.GetTopMargin(),
221  "#scale[0.8]{35.9 fb^{-1} (13 TeV)}");
222  ltitle.SetNDC();
223  rtitle.SetNDC();
224  ltitle.SetTextAlign(12);
225  rtitle.SetTextAlign(32);
226  TLatex model = GetModelLabel(c.GetLeftMargin()+0.03, 1.-c.GetTopMargin()-0.03);
227 
228  g.Draw("colz");
229 
230  for(double z = 0.; z < the_max; z+=1.){
231  int style = (z == 5. ? 1 : 2);
232  double width = (z == 5. ? 2. : 1.);
233  DrawContours(g, 1, style, width, 0, z);
234  }
235 
236  model.Draw("same");
237  ltitle.Draw("same");
238  rtitle.Draw("same");
239 
240  c.Print((model_+"_sigexp.pdf").c_str());
241  c.Print((model_+"_sigexp.root").c_str());
242 
243  TH2D h = *g.GetHistogram();
244  h.SetTitle("Expected Significance");
245  return h;
246 }
247 
248 void MakeLimitPlot(vector<double> vmx,
249  vector<double> vmy,
250  vector<double> vlim,
251  vector<double> vobs,
252  vector<double> vobsup,
253  vector<double> vobsdown,
254  vector<double> vexp,
255  vector<double> vup,
256  vector<double> vdown,
257  const TH2D &hsigobs,
258  const TH2D &hsigexp){
259  SetupColors();
260 
261  string xparticle, yparticle;
262  GetParticleNames(xparticle, yparticle);
263  string title = ";m_{"+xparticle+"} [GeV];m_{"+yparticle+"} [GeV];95% CL upper limit on cross section [pb]";
264 
265  TGraph2D glim("", title.c_str(), vlim.size(), &vmx.at(0), &vmy.at(0), &vlim.at(0));
266  TGraph2D gobs("", "Observed Limit", vobs.size(), &vmx.at(0), &vmy.at(0), &vobs.at(0));
267  TGraph2D gobsup("", "Observed +1#sigma Limit", vobsup.size(), &vmx.at(0), &vmy.at(0), &vobsup.at(0));
268  TGraph2D gobsdown("", "Observed -1#sigma Limit", vobsdown.size(), &vmx.at(0), &vmy.at(0), &vobsdown.at(0));
269  TGraph2D gexp("", "Expected Limit", vexp.size(), &vmx.at(0), &vmy.at(0), &vexp.at(0));
270  TGraph2D gup("", "Expected +1#sigma Limit", vup.size(), &vmx.at(0), &vmy.at(0), &vup.at(0));
271  TGraph2D gdown("", "Expected -1#sigma Limit", vdown.size(), &vmx.at(0), &vmy.at(0), &vdown.at(0));
272 
273  glim.SetMinimum(0.001);
274  glim.SetMaximum(2.);
275 
276  glim.SetNpx(GetNumBins(vmx, 12.5));
277  glim.SetNpy(GetNumBins(vmy, 12.5));
278 
279  glim.SetTitle(title.c_str());
280 
281  TLegend l(gStyle->GetPadLeftMargin(), 1.-2.*gStyle->GetPadTopMargin(),
282  1.-gStyle->GetPadRightMargin(), 1.-gStyle->GetPadTopMargin());
283  l.SetNColumns(2);
284  l.SetTextSize(0.05);
285  l.SetBorderSize(0);
286 
287  TCanvas c;
288  c.cd();
289 
290  TLatex ltitle(c.GetLeftMargin(), 1.-0.5*c.GetTopMargin(),
291  "#font[62]{CMS}#scale[0.76]{#font[52]{ Supplementary}}");
292  TLatex rtitle(1.-c.GetRightMargin(), 1.-0.5*c.GetTopMargin(),
293  "#scale[0.8]{35.9 fb^{-1} (13 TeV)}");
294  ltitle.SetNDC();
295  rtitle.SetNDC();
296  ltitle.SetTextAlign(12);
297  rtitle.SetTextAlign(32);
298 
299  c.SetTopMargin(2.*c.GetTopMargin());
300  c.SetLogz();
301  glim.Draw("colz");
302 
303  TGraph cup = DrawContours(gup, 2, 2, 5, num_smooth_);
304  TGraph cdown = DrawContours(gdown, 2, 2, 5, num_smooth_);
305  TGraph cexp = DrawContours(gexp, 2, 1, 5, num_smooth_, 1.);
306  TGraph cobsup = DrawContours(gobsup, 1, 2, 5, num_smooth_);
307  TGraph cobsdown = DrawContours(gobsdown, 1, 2, 5, num_smooth_);
308  TGraph cobs = DrawContours(gobs, 1, 1, 5, num_smooth_, 1.);
309 
310  l.AddEntry(&cexp, "Expected", "l");
311  l.AddEntry(&cobs, "Observed", "l");
312 
313  l.Draw("same");
314 
315  ltitle.Draw("same");
316  rtitle.Draw("same");
317 
318  string filebase = model_+"_limit_scan";
319  if(num_smooth_>0){
320  filebase += "_smooth";
321  filebase += to_string(num_smooth_);
322  }
323 
324  c.Print((filebase+".pdf").c_str());
325 
326  TFile file((filebase+".root").c_str(), "recreate");
327  glim.GetHistogram()->Write((model_+"ObservedExcludedXsec").c_str());
328  cobs.Write((model_+"ObservedLimit").c_str());
329  cobsup.Write((model_+"ObservedLimitUp").c_str());
330  cobsdown.Write((model_+"ObservedLimitDown").c_str());
331  cexp.Write((model_+"ExpectedLimit").c_str());
332  cup.Write((model_+"ExpectedLimitUp").c_str());
333  cdown.Write((model_+"ExpectedLimitDown").c_str());
334  if(false){ // Significances not saved together with limits as per recommendations
335  hsigobs.Write("ObservedSignificance");
336  hsigexp.Write("ExpectedSignificance");
337  }
338  file.Close();
339  cout << "\nSaved limit curves in " << filebase << ".root\n" << endl;
340 }
341 
342 int GetNumBins(const vector<double> &pts, double width){
343  double pmin = *min_element(pts.cbegin(), pts.cend());
344  double pmax = *max_element(pts.cbegin(), pts.cend());
345  return max(1, min(500, static_cast<int>(ceil((pmax-pmin)/width))));
346 }
347 
348 void GetParticleNames(string &xparticle, string &yparticle){
349  if(model_=="T1tttt"){
350  xparticle = "#tilde{g}";
351  yparticle = "#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
352  }else if(model_=="T5tttt"){
353  xparticle = "#tilde{g}";
354  yparticle = "#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
355  }else if(model_=="T2tt"){
356  xparticle = "#tilde{g}";
357  yparticle = "#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
358  }else if(model_=="T6ttWW"){
359  xparticle = "sbottom";
360  yparticle = "chargino";
361  }else{
362  DBG(("Unknown model: "+model_));
363  xparticle = "#tilde{g}";
364  yparticle = "#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
365  }
366 }
367 
368 TLatex GetModelLabel(double x, double y){
369  string lsp = "#lower[-0.12]{#tilde{#chi}}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
370  string label = "";
371  if(model_=="T1tttt"){
372  label = "pp #rightarrow #tilde{g}#kern[0.3]{#tilde{g}}, #tilde{g} #rightarrow t#kern[0.4]{#bar{t}}#kern[0.4]{"+lsp+"}";
373  }else if(model_=="T5tttt"){
374  label = "#splitline{pp #rightarrow #tilde{g}#kern[0.3]{#tilde{g}}, #tilde{g} #rightarrow #tilde{t}_{1}t, #tilde{t}_{1} #rightarrow #bar{t}#kern[0.4]{"
375  +lsp+"}}{(m#kern[0.3]{_{#lower[-0.12]{#tilde{t}_{1}}}} - m#kern[0.12]{_{"+lsp+"}} = 175 GeV)}";
376  }else{
377  DBG(("Unknown model: "+model_));
378  label = "";
379  }
380  TLatex l(x, y, label.c_str());
381  l.SetNDC();
382  l.SetTextAlign(13);
383  l.SetTextSize(0.032);
384  return l;
385 }
386 
387 void Style(TGraph *g, int color, int style, float width){
388  g->SetLineColor(color);
389  g->SetLineStyle(style);
390  g->SetLineWidth(width);
391 }
392 
393 TGraph DrawContours(TGraph2D &g2, int color, int style, double width,
394  int n_smooth, double val){
395  TGraph graph;
396 
397  TList *l;
399  if(n_smooth>0){
400  TH2D *histo2d = g2.GetHistogram();
401  TH2D htemp("", "",
402  100, histo2d->GetXaxis()->GetXmin(), histo2d->GetXaxis()->GetXmax(),
403  100, histo2d->GetYaxis()->GetXmin(), histo2d->GetYaxis()->GetXmax());
404  for(int binx=1; binx<=htemp.GetNbinsX(); ++binx){
405  double x = htemp.GetXaxis()->GetBinCenter(binx);
406  for(int biny=1; biny<=htemp.GetNbinsY(); ++biny){
407  double y = htemp.GetYaxis()->GetBinCenter(biny);
408  double z = g2.Interpolate(x,y);
409  if(z!=0.){
410  htemp.SetBinContent(htemp.GetBin(binx, biny), z);
411  }
412  }
413  }
414 
415  for(int ind=0; ind<n_smooth; ++ind){
416  htemp.Smooth(1,"k5b");
417  }
418 
419  vector<double> vx, vy, vz;
420  double glu_lsp = 225;
421  for(int binx=1; binx<=htemp.GetNbinsX(); ++binx){
422  double x = htemp.GetXaxis()->GetBinCenter(binx);
423  for(int biny=1; biny<=htemp.GetNbinsY(); ++biny){
424  double y = htemp.GetYaxis()->GetBinCenter(biny);
425  double z = htemp.GetBinContent(htemp.GetBin(binx,biny));
426 
427  vx.push_back(x);
428  vy.push_back(y);
429  int thresh = glu_lsp+30;
430  if (model_=="T5tttt") thresh = glu_lsp+85;
431  if(x-y>thresh){
432  vz.push_back(z);
433  }else{
434  vz.push_back(g2.Interpolate(x,y));
435  }
436  }
437  }
438 
439  TGraph2D gsmooth("gsmooth", "Cross-Section Limit", vx.size(), &vx.at(0), &vy.at(0), &vz.at(0));
440  gsmooth.GetHistogram();
441  l = gsmooth.GetContourList(val);
442  } else {
443  g2.GetHistogram();
444  l = g2.GetContourList(val);
445  }
446  if(l == nullptr) return graph;
447  int max_points = -1;
448  for(int i = 0; i < l->GetSize(); ++i){
449  TGraph *g = static_cast<TGraph*>(l->At(i));
450  Style(g, color, style, width);
451  if(g == nullptr) continue;
452  int n_points = g->GetN();
453  if(n_points > max_points){
454  if(n_smooth>0) FixGraph(*g);
455  graph = *g;
456  max_points = n_points;
457  }
458  g->Draw("L same");
459  }
460 
461  graph.SetTitle(g2.GetTitle());
462  return graph;
463 }
464 
465 void FixGraph(TGraph &graph){
466  double glu_lsp = 225;
467  if(model_=="T5tttt") glu_lsp = 265.;
468  int np(graph.GetN());
469  double iniglu, endglu, inilsp, endlsp;
470 
471  graph.GetPoint(0, iniglu, inilsp);
472  graph.GetPoint(np-1, endglu, endlsp);
473 
474  // Reversing graph if printed towards decreasing mgluino
475  if(inilsp < endlsp) {
476  ReverseGraph(graph);
477  endglu = iniglu;
478  endlsp = inilsp;
479  }
480 
481  // Adding a point so that it goes down to mLSP = 0, but not for WZ,SOS
482  if(endlsp<30){
483  graph.SetPoint(graph.GetN(), endglu, 0);
484  np++;
485  }
486 
487  ReverseGraph(graph);
488  // Adding a point at mLSP = 0, and removing points beyond the diagonal
489  for(int point(0); point < np; point++){
490  double mglu, mlsp;
491  graph.GetPoint(point, mglu, mlsp);
492  if(mlsp > mglu-glu_lsp-5){
493  while(point <= graph.GetN() && point!=0) {
494  graph.RemovePoint(graph.GetN()-1);
495  np--;
496  }
497  break;
498  }
499  }
500 }
501 
502 void ReverseGraph(TGraph &graph){
503  int np(graph.GetN());
504  double mglu, mlsp;
505  vector<double> mglus, mlsps;
506  for(int point(np-1); point >= 0; point--){
507  graph.GetPoint(point, mglu, mlsp);
508  mglus.push_back(mglu);
509  mlsps.push_back(mlsp);
510  }
511  for(int point(0); point < np; point++)
512  graph.SetPoint(point, mglus[point], mlsps[point]);
513 }
514 
515 void SetupColors(){
516  const unsigned num = 5;
517  const int bands = 255;
518  int colors[bands];
519  double stops[num] = {0.00, 0.34, 0.61, 0.84, 1.00};
520  double red[num] = {0.50, 0.50, 1.00, 1.00, 1.00};
521  double green[num] = {0.50, 1.00, 1.00, 0.60, 0.50};
522  double blue[num] = {1.00, 1.00, 0.50, 0.40, 0.50};
523  /*const unsigned num = 6;
524  double red[num] = {1.,0.,0.,0.,1.,1.};
525  double green[num] = {0.,0.,1.,1.,1.,0.};
526  double blue[num] = {1.,1.,1.,0.,0.,0.};
527  double stops[num] = {0.,0.2,0.4,0.6,0.8,1.};*/
528  int fi = TColor::CreateGradientColorTable(num,stops,red,green,blue,bands);
529  for(int i = 0; i < bands; ++i){
530  colors[i] = fi+i;
531  }
532  gStyle->SetNumberContours(bands);
533  gStyle->SetPalette(bands, colors);
534 }
535 
537  const unsigned num = 3;
538  const int bands = 255;
539  int colors[bands];
540  double stops[num] = {0.0, 0.5, 1.0};
541  double red[num] = {0.0, 1.0, 1.0};
542  double green[num] = {0.0, 1.0, 0.0};
543  double blue[num] = {1.0, 1.0, 0.0};
544  int fi = TColor::CreateGradientColorTable(num,stops,red,green,blue,bands);
545  for(int i = 0; i < bands; ++i){
546  colors[i] = fi+i;
547  }
548  gStyle->SetNumberContours(bands);
549  gStyle->SetPalette(bands, colors);
550 }
551 
552 void GetOptions(int argc, char *argv[]){
553  while(true){
554  static struct option long_options[] = {
555  {"num_smooth", required_argument, 0, 's'},
556  {"model", required_argument, 0, 'm'},
557  {"file", required_argument, 0, 'f'},
558  {0, 0, 0, 0}
559  };
560 
561  char opt = -1;
562  int option_index;
563  opt = getopt_long(argc, argv, "f:m:s:", long_options, &option_index);
564  if( opt == -1) break;
565 
566  string optname;
567  switch(opt){
568  case 's':
569  num_smooth_ = atoi(optarg);
570  break;
571  case 'm':
572  model_ = optarg;
573  break;
574  case 'f':
575  filename_ = optarg;
576  break;
577  case 0:
578  optname = long_options[option_index].name;
579  if(optname == ""){
580  printf("Bad option! Found option name %s\n", optname.c_str());
581  }else{
582  printf("Bad option! Found option name %s\n", optname.c_str());
583  }
584  break;
585  default:
586  printf("Bad option! getopt_long returned character code 0%o\n", opt);
587  break;
588  }
589  }
590 }
void Style(TGraph *g, int color, int style, float width)
Definition: limit_scan.cxx:387
#define DBG(x)
Definition: utilities.hpp:16
void GetParticleNames(string &xparticle, string &yparticle)
Definition: limit_scan.cxx:348
TH2D MakeObservedSignificancePlot(vector< double > vmx, vector< double > vmy, vector< double > vobs)
Definition: limit_scan.cxx:109
void setDefaultStyle()
Definition: styles.cpp:36
int GetNumBins(const vector< double > &pts, double width)
Definition: limit_scan.cxx:342
STL namespace.
bool Contains(const std::string &str, const std::string &pat)
Definition: utilities.cpp:26
void ReverseGraph(TGraph &graph)
Definition: limit_scan.cxx:502
void SetupColors()
Definition: limit_scan.cxx:515
TLatex GetModelLabel(double x, double y)
Definition: limit_scan.cxx:368
void ReadPoints(vector< double > &vmx, vector< double > &vmy, vector< double > &vxsec, vector< double > &vobs, vector< double > &vobsup, vector< double > &vobsdown, vector< double > &vexp, vector< double > &vup, vector< double > &vdown, vector< double > &vsigobs, vector< double > &vsigexp)
Definition: limit_scan.cxx:57
#define ERROR(x)
Definition: utilities.hpp:15
void FixGraph(TGraph &graph)
Definition: limit_scan.cxx:465
void signalCrossSection(int glu_mass, float &xsec, float &xsec_unc)
def style(h, width, style, color)
void GetOptions(int argc, char *argv[])
Definition: limit_scan.cxx:552
void MakeLimitPlot(vector< double > vmx, vector< double > vmy, vector< double > vlim, vector< double > vobs, vector< double > vobsup, vector< double > vobsdown, vector< double > vexp, vector< double > vup, vector< double > vdown, const TH2D &hsigobs, const TH2D &hsigexp)
Definition: limit_scan.cxx:248
TGraph DrawContours(TGraph2D &g2, int color, int style, double width, int n_smooth, double val)
Definition: limit_scan.cxx:393
TH2D MakeExpectedSignificancePlot(vector< double > vmx, vector< double > vmy, vector< double > vobs)
Definition: limit_scan.cxx:190
int main(int argc, char *argv[])
Definition: limit_scan.cxx:34
tuple mlsp
Definition: change_r.py:18
tuple mglu
Definition: change_r.py:17
void SetupSignedColors()
Definition: limit_scan.cxx:536