Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooExtendedBinding.cxx
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 *
4 * Copyright (c) 2023, CERN
5 *
6 * Redistribution and use in source and binary forms,
7 * with or without modification, are permitted according to the terms
8 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
9 */
10
11#include <RooExtendedBinding.h>
12
13
14RooExtendedBinding::RooExtendedBinding(const char *name, const char *title, RooAbsPdf &_pdf)
15 : RooAbsReal(name, title), pdf("pdf", "pdf", this, _pdf)
16{
17}
18
19RooExtendedBinding::RooExtendedBinding(const char *name, const char *title, RooAbsPdf &_pdf, const RooArgSet &obs)
20 : RooExtendedBinding{name, title, _pdf}
21{
22 _obsList = std::make_unique<RooSetProxy>("obsList", "List of observables", this, false, false);
23 _obsList->add(obs);
24}
25
27 : RooAbsReal(other, name), pdf("pdf", this, other.pdf)
28{
29 if (other._obsList) {
30 _obsList = std::make_unique<RooSetProxy>("obsList", this, *other._obsList);
31 }
32}
33
35{
36 RooArgSet const *normSet = _obsList ? _obsList.get() : nullptr;
37 return (const_cast<RooAbsPdf &>(static_cast<RooAbsPdf const &>(pdf.arg()))).expectedEvents(normSet);
38}
char name[80]
Definition TGX11.cxx:110
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
std::unique_ptr< RooSetProxy > _obsList
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
const T & arg() const
Return reference to object held in proxy.