Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4KM_NucleonEqRhs Class Reference

#include <G4KM_NucleonEqRhs.hh>

Inheritance diagram for G4KM_NucleonEqRhs:
G4Mag_EqRhs G4EquationOfMotion

Public Member Functions

 G4KM_NucleonEqRhs (G4KM_DummyField *field, G4V3DNucleus *nucleus)
 
 ~G4KM_NucleonEqRhs ()
 
virtual void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const
 
virtual void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double MassXc2)
 
void SetMass (G4double aMass)
 
- Public Member Functions inherited from G4Mag_EqRhs
 G4Mag_EqRhs (G4MagneticField *magField)
 
virtual ~G4Mag_EqRhs ()
 
G4double FCof () const
 
- Public Member Functions inherited from G4EquationOfMotion
 G4EquationOfMotion (G4Field *Field)
 
virtual ~G4EquationOfMotion ()
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void EvaluateRhsReturnB (const G4double y[], G4double dydx[], G4double Field[]) const
 
void GetFieldValue (const G4double Point[4], G4double Field[]) const
 
const G4FieldGetFieldObj () const
 
void SetFieldObj (G4Field *pField)
 

Detailed Description

Definition at line 49 of file G4KM_NucleonEqRhs.hh.

Constructor & Destructor Documentation

G4KM_NucleonEqRhs::G4KM_NucleonEqRhs ( G4KM_DummyField field,
G4V3DNucleus nucleus 
)

Definition at line 44 of file G4KM_NucleonEqRhs.cc.

References G4V3DNucleus::GetMassNumber(), python.hepunit::hbarc, and python.hepunit::pi2.

45  :
46  G4Mag_EqRhs(field), theNucleus(nucleus)
47 {
48  theMass = 0.;
49  A = theNucleus->GetMassNumber();
50  factor = hbarc*hbarc*std::pow(3.*pi2*A,2./3.)/3.;
51 }
virtual G4int GetMassNumber()=0
G4Mag_EqRhs(G4MagneticField *magField)
Definition: G4Mag_EqRhs.cc:50
G4KM_NucleonEqRhs::~G4KM_NucleonEqRhs ( )
inline

Definition at line 81 of file G4KM_NucleonEqRhs.hh.

82 { }

Member Function Documentation

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

Implements G4Mag_EqRhs.

Definition at line 54 of file G4KM_NucleonEqRhs.cc.

References python.hepunit::c_light, density, G4VNuclearDensity::GetDensity(), G4VNuclearDensity::GetDeriv(), and G4V3DNucleus::GetNuclearDensity().

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

Reimplemented from G4Mag_EqRhs.

Definition at line 111 of file G4KM_NucleonEqRhs.cc.

112 {
113 }
void G4KM_NucleonEqRhs::SetMass ( G4double  aMass)
inline

Definition at line 74 of file G4KM_NucleonEqRhs.hh.

Referenced by G4RKPropagation::Init().

75 {
76  theMass = aMass;
77 }

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