34 #define INCLXX_IN_GEANT4_MODE 1
83 nIntervals =
G4int(interval/step);
86 G4int remainder = nIntervals % 9;
88 nIntervals += 9 - remainder;
90 nIntervals =
std::max(nIntervals, 9);
93 const G4double dx = interval/nIntervals;
95 for(
G4int j = 1; j<nIntervals; ++j) {
97 const unsigned index = j%9;
101 return result*dx*
sign;
114 return theFunction->integrate(
xMin,x);
129 normalisation(1./theFunction->integrate(
xMin,
xMax)),
135 return fWrap(
std::min(1., normalisation * theFunction->integrate(
xMin,x)));
137 return std::min(1., normalisation * theFunction->integrate(
xMin,x));
143 } *theInverseCDF =
new InverseCDF(
this, fWrap);
146 delete theInverseCDF;
T max(const T t1, const T t2)
brief Return the largest of the two arguments
InterpolationTable * inverseCDFTable(ManipulatorFunc fWrap=0, const G4int nNodes=60) const
Return a pointer to the inverse of the CDF of this function.
static const G4double integrationCoefficients[]
Coefficients for numerical integration.
Float_t x1[n_points_granero]
virtual G4double getXMinimum() const
Return the minimum allowed value of the independent variable.
Class for interpolating the inverse of a 1-dimensional function.
virtual G4double operator()(const G4double x) const =0
Compute the value of the function.
Functor for 1-dimensional mathematical functions.
Class for interpolating the of a 1-dimensional function.
G4double G4ParticleHPJENDLHEData::G4double result
Simple interpolation table for the inverse of a IFunction1D functor.
G4double xMax
Maximum value of the independent variable.
virtual G4double integrate(const G4double x0, const G4double x1, const G4double step=-1.) const
Integrate the function between two values.
IFunction1D * primitive() const
Return a pointer to the (numerical) primitive to this function.
virtual G4double getXMaximum() const
Return the maximum allowed value of the independent variable.
G4double xMin
Minimum value of the independent variable.
G4double(*const ManipulatorFunc)(const G4double)
Typedef to simplify the syntax of inverseCDFTable.
T min(const T t1, const T t2)
brief Return the smallest of the two arguments