50 _xf(
"!xf",
"xf",this,false,false),
51 _ixf(
"!ixf",
"ixf",this),
57 std::unique_ptr<RooAbsReal> XF;
60 std::string m1name = std::string{
GetName()} +
"_moment1";
61 _mean.putOwnedArg(std::unique_ptr<RooAbsMoment>{func.
mean(
x)});
63 std::string pname = std::string{
name} +
"_product";
65 std::stringstream formula;
66 formula <<
"std::pow((@0-" <<
_xfOffset <<
"),2) * @1";
67 XF = std::make_unique<RooFormulaVar>(pname.c_str(), formula.str().c_str(),
RooArgList(
x, func));
71 std::string pname = std::string{
name} +
"_product";
72 XF = std::make_unique<RooProduct>(pname.c_str(), pname.c_str(),
RooArgList(
x,
x, func));
78 XF->specialIntegratorConfig(
true)->method1D().setLabel(
"RooBinIntegrator");
81 std::unique_ptr<RooAbsReal> intXF{XF->createIntegral(
x)};
97 bool centr,
bool takeRoot,
bool intNSet) :
99 _xf(
"!xf",
"xf",this,false,false),
100 _ixf(
"!ixf",
"ixf",this),
101 _if(
"!if",
"if",this),
108 std::unique_ptr<RooAbsReal> XF;
111 std::string m1name = std::string{
GetName()} +
"_moment1";
112 _mean.putOwnedArg(std::unique_ptr<RooAbsMoment>{func.
mean(
x, nset)});
114 std::string pname = std::string{
name} +
"_product";
116 std::stringstream formula;
117 formula <<
"std::pow((@0-" <<
_xfOffset <<
"),2) * @1";
118 XF = std::make_unique<RooFormulaVar>(pname.c_str(), formula.str().c_str(),
RooArgList(
x, func));
122 std::string pname = std::string{
name} +
"_product";
123 XF = std::make_unique<RooProduct>(pname.c_str(), pname.c_str(),
RooArgList(
x,
x, func));
129 XF->specialIntegratorConfig(
true)->method1D().setLabel(
"RooBinIntegrator");
132 XF->specialIntegratorConfig(
true)->method2D().setLabel(
"RooBinIntegrator");
133 XF->specialIntegratorConfig(
true)->methodND().setLabel(
"RooBinIntegrator");
137 if (intNSet) intSet.
add(
_nset,
true) ;
138 std::unique_ptr<RooAbsReal> intXF{XF->createIntegral(intSet, &
_nset)};
144 _ixf.setArg(*intXF) ;
171 if (
_mean.absArg()) {
RooExpensiveObjectCache & expensiveObjectCache() const
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
bool addOwnedComponents(const RooAbsCollection &comps)
Take ownership of the contents of 'comps'.
friend class RooRealIntegral
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).
RooAbsMoment * mean(RooRealVar &obs)
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
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.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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
const char * GetName() const override
Returns name of object.