6 #if (defined (STANDALONE) or defined (__CINT__) ) 11 #include "TGraphAsymmErrors.h" 17 #if (defined (STANDALONE) or defined (__CINT__) ) 27 double* y_down_points1,
29 double* y_down_points2):
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];
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];
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);
54 m_y_band_graph_1sigma =
new TGraphAsymmErrors(n_points,
61 m_y_band_graph_1sigma->SetFillColor(kGreen);
62 m_y_band_graph_1sigma->SetLineColor(kGreen);
63 m_y_band_graph_1sigma->SetMarkerColor(kGreen);
66 m_y_band_graph_2sigma =
new TGraphAsymmErrors(n_points,
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}");
80 m_one_line =
new TLine(m_y_line_graph->GetXaxis()->GetXmin(),1,
81 m_y_line_graph->GetXaxis()->GetXmax(),1);
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);
91 m_legend->SetFillColor(0);
93 delete[] y_down_bars2;
94 delete[] y_down_bars1;
149 setCanvas(
new TCanvas(GetName(),GetTitle()));
155 TString opt(options);
157 if (opt.Contains(
"4")==0){
167 if (opt.Contains(
"4")==0){
185 TFile
ofile(RootFileName,options);
205 std::cout <<
"\nExclusionBandPlot object " << GetName() <<
":\n";
TGraph * m_y_band_graph_1sigma
The band 1 sigma.
TGraph * m_y_band_graph_2sigma
The band 2 sigma.
TGraph * m_y_line_graph
The line.
void setCanvas(TCanvas *new_canvas)
Set the canvas.
void setTitle(const char *title)
Set the title of the plot.
void dumpToFile(const char *RootFileName, const char *options)
All the objects are written to rootfile.
~ExclusionBandPlot()
Destructor.
ExclusionBandPlot(const char *name, const char *title, const int n_points, double *x_vals, double *y_vals, double *y_up_bars1, double *y_down_bars1, double *y_up_bars2, double *y_down_bars2)
Constructor.
void setXaxisTitle(const char *title)
Set the title of the x axis.
StatisticalPlot: the base class for the statistical plots.
TLegend * m_legend
The legend.
void setYaxisTitle(const char *title)
Set the title of the x axis.
void draw(const char *options="")
Draw on canvas.
ClassImp(ExclusionBandPlot) ExclusionBandPlot
ExclusionBandPlot: plot a la tevatron for SM eclusion in function of mass.
TLine * m_one_line
The line at 1.
TCanvas * getCanvas()
Get the canvas.
void print(const char *options="")
Print the relevant information.