Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
HistFactory

Factory classes to create RooFit workspaces from histograms.

This is a package that creates a RooFit probability density function from ROOT histograms of expected distributions and histograms that represent the +/- 1 sigma variations from systematic effects. The resulting probability density function can then be used with any of the statistical tools provided within RooStats, such as the profile likelihood ratio, Feldman-Cousins, etc. In this version, the model is directly fed to a likelihood ratio test, but it needs to be further factorized.

The user needs to provide histograms (in picobarns per bin) and configure the job with XML. The configuration XML is defined in the file $ROOTSYS/config/HistFactorySchema.dtd, but essentially it is organized as follows (see the examples in ${ROOTSYS}/tutorials/histfactory/)

  • a top level 'Combination' that is composed of:
    • several 'Channels' (eg. ee, emu, mumu), which are composed of:
      • several 'Samples' (eg. signal, bkg1, bkg2, ...), each of which has:
        • a name
        • if the sample is normalized by theory (eg N = L*sigma) or not (eg. data driven)
        • a nominal expectation histogram
        • a named 'Normalization Factor' (which can be fixed or allowed to float in a fit)
        • several 'Overall Systematics' in normalization with:
          • a name
          • +/- 1 sigma variations (eg. 1.05 and 0.95 for a 5% uncertainty)
        • several 'Histogram Systematics' in shape with:
          • a name (which can be shared with the OverallSyst if correlated)
          • +/- 1 sigma variational histograms
    • several 'Measurements' (corresponding to a full fit of the model) each of which specifies
      • a name for this fit to be used in tables and files
      • what is the luminosity associated to the measurement in picobarns
      • which bins of the histogram should be used
      • what is the relative uncertainty on the luminosity
      • what is (are) the parameter(s) of interest that will be measured
      • which parameters should be fixed/floating (eg. nuisance parameters)

For more documentation see CERN-OPEN-2012-016.

For tutorials see HistFactory Tutorials.

Namespaces

namespace  RooStats
 Namespace for the RooStats classes.

Classes

class  RooStats::HistFactory::Asimov
 TODO Here, we are missing some documentation. More...
class  RooStats::HistFactory::Channel
 This class encapsulates all information for the statistical interpretation of one experiment. More...
class  RooStats::HistFactory::ConfigParser
 TODO Add documentation. More...
class  RooStats::HistFactory::Data
class  RooStats::HistFactory::FlexibleInterpVar
class  RooStats::HistFactory::HistFactoryNavigation
class  RooStats::HistFactory::HistoFactor
 Configuration for an *un*constrained, coherent shape variation of affected samples. More...
class  RooStats::HistFactory::HistogramUncertaintyBase
 ////////////////////////////////////////////////////////////////////////////////////////////Base class to store the up and down variations for histogram uncertainties. More...
class  RooStats::HistFactory::HistoSys
 Configuration for a constrained, coherent shape variation of affected samples. More...
class  RooStats::HistFactory::HistoToWorkspaceFactoryFast
 This class provides helper functions for creating likelihood models from histograms. More...
class  RooStats::HistFactory::HistRef
 Internal class wrapping an histogram and managing its content. More...
class  RooStats::HistFactory::LinInterpVar
 RooAbsReal that does piecewise-linear interpolations. More...
class  RooStats::HistFactory::Measurement
 The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple RooStats::HistFactory::Channel objects. More...
class  RooStats::HistFactory::NormFactor
 Configuration for an un- constrained overall systematic to scale sample normalisations. More...
class  RooStats::HistFactory::OverallSys
 Configuration for a constrained overall systematic to scale sample normalisations. More...
class  ParamHistFunc
 A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of RooAbsReal (nominally RooRealVar): More...
class  PiecewiseInterpolation
 The PiecewiseInterpolation is a class that can morph distributions into each other, which is useful to estimate systematic uncertainties. More...
class  RooStats::HistFactory::RooBarlowBeestonLL
 Class RooBarlowBeestonLL implements the profile likelihood estimator for a given likelihood and set of parameters of interest. More...
class  RooStats::HistFactory::Sample
class  RooStats::HistFactory::ShapeFactor
 *Un*constrained bin-by-bin variation of affected histogram. More...
class  RooStats::HistFactory::ShapeSys
 Constrained bin-by-bin variation of affected histogram. More...
class  RooStats::HistFactory::StatError
 Statistical error of Monte Carlo predictions. More...
class  RooStats::HistFactory::StatErrorConfig
 Configuration to automatically assign nuisance parameters for the statistical error of the Monte Carlo simulations. More...

Functions

std::string RooStats::HistFactory::channelNameFromPdf (RooAbsPdf *channelPdf)
void RooStats::HistFactory::FactorizeHistFactoryPdf (const RooArgSet &, RooAbsPdf &, RooArgList &, RooArgList &)
void RooStats::HistFactory::getDataValuesForObservables (std::map< std::string, std::vector< double > > &ChannelBinDataMap, RooAbsData *data, RooAbsPdf *simPdf)
int RooStats::HistFactory::getStatUncertaintyConstraintTerm (RooArgList *constraints, RooRealVar *gamma_stat, RooAbsReal *&pois_mean, RooRealVar *&tau)
bool RooStats::HistFactory::getStatUncertaintyFromChannel (RooAbsPdf *channel, ParamHistFunc *&paramfunc, RooArgList *gammaList)
RooAbsPdfRooStats::HistFactory::getSumPdfFromChannel (RooAbsPdf *channel)
int main (int argc, char **argv)
 main function of the hist2workspace executable.
RooFit::OwningPtr< RooWorkspaceRooStats::HistFactory::MakeModelAndMeasurementFast (RooStats::HistFactory::Measurement &measurement, HistoToWorkspaceFactoryFast::Configuration const &cfg={})
 Creates a statistical model and associated RooFit workspace(s) from a HistFactory measurement configuration.

Function Documentation

◆ channelNameFromPdf()

std::string RooStats::HistFactory::channelNameFromPdf ( RooAbsPdf * channelPdf)

Definition at line 25 of file HistFactoryModelUtils.cxx.

◆ FactorizeHistFactoryPdf()

void RooStats::HistFactory::FactorizeHistFactoryPdf ( const RooArgSet & observables,
RooAbsPdf & pdf,
RooArgList & obsTerms,
RooArgList & constraints )

Definition at line 73 of file HistFactoryModelUtils.cxx.

◆ getDataValuesForObservables()

void RooStats::HistFactory::getDataValuesForObservables ( std::map< std::string, std::vector< double > > & ChannelBinDataMap,
RooAbsData * data,
RooAbsPdf * simPdf )

Definition at line 130 of file HistFactoryModelUtils.cxx.

◆ getStatUncertaintyConstraintTerm()

int RooStats::HistFactory::getStatUncertaintyConstraintTerm ( RooArgList * constraints,
RooRealVar * gamma_stat,
RooAbsReal *& pois_mean,
RooRealVar *& tau )

Definition at line 209 of file HistFactoryModelUtils.cxx.

◆ getStatUncertaintyFromChannel()

bool RooStats::HistFactory::getStatUncertaintyFromChannel ( RooAbsPdf * channel,
ParamHistFunc *& paramfunc,
RooArgList * gammaList )

Definition at line 99 of file HistFactoryModelUtils.cxx.

◆ getSumPdfFromChannel()

RooAbsPdf * RooStats::HistFactory::getSumPdfFromChannel ( RooAbsPdf * channel)

Definition at line 31 of file HistFactoryModelUtils.cxx.

◆ main()

int main ( int argc,
char ** argv )

main function of the hist2workspace executable.

It creates RooFit models from an xml config and files with histograms. See MakeModelAndMeasurementFast(), for further instructions.

Parameters
[in]argcnumber of CLI arguments
[in]argvpointer to arguments

-h Help -v Switch HistFactory message stream to INFO level. -vv Switch HistFactory message stream to DEBUG level. -disable_binned_fit_optimization Disable the binned fit optimization used in HistFactory since ROOT 6.28.

Definition at line 106 of file hist2workspace.cxx.

◆ MakeModelAndMeasurementFast()

RooFit::OwningPtr< RooWorkspace > RooStats::HistFactory::MakeModelAndMeasurementFast ( RooStats::HistFactory::Measurement & measurement,
HistoToWorkspaceFactoryFast::Configuration const & cfg = {} )

Creates a statistical model and associated RooFit workspace(s) from a HistFactory measurement configuration.


This is a package that creates a RooFit probability density function from ROOT histograms of expected distributions and histograms that represent the +/- 1 sigma variations from systematic effects. The resulting probability density function can then be used with any of the statistical tools provided within RooStats, such as the profile likelihood ratio, Feldman-Cousins, etc. In this version, the model is directly fed to a likelihood ratio test, but it needs to be further factorized.

The user needs to provide histograms (in picobarns per bin) and configure the job with XML. The configuration XML is defined in the file $ROOTSYS/config/HistFactorySchema.dtd, but essentially it is organized as follows (see the examples in ${ROOTSYS}/tutorials/roofit/histfactory/)

  • a top level 'Combination' that is composed of:
    • several 'Channels' (eg. ee, emu, mumu), which are composed of:
      • several 'Samples' (eg. signal, bkg1, bkg2, ...), each of which has:
        • a name
        • if the sample is normalized by theory (eg N = L*sigma) or not (eg. data driven)
        • a nominal expectation histogram
        • a named 'Normalization Factor' (which can be fixed or allowed to float in a fit)
        • several 'Overall Systematics' in normalization with:
          • a name
          • +/- 1 sigma variations (eg. 1.05 and 0.95 for a 5% uncertainty)
        • several 'Histogram Systematics' in shape with:
          • a name (which can be shared with the OverallSyst if correlated)
          • +/- 1 sigma variational histograms
    • several 'Measurements' (corresponding to a full fit of the model) each of which specifies
      • a name for this fit to be used in tables and files
      • what is the luminosity associated to the measurement in picobarns
      • which bins of the histogram should be used
      • what is the relative uncertainty on the luminosity
      • what is (are) the parameter(s) of interest that will be measured
      • which parameters should be fixed/floating (eg. nuisance parameters)

This function processes a RooStats::HistFactory::Measurement using the fast RooStats::HistFactory::HistoToWorkspaceFactoryFast machinery. It creates individual channel workspaces, optionally writes them to disk, and then combines them into a single RooWorkspace representing the full statistical model.

Parameters
measurementObject containing the configuration of the statistical analysis, including luminosity, binning, systematic uncertainties, and channels.
cfgConfiguration object that controls behavior such as workspace file creation.
Returns
The combined RooWorkspace, or nullptr if workspace creation fails.

Definition at line 100 of file MakeModelAndMeasurementsFast.cxx.