BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Protected Attributes | Private Attributes
BDSFieldEM Class Referenceabstract

Interface for BDSIM electro-magnetic fields that may or may not be local. More...

#include <BDSFieldEM.hh>

Inheritance diagram for BDSFieldEM:
Inheritance graph
Collaboration diagram for BDSFieldEM:
Collaboration graph

Public Member Functions

 BDSFieldEM ()
 
 BDSFieldEM (G4Transform3D transformIn)
 
virtual std::pair< G4ThreeVector, G4ThreeVector > GetField (const G4ThreeVector &position, const G4double t=0) const =0
 
virtual void GetFieldValue (const G4double point[4], G4double *field) const
 
virtual std::pair< G4ThreeVector, G4ThreeVector > GetFieldTransformed (const G4ThreeVector &position, const G4double t) const
 Get the field value after applying transform for local offset. More...
 
virtual void SetTransform (const G4Transform3D &transformIn)
 
virtual G4bool DoesFieldChangeEnergy () const
 Required overload by Geant4. More...
 
G4bool FiniteStrength () const
 Accessor. More...
 

Protected Attributes

G4bool finiteStrength
 Flag to cache whether finite nor not. More...
 
G4Transform3D transform
 Transform to apply for the field relative to the local coordinates of the geometry. More...
 

Private Attributes

G4Transform3D inverseTransform
 The complimentary transform used to initially rotate the point of query. More...
 

Detailed Description

Interface for BDSIM electro-magnetic fields that may or may not be local.

Defines abstract interface for all derived electro-magnetic fields. More common to use G4ThreeVectors than arrays so provides common functionality.

Author
Laurie Nevay

Definition at line 38 of file BDSFieldEM.hh.

Constructor & Destructor Documentation

◆ BDSFieldEM() [1/2]

BDSFieldEM::BDSFieldEM ( )

Constructor takes transform in, which is inverted and applied to positions before querying the 'pure' derived field object. This allows local offset, translations, reflections and scalings to be applied if required - ie for misalignment from the local coordinates.

Definition at line 27 of file BDSFieldEM.cc.

◆ BDSFieldEM() [2/2]

BDSFieldEM::BDSFieldEM ( G4Transform3D  transformIn)
explicit

Definition at line 33 of file BDSFieldEM.cc.

◆ ~BDSFieldEM()

virtual BDSFieldEM::~BDSFieldEM ( )
inlinevirtual

Definition at line 47 of file BDSFieldEM.hh.

Member Function Documentation

◆ DoesFieldChangeEnergy()

virtual G4bool BDSFieldEM::DoesFieldChangeEnergy ( ) const
inlinevirtual

Required overload by Geant4.

Reimplemented in BDSFieldEMGlobal, and BDSFieldEMGlobalPlacement.

Definition at line 73 of file BDSFieldEM.hh.

◆ FiniteStrength()

G4bool BDSFieldEM::FiniteStrength ( ) const
inline

Accessor.

Definition at line 76 of file BDSFieldEM.hh.

References finiteStrength.

◆ GetField()

virtual std::pair< G4ThreeVector, G4ThreeVector > BDSFieldEM::GetField ( const G4ThreeVector &  position,
const G4double  t = 0 
) const
pure virtual

Get the field - local coordinates. First G4ThreeVector is B field, second is E Field x,y,z respectively.

Implemented in BDSFieldEMZero, BDSFieldEMGlobal, BDSFieldEMGlobalPlacement, BDSFieldEMRFCavity, BDSFieldEMInterpolated1D, BDSFieldEMInterpolated2D, BDSFieldEMInterpolated3D, and BDSFieldEMInterpolated4D.

Referenced by GetFieldTransformed().

Here is the caller graph for this function:

◆ GetFieldTransformed()

std::pair< G4ThreeVector, G4ThreeVector > BDSFieldEM::GetFieldTransformed ( const G4ThreeVector &  position,
const G4double  t 
) const
virtual

Get the field value after applying transform for local offset.

Reimplemented in BDSFieldEMGlobal, and BDSFieldEMGlobalPlacement.

Definition at line 39 of file BDSFieldEM.cc.

References finiteStrength, GetField(), and transform.

Referenced by BDSFieldEMGlobal::GetField(), BDSFieldEMGlobalPlacement::GetField(), and GetFieldValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFieldValue()

void BDSFieldEM::GetFieldValue ( const G4double  point[4],
G4double *  field 
) const
virtual

Implement interface to this class's GetField to fulfill G4ElectroMagneticField inheritance and allow a BDSFieldEM instance to be passed around in the field factory even if it's not wrapped in a BDSFieldGlobal instance and is in fact in local coordinates.

Definition at line 56 of file BDSFieldEM.cc.

References GetFieldTransformed().

Here is the call graph for this function:

◆ SetTransform()

void BDSFieldEM::SetTransform ( const G4Transform3D &  transformIn)
virtual

Set the transform applied before evaluating the field. This can be used to account for any difference between the field coordinate system and the coordinate system of the geometry. Ie an offset aperture. This is a public interface to allow the transform to be set after construction so that derived classes don't need modified constructors.

Definition at line 68 of file BDSFieldEM.cc.

References inverseTransform, and transform.

Referenced by BDSFieldFactory::CreateFieldEM().

Here is the caller graph for this function:

Field Documentation

◆ finiteStrength

G4bool BDSFieldEM::finiteStrength
protected

Flag to cache whether finite nor not.

Definition at line 79 of file BDSFieldEM.hh.

Referenced by FiniteStrength(), GetFieldTransformed(), BDSFieldEMGlobal::GetFieldTransformed(), and BDSFieldEMGlobalPlacement::GetFieldTransformed().

◆ inverseTransform

G4Transform3D BDSFieldEM::inverseTransform
private

The complimentary transform used to initially rotate the point of query.

Definition at line 86 of file BDSFieldEM.hh.

Referenced by SetTransform().

◆ transform

G4Transform3D BDSFieldEM::transform
protected

Transform to apply for the field relative to the local coordinates of the geometry.

Definition at line 82 of file BDSFieldEM.hh.

Referenced by GetFieldTransformed(), and SetTransform().


The documentation for this class was generated from the following files: