ExclusionBandPlot: plot a la tevatron for SM eclusion in function of mass. More...
#include <ExclusionBandPlot.h>
Public Member Functions | |
void | draw (const char *options="") |
Draw on canvas. | |
void | dumpToFile (const char *RootFileName, const char *options) |
All the objects are written to rootfile. | |
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 | print (const char *options="") |
Print the relevant information. | |
void | setTitle (const char *title) |
Set the title of the plot. | |
void | setXaxisTitle (const char *title) |
Set the title of the x axis. | |
void | setYaxisTitle (const char *title) |
Set the title of the x axis. | |
~ExclusionBandPlot () | |
Destructor. | |
Private Attributes | |
TLegend * | m_legend |
The legend. | |
TLine * | m_one_line |
The line at 1. | |
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. |
ExclusionBandPlot: plot a la tevatron for SM eclusion in function of mass.
Yet another band plot, this time for sm exclusion, following the examples of the Tevatron Higgs WG.
Definition at line 29 of file ExclusionBandPlot.h.
ExclusionBandPlot::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.
ExclusionBandPlot::~ExclusionBandPlot | ( | ) |
Destructor.
Definition at line 103 of file ExclusionBandPlot.cc.
References m_legend, m_one_line, m_y_band_graph_1sigma, m_y_band_graph_2sigma, and m_y_line_graph.
{ delete m_y_line_graph; delete m_y_band_graph_1sigma; delete m_y_band_graph_2sigma; delete m_one_line; delete m_legend; }
void ExclusionBandPlot::draw | ( | const char * | options = "" | ) | [virtual] |
Draw on canvas.
Implements StatisticalPlot.
Definition at line 148 of file ExclusionBandPlot.cc.
References StatisticalPlot::getCanvas(), m_legend, m_one_line, m_y_band_graph_1sigma, m_y_band_graph_2sigma, m_y_line_graph, and StatisticalPlot::setCanvas().
{ setCanvas(new TCanvas(GetName(),GetTitle())); getCanvas()->cd(); getCanvas()->SetGridx(); getCanvas()->SetGridy(); TString opt(options); // Bands if (opt.Contains("4")==0){ m_y_band_graph_2sigma->Draw("A3"); m_y_band_graph_1sigma->Draw("3"); } else{ m_y_band_graph_2sigma->Draw("A4"); m_y_band_graph_1sigma->Draw("4"); } // Lines if (opt.Contains("4")==0){ m_y_line_graph->Draw("L"); } else{ m_y_line_graph->Draw("C"); } m_one_line->Draw("Same"); // Legend m_legend->Draw("Same"); }
void ExclusionBandPlot::dumpToFile | ( | const char * | RootFileName, |
const char * | options | ||
) | [virtual] |
All the objects are written to rootfile.
Implements StatisticalPlot.
Definition at line 184 of file ExclusionBandPlot.cc.
References m_legend, m_y_band_graph_1sigma, m_y_band_graph_2sigma, m_y_line_graph, and indexGen::ofile.
{ TFile ofile(RootFileName,options); ofile.cd(); // Bands m_y_band_graph_2sigma->Write("band_2sigma"); m_y_band_graph_1sigma->Draw("band_1sigma"); // Lines m_y_line_graph->Draw("line"); // Legend m_legend->Draw("IamTheLegend"); ofile.Close(); }
void ExclusionBandPlot::print | ( | const char * | options = "" | ) | [virtual] |
Print the relevant information.
Implements StatisticalPlot.
Definition at line 205 of file ExclusionBandPlot.cc.
References gather_cfg::cout.
{ std::cout << "\nExclusionBandPlot object " << GetName() << ":\n"; }
void ExclusionBandPlot::setTitle | ( | const char * | title | ) |
Set the title of the plot.
The title is here set only for the plot of the 2sigma band plot. Indeed its axes will be the only one to be drawn.
Definition at line 142 of file ExclusionBandPlot.cc.
References m_y_band_graph_2sigma.
{ m_y_band_graph_2sigma->SetTitle(title); }
void ExclusionBandPlot::setXaxisTitle | ( | const char * | title | ) |
Set the title of the x axis.
The title of the x axis is here set only for the plot of the 2sigma band plot. Indeed its axes will be the only one to be drawn.
Definition at line 122 of file ExclusionBandPlot.cc.
References m_y_band_graph_2sigma.
{ m_y_band_graph_2sigma->GetXaxis()->SetTitle(title); }
void ExclusionBandPlot::setYaxisTitle | ( | const char * | title | ) |
Set the title of the x axis.
The title of the y axis is here set only for the plot of the 2sigma band plot. Indeed its axes will be the only one to be drawn.
Definition at line 132 of file ExclusionBandPlot.cc.
References m_y_band_graph_2sigma.
{ m_y_band_graph_2sigma->GetYaxis()->SetTitle(title); }
TLegend* ExclusionBandPlot::m_legend [private] |
The legend.
Definition at line 81 of file ExclusionBandPlot.h.
Referenced by draw(), dumpToFile(), and ~ExclusionBandPlot().
TLine* ExclusionBandPlot::m_one_line [private] |
The line at 1.
Definition at line 78 of file ExclusionBandPlot.h.
Referenced by draw(), and ~ExclusionBandPlot().
TGraph* ExclusionBandPlot::m_y_band_graph_1sigma [private] |
The band 1 sigma.
Definition at line 72 of file ExclusionBandPlot.h.
Referenced by draw(), dumpToFile(), and ~ExclusionBandPlot().
TGraph* ExclusionBandPlot::m_y_band_graph_2sigma [private] |
The band 2 sigma.
Definition at line 75 of file ExclusionBandPlot.h.
Referenced by draw(), dumpToFile(), setTitle(), setXaxisTitle(), setYaxisTitle(), and ~ExclusionBandPlot().
TGraph* ExclusionBandPlot::m_y_line_graph [private] |
The line.
Definition at line 69 of file ExclusionBandPlot.h.
Referenced by draw(), dumpToFile(), and ~ExclusionBandPlot().