65 const RooArgSet& _normSet,
const char* isetRangeName,
const char* normRangeName,
bool doFactorize) :
69 _compSetN(
"compSetN",
"Set of integral components owned by numerator",this,false),
70 _compSetD(
"compSetD",
"Set of integral components owned by denominator",this,false),
71 _intList(
"intList",
"List of integrals",this,true),
109 _compSetN(
"compSetN",
"Set of integral components owned by numerator",this),
110 _compSetD(
"compSetD",
"Set of integral components owned by denominator",this),
111 _intList(
"intList",
"List of integrals",this)
162 RooArgSet& saveSet,
const char* isetRangeName,
bool doFactorize)
167 for (
const auto arg : intSet) {
168 auto count = std::count_if(compSet.
begin(), compSet.
end(), [arg](
const RooAbsArg* pdfAsArg){
169 auto pdf = static_cast<const RooAbsPdf*>(pdfAsArg);
170 return (pdf->dependsOn(*arg));
174 anaIntSet.
add(*arg) ;
180 numIntSet.
add(intSet) ;
198 for (
const auto pdfAsArg : compSet) {
199 auto pdf =
static_cast<const RooAbsPdf*
>(pdfAsArg);
201 if (doFactorize && pdf->dependsOn(anaIntSet)) {
203 Int_t code = pdf->getAnalyticalIntegralWN(anaIntSet,anaSet,0,isetRangeName) ;
206 std::unique_ptr<RooAbsReal> pai{pdf->createIntegral(anaSet,emptyNormSet,isetRangeName)};
213 numIntSet.
remove(anaSet) ;
242 prodSet.
snapshot(prodSetClone,
false);
244 auto prod = std::make_unique<RooProduct>(prodName,
"product", prodSetClone);
249 std::unique_ptr<RooAbsReal> integral{prod->createIntegral(numIntSet,emptyNormSet,isetRangeName)};
251 auto ret = integral.get();
254 saveSet.
addOwned(std::move(prodSetClone));
256 saveSet.
addOwned(std::move(integral)) ;
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooExpensiveObjectCache & expensiveObjectCache() const
void setOperMode(OperMode mode, bool recurseADirty=true)
Set the operation mode of this node.
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
const_iterator end() const
RooAbsArg * first() const
virtual bool addOwned(RooAbsArg &var, bool silent=false)
Add an argument and transfer the ownership to the collection.
const_iterator begin() const
RooAbsArg * find(const char *name) const
Find object with given name in list.
const RooArgSet * nset() const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
RooGenProdProj is an auxiliary class for RooProdPdf that calculates a general normalised projection o...
void operModeHook() override
Intercept cache mode operation changes and propagate them to the components.
RooGenProdProj()
Default constructor.
double evaluate() const override
Calculate and return value of normalization projection.
RooAbsReal * makeIntegral(const char *name, const RooArgSet &compSet, const RooArgSet &intSet, RooArgSet &saveSet, const char *isetRangeName, bool doFactorize)
Utility function to create integral for product over certain observables.
~RooGenProdProj() override
Destructor.
RooSetProxy _compSetD
Set proxy for denominator components.
RooListProxy _intList
Master integrals representing numerator and denominator.
RooArgSet * _compSetOwnedD
Owner of denominator components.
bool _haveD
Do we have a denominator term?
RooArgSet * _compSetOwnedN
Owner of numerator components.
RooSetProxy _compSetN
Set proxy for numerator components.
const char * GetName() const override
Returns name of object.