ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PolynomialPDF Class Reference

#include <geant4/tree/geant4-10.6-release/source/processes/hadronic/models/util/include/G4PolynomialPDF.hh>

+ Collaboration diagram for G4PolynomialPDF:

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< G4doublefCoefficients
 
G4bool fChanged
 
G4double fTolerance
 
G4int fVerbose
 

Detailed Description

Definition at line 49 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 49 of file G4PolynomialPDF.hh

Constructor & Destructor Documentation

G4PolynomialPDF::G4PolynomialPDF ( size_t  n = 0,
const double *  coeffs = nullptr,
G4double  x1 = 0,
G4double  x2 = 1 
)

Definition at line 43 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 43 of file G4PolynomialPDF.cc

References SetCoefficients(), and SetNCoefficients().

+ Here is the call graph for this function:

G4PolynomialPDF::~G4PolynomialPDF ( )

Definition at line 51 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 51 of file G4PolynomialPDF.cc

Member Function Documentation

G4double G4PolynomialPDF::Bisect ( G4double  p,
G4double  x1,
G4double  x2 
)

Definition at line 392 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 392 of file G4PolynomialPDF.cc

References Evaluate(), fX1, fX2, GetX(), x1, and z.

Referenced by GetX().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4PolynomialPDF::Dump ( )

Definition at line 401 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 401 of file G4PolynomialPDF.cc

References fX1, fX2, G4cout, G4endl, GetCoefficient(), and GetNCoefficients().

Referenced by Normalize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double G4PolynomialPDF::EvalInverseCDF ( G4double  p)
inline

Definition at line 102 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 102 of file G4PolynomialPDF.hh

References fX1, fX2, and GetX().

Referenced by GetRandomX().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double G4PolynomialPDF::Evaluate ( G4double  x,
G4int  ddxPower = 0 
)

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.

View newest version in sPHENIX GitHub at line 131 of file G4PolynomialPDF.cc

References f, fVerbose, fX1, G4cout, G4endl, GetCoefficient(), GetNCoefficients(), and x.

Referenced by Bisect(), and HasNegativeMinimum().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double G4PolynomialPDF::GetCoefficient ( size_t  i) const
inline

Definition at line 62 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 62 of file G4PolynomialPDF.hh

References fCoefficients.

Referenced by Dump(), Evaluate(), GetX(), HasNegativeMinimum(), and Normalize().

+ Here is the caller graph for this function:

size_t G4PolynomialPDF::GetNCoefficients ( ) const
inline

Definition at line 58 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 58 of file G4PolynomialPDF.hh

References fCoefficients.

Referenced by Dump(), Evaluate(), GetX(), HasNegativeMinimum(), Normalize(), and SetCoefficients().

+ Here is the caller graph for this function:

G4double G4PolynomialPDF::GetRandomX ( )

Definition at line 207 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 207 of file G4PolynomialPDF.cc

References EvalInverseCDF(), fChanged, fVerbose, fX1, fX2, G4cout, G4endl, G4UniformRand, HasNegativeMinimum(), and Normalize().

Referenced by G4PolarizationTransition::GenerateGammaCosTheta().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

View newest version in sPHENIX GitHub at line 223 of file G4PolynomialPDF.cc

References a, b, Bisect(), c, f, fTolerance, fVerbose, fX1, fX2, G4cout, G4endl, GetCoefficient(), GetNCoefficients(), x1, and x2.

Referenced by Bisect(), EvalInverseCDF(), and HasNegativeMinimum().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4bool G4PolynomialPDF::HasNegativeMinimum ( G4double  x1,
G4double  x2 
)
protected

Definition at line 166 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 166 of file G4PolynomialPDF.cc

References Evaluate(), fTolerance, fVerbose, fX2, G4cout, G4endl, GetCoefficient(), GetNCoefficients(), GetX(), x1, and x2.

Referenced by GetRandomX().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

View newest version in sPHENIX GitHub at line 100 of file G4PolynomialPDF.cc

