CMS 3D CMS Logo

Functions

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

#include "assert.h"
#include "math.h"
#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 19 of file ExclusionBandPlot.cc.

References i.

                                                            :
                    StatisticalPlot(name,title,false){

    // Prepare errorbars
    double* y_down_bars2 = new double[n_points];
    double* y_down_bars1 = new double[n_points];
    double* y_up_bars1 = new double[n_points];
    double* y_up_bars2 = new double[n_points];

    for (int i=0;i<n_points;++i){
        y_down_bars2[i]=y_vals[i]-y_down_points2[i];
        y_down_bars1[i]=y_vals[i]-y_down_points1[i];
        y_up_bars2[i]=y_up_points2[i]-y_vals[i];
        y_up_bars1[i]=y_up_points1[i]-y_vals[i];
        }

    // bline
    m_y_line_graph = new TGraph(n_points, x_vals, y_vals);
    m_y_line_graph->SetLineWidth(2);
    m_y_line_graph->SetLineStyle(2);
    m_y_line_graph->SetFillColor(kWhite);



    // y band 1 sigma
    m_y_band_graph_1sigma = new TGraphAsymmErrors(n_points,
                                                  x_vals,
                                                  y_vals,
                                                  0,
                                                  0,
                                                  y_down_bars1,
                                                  y_up_bars1);
    m_y_band_graph_1sigma->SetFillColor(kGreen);
    m_y_band_graph_1sigma->SetLineColor(kGreen);
    m_y_band_graph_1sigma->SetMarkerColor(kGreen);

    // y band 2 sigma
    m_y_band_graph_2sigma = new TGraphAsymmErrors(n_points,
                                                  x_vals,
                                                  y_vals,
                                                  0,
                                                  0,
                                                  y_down_bars2,
                                                  y_up_bars2);
    m_y_band_graph_2sigma->SetFillColor(kYellow);
    m_y_band_graph_2sigma->SetFillColor(kYellow);
    m_y_band_graph_2sigma->SetLineColor(kYellow);
    m_y_band_graph_2sigma->SetMarkerColor(kYellow);
    m_y_band_graph_2sigma->GetYaxis()->SetTitle("#sigma/#sigma_{SM}");

    // Line for 1
    m_one_line = new TLine(m_y_line_graph->GetXaxis()->GetXmin(),1,
                           m_y_line_graph->GetXaxis()->GetXmax(),1);

    // The legend 

    m_legend = new TLegend(0.60,0.78,0.98,0.98);
    m_legend->SetName("SM exclusion");
    m_legend->AddEntry(m_y_band_graph_1sigma,"#pm 1#sigma");
    m_legend->AddEntry(m_y_band_graph_2sigma,"#pm 2#sigma");
    m_legend->AddEntry(m_y_line_graph,title);

    m_legend->SetFillColor(0);

    delete[] y_down_bars2;
    delete[] y_down_bars1;
    delete[] y_up_bars2;
    delete[] y_up_bars1;

    }