CombineHarvester
Plotting_Contours.h File Reference
#include "Plotting.h"
#include <iostream>
#include <math.h>
#include "TGraph.h"
#include "TTree.h"
#include "TCut.h"
#include "TROOT.h"
#include "TH2F.h"
#include "TMath.h"
#include "TPad.h"
#include "TStyle.h"
#include "TMarker.h"
#include "TFile.h"
#include "TCanvas.h"
#include "TLegend.h"
#include "TLatex.h"

Go to the source code of this file.

Functions

TGraph * bestFit (TTree *t, TString x, TString y, TCut cut)
 
TH2 * treeToHist2D (TTree *t, TString x, TString y, TString name, TCut cut, double xmin, double xmax, double ymin, double ymax, int xbins, int ybins)
 
TList * contourFromTH2 (TH2 *h2in, double threshold, int minPoints=20)
 
TH2D * frameTH2D (TH2D *in, double threshold)
 
void styleMultiGraph (TList *tmg, int lineColor, int lineWidth, int lineStyle)
 
void styleMultiGraphMarker (TList *tmg, int markerColor, int markerSize, int markerStyle)
 
void drawContours (TPad *pad, TString file, TString x_title, TString y_title, TLegend *leg)
 
void contour2D (TString filein, TString fileout, TString xvar, int xbins, float xmin, float xmax, TString yvar, int ybins, float ymin, float ymax, TString name="contour2D")
 Make a 2D contour plot from the output of MultiDimFit. More...
 

Function Documentation

◆ bestFit()

TGraph * bestFit ( TTree *  t,
TString  x,
TString  y,
TCut  cut 
)

Definition at line 100 of file Plotting_Contours.h.

◆ treeToHist2D()

TH2 * treeToHist2D ( TTree *  t,
TString  x,
TString  y,
TString  name,
TCut  cut,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
int  xbins,
int  ybins 
)

Definition at line 117 of file Plotting_Contours.h.

◆ contourFromTH2()

TList * contourFromTH2 ( TH2 *  h2in,
double  threshold,
int  minPoints = 20 
)

Definition at line 140 of file Plotting_Contours.h.

◆ frameTH2D()

TH2D * frameTH2D ( TH2D *  in,
double  threshold 
)

Definition at line 182 of file Plotting_Contours.h.

◆ styleMultiGraph()

void styleMultiGraph ( TList *  tmg,
int  lineColor,
int  lineWidth,
int  lineStyle 
)

◆ styleMultiGraphMarker()

void styleMultiGraphMarker ( TList *  tmg,
int  markerColor,
int  markerSize,
int  markerStyle 
)

◆ drawContours()

void drawContours ( TPad *  pad,
TString  file,
TString  x_title,
TString  y_title,
TLegend *  leg 
)

Definition at line 260 of file Plotting_Contours.h.

◆ contour2D()

void contour2D ( TString  filein,
TString  fileout,
TString  xvar,
int  xbins,
float  xmin,
float  xmax,
TString  yvar,
int  ybins,
float  ymin,
float  ymax,
TString  name = "contour2D" 
)

Make a 2D contour plot from the output of MultiDimFit.

Inputs:

  • gFile should point to the TFile containing the 'limit' TTree
  • xvar should be the variable to use on the X axis, with xbins bins in the [xmin, xmax] range
  • yvar should be the variable to use on the Y axis, with ybins bins in the [ymin, ymax] range
  • (smx, smy) are the coordinates at which to put a diamond representing the SM expectation
  • if fOut is not null, then the output objects will be saved to fOut:
    • the 2D histogram will be saved as a TH2 with name name+"_h2d"
    • the 68% CL contour will be saved as a TList of TGraphs with name name+"_c68"
    • the 95% CL contour will be saved as a TList of TGraphs with name name+"_c95"
    • the 99.7% CL contour will be saved as a TList of TGraphs with name name+"_c997"
    • the best fit point will be saved as a TGraph with name name+"_best"

Notes:

  • it's up to you to make sure that the binning you use for this plot matches the one used when running MultiDimFit (but you can just plot a subset of the points; e.g. if you had 100x100 points in [-1,1]x[-1,1] you can make a 50x50 plot for [0,1]x[0,1])
  • the 99.7 contour is not plotted by default
  • the SM marker is not saved

Definition at line 69 of file Plotting_Contours.h.