55 #include "SimG4Core/MagneticField/interface/G4MonopoleEquation.hh"
59 G4MonopoleEquation::G4MonopoleEquation(G4ElectroMagneticField *emField )
60 : G4EquationOfMotion( emField ) {
64 G4MonopoleEquation::SetChargeMomentumMass(G4double particleMagneticCharge,
65 G4double particleElectricCharge,
66 G4double particleMass)
69 fElCharge =eplus* particleElectricCharge*c_light;
72 fMagCharge = eplus*particleMagneticCharge*c_light ;
79 fMassCof = particleMass*particleMass ;
83 G4MonopoleEquation::EvaluateRhsGivenB(
const G4double
y[],
84 const G4double Field[],
85 G4double dydx[] )
const
92 G4double pSquared = y[3]*y[3] + y[4]*y[4] + y[5]*y[5] ;
94 G4double Energy =
std::sqrt( pSquared + fMassCof );
97 G4double pModuleInverse = 1.0/
std::sqrt(pSquared);
99 G4double inverse_velocity = Energy * pModuleInverse / c_light;
101 G4double cofEl = fElCharge * pModuleInverse ;
102 G4double cofMag = fMagCharge * Energy * pModuleInverse;
105 dydx[0] = y[3]*pModuleInverse ;
106 dydx[1] = y[4]*pModuleInverse ;
107 dydx[2] = y[5]*pModuleInverse ;
120 dydx[3] = cofMag * Field[0] + cofEl * (y[4]*Field[2] - y[5]*Field[1]);
121 dydx[4] = cofMag * Field[1] + cofEl * (y[5]*Field[0] - y[3]*Field[2]);
122 dydx[5] = cofMag * Field[2] + cofEl * (y[3]*Field[1] - y[4]*Field[0]);
140 dydx[7] = inverse_velocity;