MINT2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RooSplineProduct Class Reference

#include <RooSplineProduct.h>

Inheritance diagram for RooSplineProduct:
RooAbsGaussModelEfficiency

Public Member Functions

 RooSplineProduct ()
 
 RooSplineProduct (const char *name, const char *title, RooRealVar &x, const RooCubicSplineFun &sp1, const RooCubicSplineFun &sp2)
 
 ~RooSplineProduct ()
 
 RooSplineProduct (const RooSplineProduct &other, const char *name=0)
 
TObject * clone (const char *newname) const
 
Int_t getAnalyticalIntegral (RooArgSet &allVars, RooArgSet &analVars, const char *rangeName) const
 
Double_t analyticalIntegral (Int_t code, const char *rangeName) const
 
std::complex< double > productAnalyticalIntegral (Double_t umin, Double_t umax, Double_t scale, Double_t offset, const std::complex< double > &z) const
 
- Public Member Functions inherited from RooAbsGaussModelEfficiency
 RooAbsGaussModelEfficiency ()
 
 RooAbsGaussModelEfficiency (const char *name, const char *title, const char *unit="")
 
 RooAbsGaussModelEfficiency (const RooAbsGaussModelEfficiency &other, const char *name=0)
 
 ~RooAbsGaussModelEfficiency ()
 

Private Member Functions

void init ()
 
Double_t evaluate () const
 
std::complex< double > gaussIntegralE (bool left, const RooGaussModelAcceptance::M_n< 7U > &dM, const RooGaussModelAcceptance::K_n &K, double offset, double *sc) const
 

Private Attributes

RooRealProxy _x
 
RooCubicSplineFun _sp1
 
RooCubicSplineFun _sp2
 
RooListProxy _coefList1
 
RooListProxy _coefList2
 

Detailed Description

Definition at line 25 of file RooSplineProduct.h.

Constructor & Destructor Documentation

◆ RooSplineProduct() [1/3]

RooSplineProduct::RooSplineProduct ( )

Definition at line 41 of file RooSplineProduct.cpp.

42 {
43 }

◆ RooSplineProduct() [2/3]

RooSplineProduct::RooSplineProduct ( const char *  name,
const char *  title,
RooRealVar &  x,
const RooCubicSplineFun sp1,
const RooCubicSplineFun sp2 
)

Definition at line 46 of file RooSplineProduct.cpp.

50  :
51  RooAbsGaussModelEfficiency(name, title),
52  _x("x", "Dependent", this, x),
53  _sp1(sp1,"spline1"),
54  _sp2(sp2,"spline2"),
55  _coefList1("coefficients1","List of coefficients for first spline",this),
56  _coefList2("coefficients2","List of coefficients for second spline",this)
57 {
58  _coefList1.add(sp1.coefficients());
59  _coefList2.add(sp2.coefficients());
60  init();
61 }
RooCubicSplineFun _sp1
RooListProxy _coefList1
const RooArgList & coefficients() const
RooListProxy _coefList2
RooCubicSplineFun _sp2

◆ ~RooSplineProduct()

RooSplineProduct::~RooSplineProduct ( )

Definition at line 75 of file RooSplineProduct.cpp.

76 {
77 }

◆ RooSplineProduct() [3/3]

RooSplineProduct::RooSplineProduct ( const RooSplineProduct other,
const char *  name = 0 
)

Definition at line 64 of file RooSplineProduct.cpp.

64  :
65  RooAbsGaussModelEfficiency(other, name),
66  _x("x", this, other._x),
67  _sp1(other._sp1,"spline1"),
68  _sp2(other._sp2,"spline2"),
69  _coefList1("coefList1", this, other._coefList1),
70  _coefList2("coefList2", this, other._coefList2)
71 {
72 }
RooCubicSplineFun _sp1
RooListProxy _coefList1
RooListProxy _coefList2
RooCubicSplineFun _sp2

Member Function Documentation

◆ analyticalIntegral()

Double_t RooSplineProduct::analyticalIntegral ( Int_t  code,
const char *  rangeName 
) const

Definition at line 91 of file RooSplineProduct.cpp.

92 {
93  return 0;
94 }

◆ clone()

TObject* RooSplineProduct::clone ( const char *  newname) const
inline

Definition at line 33 of file RooSplineProduct.h.

33 { return new RooSplineProduct(*this, newname); }

◆ evaluate()

Double_t RooSplineProduct::evaluate ( ) const
private

Definition at line 80 of file RooSplineProduct.cpp.

81 {
83 }
RooCubicSplineFun _sp1
RooListProxy _coefList1
RooListProxy _coefList2
RooCubicSplineFun _sp2
double evaluate(double _u, const RooArgList &b) const
RooCubicSplineKnot _aux

