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

#include <G4MonopoleEquation.hh>

Inheritance diagram for G4MonopoleEquation:
G4EquationOfMotion

Public Member Functions

 G4MonopoleEquation (G4ElectroMagneticField *emField)
 
 ~G4MonopoleEquation ()
 
virtual void SetChargeMomentumMass (G4ChargeState particleChargeState, G4double momentum, G4double mass)
 
virtual void EvaluateRhsGivenB (const G4double y[], const G4double Field[], G4double dydx[]) const
 
- Public Member Functions inherited from G4EquationOfMotion
 G4EquationOfMotion (G4Field *Field)
 
virtual ~G4EquationOfMotion ()
 
virtual void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const =0
 
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 54 of file G4MonopoleEquation.hh.

Constructor & Destructor Documentation

G4MonopoleEquation::G4MonopoleEquation ( G4ElectroMagneticField emField)

Definition at line 65 of file G4MonopoleEquation.cc.

66  : G4EquationOfMotion( emField )
67 {}
G4EquationOfMotion(G4Field *Field)
G4MonopoleEquation::~G4MonopoleEquation ( )

Definition at line 71 of file G4MonopoleEquation.cc.

72 {}

Member Function Documentation

void G4MonopoleEquation::EvaluateRhsGivenB ( const G4double  y[],
const G4double  Field[],
G4double  dydx[] 
) const
virtual

Definition at line 99 of file G4MonopoleEquation.cc.

References python.hepunit::c_light.

102 {
103  // Components of y:
104  // 0-2 dr/ds,
105  // 3-5 dp/ds - momentum derivatives
106 
107  G4double pSquared = y[3]*y[3] + y[4]*y[4] + y[5]*y[5] ;
108 
109  G4double Energy = std::sqrt( pSquared + fMassCof );
110 
111  G4double pModuleInverse = 1.0/std::sqrt(pSquared);
112 
113  G4double inverse_velocity = Energy * pModuleInverse / c_light;
114 
115  G4double cofEl = fElCharge * pModuleInverse ;
116  G4double cofMag = fMagCharge * Energy * pModuleInverse;
117 
118 
119  dydx[0] = y[3]*pModuleInverse ;
120  dydx[1] = y[4]*pModuleInverse ;
121  dydx[2] = y[5]*pModuleInverse ;
122 
123  // G4double magCharge = twopi * hbar_Planck / (eplus * mu0);
124  // magnetic charge in SI units A*m convention
125  // see http://en.wikipedia.org/wiki/Magnetic_monopole
126  // G4cout << "Magnetic charge: " << magCharge << G4endl;
127  // dp/ds = dp/dt * dt/ds = dp/dt / v = Force / velocity
128  // dydx[3] = fMagCharge * Field[0] * inverse_velocity * c_light;
129  // multiplied by c_light to convert to MeV/mm
130  // dydx[4] = fMagCharge * Field[1] * inverse_velocity * c_light;
131  // dydx[5] = fMagCharge * Field[2] * inverse_velocity * c_light;
132 
133  dydx[3] = cofMag * Field[0] + cofEl * (y[4]*Field[2] - y[5]*Field[1]);
134  dydx[4] = cofMag * Field[1] + cofEl * (y[5]*Field[0] - y[3]*Field[2]);
135  dydx[5] = cofMag * Field[2] + cofEl * (y[3]*Field[1] - y[4]*Field[0]);
136 
137  // G4cout << std::setprecision(5)<< "E=" << Energy
138  // << "; p="<< 1/pModuleInverse
139  // << "; mC="<< magCharge
140  // <<"; x=" << y[0]
141  // <<"; y=" << y[1]
142  // <<"; z=" << y[2]
143  // <<"; dydx[3]=" << dydx[3]
144  // <<"; dydx[4]=" << dydx[4]
145  // <<"; dydx[5]=" << dydx[5]
146  // << G4endl;
147 
148  dydx[6] = 0.;//not used
149 
150  // Lab Time of flight
151  dydx[7] = inverse_velocity;
152  return;
153 }
double G4double
Definition: G4Types.hh:76
float c_light
Definition: hepunit.py:257
void G4MonopoleEquation::SetChargeMomentumMass ( G4ChargeState  particleChargeState,
G4double  momentum,
G4double  mass 
)
virtual

Implements G4EquationOfMotion.

Definition at line 77 of file G4MonopoleEquation.cc.

References python.hepunit::c_light, python.hepunit::eplus, G4ChargeState::GetCharge(), and G4ChargeState::MagneticCharge().

80 {
81  G4double particleMagneticCharge= particleChargeState.MagneticCharge();
82  G4double particleElectricCharge= particleChargeState.GetCharge();
83 
84  // fElCharge = particleElectricCharge;
85  fElCharge =eplus* particleElectricCharge*c_light;
86 
87  fMagCharge = eplus*particleMagneticCharge*c_light ;
88 
89  // G4cout << " G4MonopoleEquation: ElectricCharge=" << particleElectricCharge
90  // << "; MagneticCharge=" << particleMagneticCharge
91  // << G4endl;
92 
93  fMassCof = particleMass*particleMass ;
94 }
G4double GetCharge() const
G4double MagneticCharge() const
double G4double
Definition: G4Types.hh:76
float c_light
Definition: hepunit.py:257

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