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