13 m_bins(spline.GetNp())
16 double xmin(0.), a(0.), b(0.), c(0.), d(0.) ;
19 m_spline.GetCoeff(i, xmin, a, b, c, d) ;
30 m_spline.GetCoeff(i, xmin, a, b, c, d) ;
40 tps.first = max(min(tps.first, ibin.
xmax), ibin.
xmin) ;
41 tps.second = max(min(tps.second, ibin.
xmax), ibin.
xmin) ;
56 cerr <<
"SplineGenerator ERROR: ymin < 0. (" << ibin.
ymin <<
") for bin " << i << endl ;
83 vector<BinInfo>::const_iterator ibin =
m_bins.begin() ;
84 for(; ibin !=
m_bins.end() ; ++ibin){
85 boxsum += ibin->boxintegral ;
89 double x =
m_rndm->Rndm() * (ibin->xmax - ibin->xmin) + ibin->xmin ;
101 for(
int ibin = istart + 1 ; ibin != iend ; ++ibin)
113 double xmin(0.), a(0.), b(0.), c(0.), d(0.) ;
114 m_spline.GetCoeff(i, xmin, a, b, c, d) ;
116 return x * (a + x * (b/2. + x * (c/3. + x * d/4.))) ;
129 double xmin(0.), d(0.), c(0.), b(0.), a(0.) ;
130 m_spline.GetCoeff(i, xmin, d, c, b, a) ;
133 double arg = b*b - 4. * a * c ;
135 return pair<double, double>(xmin-1e30, xmin-1e30) ;
136 return pair<double, double>(xmin + (-b - sqrt(arg))/2./a, xmin + (-b + sqrt(arg))/2./a) ;
141 double xmin(0.), a(0.), b(0.), c(0.), d(0.) ;
142 m_spline.GetCoeff(i, xmin, a, b, c, d) ;
143 double xshift = x - xmin ;
144 return x * xshift * (a + xshift * (b/2. + xshift * (c/3. + xshift * d/4.)))
145 - xshift * xshift * (a/2. + xshift * (b/6. + xshift * (c/12. + xshift * d/20.))) ;
double gen_random() const
SplineGenerator(TRandom3 *rndm, const TSpline3 &spline)
std::pair< double, double > turning_points(int i) const
std::vector< BinInfo > m_bins
double mean_part_integral(int i, double x)
double partial_integral(int i, double x)
const TSpline3 & spline() const