CMS 3D CMS Logo

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

Go to the source code of this file.

Functions

 ClassImp (LEPBandPlot) LEPBandPlot
 Constructor. More...
 

Function Documentation

ClassImp ( LEPBandPlot  )

Constructor.

Definition at line 18 of file LEPBandPlot.cc.

References mps_fire::i.

30  :
31  StatisticalPlot(name,title,false){
32 
33  // bkg hypothesis line
34  m_b_line_graph = new TGraph(n_points, x_vals, b_vals);
35  m_b_line_graph->SetLineWidth(2);
36  m_b_line_graph->SetLineStyle(2);
37  m_b_line_graph->SetFillColor(kWhite);
38 
39 
40  // bkg hypothesis band 1 sigma
41  m_b_band_graph_1sigma = new TGraphErrors(n_points, x_vals, b_vals ,nullptr, b_rms);
42  m_b_band_graph_1sigma->SetFillColor(kGreen);
43  m_b_band_graph_1sigma->SetLineColor(kGreen);
44  m_b_band_graph_1sigma->SetMarkerColor(kGreen);
45 
46  // Make the band 2 times wider:
47  double* b_2rms = new double[n_points];
48  for (int i=0;i<n_points;++i)
49  b_2rms[i]=2*b_rms[i];
50 
51  // bkg hypothesis band 2 sigma
52  m_b_band_graph_2sigma = new TGraphErrors(n_points, x_vals, b_vals ,nullptr, b_2rms);
53  m_b_band_graph_2sigma->SetFillColor(kYellow);
54  m_b_band_graph_2sigma->SetFillColor(kYellow);
55  m_b_band_graph_2sigma->SetLineColor(kYellow);
56  m_b_band_graph_2sigma->SetMarkerColor(kYellow);
57  m_b_band_graph_2sigma->GetYaxis()->SetTitle("-2lnQ");
58 
59  // sig+bkg hypothesis line
60  m_sb_line_graph = new TGraph(n_points, x_vals, sb_vals);
61  m_sb_line_graph->SetLineWidth(2);
62  m_sb_line_graph->SetLineStyle(4);
63  m_sb_line_graph->SetLineColor(kRed);
64  m_sb_line_graph->SetFillColor(kWhite);
65 
66  // The points of the data
67  if (exp_vals!=nullptr){
68  m_data_line_graph = new TGraph(n_points, x_vals, exp_vals);
69  m_data_line_graph->SetLineWidth(2);
70  m_data_line_graph->SetFillColor(kWhite);
71  }
72  else
73  m_data_line_graph =nullptr;
74 
75 
76  // Line for 0
77  m_zero_line = new TLine(m_b_line_graph->GetXaxis()->GetXmin(),0,
78  m_b_line_graph->GetXaxis()->GetXmax(),0);
79 
80  // The legend
81 
82  m_legend = new TLegend(0.75,0.78,0.98,0.98);
83  m_legend->SetName("Confidence Levels");
84  m_legend->AddEntry(m_b_band_graph_1sigma,"-2lnQ #pm 1#sigma");
85  m_legend->AddEntry(m_b_band_graph_2sigma,"-2lnQ #pm 2#sigma");
86  m_legend->AddEntry(m_b_line_graph,"-2lnQ_{B}");
87  m_legend->AddEntry(m_sb_line_graph,"-2lnQ_{SB}");
88  if (m_data_line_graph!=nullptr)
89  m_legend->AddEntry(m_data_line_graph,"-2lnQ_{Obs}");
90 
91  m_legend->SetFillColor(0);
92 
93  delete[] b_2rms;
94  }
StatisticalPlot: the base class for the statistical plots.