ra4_stats  0341147a0dc35f80f4e12c6003afb76a38e2ed6e
Namespaces | Functions | Variables
extract_yields.cxx File Reference
#include "extract_yields.hpp"
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <initializer_list>
#include <stdexcept>
#include <getopt.h>
#include "TFile.h"
#include "TLine.h"
#include "TCanvas.h"
#include "TPad.h"
#include "TLegend.h"
#include "TColor.h"
#include "TH2D.h"
#include "TStyle.h"
#include "TLatex.h"
#include "RooArgList.h"
#include "RooArgSet.h"
#include "RooRealVar.h"
#include "RooAbsData.h"
#include "RooDataSet.h"
#include "RooProdPdf.h"
#include "RooNLLVar.h"
#include "RooMinuit.h"
#include "utilities.hpp"
#include "styles.hpp"

Go to the source code of this file.

Namespaces

 anonymous_namespace{extract_yields.cxx}
 

Functions

string anonymous_namespace{extract_yields.cxx}::file_wspace ("")
 
bool anonymous_namespace{extract_yields.cxx}::table_clean (false)
 
bool anonymous_namespace{extract_yields.cxx}::r4_only (false)
 
bool anonymous_namespace{extract_yields.cxx}::show_exp_sig (false)
 
int main (int argc, char *argv[])
 
void RunFit (const string &path)
 
string GetSignalName (const RooWorkspace &w)
 
string TexFriendly (const string &s)
 
void PrintDebug (RooWorkspace &w, const RooFitResult &f, const string &file_name)
 
void PrintTable (RooWorkspace &w, const RooFitResult &f, const string &file_name)
 
double GetMCYield (const RooWorkspace &w, const string &bin_name, const string &prc_name)
 
double GetMCTotal (const RooWorkspace &w, const string &bin_name)
 
double GetMCTotalErr (RooWorkspace &w, const RooFitResult &f, const string &bin_name)
 
double GetBkgPred (const RooWorkspace &w, const string &bin_name)
 
double GetBkgPredErr (RooWorkspace &w, const RooFitResult &f, const string &bin_name)
 
double GetSigPred (const RooWorkspace &w, const string &bin_name)
 
double GetSigPredErr (RooWorkspace &w, const RooFitResult &f, const string &bin_name)
 
double GetTotPred (const RooWorkspace &w, const string &bin_name)
 
double GetTotPredErr (RooWorkspace &w, const RooFitResult &f, const string &bin_name)
 
double GetObserved (const RooWorkspace &w, const string &bin_name)
 
double GetKappaNoSys (const RooWorkspace &w, const string &bin_name)
 
double GetKappaNoSysErr (RooWorkspace &w, const RooFitResult &f, const string &bin_name)
 
double GetKappaSys (const RooWorkspace &w, const string &bin_name)
 
double GetKappaSysErr (RooWorkspace &w, const RooFitResult &f, const string &bin_name)
 
double GetLambda (const RooWorkspace &w, const string &bin_name)
 
double GetLambdaErr (RooWorkspace &w, const RooFitResult &f, const string &bin_name)
 
RooRealVar * SetVariables (RooWorkspace &w, const RooFitResult &f)
 
void MakeYieldPlot (RooWorkspace &w, const RooFitResult &f, const string &file_name, bool linear)
 
vector< string > GetVarNames (const RooWorkspace &w)
 
vector< string > GetFuncNames (const RooWorkspace &w)
 
void ManuallyAddBins (const RooWorkspace &w, vector< string > &names)
 
vector< string > GetBinNames (const RooWorkspace &w, bool r4_only_local)
 
vector< string > GetPlainBinNames (const RooWorkspace &w)
 
vector< string > GetProcessNames (const RooWorkspace &w)
 
vector< vector< double > > GetComponentYields (const RooWorkspace &w, const vector< string > &bin_names, const vector< string > &prc_names)
 
vector< TH1D > MakeBackgroundHistos (const vector< vector< double > > &yields, const vector< string > &bin_names, const vector< string > &prc_names)
 
TH1D MakeExpSignal (RooWorkspace &w, const vector< string > &bin_names)
 
TH1D MakeTotalHisto (RooWorkspace &w, const RooFitResult &f, const vector< string > &bin_names)
 
TH1D MakeObserved (const RooWorkspace &w, const vector< string > &bin_names)
 
void SetBounds (TH1D &a, TH1D &b, std::vector< TH1D > &cs)
 
double GetMaximum (const TH1D &a, const TH1D &b, const vector< TH1D > &cs)
 
double GetMinimum (const TH1D &a, const TH1D &b, const vector< TH1D > &cs)
 
double GetMaximum (const TH1D &h, double y)
 
double GetMinimum (const TH1D &h, double y)
 
TGraphErrors MakeErrorBand (const TH1D &h)
 
TGraphErrors MakeRatio (const TH1D &num, const TH1D &den)
 
string StripPath (const string &full_path)
 
void MakeCorrectionPlot (RooWorkspace &w, const RooFitResult &f, const string &file_name)
 
void MakeCovarianceMatrix (RooWorkspace &w, const RooFitResult &f, string covar_file_name)
 
double GetError (const RooAbsReal &var, const RooFitResult &f)
 
string PrettyBinName (string name)
 
void GetOptionsExtract (int argc, char *argv[])
 

Variables

bool anonymous_namespace{extract_yields.cxx}::do_global = false
 

Function Documentation

vector<string> GetBinNames ( const RooWorkspace &  w,
bool  r4_only_local 
)

Definition at line 832 of file extract_yields.cxx.

References Append(), Contains(), GetFuncNames(), and scan_aggregate::name.

Referenced by MakeCorrectionPlot(), and MakeYieldPlot().

double GetBkgPred ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 353 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

double GetBkgPredErr ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  bin_name 
)

Definition at line 373 of file extract_yields.cxx.

References Contains(), GetError(), and scan_aggregate::name.

Referenced by PrintTable().

vector<vector<double> > GetComponentYields ( const RooWorkspace &  w,
const vector< string > &  bin_names,
const vector< string > &  prc_names 
)

Definition at line 882 of file extract_yields.cxx.

Referenced by MakeYieldPlot().

double GetError ( const RooAbsReal &  var,
const RooFitResult &  f 
)
vector<string> GetFuncNames ( const RooWorkspace &  w)

Definition at line 796 of file extract_yields.cxx.

References Append(), and scan_aggregate::name.

Referenced by GetBinNames(), GetPlainBinNames(), PrintDebug(), and SetVariables().

double GetKappaNoSys ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 493 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

double GetKappaNoSysErr ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  bin_name 
)

Definition at line 513 of file extract_yields.cxx.

References Contains(), GetError(), and scan_aggregate::name.

Referenced by PrintTable().

double GetKappaSys ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 534 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

double GetKappaSysErr ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  bin_name 
)

Definition at line 554 of file extract_yields.cxx.

References Contains(), GetError(), and scan_aggregate::name.

Referenced by PrintTable().

double GetLambda ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 575 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

double GetLambdaErr ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  bin_name 
)

Definition at line 595 of file extract_yields.cxx.

References Contains(), GetError(), and scan_aggregate::name.

Referenced by PrintTable().

double GetMaximum ( const TH1D &  a,
const TH1D &  b,
const vector< TH1D > &  cs 
)

Definition at line 1055 of file extract_yields.cxx.

References plot_variations::c.

Referenced by SetBounds(), and styles::testGlobalStyle().

double GetMaximum ( const TH1D &  h,
double  y 
)

Definition at line 1081 of file extract_yields.cxx.

References plot_variations::y.

double GetMCTotal ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 312 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

double GetMCTotalErr ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  bin_name 
)

Definition at line 332 of file extract_yields.cxx.

References Contains(), GetError(), and scan_aggregate::name.

Referenced by PrintTable().

double GetMCYield ( const RooWorkspace &  w,
const string &  bin_name,
const string &  prc_name 
)

Definition at line 291 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by MakeExpSignal(), and PrintTable().

double GetMinimum ( const TH1D &  a,
const TH1D &  b,
const vector< TH1D > &  cs 
)

Definition at line 1068 of file extract_yields.cxx.

References plot_variations::c.

Referenced by SetBounds().

double GetMinimum ( const TH1D &  h,
double  y 
)

Definition at line 1096 of file extract_yields.cxx.

References plot_variations::y.

double GetObserved ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 476 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

void GetOptionsExtract ( int  argc,
char *  argv[] 
)
vector<string> GetPlainBinNames ( const RooWorkspace &  w)

Definition at line 845 of file extract_yields.cxx.

References Append(), GetFuncNames(), and scan_aggregate::name.

Referenced by PrintTable().

vector<string> GetProcessNames ( const RooWorkspace &  w)

Definition at line 860 of file extract_yields.cxx.

References Append(), and scan_aggregate::name.

Referenced by MakeCorrectionPlot(), MakeYieldPlot(), and PrintTable().

string GetSignalName ( const RooWorkspace &  w)

Definition at line 89 of file extract_yields.cxx.

References scan_aggregate::name.

Referenced by PrintTable().

double GetSigPred ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 394 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

double GetSigPredErr ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  bin_name 
)

Definition at line 414 of file extract_yields.cxx.

References Contains(), GetError(), and scan_aggregate::name.

Referenced by PrintTable().

double GetTotPred ( const RooWorkspace &  w,
const string &  bin_name 
)

Definition at line 435 of file extract_yields.cxx.

References Contains(), and scan_aggregate::name.

Referenced by PrintTable().

double GetTotPredErr ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  bin_name 
)

Definition at line 455 of file extract_yields.cxx.

References Contains(), GetError(), and scan_aggregate::name.

Referenced by PrintTable().

vector<string> GetVarNames ( const RooWorkspace &  w)

Definition at line 779 of file extract_yields.cxx.

References Append(), and scan_aggregate::name.

Referenced by PrintDebug(), and SetVariables().

int main ( int  argc,
char *  argv[] 
)
vector<TH1D> MakeBackgroundHistos ( const vector< vector< double > > &  yields,
const vector< string > &  bin_names,
const vector< string > &  prc_names 
)
void MakeCorrectionPlot ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  file_name 
)

Definition at line 1155 of file extract_yields.cxx.

References plot_variations::c, GetBinNames(), GetError(), GetProcessNames(), and SetVariables().

Referenced by main().

void MakeCovarianceMatrix ( RooWorkspace &  w,
const RooFitResult &  f,
string  covar_file_name 
)
TGraphErrors MakeErrorBand ( const TH1D &  h)

Definition at line 1111 of file extract_yields.cxx.

Referenced by MakeYieldPlot().

TH1D MakeExpSignal ( RooWorkspace &  w,
const vector< string > &  bin_names 
)

Definition at line 952 of file extract_yields.cxx.

References GetMCYield(), and scan_aggregate::name.

Referenced by MakeYieldPlot().

TH1D MakeObserved ( const RooWorkspace &  w,
const vector< string > &  bin_names 
)

Definition at line 1001 of file extract_yields.cxx.

References scan_aggregate::name.

Referenced by MakeYieldPlot().

TGraphErrors MakeRatio ( const TH1D &  num,
const TH1D &  den 
)

Definition at line 1122 of file extract_yields.cxx.

References plot_variations::x.

Referenced by MakeYieldPlot().

TH1D MakeTotalHisto ( RooWorkspace &  w,
const RooFitResult &  f,
const vector< string > &  bin_names 
)

Definition at line 977 of file extract_yields.cxx.

References GetError(), and scan_aggregate::name.

Referenced by MakeYieldPlot().

void MakeYieldPlot ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  file_name,
bool  linear 
)
void ManuallyAddBins ( const RooWorkspace &  w,
vector< string > &  names 
)

Definition at line 814 of file extract_yields.cxx.

References scan_aggregate::name.

string PrettyBinName ( string  name)

Definition at line 1432 of file extract_yields.cxx.

References scan_aggregate::name, and ReplaceAll().

Referenced by MakeCovarianceMatrix().

void PrintDebug ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  file_name 
)
void PrintTable ( RooWorkspace &  w,
const RooFitResult &  f,
const string &  file_name 
)
void RunFit ( const string &  path)

Definition at line 80 of file extract_yields.cxx.

References execute().

Referenced by main().

void SetBounds ( TH1D &  a,
TH1D &  b,
std::vector< TH1D > &  cs 
)
RooRealVar* SetVariables ( RooWorkspace &  w,
const RooFitResult &  f 
)
string StripPath ( const string &  full_path)

Definition at line 1146 of file extract_yields.cxx.

References send_combine_aggregates::full_path.

string TexFriendly ( const string &  s)

Definition at line 121 of file extract_yields.cxx.

Referenced by PrintDebug(), and PrintTable().