46 _xf(
"!xf",
"xf",this,false,false),
47 _ixf(
"!ixf",
"ixf",this),
53 std::unique_ptr<RooAbsReal> XF;
58 std::string pname = std::string{
name} +
"_product";
60 std::stringstream formula;
61 formula <<
"std::pow((@0-" <<
_xfOffset <<
"),2) * @1";
62 XF = std::make_unique<RooFormulaVar>(pname.c_str(), formula.str().c_str(),
RooArgList(
x, func));
66 std::string pname = std::string{
name} +
"_product";
67 XF = std::make_unique<RooProduct>(pname.c_str(), pname.c_str(),
RooArgList(
x,
x, func));
73 XF->specialIntegratorConfig(
true)->method1D().setLabel(
"RooBinIntegrator");
76 std::unique_ptr<RooAbsReal> intXF{XF->createIntegral(
x)};
92 bool centr,
bool takeRoot,
bool intNSet) :
94 _xf(
"!xf",
"xf",this,false,false),
95 _ixf(
"!ixf",
"ixf",this),
103 std::unique_ptr<RooAbsReal> XF;
108 std::string pname = std::string{
name} +
"_product";
110 std::stringstream formula;
111 formula <<
"std::pow((@0-" <<
_xfOffset <<
"),2) * @1";
112 XF = std::make_unique<RooFormulaVar>(pname.c_str(), formula.str().c_str(),
RooArgList(
x, func));
116 std::string pname = std::string{
name} +
"_product";
117 XF = std::make_unique<RooProduct>(pname.c_str(), pname.c_str(),
RooArgList(
x,
x, func));
123 XF->specialIntegratorConfig(
true)->method1D().setLabel(
"RooBinIntegrator");
126 XF->specialIntegratorConfig(
true)->method2D().setLabel(
"RooBinIntegrator");
127 XF->specialIntegratorConfig(
true)->methodND().setLabel(
"RooBinIntegrator");
131 if (intNSet) intSet.
add(
_nset,
true) ;
132 std::unique_ptr<RooAbsReal> intXF{XF->createIntegral(intSet, &
_nset)};
151 _xf(
"xf",this,other._xf),
152 _ixf(
"ixf",this,other._ixf),
153 _if(
"if",this,other._if),
154 _xfOffset(other._xfOffset)
169 double ret =
_takeRoot ? sqrt(ratio) : ratio ;
RooExpensiveObjectCache & expensiveObjectCache() const
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
bool addOwnedComponents(const RooAbsCollection &comps)
Take ownership of the contents of 'comps'.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
RooRealProxy _mean
Mean (if calculated for central moment)
Int_t _takeRoot
Return n-order root of moment.
RooSetProxy _nset
Normalization set (optional)
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooAbsMoment * mean(RooRealVar &obs)
virtual bool isBinnedDistribution(const RooArgSet &) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, 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
Create an object that represents the integral of the function over one or more observables listed in ...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * absArg() const
Return pointer to contained argument.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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...
Performs hybrid numerical/analytical integrals of RooAbsReal objects.
void setCacheNumeric(bool flag)
Variable that can be changed from the outside.
RooRealProxy _ixf
Int((X-offset)*F(X))dx ;.
RooSecondMoment()=default
RooRealProxy _if
Int(F(x))dx ;.
double evaluate() const override
Calculate value.
RooRealProxy _xf
(X-offset)*F
U & putOwnedArg(std::unique_ptr< U > ownedArg)
Move a new object held and owned by proxy.
bool setArg(T &newRef)
Change object held in proxy into newRef.