Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
|
#include <G4PolynomialPDF.hh>
Public Member Functions | |
G4PolynomialPDF (size_t n=0, const double *coeffs=nullptr, G4double x1=0, G4double x2=1) | |
~G4PolynomialPDF () | |
void | SetNCoefficients (size_t n) |
size_t | GetNCoefficients () const |
void | SetCoefficients (const std::vector< G4double > &v) |
G4double | GetCoefficient (size_t i) const |
void | SetCoefficient (size_t i, G4double value, bool doSimplify) |
void | SetCoefficients (size_t n, const G4double *coeffs) |
void | Simplify () |
void | SetDomain (G4double x1, G4double x2) |
void | Normalize () |
G4double | Evaluate (G4double x, G4int ddxPower=0) |
G4double | GetRandomX () |
void | SetTolerance (G4double tolerance) |
G4double | GetX (G4double p, G4double x1, G4double x2, G4int ddxPower=0, G4double guess=1.e99, G4bool bisect=true) |
G4double | EvalInverseCDF (G4double p) |
G4double | Bisect (G4double p, G4double x1, G4double x2) |
void | Dump () |
Protected Member Functions | |
G4bool | HasNegativeMinimum (G4double x1, G4double x2) |
Protected Attributes | |
G4double | fX1 |
G4double | fX2 |
std::vector< G4double > | fCoefficients |
G4bool | fChanged |
G4double | fTolerance |
G4int | fVerbose |
Definition at line 49 of file G4PolynomialPDF.hh.
G4PolynomialPDF::G4PolynomialPDF | ( | size_t | n = 0 , |
const double * | coeffs = nullptr , |
||
G4double | x1 = 0 , |
||
G4double | x2 = 1 |
||
) |
Definition at line 43 of file G4PolynomialPDF.cc.
G4PolynomialPDF::~G4PolynomialPDF | ( | ) |
Definition at line 51 of file G4PolynomialPDF.cc.
Definition at line 392 of file G4PolynomialPDF.cc.
void G4PolynomialPDF::Dump | ( | ) |
Definition at line 401 of file G4PolynomialPDF.cc.
Referenced by Normalize().
Definition at line 102 of file G4PolynomialPDF.hh.
Referenced by GetRandomX().
Evaluate f(x) ddxPower = -1: f = CDF ddxPower = 0: f = PDF ddxPower = 1: f = (d/dx) PDF ddxPower = 2: f = (d2/dx2) PDF
Definition at line 131 of file G4PolynomialPDF.cc.
Referenced by Bisect(), and HasNegativeMinimum().
|
inline |
Definition at line 62 of file G4PolynomialPDF.hh.
Referenced by Dump(), Evaluate(), GetX(), HasNegativeMinimum(), and Normalize().
|
inline |
Definition at line 58 of file G4PolynomialPDF.hh.
Referenced by Dump(), Evaluate(), GetX(), HasNegativeMinimum(), Normalize(), and SetCoefficients().
G4double G4PolynomialPDF::GetRandomX | ( | ) |
Definition at line 207 of file G4PolynomialPDF.cc.
G4double G4PolynomialPDF::GetX | ( | G4double | p, |
G4double | x1, | ||
G4double | x2, | ||
G4int | ddxPower = 0 , |
||
G4double | guess = 1.e99 , |
||
G4bool | bisect = true |
||
) |
Find a value of X between x1 and x2 at which f(x) = p. ddxPower = -1: f = CDF ddxPower = 0: f = PDF ddxPower = 1: f = (d/dx) PDF Uses the Newton-Raphson method to find the zero of f(x) - p. If not found in range, returns the nearest boundary
Definition at line 223 of file G4PolynomialPDF.cc.
Referenced by Bisect(), EvalInverseCDF(), and HasNegativeMinimum().
Definition at line 166 of file G4PolynomialPDF.cc.
Referenced by GetRandomX(), and HasNegativeMinimum().
void G4PolynomialPDF::Normalize | ( | ) |
Normalize PDF to 1 over domain fX1 to fX2. Double-check that the highest-order coefficient is non-zero.
Definition at line 100 of file G4PolynomialPDF.cc.
Referenced by GetRandomX().
void G4PolynomialPDF::SetCoefficient | ( | size_t | i, |
G4double | value, | ||
bool | doSimplify | ||
) |
Definition at line 54 of file G4PolynomialPDF.cc.
Referenced by Normalize(), and SetCoefficients().
|
inline |
Definition at line 59 of file G4PolynomialPDF.hh.
Referenced by G4PolynomialPDF().
void G4PolynomialPDF::SetCoefficients | ( | size_t | n, |
const G4double * | coeffs | ||
) |
Definition at line 63 of file G4PolynomialPDF.cc.
|
inline |
Definition at line 57 of file G4PolynomialPDF.hh.
Referenced by G4PolynomialPDF(), and SetCoefficients().
|
inline |
Definition at line 87 of file G4PolynomialPDF.hh.
void G4PolynomialPDF::Simplify | ( | ) |
Definition at line 74 of file G4PolynomialPDF.cc.
Referenced by Normalize(), SetCoefficient(), and SetCoefficients().
|
protected |
Definition at line 114 of file G4PolynomialPDF.hh.
Referenced by GetRandomX(), SetCoefficient(), SetCoefficients(), SetDomain(), SetNCoefficients(), and Simplify().
|
protected |
Definition at line 113 of file G4PolynomialPDF.hh.
Referenced by GetCoefficient(), GetNCoefficients(), Normalize(), SetCoefficient(), SetCoefficients(), SetNCoefficients(), and Simplify().
|
protected |
Definition at line 115 of file G4PolynomialPDF.hh.
Referenced by GetX(), HasNegativeMinimum(), and SetTolerance().
|
protected |
Definition at line 116 of file G4PolynomialPDF.hh.
Referenced by Evaluate(), GetRandomX(), GetX(), HasNegativeMinimum(), Normalize(), SetDomain(), and Simplify().
|
protected |
Definition at line 111 of file G4PolynomialPDF.hh.
Referenced by Bisect(), Dump(), EvalInverseCDF(), Evaluate(), GetRandomX(), GetX(), Normalize(), and SetDomain().
|
protected |
Definition at line 112 of file G4PolynomialPDF.hh.
Referenced by Bisect(), Dump(), EvalInverseCDF(), GetRandomX(), GetX(), HasNegativeMinimum(), Normalize(), and SetDomain().