27#ifndef TCACHED_MAGNETIC_FIELD_DEF
28#define TCACHED_MAGNETIC_FIELD_DEF
34template <
class T_Field>
45 fpMagneticField = pTField;
46 fDistanceConst = distance;
55 fpMagneticField = rightCMF.fpMagneticField;
56 fDistanceConst = rightCMF.fDistanceConst;
57 fLastLocation = rightCMF.fLastLocation;
58 fLastValue = rightCMF.fLastValue;
67 T_Field* aF = this->fpMagneticField->T_Field::Clone();
70 cloned->fLastLocation = this->fLastLocation;
71 cloned->fLastValue = this->fLastValue;
89 G4double distSq = (newLocation - fLastLocation).mag2();
91 if(distSq < fDistanceConst * fDistanceConst)
93 Bfield[0] = fLastValue.
x();
94 Bfield[1] = fLastValue.
y();
95 Bfield[2] = fLastValue.
z();
101 fpMagneticField->T_Field::GetFieldValue(Point, Bfield);
127 fpMagneticField = right.fpMagneticField;
129 fDistanceConst= right.fDistanceConst;
130 fLastLocation = right.fLastLocation;
131 fLastValue = right.fLastValue;
140 T_Field* fpMagneticField;
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4int GetCountCalls() const
virtual ~G4TCachedMagneticField()
G4TCachedMagneticField(T_Field *pTField, G4double distance)
G4TCachedMagneticField(const G4TCachedMagneticField< T_Field > &rightCMF)
G4TCachedMagneticField * Clone() const
G4TCachedMagneticField & operator=(const G4TCachedMagneticField &right)
void SetConstDistance(G4double dist)
virtual void GetFieldValue(const G4double Point[4], G4double *Bfield) const
G4int GetCountEvaluations() const
G4double GetConstDistance() const