Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::Math Namespace Reference

Functions

G4double toDegrees (G4double radians)
 
G4int heaviside (G4int n)
 
G4double pow13 (G4double x)
 
G4double powMinus13 (G4double x)
 
G4double pow23 (G4double x)
 
template<typename T >
G4int sign (T t)
 

Variables

const G4double pi = 3.14159265358979323846264338328
 
const G4double twoPi = 2.0 * pi
 
const G4double tenPi = 10.0 * pi
 
const G4double piOverTwo = 0.5 * pi
 
const G4double oneOverSqrtThree = 1./std::sqrt((G4double)3.)
 
const G4double oneThird = 1./3.
 
const G4double twoThirds = 2./3.
 
const G4double sqrtFiveThirds = std::sqrt(5./3.)
 
const G4double sqrtThreeFifths = std::sqrt(3./5.)
 

Function Documentation

◆ heaviside()

G4int G4INCL::Math::heaviside ( G4int  n)
inline

Definition at line 84 of file G4INCLGlobals.hh.

84 {
85 if(n < 0) return 0;
86 else return 1;
87 }

Referenced by G4INCL::Nucleus::insertParticle().

◆ pow13()

G4double G4INCL::Math::pow13 ( G4double  x)
inline

Definition at line 89 of file G4INCLGlobals.hh.

89 {
90 return std::pow(x, oneThird);
91 }

Referenced by G4INCL::NuclearPotential::INuclearPotential::INuclearPotential(), and G4INCL::Random::sphereVector().

◆ pow23()

G4double G4INCL::Math::pow23 ( G4double  x)
inline

Definition at line 97 of file G4INCLGlobals.hh.

97 {
98 return std::pow(x, twoThirds);
99 }

Referenced by G4INCL::Nucleus::getCoulombRadius().

◆ powMinus13()

G4double G4INCL::Math::powMinus13 ( G4double  x)
inline

Definition at line 93 of file G4INCLGlobals.hh.

93 {
94 return std::pow(x, -oneThird);
95 }

◆ sign()

template<typename T >
G4int G4INCL::Math::sign ( t)
inline

A simple sign function that allows us to port fortran code to c++ more easily.

Definition at line 104 of file G4INCLGlobals.hh.

104 {
105 return t > 0 ? 1: t < 0 ? -1 : 0;
106 }

Referenced by G4INCL::DeltaProductionChannel::getFinalState(), G4INCL::ElasticChannel::getFinalState(), and G4INCL::RootFinder::solve().

◆ toDegrees()

G4double G4INCL::Math::toDegrees ( G4double  radians)
inline

Definition at line 80 of file G4INCLGlobals.hh.

80 {
81 return radians * (180.0 / pi);
82 }
const G4double pi

Referenced by G4INCL::Nucleus::fillEventInfo().

Variable Documentation

◆ oneOverSqrtThree

◆ oneThird

const G4double G4INCL::Math::oneThird = 1./3.

Definition at line 75 of file G4INCLGlobals.hh.

Referenced by pow13(), and powMinus13().

◆ pi

const G4double G4INCL::Math::pi = 3.14159265358979323846264338328

Definition at line 70 of file G4INCLGlobals.hh.

Referenced by G4INCL::PauliStandard::getBlockingProbability(), and toDegrees().

◆ piOverTwo

const G4double G4INCL::Math::piOverTwo = 0.5 * pi

Definition at line 73 of file G4INCLGlobals.hh.

Referenced by G4INCL::CoulombNonRelativistic::distortOut().

◆ sqrtFiveThirds

const G4double G4INCL::Math::sqrtFiveThirds = std::sqrt(5./3.)

Definition at line 77 of file G4INCLGlobals.hh.

◆ sqrtThreeFifths

const G4double G4INCL::Math::sqrtThreeFifths = std::sqrt(3./5.)

Definition at line 78 of file G4INCLGlobals.hh.

Referenced by G4INCL::ParticleTable::getMomentumRMS().

◆ tenPi

◆ twoPi

◆ twoThirds

const G4double G4INCL::Math::twoThirds = 2./3.

Definition at line 76 of file G4INCLGlobals.hh.

Referenced by G4INCL::InteractionAvatar::postInteraction(), and pow23().