19#include <TVirtualMC.h>
20#include <TVirtualMCApplication.h>
24 TVirtualMagField* magField, G4double constDistance)
29 fEvaluationsCounter(0),
30 fConstDistanceSquare(constDistance * constDistance)
47 const G4double point[3], G4double* bfield)
const
51 G4ThreeVector newLocation(point[0], point[1], point[2]);
77 fLastValue = G4ThreeVector(bfield[0], bfield[1], bfield[2]);
98 G4cout <<
"TG4CachedMagneticField: " << G4endl
Definition of the TG4CachedMagneticField class.
Definition of the TG4G3Units class.
Definition of the TG4Globals class and basic container types.
virtual ~TG4CachedMagneticField()
virtual void PrintStatistics() const
G4ThreeVector fLastValue
The last evaluated value.
G4int fEvaluationsCounter
The counter of field value evaluations in GetFieldValue()
void SetConstDistance(G4double value)
virtual void GetFieldValue(const G4double point[3], G4double *bfield) const
G4double fConstDistanceSquare
The square of the distance within which the field is considered constant.
G4int fCallsCounter
The counter of calls to GetFieldValue()
G4ThreeVector fLastLocation
The last evaluated location.
TG4CachedMagneticField(TVirtualMagField *magField, G4double constDistance)
static G4double InverseLength()
The magnetic field defined via TVirtualMagField.
TVirtualMagField * fVirtualMagField
The associated TGeo magnetic field.