Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
HS3Builder.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Jonas Rembser, CERN, Nov 2026
5 *
6 * Copyright (c) 2026, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef RooFit_HS3Builder_h
14#define RooFit_HS3Builder_h
15
16#include "HS3Document.h"
17
18#include <RooArgSet.h>
19
20#include <memory>
21#include <string>
22#include <vector>
23
24class RooAbsArg;
25class RooAbsBinning;
26class RooDataHist;
28class RooRealVar;
29
30namespace RooFit {
31namespace JSONIO {
32class Importer;
33}
34
35namespace HS3 {
36
37/// Forward the warnings to the message service, and throw if there are errors. The paths of the diagnostics start with
38/// the name of the object, if they are about an object that doesn't come with a document.
39void report(Diagnostics const &diagnostics, std::string const &object = "");
40
41/// Create the variables for the axes of binned data.
42RooArgSet createObservables(std::vector<BinnedAxis> const &axes);
43
44/// The axis of binned data for a variable, or for a binning of a variable with the given name.
45BinnedAxis toBinnedAxis(RooRealVar const &var);
46BinnedAxis toBinnedAxis(std::string const &name, RooAbsBinning const &binning);
47
48/// The name of an object, or the value of a literal constant.
50
51/// Create a RooDataHist with the contents and errors. If there are no errors, it doesn't store squared weights.
52std::unique_ptr<RooDataHist> createDataHist(std::string const &name, RooArgSet const &vars,
53 std::vector<double> const &contents, std::vector<double> const *errors);
54
55/// Create the RooFit objects of a HistFactory distribution in the workspace of the tool.
56void buildHistFactoryDist(RooJSONFactoryWSTool &tool, std::string const &name, HistFactoryDist const &dist);
57
58/// Create the RooSimultaneous of a combined distribution in the workspace of the tool. The other terms of the
59/// likelihoods that have the distribution are the candidates for the constraint terms of its components.
60void buildCombinedDist(RooJSONFactoryWSTool &tool, std::string const &name, CombinedDist const &dist,
61 std::vector<std::string> const &otherLikelihoodTerms = {});
62
63/// Called by the exporter of a HistFactory distribution, which is then written by the tool. The constraint terms that
64/// no modifier names are passed separately.
65void setExportedObject(RooJSONFactoryWSTool &tool, HistFactoryDist dist,
66 std::vector<DistributionRef> channelConstraints);
67
68/// Whether this is the importer that RooFit registers for HistFactory distributions, as opposed to the one of a user.
69bool isBuiltinHistFactoryImporter(JSONIO::Importer const &importer);
70
71} // namespace HS3
72} // namespace RooFit
73
74#endif
char name[80]
Definition TGX11.cxx:142
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Abstract base class for RooRealVar binning definitions.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Container class to hold N-dimensional binned data.
Definition RooDataHist.h:40
When using RooFit, statistical models can be conveniently handled and stored as a RooWorkspace.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Types that represent an HS3 document.
std::variant< std::string, double > NameOrNumber
A name, or a number for a constant.
void buildCombinedDist(RooJSONFactoryWSTool &tool, std::string const &name, CombinedDist const &dist, std::vector< std::string > const &otherLikelihoodTerms={})
Create the RooSimultaneous of a combined distribution in the workspace of the tool.
void setExportedObject(RooJSONFactoryWSTool &tool, HistFactoryDist dist, std::vector< DistributionRef > channelConstraints)
Called by the exporter of a HistFactory distribution, which is then written by the tool.
void report(Diagnostics const &diagnostics, std::string const &object="")
Forward the warnings to the message service, and throw if there are errors.
RooArgSet createObservables(std::vector< BinnedAxis > const &axes)
Create the variables for the axes of binned data.
std::vector< Diagnostic > Diagnostics
NameOrNumber toNameOrNumber(RooAbsArg const &arg)
The name of an object, or the value of a literal constant.
BinnedAxis toBinnedAxis(RooRealVar const &var)
The axis of binned data for a variable, or for a binning of a variable with the given name.
std::unique_ptr< RooDataHist > createDataHist(std::string const &name, RooArgSet const &vars, std::vector< double > const &contents, std::vector< double > const *errors)
Create a RooDataHist with the contents and errors. If there are no errors, it doesn't store squared w...
bool isBuiltinHistFactoryImporter(JSONIO::Importer const &importer)
Whether this is the importer that RooFit registers for HistFactory distributions, as opposed to the o...
void buildHistFactoryDist(RooJSONFactoryWSTool &tool, std::string const &name, HistFactoryDist const &dist)
Create the RooFit objects of a HistFactory distribution in the workspace of the tool.
Combined< DistributionRef > CombinedDist
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:73