Geant4-11
Public Member Functions | Private Attributes | Static Private Attributes
G4KM_NucleonEqRhs Class Reference

#include <G4KM_NucleonEqRhs.hh>

Inheritance diagram for G4KM_NucleonEqRhs:
G4Mag_EqRhs G4EquationOfMotion

Public Member Functions

virtual void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const
 
void EvaluateRhsReturnB (const G4double y[], G4double dydx[], G4double Field[]) const
 
G4double FCof () const
 
 G4KM_NucleonEqRhs (G4KM_DummyField *field, G4V3DNucleus *nucleus)
 
G4FieldGetFieldObj ()
 
const G4FieldGetFieldObj () const
 
void GetFieldValue (const G4double Point[4], G4double Field[]) const
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
virtual void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double MassXc2)
 
void SetFieldObj (G4Field *pField)
 
void SetMass (G4double aMass)
 
 ~G4KM_NucleonEqRhs ()
 

Private Attributes

G4int A
 
G4double factor
 
G4double fCof_val = 0.0
 
G4FielditsField = nullptr
 
G4double theMass
 
G4V3DNucleustheNucleus
 

Static Private Attributes

static const G4double fUnitConstant = 0.299792458 * (GeV/(tesla*m))
 

Detailed Description

Definition at line 49 of file G4KM_NucleonEqRhs.hh.

Constructor & Destructor Documentation

◆ G4KM_NucleonEqRhs()

G4KM_NucleonEqRhs::G4KM_NucleonEqRhs ( G4KM_DummyField field,
G4V3DNucleus nucleus 
)

Definition at line 45 of file G4KM_NucleonEqRhs.cc.

46 :
47 G4Mag_EqRhs(field), theNucleus(nucleus)
48{
49 theMass = 0.;
52}
static constexpr double pi2
Definition: G4SIunits.hh:58
G4V3DNucleus * theNucleus
G4Mag_EqRhs(G4MagneticField *magField)
Definition: G4Mag_EqRhs.cc:39
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double A23(G4double A) const
Definition: G4Pow.hh:131
virtual G4int GetMassNumber()=0
float hbarc
Definition: hepunit.py:264

References A, G4Pow::A23(), factor, G4Pow::GetInstance(), G4V3DNucleus::GetMassNumber(), source.hepunit::hbarc, pi2, theMass, and theNucleus.

◆ ~G4KM_NucleonEqRhs()

G4KM_NucleonEqRhs::~G4KM_NucleonEqRhs ( )
inline

Definition at line 81 of file G4KM_NucleonEqRhs.hh.

82{ }

Member Function Documentation

◆ EvaluateRhsGivenB()

void G4KM_NucleonEqRhs::EvaluateRhsGivenB ( const G4double  y[],
const G4double  B[3],
G4double  dydx[] 
) const
virtual

Implements G4Mag_EqRhs.

Definition at line 55 of file G4KM_NucleonEqRhs.cc.

58{
59 G4double yMod = std::sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);
60 G4double e = std::sqrt(theMass*theMass+y[3]*y[3]+y[4]*y[4]+y[5]*y[5]);
61
62// y[0..2] is position
63// y[3..5] is momentum (and not mom.direction)
64
65 dydx[0] = c_light*y[3]/e; //
66 dydx[1] = c_light*y[4]/e; // dq/dt=dH/dp = c*p/e
67 dydx[2] = c_light*y[5]/e; //
68
69/*
70 * // debug
71 * G4cout << " Nucleon RHS : 0..2(dpos/dt) " <<
72 * dydx[0] << " " <<
73 * dydx[1] << " " <<
74 * dydx[2] << " " << G4endl;
75 */
76
77
78// V=K*rho(r) ==> dydx[3] = -dV/dr*dr/dx = -K*d(rho)/dr*dr/dx.
79// GF should be V=K*rho(r) ==> dydx[3] = -dV/dr*dr/dx = -K*d(rho)/dr*dr/dt
80// GF and dV/dt = dE/dt ==> dp/dt = dE/dt * dp/dE = dE/dt *e/p
81// Idem for dydx[4] and dydx[5]
82
83 G4ThreeVector pos(y[0],y[1],y[2]);
84
85 const G4VNuclearDensity * nuclearDensity=theNucleus->GetNuclearDensity();
86
87// do not check for theMass != 0 : it is an error and core dump will signal it
88
89 G4double density= nuclearDensity->GetDensity(pos);
90 G4double deriv(0);
91 if (density > 0 ) deriv = (factor/theMass)/
92 G4Pow::GetInstance()->A13(density)*nuclearDensity->GetDeriv(pos);
93
94// dydx[3] = yMod == 0 ? 0 : -deriv*y[0]/yMod;
95// dydx[4] = yMod == 0 ? 0 : -deriv*y[1]/yMod;
96// dydx[5] = yMod == 0 ? 0 : -deriv*y[2]/yMod;
97 dydx[3] = yMod == 0 ? 0 : deriv*y[0]/yMod*c_light;
98 dydx[4] = yMod == 0 ? 0 : deriv*y[1]/yMod*c_light;
99 dydx[5] = yMod == 0 ? 0 : deriv*y[2]/yMod*c_light;
100
101
102/*
103 * // debug
104 * G4cout << " Nucleon RHS : 3..5(dE/dt) " <<
105 * dydx[3] << " " <<
106 * dydx[4] << " " <<
107 * dydx[5] << " " << G4endl;
108 */
109}
static const G4double pos
double G4double
Definition: G4Types.hh:83
G4double A13(G4double A) const
Definition: G4Pow.cc:120
virtual const G4VNuclearDensity * GetNuclearDensity() const =0
G4double GetDensity(const G4ThreeVector &aPosition) const
virtual G4double GetDeriv(const G4ThreeVector &point) const =0
float c_light
Definition: hepunit.py:256

