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

#include <G4KM_OpticalEqRhs.hh>

Inheritance diagram for G4KM_OpticalEqRhs:
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_OpticalEqRhs (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 SetFactor (G4double mass, G4double opticalParameter)
 
void SetFieldObj (G4Field *pField)
 
 ~G4KM_OpticalEqRhs ()
 

Private Attributes

G4double fCof_val = 0.0
 
G4FielditsField = nullptr
 
G4double theFactor
 
G4double theMass
 
G4V3DNucleustheNucleus
 

Static Private Attributes

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

Detailed Description

Definition at line 49 of file G4KM_OpticalEqRhs.hh.

Constructor & Destructor Documentation

◆ G4KM_OpticalEqRhs()

G4KM_OpticalEqRhs::G4KM_OpticalEqRhs ( G4KM_DummyField field,
G4V3DNucleus nucleus 
)

Definition at line 45 of file G4KM_OpticalEqRhs.cc.

46 :
47 G4Mag_EqRhs(field), theNucleus(nucleus)
48{
49 theFactor = 0;
50 theMass = 0;
51}
G4V3DNucleus * theNucleus
G4Mag_EqRhs(G4MagneticField *magField)
Definition: G4Mag_EqRhs.cc:39

References theFactor, and theMass.

◆ ~G4KM_OpticalEqRhs()

G4KM_OpticalEqRhs::~G4KM_OpticalEqRhs ( )
inline

Definition at line 69 of file G4KM_OpticalEqRhs.hh.

70{ }

Member Function Documentation

◆ EvaluateRhsGivenB()

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

Implements G4Mag_EqRhs.

Definition at line 71 of file G4KM_OpticalEqRhs.cc.

73{
74 G4double yMod = std::sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);
75 G4double e = std::sqrt(theMass*theMass+y[3]*y[3]+y[4]*y[4]+y[5]*y[5]);
76 dydx[0] = c_light*y[3]/e; //
77 dydx[1] = c_light*y[4]/e; // dq/dt=dH/dp = c*p/e
78 dydx[2] = c_light*y[5]/e; //
79
80// V=K*rho(r) ==> dydx[3] = -dV/dr*dr/dx = -K*d(rho)/dr*dr/dx.
81// Idem for dydx[4] and dydx[5]
82
83 const G4VNuclearDensity * nuclearDensity=theNucleus->GetNuclearDensity();
84
85 G4ThreeVector pos(y[0],y[1],y[2]);
86 G4double deriv = theFactor*nuclearDensity->GetDeriv(pos);
87
88 dydx[3] = yMod == 0 ? 0 : -deriv*y[0]/yMod*c_light;
89 dydx[4] = yMod == 0 ? 0 : -deriv*y[1]/yMod*c_light;
90 dydx[5] = yMod == 0 ? 0 : -deriv*y[2]/yMod*c_light;
91}
static const G4double pos
double G4double
Definition: G4Types.hh:83
virtual const G4VNuclearDensity * GetNuclearDensity() const =0
virtual G4double GetDeriv(const G4ThreeVector &point) const =0
float c_light
Definition: hepunit.py:256

References source.hepunit::c_light, G4VNuclearDensity::GetDeriv(), G4V3DNucleus::GetNuclearDensity(), pos, theFactor, 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_OpticalEqRhs::SetChargeMomentumMass ( G4ChargeState  particleCharge,
G4double  MomentumXc,
G4double  MassXc2 
)
virtual

Reimplemented from G4Mag_EqRhs.

Definition at line 94 of file G4KM_OpticalEqRhs.cc.

95{
96}

◆ SetFactor()

void G4KM_OpticalEqRhs::SetFactor ( G4double  mass,
G4double  opticalParameter 
)

Definition at line 54 of file G4KM_OpticalEqRhs.cc.

55{
60 G4double reducedMass = mass*nucleusMass/(mass+nucleusMass);
61
62 G4double nucleonMass = (proton_mass_c2+neutron_mass_c2)/2;
63
64// _factor in (MeV*fermi)*fermi/MeV = fermi*fermi -- need to have A as density normalized to 1
65 theFactor = 2*pi*hbarc*hbarc*(1+mass/nucleonMass)* opticalParameter/reducedMass * A;
66
67 theMass = mass;
68}
static constexpr double pi
Definition: G4SIunits.hh:55
const G4int Z[17]
const G4double A[17]
static G4double GetBindingEnergy(const G4int A, const G4int Z)
virtual G4int GetCharge()=0
virtual G4int GetMassNumber()=0
G4double bindingEnergy(G4int A, G4int Z)
float proton_mass_c2
Definition: hepunit.py:274
float hbarc
Definition: hepunit.py:264
float neutron_mass_c2
Definition: hepunit.py:275
int G4lrint(double ad)
Definition: templates.hh:134

References A, G4InuclSpecialFunctions::bindingEnergy(), G4lrint(), G4NucleiProperties::GetBindingEnergy(), G4V3DNucleus::GetCharge(), G4V3DNucleus::GetMassNumber(), source.hepunit::hbarc, source.hepunit::neutron_mass_c2, pi, source.hepunit::proton_mass_c2, theFactor, theMass, theNucleus, and Z.

Referenced by G4RKPropagation::Init().

◆ SetFieldObj()

void G4EquationOfMotion::SetFieldObj ( G4Field pField)
inlineinherited

Field Documentation

◆ 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.

◆ theFactor

G4double G4KM_OpticalEqRhs::theFactor
private

Definition at line 65 of file G4KM_OpticalEqRhs.hh.

Referenced by EvaluateRhsGivenB(), G4KM_OpticalEqRhs(), and SetFactor().

◆ theMass

G4double G4KM_OpticalEqRhs::theMass
private

Definition at line 66 of file G4KM_OpticalEqRhs.hh.

Referenced by EvaluateRhsGivenB(), G4KM_OpticalEqRhs(), and SetFactor().

◆ theNucleus

G4V3DNucleus* G4KM_OpticalEqRhs::theNucleus
private

Definition at line 64 of file G4KM_OpticalEqRhs.hh.

Referenced by EvaluateRhsGivenB(), and SetFactor().


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