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

A base class for electro-magnetic fields in local to be used in global coordinates. More...

#include <BDSFieldEMGlobalPlacement.hh>

Inheritance diagram for BDSFieldEMGlobalPlacement:
Inheritance graph
Collaboration diagram for BDSFieldEMGlobalPlacement:
Collaboration graph

Public Member Functions

 BDSFieldEMGlobalPlacement (BDSFieldEM *fieldIn)
 
virtual std::pair< G4ThreeVector, G4ThreeVector > GetFieldTransformed (const G4ThreeVector &position, const G4double t) const
 
virtual std::pair< G4ThreeVector, G4ThreeVector > GetField (const G4ThreeVector &position, const G4double t) const
 
virtual G4bool DoesFieldChangeEnergy () const
 Necessary overload for Geant4. More...
 
- Public Member Functions inherited from BDSFieldEM
 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...
 
- Public Member Functions inherited from BDSNavigatorPlacements
G4ThreeVector ConvertToLocal (const G4ThreeVector &globalPosition, G4bool &foundAPlacementVolume) const
 
G4ThreeVector ConvertToLocalNoSetup (const G4ThreeVector &globalPosition) const
 Similar to above function but does NOT initialise the transforms. More...
 
G4ThreeVector ConvertAxisToGlobal (const G4ThreeVector &localAxis) const
 
std::pair< G4ThreeVector, G4ThreeVector > ConvertAxisToGlobal (const std::pair< G4ThreeVector, G4ThreeVector > &localAxis) const
 

Private Attributes

BDSFieldEMfield
 The field on which this is based. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BDSNavigatorPlacements
static void AttachWorldVolumeToNavigator (G4VPhysicalVolume *worldPVIn)
 Setup the navigator w.r.t. to a world volume - typically real world. More...
 
static void ResetNavigatorStates ()
 
- Protected Attributes inherited from BDSFieldEM
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...
 
- Protected Attributes inherited from BDSNavigatorPlacements
G4AffineTransform globalToLocal
 
G4AffineTransform localToGlobal
 
- Static Protected Attributes inherited from BDSNavigatorPlacements
static G4Navigator * navigator = new G4Navigator()
 

Detailed Description

A base class for electro-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.

Author
Laurie Nevay

Definition at line 46 of file BDSFieldEMGlobalPlacement.hh.

Constructor & Destructor Documentation

◆ BDSFieldEMGlobalPlacement()

BDSFieldEMGlobalPlacement::BDSFieldEMGlobalPlacement ( BDSFieldEM fieldIn)
explicit

Definition at line 27 of file BDSFieldEMGlobalPlacement.cc.

◆ ~BDSFieldEMGlobalPlacement()

BDSFieldEMGlobalPlacement::~BDSFieldEMGlobalPlacement ( )
virtual

Definition at line 33 of file BDSFieldEMGlobalPlacement.cc.

Member Function Documentation

◆ DoesFieldChangeEnergy()

virtual G4bool BDSFieldEMGlobalPlacement::DoesFieldChangeEnergy ( ) const
inlinevirtual

Necessary overload for Geant4.

Reimplemented from BDSFieldEM.

Definition at line 65 of file BDSFieldEMGlobalPlacement.hh.

◆ GetField()

std::pair< G4ThreeVector, G4ThreeVector > BDSFieldEMGlobalPlacement::GetField ( const G4ThreeVector &  position,
const G4double  t 
) const
virtual

Get the field - local coordinates. First G4ThreeVector is B field, second is E Field x,y,z respectively. Apply the global to local transform, query the wrapped field object and transform this field to global coordinates before returning.

Implements BDSFieldEM.

Definition at line 47 of file BDSFieldEMGlobalPlacement.cc.

References BDSNavigatorPlacements::ConvertAxisToGlobal(), BDSNavigatorPlacements::ConvertToLocal(), field, and BDSFieldEM::GetFieldTransformed().

Referenced by GetFieldTransformed().

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

◆ GetFieldTransformed()

std::pair< G4ThreeVector, G4ThreeVector > BDSFieldEMGlobalPlacement::GetFieldTransformed ( const G4ThreeVector &  position,
const G4double  t 
) const
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 BDSFieldEM.

Definition at line 38 of file BDSFieldEMGlobalPlacement.cc.

References BDSFieldEM::finiteStrength, and GetField().

Here is the call graph for this function:

Field Documentation

◆ field

BDSFieldEM* BDSFieldEMGlobalPlacement::field
private

The field on which this is based.

Definition at line 69 of file BDSFieldEMGlobalPlacement.hh.

Referenced by GetField().


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