◆ gaussIntegralE()

complex< double > RooSplineProduct::gaussIntegralE ( bool  left,
const RooGaussModelAcceptance::M_n< 7U > &  dM,
const RooGaussModelAcceptance::K_n K,
double  offset,
double *  sc 
) const
private

Definition at line 97 of file RooSplineProduct.cpp.

100 {
102  std::complex<double> sum(0,0);
103  for (int j=0;j<3;++j) for (int k=0;k<3-j;++k) sum += dM(j)*s2_jk(j,k)*K(k)*sc[j+k];
104  return sum;
105 }
RooCubicSplineFun _sp1
RooCubicSplineKnot::S2_edge S2_jk_edge(bool left, const RooArgList &b1, const RooArgList &b2) const
RooListProxy _coefList1
RooListProxy _coefList2
RooCubicSplineKnot _aux

◆ getAnalyticalIntegral()

Int_t RooSplineProduct::getAnalyticalIntegral ( RooArgSet &  allVars,
RooArgSet &  analVars,
const char *  rangeName 
) const

Definition at line 86 of file RooSplineProduct.cpp.

87 {
88  return 0;
89 }

◆ init()

void RooSplineProduct::init ( )
private

Definition at line 33 of file RooSplineProduct.cpp.

33  {
34  // TODO: current implementation of product of two splines
35  // only for splines with the same knot vector
36  assert(_sp1.knots() == _sp2.knots());
37  assert(_sp1.knotSize() == _sp2.knotSize());
38 }
RooCubicSplineFun _sp1
RooCubicSplineFun _sp2
const std::vector< double > & knots() const
unsigned knotSize() const

◆ productAnalyticalIntegral()

std::complex< double > RooSplineProduct::productAnalyticalIntegral ( Double_t  umin,
Double_t  umax,
Double_t  scale,
Double_t  offset,
const std::complex< double > &  z 
) const
virtual

Implements RooAbsGaussModelEfficiency.

Definition at line 109 of file RooSplineProduct.cpp.

112 {
114  assert(_sp1.knotSize()>1);
115  double lo = scale*umin+offset;
116  double hi = scale*umax+offset+1.e-7;
118  std::vector<M_n> M; M.reserve( _sp1.knotSize() );
119  for (unsigned int i=0;i<_sp1.knotSize();++i) {
120  double x = (_sp1.u(i)-offset)/scale ;
121  if (lo>=_sp1.u(i)) x = umin ; // take M[i] if lo<=u(i) else M_n(lo)
122  if (_sp1.u(i)>=hi) x = umax ; // take M[i+1] if u(i+1)<=hi else M_n(hi)
123  M.push_back( M_n( x, z ) );
124  }
125  double sc[7]; for (int i=0;i<7;++i) sc[i] = pow(scale,i);
126  std::complex<double> sum(0,0);
127  if (lo<_sp1.u(0)) sum += gaussIntegralE(true, M.front()-M_n( umin,z), K, offset, sc);
128  for (unsigned i=0;i<_sp1.knotSize()-1 && _sp1.u(i)<hi ;++i) {
129  M_n dM = M[i+1]-M[i];
131  for (int j=0;j<7;++j) for (int k=0;k<7-j;++k) sum += dM(j)*s2_jk(j,k)*K(k)*sc[j+k];
132  }
133  if (hi>_sp1.u(_sp1.knotSize()-1)) sum += gaussIntegralE(false, M_n(umax,z)-M.back(), K, offset, sc);
134  return sum;
135 }
double u(int i) const
RooCubicSplineFun _sp1
RooCubicSplineKnot::S2_jk S2_jk_sum(int i, const RooArgList &b1, const RooArgList &b2) const
RooListProxy _coefList1
RooListProxy _coefList2
std::complex< double > gaussIntegralE(bool left, const RooGaussModelAcceptance::M_n< 7U > &dM, const RooGaussModelAcceptance::K_n &K, double offset, double *sc) const
unsigned knotSize() const
RooCubicSplineKnot _aux

Member Data Documentation

◆ _coefList1

RooListProxy RooSplineProduct::_coefList1
private

Definition at line 48 of file RooSplineProduct.h.

◆ _coefList2

RooListProxy RooSplineProduct::_coefList2
private

Definition at line 49 of file RooSplineProduct.h.

◆ _sp1

RooCubicSplineFun RooSplineProduct::_sp1
private

Definition at line 46 of file RooSplineProduct.h.

◆ _sp2

RooCubicSplineFun RooSplineProduct::_sp2
private

Definition at line 47 of file RooSplineProduct.h.

◆ _x

RooRealProxy RooSplineProduct::_x
private

Definition at line 45 of file RooSplineProduct.h.


The documentation for this class was generated from the following files: