BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
A base class for magnetic fields in local to be used in global coordinates. More...
#include <BDSFieldMagGlobalPlacement.hh>
Public Member Functions | |
BDSFieldMagGlobalPlacement (BDSFieldMag *fieldIn) | |
virtual G4ThreeVector | GetFieldTransformed (const G4ThreeVector &position, const G4double t) const |
virtual G4ThreeVector | GetField (const G4ThreeVector &position, const G4double t=0) const |
![]() | |
BDSFieldMag () | |
BDSFieldMag (G4Transform3D transformIn) | |
virtual G4ThreeVector | GetField (const G4ThreeVector &position, const G4double t=0) const =0 |
virtual G4bool | TimeVarying () const |
virtual void | GetFieldValue (const G4double point[4], G4double *field) const |
virtual G4ThreeVector | GetFieldTransformed (const G4ThreeVector &position, const G4double t) const |
Get the field value after applying transform for local offset. | |
virtual void | SetTransform (const G4Transform3D &transformIn) |
void | SetModulator (BDSModulator *modulatorIn) |
Set the optional modulator. | |
G4bool | FiniteStrength () const |
Accessor. | |
![]() | |
G4ThreeVector | ConvertToLocal (const G4ThreeVector &globalPosition, G4bool &foundAPlacementVolume) const |
G4ThreeVector | ConvertToLocalNoSetup (const G4ThreeVector &globalPosition) const |
Similar to above function but does NOT initialise the transforms. | |
G4ThreeVector | ConvertAxisToGlobal (const G4ThreeVector &localAxis) const |
std::pair< G4ThreeVector, G4ThreeVector > | ConvertAxisToGlobal (const std::pair< G4ThreeVector, G4ThreeVector > &localAxis) const |
Private Attributes | |
BDSFieldMag * | field |
The field on which this is based. | |
Additional Inherited Members | |
![]() | |
static void | AttachWorldVolumeToNavigator (G4VPhysicalVolume *worldPVIn) |
Setup the navigator w.r.t. to a world volume - typically real world. | |
static void | ResetNavigatorStates () |
![]() | |
G4bool | finiteStrength |
Flag to cache whether finite nor not. | |
G4Transform3D | transform |
Transform to apply for the field relative to the local coordinates of the geometry. | |
G4bool | transformIsNotIdentity |
Cache of whether to use transform at all. | |
BDSModulator * | modulator |
Optional modulator;. | |
![]() | |
G4AffineTransform | globalToLocal |
G4AffineTransform | localToGlobal |
![]() | |
static G4Navigator * | navigator = new G4Navigator() |
A base class for magnetic fields in local to be used in global coordinates.
This is done using a navigator for the placement world not the curvilinear one.
This base class provides the aggregate inheritance and utility functions for magnetic fields in local coordinates to be used in global coordinates.
Constness is particularly important here as member functions are called from inside G4MagneticField::GetField function which is const.
This owns the field it wraps.
Definition at line 44 of file BDSFieldMagGlobalPlacement.hh.
|
explicit |
Definition at line 25 of file BDSFieldMagGlobalPlacement.cc.
|
virtual |
Definition at line 31 of file BDSFieldMagGlobalPlacement.cc.
|
virtual |
Apply the global to local transform, query the wrapped field object and transform this field to global coordinates before returning.
Implements BDSFieldMag.
Definition at line 45 of file BDSFieldMagGlobalPlacement.cc.
References BDSNavigatorPlacements::ConvertAxisToGlobal(), BDSNavigatorPlacements::ConvertToLocal(), field, and BDSFieldMag::GetFieldTransformed().
Referenced by GetFieldTransformed().
|
virtual |
As we use a discrete member field object, we do not need to apply the transform. Override default method and just directly call GetField().
Reimplemented from BDSFieldMag.
Definition at line 36 of file BDSFieldMagGlobalPlacement.cc.
References BDSFieldMag::finiteStrength, and GetField().
|
private |
The field on which this is based.
Definition at line 63 of file BDSFieldMagGlobalPlacement.hh.
Referenced by GetField().