CMS 3D CMS Logo

Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/PhysicsTools/RooStatsCms/src/LEPBandPlot.cc File Reference

#include "assert.h"
#include "math.h"
#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.

Function Documentation

ClassImp ( LEPBandPlot  )

Constructor.

Definition at line 19 of file LEPBandPlot.cc.

References i, and NULL.

                                          :
    StatisticalPlot(name,title,false){

    // bkg hypothesis line
    m_b_line_graph = new TGraph(n_points, x_vals, b_vals);
    m_b_line_graph->SetLineWidth(2);
    m_b_line_graph->SetLineStyle(2);
    m_b_line_graph->SetFillColor(kWhite);


    // bkg hypothesis band 1 sigma
    m_b_band_graph_1sigma = new TGraphErrors(n_points, x_vals, b_vals ,0, b_rms);
    m_b_band_graph_1sigma->SetFillColor(kGreen);
    m_b_band_graph_1sigma->SetLineColor(kGreen);
    m_b_band_graph_1sigma->SetMarkerColor(kGreen);

    // Make the band 2 times wider:
    double* b_2rms = new double[n_points];
    for (int i=0;i<n_points;++i)
        b_2rms[i]=2*b_rms[i];

    // bkg hypothesis band 2 sigma
    m_b_band_graph_2sigma = new TGraphErrors(n_points, x_vals, b_vals ,0, b_2rms);
    m_b_band_graph_2sigma->SetFillColor(kYellow);
    m_b_band_graph_2sigma->SetFillColor(kYellow);
    m_b_band_graph_2sigma->SetLineColor(kYellow);
    m_b_band_graph_2sigma->SetMarkerColor(kYellow);
    m_b_band_graph_2sigma->GetYaxis()->SetTitle("-2lnQ");

    // sig+bkg hypothesis line
    m_sb_line_graph = new TGraph(n_points, x_vals, sb_vals);
    m_sb_line_graph->SetLineWidth(2);
    m_sb_line_graph->SetLineStyle(4);
    m_sb_line_graph->SetLineColor(kRed);
    m_sb_line_graph->SetFillColor(kWhite);

    // The points of the data
    if (exp_vals!=0){
        m_data_line_graph = new TGraph(n_points, x_vals, exp_vals);
        m_data_line_graph->SetLineWidth(2);
        m_data_line_graph->SetFillColor(kWhite);
        }
    else
        m_data_line_graph =NULL;


    // Line for 0
    m_zero_line = new TLine(m_b_line_graph->GetXaxis()->GetXmin(),0,
                            m_b_line_graph->GetXaxis()->GetXmax(),0);

    // The legend 

    m_legend = new TLegend(0.75,0.78,0.98,0.98);
    m_legend->SetName("Confidence Levels");
    m_legend->AddEntry(m_b_band_graph_1sigma,"-2lnQ #pm 1#sigma");
    m_legend->AddEntry(m_b_band_graph_2sigma,"-2lnQ #pm 2#sigma");
    m_legend->AddEntry(m_b_line_graph,"-2lnQ_{B}");
    m_legend->AddEntry(m_sb_line_graph,"-2lnQ_{SB}");
    if (m_data_line_graph!=NULL)
        m_legend->AddEntry(m_data_line_graph,"-2lnQ_{Obs}");

    m_legend->SetFillColor(0);

    delete[] b_2rms;
    }