CombineHarvester
ch::CombineHarvester Class Reference

#include "/afs/cern.ch/user/a/agilbert/CMSSW_14_1_0_pre4/src/CombineHarvester/CombineTools/interface/CombineHarvester.h"

Public Member Functions

void SetAutoMCStats (CombineHarvester &target, double thresh, bool sig=false, int mode=1)
 
void RenameAutoMCStatsBin (std::string const &oldname, std::string const &newname)
 
std::set< std::string > GetAutoMCStatsBins () const
 
void AddExtArgValue (std::string const &name, double const &value)
 
Constructors, destructors and copying

Distinct shallow and deep copying methods are provided. A deep copy creates a completely independent CombineHarvester instace: all Observation, Process, Systematic and Parameter objects are cloned, as well as any histogram objects they may contain and any attached RooWorkspaces. In a shallow copy these objects are shared with the original CombineHarvester instance.

 CombineHarvester ()
 
 ~CombineHarvester ()
 
 CombineHarvester (CombineHarvester const &other)
 Copy constructor (makes a shallow copy) More...
 
 CombineHarvester (CombineHarvester &&other)
 
CombineHarvesteroperator= (CombineHarvester other)
 
void SetFlag (std::string const &flag, bool const &value)
 Set a named flag value. More...
 
bool GetFlag (std::string const &flag) const
 
CombineHarvester cp ()
 Creates and returns a shallow copy of the CombineHarvester instance. More...
 
CombineHarvester deep ()
 Creates and retunrs a deep copy of the CombineHarvester instance. More...
 
Logging and Printing
CombineHarvesterPrintAll ()
 
CombineHarvesterPrintObs ()
 
CombineHarvesterPrintProcs ()
 
CombineHarvesterPrintSysts ()
 
CombineHarvesterPrintParams ()
 
void SetVerbosity (unsigned verbosity)
 
unsigned Verbosity ()
 
Datacards

Methods for the reading and writing of datacards.

As well as reading or writing the plain-text datacard files these methods also handle the automatic loading and saving of any TH1 objects or RooWorkspaces.

int ParseDatacard (std::string const &filename, std::string const &analysis, std::string const &era, std::string const &channel, int bin_id, std::string const &mass)
 
int ParseDatacard (std::string const &filename, std::string parse_rule="")
 
void WriteDatacard (std::string const &name, std::string const &root_file)
 
void WriteDatacard (std::string const &name, TFile &root_file)
 
void WriteDatacard (std::string const &name)
 
Filters

A collection of methods to filter the Observation, Process and Systematic objects

Each method here will remove objects from the Observation, Process and Systematic collections where the value of the relevant property is not equal to one of those specified in the list vec. Each methods returns a reference to the class instance, meaning it is simple to chain multiple filters. Note that filters only act on a set of objects where that property is defined. For example, the method systs_name will only filter the Systematic collection, and process will only filter the Process and Systematic collections.

Parameters
vecA vector containing the possible values of the given property.
CombineHarvesterbin (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvesterbin_id (std::vector< int > const &vec, bool cond=true)
 
CombineHarvesterprocess (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvesteranalysis (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvesterera (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvesterchannel (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvestermass (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvesterattr (std::vector< std::string > const &vec, std::string attr_label, bool cond=true)
 
CombineHarvestersyst_name (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvestersyst_type (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvesterprocess_rgx (std::vector< std::string > const &vec, bool cond=true)
 
CombineHarvestersignals ()
 
CombineHarvesterbackgrounds ()
 
CombineHarvesterhistograms ()
 
CombineHarvesterpdfs ()
 
CombineHarvesterdata ()
 
template<typename Function >
CombineHarvesterFilterAll (Function func)
 
template<typename Function >
CombineHarvesterFilterObs (Function func)
 
template<typename Function >
CombineHarvesterFilterProcs (Function func)
 
template<typename Function >
CombineHarvesterFilterSysts (Function func)
 
Set producers

Methods that extract sets of properties from the Observation, Process and Systematic entries

std::set< std::string > bin_set ()
 
std::set< int > bin_id_set ()
 
std::set< std::string > process_set ()
 
std::set< std::string > analysis_set ()
 
std::set< std::string > era_set ()
 
std::set< std::string > channel_set ()
 
std::set< std::string > mass_set ()
 
std::set< std::string > syst_name_set ()
 
std::set< std::string > syst_type_set ()
 
template<typename T , typename R = typename std::decay< typename std::result_of<T(Object const*)>::type>::type>
std::set< R > SetFromAll (T func)
 Fill an std::set with the return values from an arbitrary function. More...
 
template<typename T , typename R = typename std::decay< typename std::result_of<T(Observation const*)>::type>::type>
std::set< R > SetFromObs (T func)
 Fill an std::set using only the Observation entries. More...
 
template<typename T , typename R = typename std::decay< typename std::result_of<T(Process const*)>::type>::type>
std::set< R > SetFromProcs (T func)
 Fill an std::set using only the Process entries. More...
 
template<typename T , typename R = typename std::decay< typename std::result_of<T(Systematic const*)>::type>::type>
std::set< R > SetFromSysts (T func)
 Fill an std::set using only the Systematic entries. More...
 
Modification

Methods to modify existing objects.

See the documentation of each method for details

ch::Parameter const * GetParameter (std::string const &name) const
 
ch::ParameterGetParameter (std::string const &name)
 
void UpdateParameters (std::vector< ch::Parameter > const &params)
 
void UpdateParameters (RooFitResult const *fit)
 Update the parameters to the post-fit values in a RooFitResult. More...
 
void UpdateParameters (RooFitResult const &fit)
 
std::vector< ch::ParameterGetParameters () const
 
void RenameParameter (std::string const &oldname, std::string const &newname)
 
template<typename Function >
void ForEachObj (Function func)
 
template<typename Function >
void ForEachProc (Function func)
 
template<typename Function >
void ForEachObs (Function func)
 
template<typename Function >
void ForEachSyst (Function func)
 
void VariableRebin (std::vector< double > bins)
 
void ZeroBins (double min, double max)
 
void SetPdfBins (unsigned nbins)
 
double getParFromWs (const std::string name)
 
void setParInWs (const std::string name, double value)
 
void renameParInWs (const std::string &name, const std::string &newName, const std::string &wsName="")
 
void SetGroup (std::string const &name, std::vector< std::string > const &patterns)
 Add parameters to a given group. More...
 
void RemoveGroup (std::string const &name, std::vector< std::string > const &patterns)
 Remove parameters to a given group. More...
 
void RenameGroup (std::string const &oldname, std::string const &newname)
 Rename a nuisance parameter group. More...
 
void AddDatacardLineAtEnd (std::string const &line)
 Add a line of text at the end of all datacards. More...
 
void ClearDatacardLinesAtEnd ()
 Clear all added datacard lines. More...
 
Rate, shape and uncertainty evaluation

Methods to calculate total yields and shapes

All of these methods are greedy, meaning they will sum over all available objects and evaluate the effect of all uncertainties. They should be used at the end of a chain of filter methods to give the desired yield, shape or uncertainty.

double GetRate ()
 
double GetObservedRate ()
 
double GetUncertainty ()
 
double GetUncertainty (RooFitResult const *fit, unsigned n_samples)
 Sum all Process yields and evaluate uncertainty by sampling from the fit convariance matrix. More...
 
double GetUncertainty (RooFitResult const &fit, unsigned n_samples)
 
TH1F GetShape ()
 
TH1F GetShapeWithUncertainty ()
 
TH1F GetShapeWithUncertainty (RooFitResult const *fit, unsigned n_samples)
 Sum all Process shapes and evaluate bin-wise uncertainty by sampling from the fit convariance matrix. More...
 
TH1F GetShapeWithUncertainty (RooFitResult const &fit, unsigned n_samples)
 
TH1F GetObservedShape ()
 
TH2F GetRateCovariance (RooFitResult const &fit, unsigned n_samples)
 
TH2F GetRateCorrelation (RooFitResult const &fit, unsigned n_samples)
 
Creating new entries

Methods to create new Observation, Process, Systematic and Parameter objects

The general order in which these are run is given below.

  1. The AddObservations and AddProcesses methods build the desired Observation and ch::Process entries. The rate entries will default to zero at this stage, and are determined automatically in step 3.
  2. The AddSyst method will iterate through each Process and add a matching Systematic entry, with the name, type and value specfied in the method arguments. This method can be used at the end of a chain of filters to only create Systematic objects for a subset of processes.
  3. The method CombineHarvester::ExtractShapes opens a specified ROOT file and uses the provided pattern rules to load the TH1 objects for all entries. The TH1 integrals are used to set the event rates at this stage.
  4. Optionally, methods such as AddBinByBin may be used to prepare additional entries.
void AddObservations (std::vector< std::string > mass, std::vector< std::string > analysis, std::vector< std::string > era, std::vector< std::string > channel, ch::Categories bin)
 
void AddProcesses (std::vector< std::string > mass, std::vector< std::string > analysis, std::vector< std::string > era, std::vector< std::string > channel, std::vector< std::string > procs, ch::Categories bin, bool signal)
 
void AddSystVar (std::string const &name, double val, double err)
 
void AddSystFromProc (Process const &proc, std::string const &name, std::string const &type, bool asymm, double val_u, double val_d, std::string const &formula, std::string const &args)
 
template<class Map >
void AddSyst (CombineHarvester &target, std::string const &name, std::string const &type, Map const &valmap)
 
void ExtractShapes (std::string const &file, std::string const &rule, std::string const &syst_rule)
 
void ExtractPdfs (CombineHarvester &target, std::string const &ws_name, std::string const &rule, std::string norm_rule="")
 
void ExtractData (std::string const &ws_name, std::string const &rule)
 
void AddWorkspace (RooWorkspace const &ws, bool can_rename=false)
 
void InsertObservation (ch::Observation const &obs)
 
void InsertProcess (ch::Process const &proc)
 
void InsertSystematic (ch::Systematic const &sys)
 
void RenameSystematic (CombineHarvester &target, std::string const &old_name, std::string const &new_name)
 Rename a systematic from 'old_name' to 'new_name' and add a parameter 'new_name' to CH instance 'target' if that parameter doesn't exist yet. More...
 
void CreateParameterIfEmpty (std::string const &name)
 
void AddBinByBin (double threshold, bool fixed_norm, CombineHarvester *other)
 Create bin-by-bin uncertainties. More...
 
void AddBinByBin (double threshold, bool fixed_norm, CombineHarvester &other)
 Create bin-by-bin uncertainties. More...
 
void MergeBinErrors (double bbb_threshold, double merge_threshold)
 Merge bin errors within a bin. More...
 

Friends

void swap (CombineHarvester &first, CombineHarvester &second)
 

Detailed Description

Definition at line 30 of file CombineHarvester.h.

Constructor & Destructor Documentation

◆ CombineHarvester() [1/3]

ch::CombineHarvester::CombineHarvester ( )

Definition at line 17 of file CombineHarvester.cc.

◆ ~CombineHarvester()

ch::CombineHarvester::~CombineHarvester ( )

Definition at line 32 of file CombineHarvester.cc.

◆ CombineHarvester() [2/3]

ch::CombineHarvester::CombineHarvester ( CombineHarvester const &  other)

Copy constructor (makes a shallow copy)

When copying a CombineHarvester instance it is important to remember that the stored Observation, Process, Systematic and Parameter objects themselves are not duplicated, rather their pointers are simply copied. This is called making a shallow-copy, and means modifying the contents of one of these objects in the copied CombineHarvester also modifies it for the original. However, filtering methods only affect the instance they are called from. For example, if all the signal Process entries are filtered from a copied CombineHarvester instance they will remain in the original instance.

Definition at line 52 of file CombineHarvester.cc.

◆ CombineHarvester() [3/3]

ch::CombineHarvester::CombineHarvester ( CombineHarvester &&  other)

Definition at line 207 of file CombineHarvester.cc.

Member Function Documentation

◆ operator=()

CombineHarvester & ch::CombineHarvester::operator= ( CombineHarvester  other)

Definition at line 213 of file CombineHarvester.cc.

◆ SetFlag()

void ch::CombineHarvester::SetFlag ( std::string const &  flag,
bool const &  value 
)

Set a named flag value.

Creates the flag if it doesn't already

Definition at line 68 of file CombineHarvester.cc.

◆ GetFlag()

bool ch::CombineHarvester::GetFlag ( std::string const &  flag) const

Definition at line 79 of file CombineHarvester.cc.

◆ cp()

CombineHarvester ch::CombineHarvester::cp ( )

Creates and returns a shallow copy of the CombineHarvester instance.

Definition at line 220 of file CombineHarvester.cc.

◆ deep()

CombineHarvester ch::CombineHarvester::deep ( )

Creates and retunrs a deep copy of the CombineHarvester instance.

Unlike the shallow copy, a deep copy will duplicate every internal object, including any attached RooWorkspaces. This makes it completely independent of the original instance.

Definition at line 88 of file CombineHarvester.cc.

◆ PrintAll()

CombineHarvester & ch::CombineHarvester::PrintAll ( )

Definition at line 226 of file CombineHarvester.cc.

◆ PrintObs()

CombineHarvester & ch::CombineHarvester::PrintObs ( )

Definition at line 230 of file CombineHarvester.cc.

◆ PrintProcs()

CombineHarvester & ch::CombineHarvester::PrintProcs ( )

Definition at line 237 of file CombineHarvester.cc.

◆ PrintSysts()

CombineHarvester & ch::CombineHarvester::PrintSysts ( )

Definition at line 244 of file CombineHarvester.cc.

◆ PrintParams()

CombineHarvester & ch::CombineHarvester::PrintParams ( )

Definition at line 251 of file CombineHarvester.cc.

◆ SetVerbosity()

void ch::CombineHarvester::SetVerbosity ( unsigned  verbosity)
inline

Definition at line 95 of file CombineHarvester.h.

◆ Verbosity()

unsigned ch::CombineHarvester::Verbosity ( )
inline

Definition at line 96 of file CombineHarvester.h.

◆ ParseDatacard() [1/2]

int ch::CombineHarvester::ParseDatacard ( std::string const &  filename,
std::string const &  analysis,
std::string const &  era,
std::string const &  channel,
int  bin_id,
std::string const &  mass 
)

Definition at line 96 of file CombineHarvester_Datacards.cc.

◆ ParseDatacard() [2/2]

int ch::CombineHarvester::ParseDatacard ( std::string const &  filename,
std::string  parse_rule = "" 
)

Definition at line 76 of file CombineHarvester_Datacards.cc.

◆ WriteDatacard() [1/3]

void ch::CombineHarvester::WriteDatacard ( std::string const &  name,
std::string const &  root_file 
)

Definition at line 589 of file CombineHarvester_Datacards.cc.

◆ WriteDatacard() [2/3]

void ch::CombineHarvester::WriteDatacard ( std::string const &  name,
TFile &  root_file 
)

Definition at line 774 of file CombineHarvester_Datacards.cc.

◆ WriteDatacard() [3/3]

void ch::CombineHarvester::WriteDatacard ( std::string const &  name)

Definition at line 596 of file CombineHarvester_Datacards.cc.

◆ bin()

CombineHarvester & ch::CombineHarvester::bin ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 13 of file CombineHarvester_Filters.cc.

◆ bin_id()

CombineHarvester & ch::CombineHarvester::bin_id ( std::vector< int > const &  vec,
bool  cond = true 
)

Definition at line 27 of file CombineHarvester_Filters.cc.

◆ process()

CombineHarvester & ch::CombineHarvester::process ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 35 of file CombineHarvester_Filters.cc.

◆ analysis()

CombineHarvester & ch::CombineHarvester::analysis ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 55 of file CombineHarvester_Filters.cc.

◆ era()

CombineHarvester & ch::CombineHarvester::era ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 69 of file CombineHarvester_Filters.cc.

◆ channel()

CombineHarvester & ch::CombineHarvester::channel ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 83 of file CombineHarvester_Filters.cc.

◆ mass()

CombineHarvester & ch::CombineHarvester::mass ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 97 of file CombineHarvester_Filters.cc.

◆ attr()

CombineHarvester & ch::CombineHarvester::attr ( std::vector< std::string > const &  vec,
std::string  attr_label,
bool  cond = true 
)

Definition at line 111 of file CombineHarvester_Filters.cc.

◆ syst_name()

CombineHarvester & ch::CombineHarvester::syst_name ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 126 of file CombineHarvester_Filters.cc.

◆ syst_type()

CombineHarvester & ch::CombineHarvester::syst_type ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 136 of file CombineHarvester_Filters.cc.

◆ process_rgx()

CombineHarvester & ch::CombineHarvester::process_rgx ( std::vector< std::string > const &  vec,
bool  cond = true 
)

Definition at line 48 of file CombineHarvester_Filters.cc.

◆ signals()

CombineHarvester & ch::CombineHarvester::signals ( )

Definition at line 146 of file CombineHarvester_Filters.cc.

◆ backgrounds()

CombineHarvester & ch::CombineHarvester::backgrounds ( )

Definition at line 156 of file CombineHarvester_Filters.cc.

◆ histograms()

CombineHarvester & ch::CombineHarvester::histograms ( )

Definition at line 166 of file CombineHarvester_Filters.cc.

◆ pdfs()

CombineHarvester & ch::CombineHarvester::pdfs ( )

Definition at line 176 of file CombineHarvester_Filters.cc.

◆ data()

CombineHarvester & ch::CombineHarvester::data ( )

Definition at line 183 of file CombineHarvester_Filters.cc.

◆ FilterAll()

template<typename Function >
CombineHarvester & ch::CombineHarvester::FilterAll ( Function  func)

Definition at line 651 of file CombineHarvester.h.

◆ FilterObs()

template<typename Function >
CombineHarvester & ch::CombineHarvester::FilterObs ( Function  func)

Definition at line 659 of file CombineHarvester.h.

◆ FilterProcs()

template<typename Function >
CombineHarvester & ch::CombineHarvester::FilterProcs ( Function  func)

Definition at line 667 of file CombineHarvester.h.

◆ FilterSysts()

template<typename Function >
CombineHarvester & ch::CombineHarvester::FilterSysts ( Function  func)

Definition at line 674 of file CombineHarvester.h.

◆ bin_set()

std::set< std::string > ch::CombineHarvester::bin_set ( )

Definition at line 190 of file CombineHarvester_Filters.cc.

◆ bin_id_set()

std::set< int > ch::CombineHarvester::bin_id_set ( )

Definition at line 202 of file CombineHarvester_Filters.cc.

◆ process_set()

std::set< std::string > ch::CombineHarvester::process_set ( )

Definition at line 214 of file CombineHarvester_Filters.cc.

◆ analysis_set()

std::set< std::string > ch::CombineHarvester::analysis_set ( )

Definition at line 223 of file CombineHarvester_Filters.cc.

◆ era_set()

std::set< std::string > ch::CombineHarvester::era_set ( )

Definition at line 235 of file CombineHarvester_Filters.cc.

◆ channel_set()

std::set< std::string > ch::CombineHarvester::channel_set ( )

Definition at line 247 of file CombineHarvester_Filters.cc.

◆ mass_set()

std::set< std::string > ch::CombineHarvester::mass_set ( )

Definition at line 259 of file CombineHarvester_Filters.cc.

◆ syst_name_set()

std::set< std::string > ch::CombineHarvester::syst_name_set ( )

Definition at line 271 of file CombineHarvester_Filters.cc.

◆ syst_type_set()

std::set< std::string > ch::CombineHarvester::syst_type_set ( )

Definition at line 277 of file CombineHarvester_Filters.cc.

◆ SetFromAll()

template<typename T , typename R >
std::set< R > ch::CombineHarvester::SetFromAll ( func)

Fill an std::set with the return values from an arbitrary function.

This method will loop through all ch::Observation, ch::Process and ch::Systematic entries and call the user-supplied function func. The return value is then inserted into the set.

Template Parameters
TA function (or other callable) that must have a single ch::Object const* argument.
RThe return type of the function, which is deduced by using std::result_of, then std::decay. The latter is needed to handle functions that return by reference, i.e. turning a type R& into a type R.

Definition at line 599 of file CombineHarvester.h.

◆ SetFromObs()

template<typename T , typename R >
std::set< R > ch::CombineHarvester::SetFromObs ( func)

Fill an std::set using only the Observation entries.

See also
SetFromAll

Definition at line 608 of file CombineHarvester.h.

◆ SetFromProcs()

template<typename T , typename R >
std::set< R > ch::CombineHarvester::SetFromProcs ( func)

Fill an std::set using only the Process entries.

See also
SetFromAll

Definition at line 615 of file CombineHarvester.h.

◆ SetFromSysts()

template<typename T , typename R >
std::set< R > ch::CombineHarvester::SetFromSysts ( func)

Fill an std::set using only the Systematic entries.

See also
SetFromAll

Definition at line 622 of file CombineHarvester.h.

◆ GetParameter() [1/2]

ch::Parameter const * ch::CombineHarvester::GetParameter ( std::string const &  name) const

Definition at line 535 of file CombineHarvester_Evaluate.cc.

◆ GetParameter() [2/2]

ch::Parameter * ch::CombineHarvester::GetParameter ( std::string const &  name)

Definition at line 545 of file CombineHarvester_Evaluate.cc.

◆ UpdateParameters() [1/3]

void ch::CombineHarvester::UpdateParameters ( std::vector< ch::Parameter > const &  params)

Definition at line 554 of file CombineHarvester_Evaluate.cc.

◆ UpdateParameters() [2/3]

void ch::CombineHarvester::UpdateParameters ( RooFitResult const *  fit)

Update the parameters to the post-fit values in a RooFitResult.

Deprecated:
For consistency and compatibility with the python interface, please use the UpdateParameters(RooFitResult const&) version of this method instead - this method will be removed in an upcoming release

Definition at line 589 of file CombineHarvester_Evaluate.cc.

◆ UpdateParameters() [3/3]

void ch::CombineHarvester::UpdateParameters ( RooFitResult const &  fit)

Definition at line 570 of file CombineHarvester_Evaluate.cc.

◆ GetParameters()

std::vector< ch::Parameter > ch::CombineHarvester::GetParameters ( ) const

Definition at line 593 of file CombineHarvester_Evaluate.cc.

◆ RenameParameter()

void ch::CombineHarvester::RenameParameter ( std::string const &  oldname,
std::string const &  newname 
)

Definition at line 525 of file CombineHarvester_Evaluate.cc.

◆ ForEachObj()

template<typename Function >
void ch::CombineHarvester::ForEachObj ( Function  func)

Definition at line 629 of file CombineHarvester.h.

◆ ForEachProc()

template<typename Function >
void ch::CombineHarvester::ForEachProc ( Function  func)

Definition at line 636 of file CombineHarvester.h.

◆ ForEachObs()

template<typename Function >
void ch::CombineHarvester::ForEachObs ( Function  func)

Definition at line 641 of file CombineHarvester.h.

◆ ForEachSyst()

template<typename Function >
void ch::CombineHarvester::ForEachSyst ( Function  func)

Definition at line 646 of file CombineHarvester.h.

◆ VariableRebin()

void ch::CombineHarvester::VariableRebin ( std::vector< double >  bins)

Definition at line 601 of file CombineHarvester_Evaluate.cc.

◆ ZeroBins()

void ch::CombineHarvester::ZeroBins ( double  min,
double  max 
)

Definition at line 664 of file CombineHarvester_Evaluate.cc.

◆ SetPdfBins()

void ch::CombineHarvester::SetPdfBins ( unsigned  nbins)

Definition at line 742 of file CombineHarvester_Evaluate.cc.

◆ getParFromWs()

double ch::CombineHarvester::getParFromWs ( const std::string  name)

Definition at line 936 of file CombineHarvester.cc.

◆ setParInWs()

void ch::CombineHarvester::setParInWs ( const std::string  name,
double  value 
)

Definition at line 948 of file CombineHarvester.cc.

◆ renameParInWs()

void ch::CombineHarvester::renameParInWs ( const std::string &  name,
const std::string &  newName,
const std::string &  wsName = "" 
)

Definition at line 958 of file CombineHarvester.cc.

◆ SetGroup()

void ch::CombineHarvester::SetGroup ( std::string const &  name,
std::vector< std::string > const &  patterns 
)

Add parameters to a given group.

A parameter will be added to the given group if its name passes a regex match with any of the input patterns. A parameter can belong to any number of groups.

Parameters
nameThe group name to set
patternsA vector of regex pattern strings

Definition at line 790 of file CombineHarvester_Evaluate.cc.

◆ RemoveGroup()

void ch::CombineHarvester::RemoveGroup ( std::string const &  name,
std::vector< std::string > const &  patterns 
)

Remove parameters to a given group.

A parameter will be removed from the given group if its name passes a regex match with any of the input patterns.

Parameters
nameThe group name to remove
patternsA vector of regex pattern strings

Definition at line 804 of file CombineHarvester_Evaluate.cc.

◆ RenameGroup()

void ch::CombineHarvester::RenameGroup ( std::string const &  oldname,
std::string const &  newname 
)

Rename a nuisance parameter group.

Parameters
oldnameThe current name
newnameThe new name

Definition at line 818 of file CombineHarvester_Evaluate.cc.

◆ AddDatacardLineAtEnd()

void ch::CombineHarvester::AddDatacardLineAtEnd ( std::string const &  line)

Add a line of text at the end of all datacards.

Parameters
lineLine of text to add

Definition at line 829 of file CombineHarvester_Evaluate.cc.

◆ ClearDatacardLinesAtEnd()

void ch::CombineHarvester::ClearDatacardLinesAtEnd ( )

Clear all added datacard lines.

Definition at line 833 of file CombineHarvester_Evaluate.cc.

◆ GetRate()

double ch::CombineHarvester::GetRate ( )

Definition at line 282 of file CombineHarvester_Evaluate.cc.

◆ GetObservedRate()

double ch::CombineHarvester::GetObservedRate ( )

Definition at line 435 of file CombineHarvester_Evaluate.cc.

◆ GetUncertainty() [1/3]

double ch::CombineHarvester::GetUncertainty ( )

Definition at line 44 of file CombineHarvester_Evaluate.cc.

◆ GetUncertainty() [2/3]

double ch::CombineHarvester::GetUncertainty ( RooFitResult const *  fit,
unsigned  n_samples 
)

Sum all Process yields and evaluate uncertainty by sampling from the fit convariance matrix.

Deprecated:
For consistency and compatibility with the python interface, please use the GetUncertainty(RooFitResult const&, unsigned) version of this method instead - this method will be removed in an upcoming release

Definition at line 60 of file CombineHarvester_Evaluate.cc.

◆ GetUncertainty() [3/3]

double ch::CombineHarvester::GetUncertainty ( RooFitResult const &  fit,
unsigned  n_samples 
)

Definition at line 65 of file CombineHarvester_Evaluate.cc.

◆ GetShape()

TH1F ch::CombineHarvester::GetShape ( )

Definition at line 287 of file CombineHarvester_Evaluate.cc.

◆ GetShapeWithUncertainty() [1/3]

TH1F ch::CombineHarvester::GetShapeWithUncertainty ( )

Definition at line 103 of file CombineHarvester_Evaluate.cc.

◆ GetShapeWithUncertainty() [2/3]

TH1F ch::CombineHarvester::GetShapeWithUncertainty ( RooFitResult const *  fit,
unsigned  n_samples 
)

Sum all Process shapes and evaluate bin-wise uncertainty by sampling from the fit convariance matrix.

Deprecated:
For consistency and compatibility with the python interface, please use the GetShapeWithUncertainty(RooFitResult const&, unsigned) version of this method instead - this method will be removed in an upcoming release

Definition at line 128 of file CombineHarvester_Evaluate.cc.

◆ GetShapeWithUncertainty() [3/3]

TH1F ch::CombineHarvester::GetShapeWithUncertainty ( RooFitResult const &  fit,
unsigned  n_samples 
)

Definition at line 133 of file CombineHarvester_Evaluate.cc.

◆ GetObservedShape()

TH1F ch::CombineHarvester::GetObservedShape ( )

Definition at line 443 of file CombineHarvester_Evaluate.cc.

◆ GetRateCovariance()

TH2F ch::CombineHarvester::GetRateCovariance ( RooFitResult const &  fit,
unsigned  n_samples 
)

Definition at line 189 of file CombineHarvester_Evaluate.cc.

◆ GetRateCorrelation()

TH2F ch::CombineHarvester::GetRateCorrelation ( RooFitResult const &  fit,
unsigned  n_samples 
)

Definition at line 262 of file CombineHarvester_Evaluate.cc.

◆ AddObservations()

void ch::CombineHarvester::AddObservations ( std::vector< std::string >  mass,
std::vector< std::string >  analysis,
std::vector< std::string >  era,
std::vector< std::string >  channel,
ch::Categories  bin 
)

Definition at line 20 of file CombineHarvester_Creation.cc.

◆ AddProcesses()

void ch::CombineHarvester::AddProcesses ( std::vector< std::string >  mass,
std::vector< std::string >  analysis,
std::vector< std::string >  era,
std::vector< std::string >  channel,
std::vector< std::string >  procs,
ch::Categories  bin,
bool  signal 
)

Definition at line 45 of file CombineHarvester_Creation.cc.

◆ AddSystVar()

void ch::CombineHarvester::AddSystVar ( std::string const &  name,
double  val,
double  err 
)

Definition at line 137 of file CombineHarvester_Creation.cc.

◆ AddSystFromProc()

void ch::CombineHarvester::AddSystFromProc ( Process const &  proc,
std::string const &  name,
std::string const &  type,
bool  asymm,
double  val_u,
double  val_d,
std::string const &  formula,
std::string const &  args 
)

Definition at line 76 of file CombineHarvester_Creation.cc.

◆ AddSyst()

template<class Map >
void ch::CombineHarvester::AddSyst ( CombineHarvester target,
std::string const &  name,
std::string const &  type,
Map const &  valmap 
)

Definition at line 682 of file CombineHarvester.h.

◆ ExtractShapes()

void ch::CombineHarvester::ExtractShapes ( std::string const &  file,
std::string const &  rule,
std::string const &  syst_rule 
)

Definition at line 159 of file CombineHarvester_Creation.cc.

◆ ExtractPdfs()

void ch::CombineHarvester::ExtractPdfs ( CombineHarvester target,
std::string const &  ws_name,
std::string const &  rule,
std::string  norm_rule = "" 
)

Definition at line 193 of file CombineHarvester_Creation.cc.

◆ ExtractData()

void ch::CombineHarvester::ExtractData ( std::string const &  ws_name,
std::string const &  rule 
)

Definition at line 211 of file CombineHarvester_Creation.cc.

◆ AddWorkspace()

void ch::CombineHarvester::AddWorkspace ( RooWorkspace const &  ws,
bool  can_rename = false 
)

Definition at line 188 of file CombineHarvester_Creation.cc.

◆ InsertObservation()

void ch::CombineHarvester::InsertObservation ( ch::Observation const &  obs)

Definition at line 257 of file CombineHarvester_Creation.cc.

◆ InsertProcess()

void ch::CombineHarvester::InsertProcess ( ch::Process const &  proc)

Definition at line 261 of file CombineHarvester_Creation.cc.

◆ InsertSystematic()

void ch::CombineHarvester::InsertSystematic ( ch::Systematic const &  sys)

Definition at line 265 of file CombineHarvester_Creation.cc.

◆ RenameSystematic()

void ch::CombineHarvester::RenameSystematic ( CombineHarvester target,
std::string const &  old_name,
std::string const &  new_name 
)

Rename a systematic from 'old_name' to 'new_name' and add a parameter 'new_name' to CH instance 'target' if that parameter doesn't exist yet.

Usage similar to AddSyst()

Definition at line 149 of file CombineHarvester_Creation.cc.

◆ CreateParameterIfEmpty()

void ch::CombineHarvester::CreateParameterIfEmpty ( std::string const &  name)

Definition at line 240 of file CombineHarvester_Creation.cc.

◆ AddBinByBin() [1/2]

void ch::CombineHarvester::AddBinByBin ( double  threshold,
bool  fixed_norm,
CombineHarvester other 
)

Create bin-by-bin uncertainties.

Deprecated:
Please use the standalone ch::BinByBinFactory tool, defined in CombineTools/interface/BinByBin.h

Definition at line 231 of file CombineHarvester_Creation.cc.

◆ AddBinByBin() [2/2]

void ch::CombineHarvester::AddBinByBin ( double  threshold,
bool  fixed_norm,
CombineHarvester other 
)

Create bin-by-bin uncertainties.

Deprecated:
Please use the standalone ch::BinByBinFactory tool, defined in CombineTools/interface/BinByBin.h

Definition at line 226 of file CombineHarvester_Creation.cc.

◆ MergeBinErrors()

void ch::CombineHarvester::MergeBinErrors ( double  bbb_threshold,
double  merge_threshold 
)

Merge bin errors within a bin.

Deprecated:
Please use the standalone ch::BinByBinFactory tool, defined in CombineTools/interface/BinByBin.h

Definition at line 248 of file CombineHarvester_Creation.cc.

◆ SetAutoMCStats()

void ch::CombineHarvester::SetAutoMCStats ( CombineHarvester target,
double  thresh,
bool  sig = false,
int  mode = 1 
)

Definition at line 908 of file CombineHarvester.cc.

◆ RenameAutoMCStatsBin()

void ch::CombineHarvester::RenameAutoMCStatsBin ( std::string const &  oldname,
std::string const &  newname 
)

Definition at line 914 of file CombineHarvester.cc.

◆ GetAutoMCStatsBins()

std::set< std::string > ch::CombineHarvester::GetAutoMCStatsBins ( ) const

Definition at line 922 of file CombineHarvester.cc.

◆ AddExtArgValue()

void ch::CombineHarvester::AddExtArgValue ( std::string const &  name,
double const &  value 
)

Definition at line 930 of file CombineHarvester.cc.

Friends And Related Function Documentation

◆ swap

void swap ( CombineHarvester first,
CombineHarvester second 
)
friend

Definition at line 36 of file CombineHarvester.cc.


The documentation for this class was generated from the following files: