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

Interface for BDSIM electric fields that may or may not be local. More...

#include <BDSFieldE.hh>

Inheritance diagram for BDSFieldE:
Inheritance graph
Collaboration diagram for BDSFieldE:
Collaboration graph

Public Member Functions

 BDSFieldE ()
 
 BDSFieldE (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.
 

Protected Attributes

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.
 
BDSModulatormodulator
 Optional modulator;.
 

Private Attributes

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

Detailed Description

Interface for BDSIM electric fields that may or may not be local.

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

Author
Laurie Nevay

Definition at line 38 of file BDSFieldE.hh.

Constructor & Destructor Documentation

◆ BDSFieldE() [1/2]

BDSFieldE::BDSFieldE ( )

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 26 of file BDSFieldE.cc.

◆ BDSFieldE() [2/2]

BDSFieldE::BDSFieldE ( G4Transform3D  transformIn)
explicit

Definition at line 34 of file BDSFieldE.cc.

◆ ~BDSFieldE()

virtual BDSFieldE::~BDSFieldE ( )
inlinevirtual

Definition at line 47 of file BDSFieldE.hh.

Member Function Documentation

◆ FiniteStrength()

G4bool BDSFieldE::FiniteStrength ( ) const
inline

Accessor.

Definition at line 80 of file BDSFieldE.hh.

References finiteStrength.

◆ GetField()

virtual G4ThreeVector BDSFieldE::GetField ( const G4ThreeVector &  position,
const G4double  t = 0 
) const
pure virtual

Get the electric field vector in local coordinates. The derived class does not need to apply the transform.

Implemented in BDSFieldEZero, BDSFieldEGlobal, BDSFieldEGlobalPlacement, BDSFieldEInterpolated4D, BDSFieldESinusoid, BDSFieldEInterpolated1D, BDSFieldEInterpolated2D, BDSFieldEInterpolated2Layer, and BDSFieldEInterpolated3D.

Referenced by GetFieldTransformed().

Here is the caller graph for this function:

◆ GetFieldTransformed()

G4ThreeVector BDSFieldE::GetFieldTransformed ( const G4ThreeVector &  position,
const G4double  t 
) const
virtual

Get the field value after applying transform for local offset.

Reimplemented in BDSFieldEGlobal, and BDSFieldEGlobalPlacement.

Definition at line 42 of file BDSFieldE.cc.

References BDSModulator::Factor(), finiteStrength, GetField(), inverseTransform, modulator, transform, and transformIsNotIdentity.

Referenced by BDSFieldEGlobal::GetField(), BDSFieldEGlobalPlacement::GetField(), BDSFieldEInterpolated2Layer::GetField(), and GetFieldValue().

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

◆ GetFieldValue()

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

Implement interface to this class's GetField to fulfill G4ElectricField inheritance and allow a BDSFieldE 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. This uses GetFieldTransformed.

Definition at line 71 of file BDSFieldE.cc.

References GetFieldTransformed().

Here is the call graph for this function:

◆ SetModulator()

void BDSFieldE::SetModulator ( BDSModulator modulatorIn)
inline

Set the optional modulator.

Definition at line 77 of file BDSFieldE.hh.

References modulator.

Referenced by BDSFieldFactory::CreateFieldERaw().

Here is the caller graph for this function:

◆ SetTransform()

void BDSFieldE::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 84 of file BDSFieldE.cc.

References inverseTransform, transform, and transformIsNotIdentity.

Referenced by BDSFieldFactory::CreateFieldERaw().

Here is the caller graph for this function:

◆ TimeVarying()

virtual G4bool BDSFieldE::TimeVarying ( ) const
inlinevirtual

Each derived class should override this if needs be. Used to warn about time modulation with a time-varying field.

Reimplemented in BDSFieldEInterpolated, BDSFieldEInterpolated2Layer, and BDSFieldESinusoid.

Definition at line 56 of file BDSFieldE.hh.

Referenced by BDSFieldFactory::CreateFieldERaw().

Here is the caller graph for this function:

Field Documentation

◆ finiteStrength

G4bool BDSFieldE::finiteStrength
protected

◆ inverseTransform

G4Transform3D BDSFieldE::inverseTransform
private

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

Definition at line 93 of file BDSFieldE.hh.

Referenced by GetFieldTransformed(), and SetTransform().

◆ modulator

BDSModulator* BDSFieldE::modulator
protected

Optional modulator;.

Definition at line 89 of file BDSFieldE.hh.

Referenced by GetFieldTransformed(), and SetModulator().

◆ transform

G4Transform3D BDSFieldE::transform
protected

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

Definition at line 86 of file BDSFieldE.hh.

Referenced by BDSFieldEInterpolated::Extent(), GetFieldTransformed(), and SetTransform().

◆ transformIsNotIdentity

G4bool BDSFieldE::transformIsNotIdentity
protected

Cache of whether to use transform at all.

Definition at line 88 of file BDSFieldE.hh.

Referenced by GetFieldTransformed(), and SetTransform().


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