Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
HS3Document.h File Reference
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <tuple>
#include <variant>
#include <vector>
Include dependency graph for HS3Document.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  RooFit::HS3::Analysis
 
struct  RooFit::HS3::Attributes
 
struct  RooFit::HS3::AuxiliaryConstraints
 What readAuxiliaryChannelsAsConstraints() changed. More...
 
struct  RooFit::HS3::BinnedAxis
 The axis of binned data. More...
 
struct  RooFit::HS3::BinnedData
 
struct  RooFit::HS3::CategoricalAxis
 
struct  RooFit::HS3::Combined< Ref_t >
 Data sets or distributions that are selected by a key (HS3 #119). The columns are categorical axes of the domains. More...
 
struct  RooFit::HS3::CombinedComponent< Ref_t >
 The data set or distribution that a combined data set or distribution selects for one key, which has one label per column. More...
 
struct  RooFit::HS3::CombinedDataset
 The data set of a RooSimultaneous as older versions of RooFit wrote it. It is only read. More...
 
struct  RooFit::HS3::CombinedDistribution
 A RooSimultaneous as older versions of RooFit wrote it, before HS3 had combined distributions. It is only read. More...
 
struct  RooFit::HS3::ConstantGammas
 The gamma parameters are constant, which is a RooFit extension. More...
 
struct  RooFit::HS3::ConstraintPdf
 The constraint term is a distribution of the document, named in "constraints". More...
 
struct  RooFit::HS3::ContinuousAxis
 The axis of point data or unbinned data, which can't have a binning. More...
 
struct  RooFit::HS3::CustomModifier
 Multiplies the sample with a function of the document. More...
 
struct  RooFit::HS3::Data
 
struct  RooFit::HS3::Diagnostic
 
struct  RooFit::HS3::Distribution
 
struct  RooFit::HS3::Domain
 
struct  RooFit::HS3::DomainAxis
 The axis of a domain. More...
 
class  RooFit::HS3::DomainRanges
 Where RooFit takes the ranges of variables from: the "default_domain" if there is one, otherwise the first domain by name that has the variable. More...
 
struct  RooFit::HS3::EdgesBinning
 
struct  RooFit::HS3::Function
 
struct  RooFit::HS3::GammaConstraintPdfs
 Every gamma parameter has its own constraint term, or none, as named in "constraints". More...
 
struct  RooFit::HS3::GaussianUncertainty
 
struct  RooFit::HS3::GenericObject
 A distribution or function that is not interpreted by the document, but by the importers that are registered for its type in RooFit::JSONIO::importers(). More...
 
struct  RooFit::HS3::HistFactoryDist
 
struct  RooFit::HS3::HistoSys
 
struct  RooFit::HS3::HistoSysVariation
 
class  RooFit::HS3Document
 An HS3 document. It is move-only, because generic objects refer to the JSON tree of the document. More...
 
struct  RooFit::HS3::InterpolatedFunction
 The function "interpolation" of RooFit, implemented by PiecewiseInterpolation: a nominal function plus the interpolated differences to the variations "high" and "low" for each parameter. More...
 
struct  RooFit::HS3::InterpolatedNumber
 The function "interpolation0d" of RooFit, implemented by FlexibleInterpVar: a nominal value plus the interpolated differences to the variations "high" and "low" for each parameter. More...
 
struct  RooFit::HS3::Interpolation
 How a modifier of a HistFactory distribution interpolates and extrapolates its effect. More...
 
struct  RooFit::HS3::Likelihood
 
struct  RooFit::HS3::LikelihoodTerm
 The data of a likelihood term: a data set, a number given in-line, or none (std::monostate) in a pure model. More...
 
struct  RooFit::HS3::Metadata
 
struct  RooFit::HS3::ModelConfigInfo
 
struct  RooFit::HS3::NormFactor
 
struct  RooFit::HS3::NormSys
 
struct  RooFit::HS3::overloaded< Ts >
 Combines lambdas into one visitor for std::visit(). The compiler complains about the alternatives without lambda. More...
 
struct  RooFit::HS3::Package
 
struct  RooFit::HS3::ParameterPoint
 
struct  RooFit::HS3::ParameterValue
 
struct  RooFit::HS3::ParseOptions
 Options for upgradeDocument() and parseDocument(). More...
 
struct  RooFit::HS3::PointData
 
struct  RooFit::HS3::Ref< Tag >
 A name that says what it refers to, so that for example a DataRef can't be used as a DomainRef. More...
 
struct  RooFit::HS3::RegularBinning
 
struct  RooFit::HS3::RooFitInternal
 The content of misc.ROOT_internal and misc.minimization. More...
 
struct  RooFit::HS3::Sample
 
struct  RooFit::HS3::ShapeSys
 Scales each bin by its own parameter. The modifier type "shapesys" is a deprecated alias of "shapefactor". More...
 
struct  RooFit::HS3::StatError
 Scales each bin by a parameter, that is constrained by the statistical uncertainty of all samples that have this modifier. More...
 
struct  RooFit::HS3::StatErrorConfig
 Settings of the staterror modifiers that apply to the whole channel. This is a RooFit extension. More...
 
struct  RooFit::HS3::StepWidth
 
struct  RooFit::HS3::UnbinnedData
 
struct  RooFit::HS3::Unconstrained
 The parameter of the modifier is not constrained. More...
 
class  RooFit::ValidatedHS3Document
 A document that passed validate(). More...
 
struct  RooFit::HS3::ValidateOptions
 Options for validate(). More...
 
struct  RooFit::HS3::Version
 

Namespaces

namespace  RooFit
 The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or other types of arguments).
 
namespace  RooFit::Detail
 
namespace  RooFit::HS3
 Types that represent an HS3 document.
 

Typedefs

using RooFit::HS3::Binning = std::variant<RegularBinning, EdgesBinning>
 
using RooFit::HS3::CombinedData = Combined<DataRef>
 
using RooFit::HS3::CombinedDist = Combined<DistributionRef>
 
using RooFit::HS3::Constraint = std::variant<Unconstrained, ConstraintType, ConstraintPdf>
 
using RooFit::HS3::DataRef = Ref<struct DataTag>
 
using RooFit::HS3::Diagnostics = std::vector<Diagnostic>
 
using RooFit::HS3::DomainRef = Ref<struct DomainTag>
 
using RooFit::HS3::GammaConstraint = std::variant<Unconstrained, ConstraintType, ConstantGammas, GammaConstraintPdfs>
 
using RooFit::HS3::LikelihoodRef = Ref<struct LikelihoodTag>
 
using RooFit::HS3::Modifier = std::variant<NormFactor, NormSys, HistoSys, ShapeSys, StatError, CustomModifier>
 
using RooFit::HS3::NameOrNumber = std::variant<std::string, double>
 A name, or a number for a constant.
 
using RooFit::HS3::ParameterPointRef = Ref<struct ParameterPointTag>
 
using RooFit::HS3::ParameterRef = Ref<struct ParameterTag>
 

Enumerations

enum class  RooFit::HS3::ConstraintType { RooFit::HS3::Gauss , RooFit::HS3::Poisson , RooFit::HS3::LogNormal }
 The constraint types that older documents named, for which RooFit creates the constraint terms. More...
 
enum class  RooFit::HS3::InterpolationClass { RooFit::HS3::Piecewise , RooFit::HS3::Flexible }
 The RooFit classes that implement the interpolations, which encode them with integer codes. More...
 
enum class  RooFit::HS3::InterpolationFunction { RooFit::HS3::Poly1 , RooFit::HS3::Poly2 , RooFit::HS3::Poly6 , RooFit::HS3::Exp }
 
enum class  RooFit::HS3::InterpolationType { RooFit::HS3::Add , RooFit::HS3::Mult }
 

Functions

std::string RooFit::HS3::arrayComponentForm (std::string const &componentType, RooFit::Detail::JSONNode const &component, RooFit::Detail::JSONNode const *defaults)
 A canonical form of the component component of an array distribution with the type componentType and the default parameters defaults (may be nullptr): the type and all fields after applying the defaults, sorted, with numbers in a canonical representation.
 
std::map< std::string, std::set< std::string > > RooFit::HS3::bookkeepingColumns (HS3Document const &doc)
 The bookkeeping columns by combined data set: the declared ones (RooFitInternal::bookkeepingColumns), except for those that are a variate of a distribution after all.
 
void RooFit::HS3::checkDocument (HS3Document const &doc, Diagnostics &diagnostics, ValidateOptions const &options={})
 The checks of validate(), for a document that is still needed if it doesn't pass them.
 
std::optional< int > RooFit::HS3::codeFromInterpolation (Interpolation const &interpolation, InterpolationClass interpolationClass)
 The integer code of an interpolation, or nothing if the class can't represent the interpolation.
 
std::set< std::string > RooFit::HS3::componentsWithData (HS3Document const &doc)
 The distributions that are components of a combined distribution of a likelihood, with a component of the paired combined data set that has entries: measurements of their own.
 
void RooFit::HS3::factorOutDefaultInterpolation (HistFactoryDist &dist)
 Makes the most common interpolation of the modifiers the "default_interpolation", which they then don't repeat.
 
template<class Body_t , class Objects_t >
auto RooFit::HS3::find (Objects_t &objects, std::string const &name) -> decltype(std::get_if< Body_t >(&objects.begin() ->body))
 The body of the object name if it is a Body_t, e.g. find<CombinedData>(doc.data, "obsData"), or nullptr.
 
template<class Objects_t >
auto RooFit::HS3::findByName (Objects_t &objects, std::string const &name) -> decltype(&*objects.begin())
 The object with the name name among the objects of a section, e.g. findByName(doc.data, "obsData"), or nullptr.
 
bool RooFit::HS3::hasErrors (Diagnostics const &diagnostics)
 Whether there is a diagnostic with error severity.
 
std::optional< Interpolation > RooFit::HS3::interpolationFromCode (int code, InterpolationClass interpolationClass)
 The interpolation for an integer code, or nothing if the class doesn't support the code.
 
void RooFit::HS3::mergeDuplicateModifiers (HistFactoryDist &dist, std::string const &channel, Diagnostics &diagnostics)
 Combines the modifiers of a sample that have the same type and name, which HistFactory models can have but documents can't: normsys by multiplying their variations, and histosys by adding up their differences to the nominal contents.
 
template<class... Ts>
std::string const & RooFit::HS3::nameOf (std::variant< Ts... > const &v)
 The name of the alternative that a variant holds, e.g. of an axis or of a modifier.
 
bool RooFit::HS3::operator!= (Interpolation const &l, Interpolation const &r)
 
bool RooFit::HS3::operator< (Interpolation const &l, Interpolation const &r)
 
bool RooFit::HS3::operator< (Version const &l, Version const &r)
 
bool RooFit::HS3::operator== (ConstraintPdf const &l, ConstraintPdf const &r)
 
bool RooFit::HS3::operator== (Interpolation const &l, Interpolation const &r)
 
bool RooFit::HS3::operator== (Unconstrained, Unconstrained)
 
template<class... Ts>
 RooFit::HS3::overloaded (Ts...) -> overloaded< Ts... >
 
std::vector< BinnedAxis > RooFit::HS3::parseBinnedAxes (Detail::JSONNode const &axes, Diagnostics &diagnostics)
 Reads the axes of binned data that doesn't come with a document.
 
Data RooFit::HS3::parseData (Detail::JSONNode const &data, Diagnostics &diagnostics)
 Reads a data set that doesn't come with a document.
 
Distribution RooFit::HS3::parseDistribution (Detail::JSONNode const &distribution, Diagnostics &diagnostics)
 Reads a distribution that doesn't come with a document.
 
HS3Document RooFit::HS3::parseDocument (Detail::JSONNode const &root, Diagnostics &diagnostics, ParseOptions const &options={})
 Reads a document.
 
HistFactoryDist RooFit::HS3::parseHistFactoryDist (Detail::JSONNode const &distribution, Diagnostics &diagnostics)
 Reads a HistFactory distribution that doesn't come with a document.
 
InterpolatedFunction RooFit::HS3::parseInterpolatedFunction (Detail::JSONNode const &node, Diagnostics &diagnostics)
 Reads the functions "interpolation" and "interpolation0d", which don't come with a document.
 
InterpolatedNumber RooFit::HS3::parseInterpolatedNumber (Detail::JSONNode const &node, Diagnostics &diagnostics)
 
bool RooFit::HS3::parseVersion (std::string const &version, Version &out)
 Reads the leading "MAJOR.MINOR" and the optional ".PATCH" of an HS3 version string.
 
AuxiliaryConstraints RooFit::HS3::readAuxiliaryChannelsAsConstraints (ValidatedHS3Document &doc, bool asChannels)
 RooFit writes an array of constraints with the data set of its observed values as a component of the combined distribution of the model (RooJSONFactoryWSTool::Config::exportConstraintData), and marks it in misc.ROOT_internal.auxiliary_channels.
 
std::vector< std::string > RooFit::HS3::resolvePointData (ValidatedHS3Document &doc)
 A number given in-line in the "data" of a likelihood, or a point data set without axes, is the value of the single variate of the paired distribution (HS3 0.3).
 
std::map< std::string, std::set< std::string > > RooFit::HS3::sharedAxes (HS3Document const &doc)
 The axes that several components of a combined data set have, by combined data set.
 
std::vector< std::string > RooFit::HS3::sharedVariates (HS3Document const &doc)
 Describes each variate that is shared although it must be distinct: by the terms of a likelihood, by the components of a combined distribution that no likelihood lists (the others are checked through the likelihood), or by the components of a combined data set, except for bookkeeping columns.
 
char const * RooFit::HS3::toString (ConstraintType type)
 
char const * RooFit::HS3::toString (InterpolationFunction function)
 
char const * RooFit::HS3::toString (InterpolationType type)
 
char const * RooFit::HS3::typeOf (Modifier const &modifier)
 The type of a modifier, as the standard names it.
 
std::vector< std::string > RooFit::HS3::unlistedConstraints (HS3Document const &doc, std::vector< std::string > *warnings=nullptr)
 In HS3 0.3 (HS3 PR #154, decision on HS3 #156), the "constraints" of a HistFactory modifier add no term to a likelihood: every likelihood that contains the channel must list each named distribution exactly once, in "distributions" or "aux_distributions", or as a factor of a product_dist or a component of a combined_dist reached from them.
 
void RooFit::HS3::upgradeDocument (Detail::JSONNode &root, Diagnostics &diagnostics, ParseOptions const &options={})
 Rewrites everything that older versions of RooFit wrote in a way that is not part of the standard into the form that parseDocument() understands.
 
void RooFit::HS3::upgradeHistFactoryDist (Detail::JSONNode &distribution, Version const &version, Diagnostics &diagnostics)
 Same as upgradeDocument(), but for a single HistFactory distribution that doesn't come with a document.
 
std::optional< ValidatedHS3Document > RooFit::HS3::validate (HS3Document doc, Diagnostics &diagnostics, ValidateOptions const &options={})
 Checks what can be checked without knowing how the objects are built: unique names, that the references can be resolved, and that the sizes of arrays are consistent.
 
void RooFit::HS3::validateCombinedDist (CombinedDist const &dist, std::string const &name, Diagnostics &diagnostics)
 
void RooFit::HS3::validateHistFactoryDist (HistFactoryDist const &dist, std::string const &name, Diagnostics &diagnostics)
 Same as validate(), but for a single HistFactory or combined distribution that doesn't come with a document.
 
std::set< std::string > RooFit::HS3::variatesOf (HS3Document const &doc, Likelihood const &likelihood)
 The variates of the "distributions" of a likelihood, which it pairs with data, with the columns of its combined distributions.
 
std::set< std::string > RooFit::HS3::variatesOf (HS3Document const &doc, std::string const &distribution)
 The variates of the distribution distribution, without the columns of a combined distribution.
 
void RooFit::HS3::writeAxis (Detail::JSONNode &node, BinnedAxis const &axis)
 Writes an axis of binned data.
 
void RooFit::HS3::writeBinnedData (Detail::JSONNode &node, BinnedData const &data)
 Writes the axes, contents and uncertainties of binned data, without its name and type.
 
void RooFit::HS3::writeCombinedDist (Detail::JSONNode &node, CombinedDist const &dist)
 Writes a combined distribution, without its name.
 
void RooFit::HS3::writeContents (Detail::JSONNode &node, std::vector< double > const &values)
 Writes an array of numbers, each as an integer if it has no fractional part.
 
void RooFit::HS3::writeDocument (Detail::JSONNode &root, HS3Document const &doc)
 Writes everything but the distributions and functions, which are written one by one while they are exported: the generic ones by the exporters, and the others with functions like writeHistFactoryDist().
 
void RooFit::HS3::writeHistFactoryDist (Detail::JSONNode &node, HistFactoryDist const &dist)
 Writes a HistFactory distribution, without its name.
 
void RooFit::HS3::writeInterpolatedFunction (Detail::JSONNode &node, InterpolatedFunction const &function)
 Writes the functions "interpolation" and "interpolation0d", with a single interpolation if they are all the same.
 
void RooFit::HS3::writeInterpolatedNumber (Detail::JSONNode &node, InterpolatedNumber const &function)
 
void RooFit::HS3::writeInterpolation (Detail::JSONNode &node, Interpolation const &interpolation)
 
std::map< std::string, std::set< std::string > > RooFit::HS3::writeLikelihoodTermsOnce (HS3Document const &doc, Detail::JSONNode &root)
 Writes each term of the likelihoods once: a factor of a product that is a term of the likelihood as well would enter it twice, so it is removed from the "factors" of the product in root, the JSON tree that the document is written to.
 

Variables

constexpr Interpolation RooFit::HS3::additivePiecewiseLinear
 
constexpr Interpolation RooFit::HS3::additivePolynomialLinear
 
constexpr Interpolation RooFit::HS3::additiveQuadraticLinear
 
constexpr char const * RooFit::HS3::defaultDomainName = "default_domain"
 The domain in which RooFit writes the ranges of all variables. It is a convention of RooFit, not of the standard.
 
constexpr Interpolation RooFit::HS3::multiplicativePiecewiseExponential
 
constexpr Interpolation RooFit::HS3::multiplicativePolynomialExponential
 
constexpr Interpolation RooFit::HS3::multiplicativePolynomialLinear