References G4Pow::A13(), source.hepunit::c_light, factor, G4VNuclearDensity::GetDensity(), G4VNuclearDensity::GetDeriv(), G4Pow::GetInstance(), G4V3DNucleus::GetNuclearDensity(), pos, theMass, and theNucleus.

◆ EvaluateRhsReturnB()

void G4EquationOfMotion::EvaluateRhsReturnB ( const G4double  y[],
G4double  dydx[],
G4double  Field[] 
) const
inlineinherited

◆ FCof()

G4double G4Mag_EqRhs::FCof ( ) const
inlineinherited

◆ GetFieldObj() [1/2]

G4Field * G4EquationOfMotion::GetFieldObj ( )
inlineinherited

◆ GetFieldObj() [2/2]

const G4Field * G4EquationOfMotion::GetFieldObj ( ) const
inlineinherited

Referenced by G4NystromRK4::GetField().

◆ GetFieldValue()

void G4EquationOfMotion::GetFieldValue ( const G4double  Point[4],
G4double  Field[] 
) const
inlineinherited

◆ RightHandSide()

void G4EquationOfMotion::RightHandSide ( const G4double  y[],
G4double  dydx[] 
) const
inlineinherited

◆ SetChargeMomentumMass()

void G4KM_NucleonEqRhs::SetChargeMomentumMass ( G4ChargeState  particleCharge,
G4double  MomentumXc,
G4double  MassXc2 
)
virtual

Reimplemented from G4Mag_EqRhs.

Definition at line 112 of file G4KM_NucleonEqRhs.cc.

113{
114}

◆ SetFieldObj()

void G4EquationOfMotion::SetFieldObj ( G4Field pField)
inlineinherited

◆ SetMass()

void G4KM_NucleonEqRhs::SetMass ( G4double  aMass)
inline

Definition at line 74 of file G4KM_NucleonEqRhs.hh.

75{
76 theMass = aMass;
77}

References theMass.

Referenced by G4RKPropagation::Init().

Field Documentation

◆ A

G4int G4KM_NucleonEqRhs::A
private

Definition at line 68 of file G4KM_NucleonEqRhs.hh.

Referenced by G4KM_NucleonEqRhs(), and mcscore.MCParticle::printout().

◆ factor

G4double G4KM_NucleonEqRhs::factor
private

Definition at line 67 of file G4KM_NucleonEqRhs.hh.

Referenced by EvaluateRhsGivenB(), and G4KM_NucleonEqRhs().

◆ fCof_val

G4double G4Mag_EqRhs::fCof_val = 0.0
privateinherited

Definition at line 69 of file G4Mag_EqRhs.hh.

Referenced by G4Mag_EqRhs::FCof(), and G4Mag_EqRhs::SetChargeMomentumMass().

◆ fUnitConstant

const G4double G4Mag_EqRhs::fUnitConstant = 0.299792458 * (GeV/(tesla*m))
staticprivateinherited

Definition at line 71 of file G4Mag_EqRhs.hh.

◆ itsField

G4Field* G4EquationOfMotion::itsField = nullptr
privateinherited

Definition at line 90 of file G4EquationOfMotion.hh.

◆ theMass

G4double G4KM_NucleonEqRhs::theMass
private

Definition at line 69 of file G4KM_NucleonEqRhs.hh.

Referenced by EvaluateRhsGivenB(), G4KM_NucleonEqRhs(), and SetMass().

◆ theNucleus

G4V3DNucleus* G4KM_NucleonEqRhs::theNucleus
private

Definition at line 66 of file G4KM_NucleonEqRhs.hh.

Referenced by EvaluateRhsGivenB(), and G4KM_NucleonEqRhs().


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