CMS 3D CMS Logo

Functions
ExclusionBandPlot.cc File Reference
#include <cassert>
#include <cmath>
#include "ExclusionBandPlot.h"
#include "TGraphAsymmErrors.h"
#include "TStyle.h"
#include "TAxis.h"

Go to the source code of this file.

Functions

 ClassImp (ExclusionBandPlot) ExclusionBandPlot
 

Function Documentation

ClassImp ( ExclusionBandPlot  )

Definition at line 18 of file ExclusionBandPlot.cc.

References mps_fire::i.

29  :
30  StatisticalPlot(name,title,false){
31 
32  // Prepare errorbars
33  double* y_down_bars2 = new double[n_points];
34  double* y_down_bars1 = new double[n_points];
35  double* y_up_bars1 = new double[n_points];
36  double* y_up_bars2 = new double[n_points];
37 
38  for (int i=0;i<n_points;++i){
39  y_down_bars2[i]=y_vals[i]-y_down_points2[i];
40  y_down_bars1[i]=y_vals[i]-y_down_points1[i];
41  y_up_bars2[i]=y_up_points2[i]-y_vals[i];
42  y_up_bars1[i]=y_up_points1[i]-y_vals[i];
43  }
44 
45  // bline
46  m_y_line_graph = new TGraph(n_points, x_vals, y_vals);
47  m_y_line_graph->SetLineWidth(2);
48  m_y_line_graph->SetLineStyle(2);
49  m_y_line_graph->SetFillColor(kWhite);
50 
51 
52 
53  // y band 1 sigma
54  m_y_band_graph_1sigma = new TGraphAsymmErrors(n_points,
55  x_vals,
56  y_vals,
57  0,
58  0,
59  y_down_bars1,
60  y_up_bars1);
61  m_y_band_graph_1sigma->SetFillColor(kGreen);
62  m_y_band_graph_1sigma->SetLineColor(kGreen);
63  m_y_band_graph_1sigma->SetMarkerColor(kGreen);
64 
65  // y band 2 sigma
66  m_y_band_graph_2sigma = new TGraphAsymmErrors(n_points,
67  x_vals,
68  y_vals,
69  0,
70  0,
71  y_down_bars2,
72  y_up_bars2);
73  m_y_band_graph_2sigma->SetFillColor(kYellow);
74  m_y_band_graph_2sigma->SetFillColor(kYellow);
75  m_y_band_graph_2sigma->SetLineColor(kYellow);
76  m_y_band_graph_2sigma->SetMarkerColor(kYellow);
77  m_y_band_graph_2sigma->GetYaxis()->SetTitle("#sigma/#sigma_{SM}");
78 
79  // Line for 1
80  m_one_line = new TLine(m_y_line_graph->GetXaxis()->GetXmin(),1,
81  m_y_line_graph->GetXaxis()->GetXmax(),1);
82 
83  // The legend
84 
85  m_legend = new TLegend(0.60,0.78,0.98,0.98);
86  m_legend->SetName("SM exclusion");
87  m_legend->AddEntry(m_y_band_graph_1sigma,"#pm 1#sigma");
88  m_legend->AddEntry(m_y_band_graph_2sigma,"#pm 2#sigma");
89  m_legend->AddEntry(m_y_line_graph,title);
90 
91  m_legend->SetFillColor(0);
92 
93  delete[] y_down_bars2;
94  delete[] y_down_bars1;
95  delete[] y_up_bars2;
96  delete[] y_up_bars1;
97 
98  }
StatisticalPlot: the base class for the statistical plots.