54 #include "SimG4Core/MagneticField/interface/G4MonopoleEquation.hh"
58 G4MonopoleEquation::G4MonopoleEquation(G4ElectroMagneticField *emField )
59 : G4EquationOfMotion( emField ) {
63 G4MonopoleEquation::SetChargeMomentumMass(G4double particleMagneticCharge,
64 G4double particleElectricCharge,
65 G4double particleMass)
68 fElCharge =eplus* particleElectricCharge*c_light;
71 fMagCharge = eplus*particleMagneticCharge*c_light ;
78 fMassCof = particleMass*particleMass ;
82 G4MonopoleEquation::EvaluateRhsGivenB(
const G4double
y[],
83 const G4double Field[],
84 G4double dydx[] )
const
91 G4double pSquared = y[3]*y[3] + y[4]*y[4] + y[5]*y[5] ;
93 G4double Energy =
std::sqrt( pSquared + fMassCof );
96 G4double pModuleInverse = 1.0/
std::sqrt(pSquared);
98 G4double inverse_velocity = Energy * pModuleInverse / c_light;
100 G4double cofEl = fElCharge * pModuleInverse ;
101 G4double cofMag = fMagCharge * Energy * pModuleInverse;
104 dydx[0] = y[3]*pModuleInverse ;
105 dydx[1] = y[4]*pModuleInverse ;
106 dydx[2] = y[5]*pModuleInverse ;
119 dydx[3] = cofMag * Field[0] + cofEl * (y[4]*Field[2] - y[5]*Field[1]);
120 dydx[4] = cofMag * Field[1] + cofEl * (y[5]*Field[0] - y[3]*Field[2]);
121 dydx[5] = cofMag * Field[2] + cofEl * (y[3]*Field[1] - y[4]*Field[0]);
139 dydx[7] = inverse_velocity;
return(e1-e2)*(e1-e2)+dp *dp