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 RooDataHist;
27class RooRealVar;
28
29namespace RooFit {
30namespace JSONIO {
31class Importer;
32}
33
34namespace HS3 {
35
36/// Forward the warnings to the message service, and throw if there are errors.
37void report(Diagnostics const &diagnostics);
38
39/// Create the variables for the axes of binned data.
40RooArgSet createObservables(std::vector<BinnedAxis> const &axes);
41
42/// The axis of binned data for a variable.
43BinnedAxis toBinnedAxis(RooRealVar const &var);
44
45/// The name of an object, or the value of a literal constant.
47
48/// Create a RooDataHist with the contents and errors. If there are no errors, it doesn't store squared weights.
49std::unique_ptr<RooDataHist> createDataHist(std::string const &name, RooArgSet const &vars,
50 std::vector<double> const &contents, std::vector<double> const *errors);
51
52/// Create the RooFit objects of a HistFactory distribution in the workspace of the tool. The constraint terms that no
53/// modifier names are passed separately.
54void buildHistFactoryDist(RooJSONFactoryWSTool &tool, std::string const &name, HistFactoryDist const &dist,
55 std::vector<DistributionRef> const *channelConstraints = nullptr);
56
57/// Called by the exporter of a HistFactory distribution, which is then written by the tool. The constraint terms that
58/// no modifier names are passed separately.
59void setExportedObject(RooJSONFactoryWSTool &tool, HistFactoryDist dist,
60 std::vector<DistributionRef> channelConstraints);
61
62/// Whether this is the importer that RooFit registers for HistFactory distributions, as opposed to the one of a user.
63bool isBuiltinHistFactoryImporter(JSONIO::Importer const &importer);
64
65/// What the built-in importer does with a HistFactory distribution, plus the constraint terms of the channel.
66void importHistFactoryNode(RooJSONFactoryWSTool &tool, Detail::JSONNode const &node,
67 std::vector<DistributionRef> const *channelConstraints);
68
69} // namespace HS3
70} // namespace RooFit
71
72#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
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 buildHistFactoryDist(RooJSONFactoryWSTool &tool, std::string const &name, HistFactoryDist const &dist, std::vector< DistributionRef > const *channelConstraints=nullptr)
Create the RooFit objects of a HistFactory 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.
RooArgSet createObservables(std::vector< BinnedAxis > const &axes)
Create the variables for the axes of binned data.
void importHistFactoryNode(RooJSONFactoryWSTool &tool, Detail::JSONNode const &node, std::vector< DistributionRef > const *channelConstraints)
What the built-in importer does with a HistFactory distribution, plus the constraint terms of the cha...
std::vector< Diagnostic > Diagnostics
void report(Diagnostics const &diagnostics)
Forward the warnings to the message service, and throw if there are errors.
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.
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...
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:73