43 _varItr = _varList.createIterator() ;
64 _varList(
"varList",
"List of variables",this),
71 if (!dynamic_cast<RooAbsReal*>(var)) {
73 throw string(
"RooPolyMorh::ctor() ERROR variable is not of type RooAbsReal") ;
142 (*dm)[i] = (*_mref)[i]-(*_mref)[0];
144 if (i>0) M(0,i) = 0.;
168 ret += (*_frac)(i) * var->
getVal();
184 double sumposfrac=0.;
185 for (
Int_t i=0; i<nVar; ++i) {
187 for (
Int_t j=0; j<nVar; ++j) { ffrac += (*_M)(j,i) * (j==0?1.:
TMath::Power(dm,(
double)j)); }
188 if (ffrac>=0) sumposfrac+=ffrac;
195 double mfrac = (
m-(*_mref)[imin])/((*_mref)[imax]-(*_mref)[imin]);
201 for (
Int_t i=0; i<nVar; ++i)
204 (*_frac)(imin) = (1.-mfrac);
205 (*_frac)(imax) = (mfrac);
206 }
else if (imax==imin) {
207 (*_frac)(imin) = (1.);
211 for (
Int_t i=0; i<nVar; ++i)
214 (*_frac)(imin) = (1.-mfrac);
215 (*_frac)(imax) = (mfrac);
216 }
else if (imax==imin) {
217 (*_frac)(imin) = (1.);
221 for (
Int_t i=0; i<nVar; ++i) {
222 if ((*
_frac)(i)<0) (*_frac)(i)=(0.);
223 (*_frac)(i) = (*
_frac)(i)/sumposfrac;
235 double mmin=-DBL_MAX;
236 for (
Int_t i=0; i<nVar; ++i)
237 if ( (*
_mref)[i]>mmin && (*
_mref)[i]<=mval ) { mmin=(*_mref)[i]; imin=i; }
249 for (
Int_t i=0; i<nVar; ++i)
250 if ( (*
_mref)[i]<mmax && (*
_mref)[i]>=mval ) { mmax=(*_mref)[i]; imax=i; }
TMatrixD * _M
do not persist
Double_t evaluate() const
virtual ~Roo1DMomentMorphFunction()
Destructor.
int idxmin(const double &m) const
int idxmax(const double &m) const
Iterator abstract base class.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
TIterator * createIterator(Bool_t dir=kIterForward) const
Double_t getVal(const RooArgSet *set=0) const
TVectorT< Double_t > TVectorD
TMatrixT< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant.
Roo1DMomentMorphFunction()
Default constructor.
TMatrixT< Double_t > TMatrixD
1-dimensional morph function between a list of input functions (varlist) as a function of one input p...
virtual 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...
static std::shared_ptr< std::function< double(double)> > Linear
virtual TObject * Next()=0
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
void calculateFractions() const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...