37 auto const &
bound = node[key];
38 return bound.is_null() ? defaultValue :
bound.val_double();
58 for (
const auto &domain :
_map) {
61 domain.second.registerBinnings(domain.first.c_str(), ws);
90 for (
auto &domain : node.
children()) {
91 if (!domain.has_child(
"name")) {
94 auto &
name = domain[
"name"];
101 for (
auto const &domain :
_map) {
111 for (
auto const &domain :
_map) {
112 if (domain.second.hasVariable(
name)) {
126 elem.hasNBins =
false;
130 const int nBins = binning.
numBins();
136 elem.hasNBins =
true;
140 for (
int i = 0; i < nBins; ++i) {
154 readBinning(
elem, binning);
159 if (!
elem.edges.empty()) {
165 }
else if (
elem.hasNBins &&
elem.nBins != 0) {
172 if (!
elem.edges.empty()) {
173 auto &edges = node[
"edges"].
set_seq();
175 edges.append_child() <<
edge;
177 }
else if (
elem.hasNBins &&
elem.nBins != 0) {
178 node[
"nbins"] <<
elem.nBins;
184 if (found !=
_map.end()) {
185 auto const &
elem = found->second;
200 applyBinning(var,
elem);
211 if (!node.
has_child(
"type") || node[
"type"].
val() !=
"product_domain") {
217 if (
varNode.has_child(
"min")) {
221 if (
varNode.has_child(
"max")) {
225 if (
varNode.has_child(
"edges")) {
226 elem.hasNBins =
false;
228 for (
auto const &
edge :
varNode[
"edges"].children()) {
229 elem.edges.push_back(
edge.val_double());
231 if (!
elem.edges.empty()) {
241 }
else if (
varNode.has_child(
"nbins")) {
252 node[
"type"] <<
"product_domain";
273 applyBinning(var,
elem);
281 auto *var = ws.
var(
item.first);
287 applyBinning(*var,
item.second,
name);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
const_iterator end() const
Abstract base class for RooRealVar binning definitions.
Int_t numBins() const
Return number of bins.
virtual double binLow(Int_t bin) const =0
virtual bool isUniform() const
virtual double highBound() const =0
virtual double lowBound() const =0
virtual double binHigh(Int_t bin) const =0
Implements a RooAbsBinning in terms of an array of boundary values, posing no constraints on the choi...
bool addBoundary(double boundary)
Add bin boundary at given value.
virtual std::string val() const =0
virtual JSONNode & set_map()=0
virtual JSONNode & set_null()=0
virtual children_view children()
virtual JSONNode & set_seq()=0
virtual bool has_child(std::string const &) const =0
void registerBinnings(const char *name, RooWorkspace &ws) const
bool hasVariable(const char *name) const
static void writeBinning(RooFit::Detail::JSONNode &node, ProductDomainElement const &elem)
static void readBinning(ProductDomainElement &elem, RooAbsBinning const &binning)
void populate(RooWorkspace &ws) const
static void applyBinning(RooRealVar &var, ProductDomainElement const &elem, const char *name=nullptr)
void readVariable(const RooRealVar &)
void writeJSON(RooFit::Detail::JSONNode &) const
void readJSON(RooFit::Detail::JSONNode const &)
void writeVariable(RooRealVar &) const
void populate(RooWorkspace &ws) const
std::map< std::string, ProductDomain > _map
void writeVariable(RooRealVar &) const
void readVariable(RooRealVar const &)
void writeJSON(RooFit::Detail::JSONNode &) const
void readJSON(RooFit::Detail::JSONNode const &)
bool hasVariable(const char *name) const
static constexpr double infinity()
Return internal infinity representation.
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Variable that can be changed from the outside.
void removeMin(const char *name=nullptr)
Remove lower range limit for binning with given name. Empty name means default range.
void setMin(const char *name, double value, bool shared=true)
Set minimum of name range to given value.
std::list< std::string > getBinningNames() const override
Get a list of all binning names.
void setBins(Int_t nBins, const char *name=nullptr, bool shared=true)
Create a uniform binning under name 'name' for this variable.
void setBinning(const RooAbsBinning &binning, const char *name=nullptr, bool shared=true)
Add given binning under name 'name' with this variable.
void setMax(const char *name, double value, bool shared=true)
Set maximum of name range to given value.
void removeMax(const char *name=nullptr)
Remove upper range limit for binning with given name. Empty name means default range.
const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false, bool shared=true) const override
Return binning definition with name.
Persistable container for RooFit projects.
RooAbsArg * arg(RooStringView name) const
Return RooAbsArg with given name. A null pointer is returned if none is found.
RooRealVar * var(RooStringView name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
bool import(const RooAbsArg &arg, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={})
Import a RooAbsArg object, e.g.
const char * GetName() const override
Returns name of object.
static constexpr auto defaultDomainName
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...