00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4MonopoleEq.cc 69786 2013-05-15 09:38:51Z gcosmo $ 00028 // 00029 // 00030 // This is the right-hand side for equation of motion for a 00031 // magnetic charge in a combined Electro-Magnetic field 00032 // 00033 // d(p_c)/ds=g{c-energyB_ - p_c x E}/pc 00034 // 00035 // 17.11.09 V.Grichine 00036 // 00037 // ------------------------------------------------------------------- 00038 00039 #include "G4MonopoleEq.hh" 00040 #include "globals.hh" 00041 #include "G4PhysicalConstants.hh" 00042 #include "G4SystemOfUnits.hh" 00043 00044 void 00045 G4MonopoleEq::SetChargeMomentumMass(G4double particleCharge, // e+ units 00046 G4double, 00047 G4double particleMass) 00048 { 00049 fElectroMagCof = eplus*particleCharge; // no *c_light as for ususal q 00050 fElectroMagCof /= 2*fine_structure_const; 00051 00052 fMassCof = particleMass*particleMass ; 00053 } 00054 00055 00056 00057 void 00058 G4MonopoleEq::EvaluateRhsGivenB(const G4double y[], 00059 const G4double Field[], 00060 G4double dydx[] ) const 00061 { 00062 00063 // Components of y: 00064 // 0-2 dr/ds, 00065 // 3-5 d(pc)/ds - momentum derivatives 00066 00067 G4double pSquared = y[3]*y[3] + y[4]*y[4] + y[5]*y[5] ; 00068 00069 G4double Energy = std::sqrt( pSquared + fMassCof ); 00070 G4double cof2 = Energy*c_light ; 00071 00072 G4double pModuleInverse = 1.0/std::sqrt(pSquared) ; 00073 00074 // G4double inverse_velocity = Energy * c_light * pModuleInverse; 00075 G4double inverse_velocity = Energy * pModuleInverse / c_light; 00076 00077 G4double cof1 = fElectroMagCof*pModuleInverse ; 00078 00079 // G4double vDotE = y[3]*Field[3] + y[4]*Field[4] + y[5]*Field[5] ; 00080 00081 dydx[0] = y[3]*pModuleInverse ; 00082 dydx[1] = y[4]*pModuleInverse ; 00083 dydx[2] = y[5]*pModuleInverse ; 00084 00085 dydx[3] = cof1*(cof2*Field[0] - (y[4]*Field[5] - y[5]*Field[4])) ; 00086 00087 dydx[4] = cof1*(cof2*Field[1] - (y[5]*Field[3] - y[3]*Field[5])) ; 00088 00089 dydx[5] = cof1*(cof2*Field[2] - (y[3]*Field[4] - y[4]*Field[3])) ; 00090 00091 dydx[6] = 0.;//not used 00092 00093 // Lab Time of flight 00094 dydx[7] = inverse_velocity; 00095 return ; 00096 }