42 _varItr = _varList.createIterator() ;
61 _varList(
"varList",
"List of variables",this),
68 if (!dynamic_cast<RooAbsReal*>(var)) {
70 throw string(
"RooPolyMorh::ctor() ERROR variable is not of type RooAbsReal") ;
134 (*dm)[i] = (*_mref)[i]-(*_mref)[0];
136 if (i>0) M(0,i) = 0.;
159 ret += (*_frac)(i) * var->
getVal();
174 double sumposfrac=0.;
175 for (
Int_t i=0; i<nVar; ++i) {
177 for (
Int_t j=0; j<nVar; ++j) { ffrac += (*_M)(j,i) * (j==0?1.:
TMath::Power(dm,(
double)j)); }
178 if (ffrac>=0) sumposfrac+=ffrac;
185 double mfrac = (
m-(*_mref)[imin])/((*_mref)[imax]-(*_mref)[imin]);
191 for (
Int_t i=0; i<nVar; ++i)
194 (*_frac)(imin) = (1.-mfrac);
195 (*_frac)(imax) = (mfrac);
196 }
else if (imax==imin) {
197 (*_frac)(imin) = (1.);
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) {
212 if ((*
_frac)(i)<0) (*_frac)(i)=(0.);
213 (*_frac)(i) = (*
_frac)(i)/sumposfrac;
225 double mmin=-DBL_MAX;
226 for (
Int_t i=0; i<nVar; ++i)
227 if ( (*
_mref)[i]>mmin && (*
_mref)[i]<=mval ) { mmin=(*_mref)[i]; imin=i; }
238 for (
Int_t i=0; i<nVar; ++i)
239 if ( (*
_mref)[i]<mmax && (*
_mref)[i]>=mval ) { mmax=(*_mref)[i]; imax=i; }
TMatrixD * _M
do not persist
virtual const char * GetName() const
Returns name of object.
TIterator * createIterator(Bool_t dir=kIterForward) const
Double_t getVal(const RooArgSet *set=0) const
int idxmin(const double &m) const
virtual ~Roo1DMomentMorphFunction()
Destructor.
Iterator abstract base class.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
int idxmax(const double &m) const
TVectorT< Double_t > TVectorD
TMatrixT< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant.
Roo1DMomentMorphFunction()
Default constructor.
Double_t evaluate() const
TMatrixT< Double_t > TMatrixD
1-dimensional morph function between a list of input functions (varlist) as a function of one input p...
void calculateFractions() const
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...
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...