42 for (
const auto &
d : p[
"dependents"].children()) {
49 TString formula(p[
"formula"].val());
72 for (
const auto &
d : p[
"dependents"].children()) {
79 TString formula(p[
"formula"].val());
99 if (!p[
"pdfs"].is_seq()) {
102 for (
const auto &comp : p[
"pdfs"].children()) {
103 std::string pdfname(comp.val());
127 if (!p[
"summands"].is_seq()) {
133 if (!p[
"coefficients"].is_seq()) {
136 for (
const auto &comp : p[
"summands"].children()) {
137 std::string pdfname(comp.val());
141 for (
const auto &comp : p[
"coefficients"].children()) {
142 std::string coefname(comp.val());
161 bool divideByBinWidth = p[
"divideByBinWidth"].
val_bool();
182 std::map<std::string, RooAbsPdf *> components;
183 std::string indexname(p[
"index"].val());
184 RooCategory cat(indexname.c_str(), indexname.c_str());
185 for (
const auto &comp : p[
"channels"].children()) {
187 tool->
log(
RooFit::INFO) <<
"importing category " << catname << std::endl;
191 components[catname] = pdf;
192 cat.defineType(catname.c_str());
214 std::string pdfname(p[
"pdf"].val());
220 std::string obsname(p[
"observable"].val());
226 "' as indicated by parent RooBinSamplingPdf '" +
name +
"', please check!");
232 double epsilon(p[
"epsilon"].val_float());
257 for (
const auto &sample : p[
"samples"].children()) {
262 for (
const auto &coef : p[
"coefficients"].children()) {
264 coefficients.
add(*
c);
267 bool extended =
false;
287 std::string
const &
key()
const override
289 const static std::string keystring =
"sumpdf";
295 elem[
"type"] <<
key();
296 auto &samples = elem[
"samples"];
298 auto &coefs = elem[
"coefficients"];
300 for (
const auto &s : pdf->funcList()) {
301 samples.append_child() << s->
GetName();
303 for (
const auto &
c : pdf->coefList()) {
304 coefs.append_child() <<
c->
GetName();
315 std::string
const &
key()
const override
317 const static std::string keystring =
"simultaneous";
324 elem[
"type"] <<
key();
326 auto &channels = elem[
"channels"];
328 const auto &indexCat = sim->
indexCat();
329 for (
const auto &cat : indexCat) {
330 const auto catname = cat.first.c_str();
347 std::string
const &
key()
const override
349 static const std::string keystring =
"histogram";
356 elem[
"type"] <<
key();
359 auto &data = elem[
"data"];
395 std::string
const &
key()
const override
397 static const std::string keystring =
"binsampling";
403 elem[
"type"] <<
key();
406 elem[
"epsilon"] << pdf->
epsilon();
417 std::string
const &
key()
const override
419 static const std::string keystring =
"pdfprod";
425 elem[
"type"] <<
key();
426 auto &factors = elem[
"pdfs"];
427 for (
const auto &
f : pdf->pdfList()) {
428 factors.append_child() <<
f->
GetName();
440 std::string
const &
key()
const override
442 static const std::string keystring =
"genericpdf";
448 elem[
"type"] <<
key();
450 auto &factors = elem[
"dependents"];
451 for (
const auto &
f : pdf->dependents()) {
452 factors.append_child() <<
f->
GetName();
464 std::string
const &
key()
const override
466 static const std::string keystring =
"binwidth";
472 elem[
"type"] <<
key();
485 std::string
const &
key()
const override
487 static const std::string keystring =
"formulavar";
493 elem[
"type"] <<
key();
495 auto &factors = elem[
"dependents"];
496 for (
const auto &
f : var->dependents()) {
497 factors.append_child() <<
f->
GetName();
513 Tool::registerImporter<RooProdPdfFactory>(
"pdfprod",
false);
514 Tool::registerImporter<RooGenericPdfFactory>(
"genericpdf",
false);
515 Tool::registerImporter<RooFormulaVarFactory>(
"formulavar",
false);
516 Tool::registerImporter<RooBinSamplingPdfFactory>(
"binsampling",
false);
517 Tool::registerImporter<RooAddPdfFactory>(
"pdfsum",
false);
518 Tool::registerImporter<RooHistFuncFactory>(
"histogram",
false);
519 Tool::registerImporter<RooSimultaneousFactory>(
"simultaneous",
false);
520 Tool::registerImporter<RooBinWidthFunctionFactory>(
"binwidth",
false);
521 Tool::registerImporter<RooRealSumPdfFactory>(
"sumpdf",
false);
523 Tool::registerExporter<RooBinWidthFunctionStreamer>(RooBinWidthFunction::Class(),
false);
524 Tool::registerExporter<RooProdPdfStreamer>(RooProdPdf::Class(),
false);
525 Tool::registerExporter<RooSimultaneousStreamer>(RooSimultaneous::Class(),
false);
526 Tool::registerExporter<RooBinSamplingPdfStreamer>(RooBinSamplingPdf::Class(),
false);
527 Tool::registerExporter<RooHistFuncStreamer>(RooHistFunc::Class(),
false);
528 Tool::registerExporter<RooGenericPdfStreamer>(RooGenericPdf::Class(),
false);
529 Tool::registerExporter<RooFormulaVarStreamer>(RooFormulaVar::Class(),
false);
530 Tool::registerExporter<RooRealSumPdfStreamer>(RooRealSumPdf::Class(),
false);
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
virtual void Print(Option_t *options=0) const
Print the object to the defaultPrintStream().
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
const char * GetName() const
Returns name of object.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
TH1 * createHistogram(const char *varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const
Create and fill a ROOT histogram TH1, TH2 or TH3 with the values of this function for the variables w...
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
The RooBinSamplingPdf is supposed to be used as an adapter between a continuous PDF and a binned dist...
const RooAbsPdf & pdf() const
const RooAbsReal & observable() const
RooBinWidthFunction is a class that returns the bin width (or volume) given a RooHistFunc.
bool divideByBinWidth() const
const RooHistFunc & histFunc() const
RooCategory is an object to represent discrete states.
The RooDataHist is a container class to hold N-dimensional binned data.
const RooArgSet * get() const override
Get bin centre of current bin.
virtual std::string val() const =0
virtual bool has_child(std::string const &) const =0
virtual bool val_bool() const
RooGenericPdf is a concrete implementation of a probability density function, which takes a RooArgLis...
const char * expression() const
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
RooDataHist & dataHist()
Return RooDataHist that is represented.
RooProdPdf is an efficient implementation of a product of PDFs of the form.
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
virtual ExtendMode extendMode() const
Returns ability of PDF to provide extended likelihood terms.
RooRealVar represents a variable that can be changed from the outside.
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
const RooAbsCategoryLValue & indexCat() const
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
RooAbsData * embeddedData(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found.
Bool_t import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
RooCmdArg RecycleConflictNodes(Bool_t flag=kTRUE)
RooCmdArg Embedded(Bool_t flag=kTRUE)
RooCmdArg Silence(Bool_t flag=kTRUE)
#define STATIC_EXECUTE(MY_CODE)