Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
JSONFactories_RooFitCore.cxx
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Carsten D. Burgard, DESY/ATLAS, Dec 2021
5 *
6 * Copyright (c) 2022, 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
14
15#include <RooAddPdf.h>
16#include <RooBinSamplingPdf.h>
17#include <RooBinWidthFunction.h>
18#include <RooCategory.h>
19#include <RooDataHist.h>
21#include <RooFitHS3/JSONIO.h>
22#include <RooFormulaVar.h>
23#include <RooGenericPdf.h>
24#include <RooMultiVarGaussian.h>
25#include <RooTFnBinding.h>
26#include <RooHistFunc.h>
27#include <RooHistPdf.h>
28#include <RooProdPdf.h>
29#include <RooPolynomial.h>
30#include <RooRealSumFunc.h>
31#include <RooRealSumPdf.h>
32#include <RooRealVar.h>
33#include <RooWorkspace.h>
34
35#include <TF1.h>
36#include <TH1.h>
37
38#include "static_execute.h"
39
41
42///////////////////////////////////////////////////////////////////////////////////////////////////////
43// individually implemented importers
44///////////////////////////////////////////////////////////////////////////////////////////////////////
45
46namespace {
47/**
48 * Extracts arguments from a mathematical expression.
49 *
50 * This function takes a string representing a mathematical
51 * expression and extracts the arguments from it. The arguments are
52 * defined as sequences of characters that do not contain digits,
53 * spaces, or parentheses, and that start with a letter. Function
54 * calls such as "exp( ... )", identified as being followed by an
55 * opening parenthesis, are not treated as arguments. The extracted
56 * arguments are returned as a vector of strings.
57 *
58 * @param expression A string representing a mathematical expression.
59 * @return A vector of strings representing the extracted arguments.
60 */
61std::vector<std::string> extract_arguments(const std::string &expression)
62{
63 std::vector<std::string> arguments;
64 size_t startidx = expression.size();
65 for (size_t i = 0; i < expression.size(); ++i) {
66 if (startidx >= expression.size()) {
67 if (isalpha(expression[i])) {
68 startidx = i;
69 }
70 } else {
71 if (!isdigit(expression[i]) && !isalpha(expression[i]) && expression[i] != '_') {
72 if (expression[i] == ' ')
73 continue;
74 if (expression[i] == '(') {
75 startidx = expression.size();
76 continue;
77 }
78 std::string arg(expression.substr(startidx, i - startidx));
79 startidx = expression.size();
80 arguments.push_back(arg);
81 }
82 }
83 }
84 if (startidx < expression.size())
85 arguments.push_back(expression.substr(startidx));
86 return arguments;
87}
88
89template <class RooArg_t>
90class RooFormulaArgFactory : public RooFit::JSONIO::Importer {
91public:
92 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
93 {
94 std::string name(RooJSONFactoryWSTool::name(p));
95 if (!p.has_child("expression")) {
96 RooJSONFactoryWSTool::error("no expression given for '" + name + "'");
97 }
98 TString formula(p["expression"].val());
99 RooArgList dependents;
100 for (const auto &d : extract_arguments(formula.Data())) {
101 dependents.add(*tool->request<RooAbsReal>(d, name));
102 }
103 tool->wsImport(RooArg_t{name.c_str(), formula, dependents});
104 return true;
105 }
106};
107
108class RooAddPdfFactory : public RooFit::JSONIO::Importer {
109public:
110 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
111 {
112 std::string name(RooJSONFactoryWSTool::name(p));
113 tool->wsEmplace<RooAddPdf>(name, tool->requestArgList<RooAbsPdf>(p, "summands"),
114 tool->requestArgList<RooAbsReal>(p, "coefficients"));
115 return true;
116 }
117};
118
119class RooBinWidthFunctionFactory : public RooFit::JSONIO::Importer {
120public:
121 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
122 {
123 std::string name(RooJSONFactoryWSTool::name(p));
124 RooHistFunc *hf = static_cast<RooHistFunc *>(tool->request<RooAbsReal>(p["histogram"].val(), name));
125 tool->wsEmplace<RooBinWidthFunction>(name, *hf, p["divideByBinWidth"].val_bool());
126 return true;
127 }
128};
129
130class RooBinSamplingPdfFactory : public RooFit::JSONIO::Importer {
131public:
132 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
133 {
134 std::string name(RooJSONFactoryWSTool::name(p));
135
136 RooAbsPdf *pdf = tool->requestArg<RooAbsPdf>(p, "pdf");
137 RooRealVar *obs = tool->requestArg<RooRealVar>(p, "observable");
138
139 if (!pdf->dependsOn(*obs)) {
140 pdf->Print("t");
141 RooJSONFactoryWSTool::error(std::string("pdf '") + pdf->GetName() + "' does not depend on observable '" +
142 obs->GetName() + "' as indicated by parent RooBinSamplingPdf '" + name +
143 "', please check!");
144 }
145
146 if (!p.has_child("epsilon")) {
147 RooJSONFactoryWSTool::error("no epsilon given in '" + name + "'");
148 }
149 double epsilon(p["epsilon"].val_double());
150
151 tool->wsEmplace<RooBinSamplingPdf>(name, *obs, *pdf, epsilon);
152
153 return true;
154 }
155};
156
157class RooRealSumPdfFactory : public RooFit::JSONIO::Importer {
158public:
159 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
160 {
161 std::string name(RooJSONFactoryWSTool::name(p));
162
163 bool extended = false;
164 if (p.has_child("extended") && p["extended"].val_bool()) {
165 extended = true;
166 }
167 tool->wsEmplace<RooRealSumPdf>(name, tool->requestArgList<RooAbsReal>(p, "samples"),
168 tool->requestArgList<RooAbsReal>(p, "coefficients"), extended);
169 return true;
170 }
171};
172
173class RooRealSumFuncFactory : public RooFit::JSONIO::Importer {
174public:
175 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
176 {
177 std::string name(RooJSONFactoryWSTool::name(p));
178 tool->wsEmplace<RooRealSumFunc>(name, tool->requestArgList<RooAbsReal>(p, "samples"),
179 tool->requestArgList<RooAbsReal>(p, "coefficients"));
180 return true;
181 }
182};
183
184class RooPolynomialFactory : public RooFit::JSONIO::Importer {
185public:
186 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
187 {
188 std::string name(RooJSONFactoryWSTool::name(p));
189 if (!p.has_child("coefficients")) {
190 RooJSONFactoryWSTool::error("no coefficients given in '" + name + "'");
191 }
192 RooAbsReal *x = tool->requestArg<RooAbsReal>(p, "x");
193 RooArgList coefs;
194 int order = 0;
195 int lowestOrder = 0;
196 for (const auto &coef : p["coefficients"].children()) {
197 // As long as the coefficients match the default coefficients in
198 // RooFit, we don't have to instantiate RooFit objects but can
199 // increase the lowestOrder flag.
200 if (order == 0 && coef.val() == "1.0") {
201 ++lowestOrder;
202 } else if (coefs.empty() && coef.val() == "0.0") {
203 ++lowestOrder;
204 } else {
205 coefs.add(*tool->request<RooAbsReal>(coef.val(), name));
206 }
207 ++order;
208 }
209
210 tool->wsEmplace<RooPolynomial>(name, *x, coefs, lowestOrder);
211 return true;
212 }
213};
214
215class RooMultiVarGaussianFactory : public RooFit::JSONIO::Importer {
216public:
217 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
218 {
219 std::string name(RooJSONFactoryWSTool::name(p));
220 bool has_cov = p.has_child("covariances");
221 bool has_corr = p.has_child("correlations") && p.has_child("standard_deviations");
222 if (!has_cov && !has_corr) {
223 RooJSONFactoryWSTool::error("no covariances or correlations+standard_deviations given in '" + name + "'");
224 }
225
226 TMatrixDSym covmat;
227
228 if (has_cov) {
229 int n = p["covariances"].num_children();
230 int i = 0;
231 covmat.ResizeTo(n, n);
232 for (const auto &row : p["covariances"].children()) {
233 int j = 0;
234 for (const auto &val : row.children()) {
235 covmat(i, j) = val.val_double();
236 ++j;
237 }
238 ++i;
239 }
240 } else {
241 std::vector<double> variances;
242 for (const auto &v : p["standard_deviations"].children()) {
243 variances.push_back(v.val_double());
244 }
245 covmat.ResizeTo(variances.size(), variances.size());
246 int i = 0;
247 for (const auto &row : p["correlations"].children()) {
248 int j = 0;
249 for (const auto &val : row.children()) {
250 covmat(i, j) = val.val_double() * variances[i] * variances[j];
251 ++j;
252 }
253 ++i;
254 }
255 }
257 tool->requestArgList<RooAbsReal>(p, "mean"), covmat);
258 return true;
259 }
260};
261
262///////////////////////////////////////////////////////////////////////////////////////////////////////
263// specialized exporter implementations
264///////////////////////////////////////////////////////////////////////////////////////////////////////
265
266class RooRealSumPdfStreamer : public RooFit::JSONIO::Exporter {
267public:
268 std::string const &key() const override;
269 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
270 {
271 const RooRealSumPdf *pdf = static_cast<const RooRealSumPdf *>(func);
272 elem["type"] << key();
273 RooJSONFactoryWSTool::fillSeq(elem["samples"], pdf->funcList());
274 RooJSONFactoryWSTool::fillSeq(elem["coefficients"], pdf->coefList());
275 elem["extended"] << (pdf->extendMode() == RooAbsPdf::CanBeExtended);
276 return true;
277 }
278};
279
280class RooRealSumFuncStreamer : public RooFit::JSONIO::Exporter {
281public:
282 std::string const &key() const override;
283 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
284 {
285 const RooRealSumFunc *pdf = static_cast<const RooRealSumFunc *>(func);
286 elem["type"] << key();
287 RooJSONFactoryWSTool::fillSeq(elem["samples"], pdf->funcList());
288 RooJSONFactoryWSTool::fillSeq(elem["coefficients"], pdf->coefList());
289 return true;
290 }
291};
292
293class RooHistFuncStreamer : public RooFit::JSONIO::Exporter {
294public:
295 std::string const &key() const override;
296 bool exportObject(RooJSONFactoryWSTool *tool, const RooAbsArg *func, JSONNode &elem) const override
297 {
298 const RooHistFunc *hf = static_cast<const RooHistFunc *>(func);
299 elem["type"] << key();
300 RooDataHist const &dh = hf->dataHist();
301 tool->exportHisto(*dh.get(), dh.numEntries(), dh.weightArray(), elem["data"].set_map());
302 return true;
303 }
304};
305
306class RooHistFuncFactory : public RooFit::JSONIO::Importer {
307public:
308 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
309 {
310 std::string name(RooJSONFactoryWSTool::name(p));
311 if (!p.has_child("data")) {
312 RooJSONFactoryWSTool::error("function '" + name + "' is of histogram type, but does not define a 'data' key");
313 }
314 std::unique_ptr<RooDataHist> dataHist = RooJSONFactoryWSTool::readBinnedData(p["data"], name);
315 tool->wsEmplace<RooHistFunc>(name, *dataHist->get(), *dataHist);
316 return true;
317 }
318};
319
320class RooHistPdfStreamer : public RooFit::JSONIO::Exporter {
321public:
322 std::string const &key() const override;
323 bool exportObject(RooJSONFactoryWSTool *tool, const RooAbsArg *func, JSONNode &elem) const override
324 {
325 const RooHistPdf *hf = static_cast<const RooHistPdf *>(func);
326 elem["type"] << key();
327 RooDataHist const &dh = hf->dataHist();
328 tool->exportHisto(*dh.get(), dh.numEntries(), dh.weightArray(), elem["data"].set_map());
329 return true;
330 }
331};
332
333class RooHistPdfFactory : public RooFit::JSONIO::Importer {
334public:
335 bool importArg(RooJSONFactoryWSTool *tool, const JSONNode &p) const override
336 {
337 std::string name(RooJSONFactoryWSTool::name(p));
338 if (!p.has_child("data")) {
339 RooJSONFactoryWSTool::error("function '" + name + "' is of histogram type, but does not define a 'data' key");
340 }
341 std::unique_ptr<RooDataHist> dataHist = RooJSONFactoryWSTool::readBinnedData(p["data"], name);
342 tool->wsEmplace<RooHistPdf>(name, *dataHist->get(), *dataHist);
343 return true;
344 }
345};
346
347class RooBinSamplingPdfStreamer : public RooFit::JSONIO::Exporter {
348public:
349 std::string const &key() const override;
350 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
351 {
352 const RooBinSamplingPdf *pdf = static_cast<const RooBinSamplingPdf *>(func);
353 elem["type"] << key();
354 elem["pdf"] << pdf->pdf().GetName();
355 elem["observable"] << pdf->observable().GetName();
356 elem["epsilon"] << pdf->epsilon();
357 return true;
358 }
359};
360
361class RooBinWidthFunctionStreamer : public RooFit::JSONIO::Exporter {
362public:
363 std::string const &key() const override;
364 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
365 {
366 const RooBinWidthFunction *pdf = static_cast<const RooBinWidthFunction *>(func);
367 elem["type"] << key();
368 elem["histogram"] << pdf->histFunc().GetName();
369 elem["divideByBinWidth"] << pdf->divideByBinWidth();
370 return true;
371 }
372};
373
374template <class RooArg_t>
375class RooFormulaArgStreamer : public RooFit::JSONIO::Exporter {
376public:
377 std::string const &key() const override;
378 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
379 {
380 const RooArg_t *pdf = static_cast<const RooArg_t *>(func);
381 elem["type"] << key();
382 TString expression(pdf->expression());
383 for (size_t i = 0; i < pdf->nParameters(); ++i) {
384 RooAbsArg *par = pdf->getParameter(i);
385 std::stringstream ss;
386 ss << "x[" << i << "]";
387 expression.ReplaceAll(ss.str().c_str(), par->GetName());
388 }
389 elem["expression"] << expression.Data();
390 return true;
391 }
392};
393
394class RooPolynomialStreamer : public RooFit::JSONIO::Exporter {
395public:
396 std::string const &key() const override;
397 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
398 {
399 auto *pdf = static_cast<const RooPolynomial *>(func);
400 elem["type"] << key();
401 elem["x"] << pdf->x().GetName();
402 auto &coefs = elem["coefficients"].set_seq();
403 // Write out the default coefficient that RooFit uses for the lower
404 // orders before the order of the first coefficient. Like this, the
405 // output is more self-documenting.
406 for (int i = 0; i < pdf->lowestOrder(); ++i) {
407 coefs.append_child() << (i == 0 ? "1.0" : "0.0");
408 }
409 for (const auto &coef : pdf->coefList()) {
410 coefs.append_child() << coef->GetName();
411 }
412 return true;
413 }
414};
415
416class RooMultiVarGaussianStreamer : public RooFit::JSONIO::Exporter {
417public:
418 std::string const &key() const override;
419 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
420 {
421 auto *pdf = static_cast<const RooMultiVarGaussian *>(func);
422 elem["type"] << key();
423 RooJSONFactoryWSTool::fillSeq(elem["x"], pdf->xVec());
424 RooJSONFactoryWSTool::fillSeq(elem["mean"], pdf->muVec());
425 elem["covariances"].fill_mat(pdf->covarianceMatrix());
426 return true;
427 }
428};
429
430class RooTFnBindingStreamer : public RooFit::JSONIO::Exporter {
431public:
432 std::string const &key() const override;
433 bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
434 {
435 auto *pdf = static_cast<const RooTFnBinding *>(func);
436 elem["type"] << key();
437
438 TString formula(pdf->function().GetExpFormula());
439 formula.ReplaceAll("x", pdf->observables()[0].GetName());
440 formula.ReplaceAll("y", pdf->observables()[1].GetName());
441 formula.ReplaceAll("z", pdf->observables()[2].GetName());
442 for (size_t i = 0; i < pdf->parameters().size(); ++i) {
443 TString pname(TString::Format("[%d]", (int)i));
444 formula.ReplaceAll(pname, pdf->parameters()[i].GetName());
445 }
446 elem["expression"] << formula.Data();
447 return true;
448 }
449};
450
451#define DEFINE_EXPORTER_KEY(class_name, name) \
452 std::string const &class_name::key() const \
453 { \
454 const static std::string keystring = name; \
455 return keystring; \
456 }
457
458template <>
459DEFINE_EXPORTER_KEY(RooFormulaArgStreamer<RooGenericPdf>, "generic_dist");
460template <>
461DEFINE_EXPORTER_KEY(RooFormulaArgStreamer<RooFormulaVar>, "generic_function");
462DEFINE_EXPORTER_KEY(RooRealSumPdfStreamer, "weighted_sum_dist");
463DEFINE_EXPORTER_KEY(RooRealSumFuncStreamer, "weighted_sum");
464DEFINE_EXPORTER_KEY(RooHistFuncStreamer, "histogram");
465DEFINE_EXPORTER_KEY(RooHistPdfStreamer, "histogram_dist");
466DEFINE_EXPORTER_KEY(RooBinSamplingPdfStreamer, "binsampling");
467DEFINE_EXPORTER_KEY(RooBinWidthFunctionStreamer, "binwidth");
468DEFINE_EXPORTER_KEY(RooPolynomialStreamer, "polynomial_dist");
469DEFINE_EXPORTER_KEY(RooMultiVarGaussianStreamer, "multinormal_dist");
470DEFINE_EXPORTER_KEY(RooTFnBindingStreamer, "generic_function");
471
472///////////////////////////////////////////////////////////////////////////////////////////////////////
473// instantiate all importers and exporters
474///////////////////////////////////////////////////////////////////////////////////////////////////////
475
476STATIC_EXECUTE([]() {
477 using namespace RooFit::JSONIO;
478
479 registerImporter<RooFormulaArgFactory<RooGenericPdf>>("generic_dist", false);
480 registerImporter<RooFormulaArgFactory<RooFormulaVar>>("generic_function", false);
481 registerImporter<RooBinSamplingPdfFactory>("binsampling_dist", false);
482 registerImporter<RooAddPdfFactory>("mixture_dist", false);
483 registerImporter<RooHistFuncFactory>("histogram", false);
484 registerImporter<RooHistPdfFactory>("histogram_dist", false);
485 registerImporter<RooBinWidthFunctionFactory>("binwidth", false);
486 registerImporter<RooRealSumPdfFactory>("weighted_sum_dist", false);
487 registerImporter<RooRealSumFuncFactory>("weighted_sum", false);
488 registerImporter<RooPolynomialFactory>("polynomial_dist", false);
489 registerImporter<RooMultiVarGaussianFactory>("multinormal_dist", false);
490
491 registerExporter<RooBinWidthFunctionStreamer>(RooBinWidthFunction::Class(), false);
492 registerExporter<RooBinSamplingPdfStreamer>(RooBinSamplingPdf::Class(), false);
493 registerExporter<RooHistFuncStreamer>(RooHistFunc::Class(), false);
494 registerExporter<RooHistPdfStreamer>(RooHistPdf::Class(), false);
495 registerExporter<RooFormulaArgStreamer<RooGenericPdf>>(RooGenericPdf::Class(), false);
496 registerExporter<RooFormulaArgStreamer<RooFormulaVar>>(RooFormulaVar::Class(), false);
497 registerExporter<RooRealSumPdfStreamer>(RooRealSumPdf::Class(), false);
498 registerExporter<RooRealSumFuncStreamer>(RooRealSumFunc::Class(), false);
499 registerExporter<RooPolynomialStreamer>(RooPolynomial::Class(), false);
500 registerExporter<RooMultiVarGaussianStreamer>(RooMultiVarGaussian::Class(), false);
501 registerExporter<RooTFnBindingStreamer>(RooTFnBinding::Class(), false);
502});
503
504} // namespace
#define DEFINE_EXPORTER_KEY(class_name, name)
#define d(i)
Definition RSha256.hxx:102
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
char name[80]
Definition TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:74
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
Definition RooAbsArg.h:318
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
@ CanBeExtended
Definition RooAbsPdf.h:272
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
Definition RooAddPdf.h:34
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
The RooBinSamplingPdf is supposed to be used as an adapter between a continuous PDF and a binned dist...
static TClass * Class()
double epsilon() const
const RooAbsPdf & pdf() const
const RooAbsReal & observable() const
RooBinWidthFunction is a class that returns the bin width (or volume) given a RooHistFunc.
const RooHistFunc & histFunc() const
static TClass * Class()
The RooDataHist is a container class to hold N-dimensional binned data.
Definition RooDataHist.h:39
double const * weightArray() const
const RooArgSet * get() const override
Get bin centre of current bin.
Definition RooDataHist.h:76
virtual JSONNode & append_child()=0
virtual JSONNode & set_seq()=0
void fill_mat(Matrix const &mat)
virtual std::string const & key() const =0
virtual bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *, RooFit::Detail::JSONNode &) const
Definition JSONIO.h:59
virtual bool importArg(RooJSONFactoryWSTool *tool, const RooFit::Detail::JSONNode &node) const
Definition JSONIO.h:37
static TClass * Class()
static TClass * Class()
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
Definition RooHistFunc.h:31
RooDataHist & dataHist()
Return RooDataHist that is represented.
Definition RooHistFunc.h:45
static TClass * Class()
RooHistPdf implements a probablity density function sampled from a multidimensional histogram.
Definition RooHistPdf.h:30
static TClass * Class()
RooDataHist & dataHist()
Definition RooHistPdf.h:43
When using RooFit, statistical models can be conveniently handled and stored as a RooWorkspace.
T * requestArg(const RooFit::Detail::JSONNode &node, const std::string &key)
T * request(const std::string &objname, const std::string &requestAuthor)
static std::unique_ptr< RooDataHist > readBinnedData(const RooFit::Detail::JSONNode &n, const std::string &namecomp)
Obj_t & wsImport(Obj_t const &obj)
static void fillSeq(RooFit::Detail::JSONNode &node, RooAbsCollection const &coll)
static void exportHisto(RooArgSet const &vars, std::size_t n, double const *contents, RooFit::Detail::JSONNode &output)
RooArgList requestArgList(const RooFit::Detail::JSONNode &node, const std::string &seqName)
static void error(const char *s)
Obj_t & wsEmplace(RooStringView name, Args_t &&...args)
static std::string name(const RooFit::Detail::JSONNode &n)
Multivariate Gaussian p.d.f.
static TClass * Class()
RooPolynomial implements a polynomial p.d.f of the form.
static TClass * Class()
const RooArgList & coefList() const
const RooArgList & funcList() const
static TClass * Class()
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
const RooArgList & funcList() const
static TClass * Class()
ExtendMode extendMode() const override
Returns ability of PDF to provide extended likelihood terms.
const RooArgList & coefList() const
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:40
Use TF1, TF2, TF3 functions as RooFit objects.
static TClass * Class()
TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1) override
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
Basic string class.
Definition TString.h:139
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2356
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
#define STATIC_EXECUTE(MY_FUNC)
double epsilon
Definition triangle.c:618