35 :
G4MagneticField(), fpMagneticField(pMagField), fDistanceConst(distance),
48 cloned->fLastLocation = fLastLocation;
49 cloned->fLastValue = fLastValue;
69 fpMagneticField= rightCMF.fpMagneticField;
70 fDistanceConst = rightCMF.fDistanceConst;
71 fLastLocation = rightCMF.fLastLocation;
72 fLastValue = rightCMF.fLastValue;
79 if (&p ==
this) {
return *
this; }
81 fpMagneticField= p.fpMagneticField;
82 fDistanceConst = p.fDistanceConst;
83 fLastLocation = p.fLastLocation;
84 fLastValue = p.fLastValue;
95 G4double distSq= (newLocation-fLastLocation).mag2();
97 if( distSq < fDistanceConst*fDistanceConst )
99 Bfield[0] = fLastValue.
x();
100 Bfield[1] = fLastValue.
y();
101 Bfield[2] = fLastValue.
z();
107 fLastLocation =
G4ThreeVector( Point[0], Point[1], Point[2] );
108 fLastValue =
G4ThreeVector( Bfield[0], Bfield[1], Bfield[2] );
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
virtual void GetFieldValue(const G4double Point[4], G4double *Bfield) const
G4CachedMagneticField(G4MagneticField *, G4double distanceConst)
virtual G4Field * Clone() const
G4CachedMagneticField & operator=(const G4CachedMagneticField &p)
virtual ~G4CachedMagneticField()
virtual G4Field * Clone() const
virtual void GetFieldValue(const G4double Point[4], G4double *Bfield) const =0
G4MagneticField & operator=(const G4MagneticField &p)