Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4KM_NucleonEqRhs Class Reference

#include <G4KM_NucleonEqRhs.hh>

Inheritance diagram for G4KM_NucleonEqRhs:
Collaboration diagram for G4KM_NucleonEqRhs:

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 45 of file G4KM_NucleonEqRhs.cc.

46  :
47  G4Mag_EqRhs(field), theNucleus(nucleus)
48 {
49  theMass = 0.;
50  A = theNucleus->GetMassNumber();
51  factor = hbarc*hbarc*G4Pow::GetInstance()->A23(3.*pi2*A)/3.;
52 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
virtual G4int GetMassNumber()=0
G4double A23(G4double A) const
Definition: G4Pow.hh:160
G4Mag_EqRhs(G4MagneticField *magField)
Definition: G4Mag_EqRhs.cc:50
static constexpr double pi2
Definition: G4SIunits.hh:78

Here is the call graph for this function:

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 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 G4Pow * GetInstance()
Definition: G4Pow.cc:55
virtual const G4VNuclearDensity * GetNuclearDensity() const =0
virtual G4double GetDeriv(const G4ThreeVector &point) const =0
G4double GetDensity(const G4ThreeVector &aPosition) const
G4double A13(G4double A) const
Definition: G4Pow.hh:132
double G4double
Definition: G4Types.hh:76
float c_light
Definition: hepunit.py:257
static const G4double pos

Here is the call graph for this function:

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 }
void G4KM_NucleonEqRhs::SetMass ( G4double  aMass)
inline

Definition at line 74 of file G4KM_NucleonEqRhs.hh.

75 {
76  theMass = aMass;
77 }

Here is the caller graph for this function:


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