References Dump(), fCoefficients, fVerbose, fX1, fX2, G4cout, G4endl, GetCoefficient(), GetNCoefficients(), SetCoefficient(), Simplify(), and sum.

Referenced by GetRandomX().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4PolynomialPDF::SetCoefficient ( size_t  i,
G4double  value,
bool  doSimplify 
)

Definition at line 54 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 54 of file G4PolynomialPDF.cc

References fChanged, fCoefficients, and Simplify().

Referenced by Normalize(), and SetCoefficients().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4PolynomialPDF::SetCoefficients ( const std::vector< G4double > &  v)
inline

Definition at line 59 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 59 of file G4PolynomialPDF.hh

References fChanged, fCoefficients, Simplify(), and v.

Referenced by G4PolynomialPDF(), and G4PolarizationTransition::GenerateGammaCosTheta().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4PolynomialPDF::SetCoefficients ( size_t  n,
const G4double coeffs 
)

Definition at line 63 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 63 of file G4PolynomialPDF.cc

References fChanged, GetNCoefficients(), SetCoefficient(), SetNCoefficients(), and Simplify().

+ Here is the call graph for this function:

void G4PolynomialPDF::SetDomain ( G4double  x1,
G4double  x2 
)

Definition at line 86 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 86 of file G4PolynomialPDF.cc

References fChanged, fVerbose, fX1, fX2, G4cout, G4endl, x1, and x2.

void G4PolynomialPDF::SetNCoefficients ( size_t  n)
inline

Definition at line 57 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 57 of file G4PolynomialPDF.hh

References fChanged, and fCoefficients.

Referenced by G4PolynomialPDF(), and SetCoefficients().

+ Here is the caller graph for this function:

void G4PolynomialPDF::SetTolerance ( G4double  tolerance)
inline

Definition at line 87 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 87 of file G4PolynomialPDF.hh

References fTolerance.

void G4PolynomialPDF::Simplify ( )

Definition at line 74 of file G4PolynomialPDF.cc.

View newest version in sPHENIX GitHub at line 74 of file G4PolynomialPDF.cc

References fChanged, fCoefficients, fVerbose, G4cout, and G4endl.

Referenced by Normalize(), SetCoefficient(), and SetCoefficients().

+ Here is the caller graph for this function:

Member Data Documentation

G4bool G4PolynomialPDF::fChanged
protected

Definition at line 114 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 114 of file G4PolynomialPDF.hh

Referenced by GetRandomX(), SetCoefficient(), SetCoefficients(), SetDomain(), SetNCoefficients(), and Simplify().

std::vector<G4double> G4PolynomialPDF::fCoefficients
protected

Definition at line 113 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 113 of file G4PolynomialPDF.hh

Referenced by GetCoefficient(), GetNCoefficients(), Normalize(), SetCoefficient(), SetCoefficients(), SetNCoefficients(), and Simplify().

G4double G4PolynomialPDF::fTolerance
protected

Definition at line 115 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 115 of file G4PolynomialPDF.hh

Referenced by GetX(), HasNegativeMinimum(), and SetTolerance().

G4int G4PolynomialPDF::fVerbose
protected

Definition at line 116 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 116 of file G4PolynomialPDF.hh

Referenced by Evaluate(), GetRandomX(), GetX(), HasNegativeMinimum(), Normalize(), SetDomain(), and Simplify().

G4double G4PolynomialPDF::fX1
protected

Definition at line 111 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 111 of file G4PolynomialPDF.hh

Referenced by Bisect(), Dump(), EvalInverseCDF(), Evaluate(), GetRandomX(), GetX(), Normalize(), and SetDomain().

G4double G4PolynomialPDF::fX2
protected

Definition at line 112 of file G4PolynomialPDF.hh.

View newest version in sPHENIX GitHub at line 112 of file G4PolynomialPDF.hh

Referenced by Bisect(), Dump(), EvalInverseCDF(), GetRandomX(), GetX(), HasNegativeMinimum(), Normalize(), and SetDomain().


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