Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4CachedMagneticField.h
Go to the documentation of this file.
1#ifndef TG4_CACHED_MAGNETIC_FIELD_H
2#define TG4_CACHED_MAGNETIC_FIELD_H
3
4//-------------------------------------------------
5// The Geant4 Virtual Monte Carlo package
6// Copyright (C) 2007 - 2014 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
17
18#include "TG4FieldParameters.h"
19#include "TG4MagneticField.h"
20
21#include <G4ThreeVector.hh>
22#include <globals.hh>
23
25
27class G4MagIntegratorStepper;
28class G4LogicalVolume;
29
30class TVirtualMagField;
31
44
46{
47 public:
48 TG4CachedMagneticField(TVirtualMagField* magField, G4double constDistance);
50
51 virtual void GetFieldValue(const G4double point[3], G4double* bfield) const;
52
53 // virtual void Update(const TG4FieldParameters& parameters);
54 virtual void PrintStatistics() const;
55
56 void ClearCounter();
57 void SetConstDistance(G4double value);
58
59 private:
60 // data members
62 mutable G4ThreeVector fLastLocation;
64 mutable G4ThreeVector fLastValue;
66 mutable G4int fCallsCounter;
68 mutable G4int fEvaluationsCounter;
71};
72
73#endif // TG4_CACHED_MAGNETIC_FIELD_H
Definition of the TG4FieldParameters class.
Definition of the TG4MagneticField class.
The cached magnetic field defined by the TVirtualMCApplication field map.
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)
The magnetic field parameters.
The magnetic field defined via TVirtualMagField.