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

A holder for all the Geant4 field related objects. More...

#include <BDSFieldObjects.hh>

Collaboration diagram for BDSFieldObjects:
Collaboration graph

Public Member Functions

 BDSFieldObjects (const BDSFieldObjects &other)=delete
 
 BDSFieldObjects (const BDSFieldInfo *infoIn, G4Field *fieldIn, G4EquationOfMotion *equationOfMotionIn, G4MagIntegratorStepper *magIntegratorStepperIn, G4ChordFinder *chordFinderIn, G4FieldManager *fieldManagerIn)
 A field is required to build the required objects to manage and use it. More...
 
 BDSFieldObjects (const BDSFieldInfo *infoIn, G4ElectroMagneticField *fieldIn, G4EquationOfMotion *equationOfMotionIn, G4MagIntegratorStepper *magIntegratorStepperIn)
 
 BDSFieldObjects (const BDSFieldInfo *infoIn, G4MagneticField *fieldIn, G4EquationOfMotion *equationOfMotionIn, G4MagIntegratorStepper *magIntegratorStepperIn)
 
 ~BDSFieldObjects ()
 Destructor deletes all objects apart from the magnetic field. More...
 
void AttachToVolume (G4LogicalVolume *volume, G4bool penetrateToDaughterVolumes=true) const
 Interface to easily attach to logical volume. More...
 
void AttachToVolume (const std::vector< G4LogicalVolume * > &volumes, G4bool penetrateToDaughterVolumes=true) const
 Interface to easily attach to logical volumes. More...
 
void AttachUserLimitsToVolume (G4LogicalVolume *volume, G4UserLimits *userLimits, G4bool penetrateToDaughterVolumes=true) const
 
const BDSFieldInfoGetInfo () const
 Accessor. More...
 
G4Field * GetField () const
 Accessor. More...
 
G4EquationOfMotion * GetEquationOfMotion () const
 Accessor. More...
 
G4MagIntegratorStepper * GetIntegrator () const
 Accessor. More...
 
G4ChordFinder * GetChordFinder () const
 Accessor. More...
 
G4FieldManager * GetFieldManager () const
 Accessor. More...
 
G4MagInt_Driver * GetMagIntDriver () const
 Accessor. More...
 

Private Attributes

const BDSFieldInfoinfo
 The complete information required to build this field. More...
 
G4Field * field
 Reference to field this instance is based on. More...
 
G4EquationOfMotion * equationOfMotion
 Equation of motion, typically G4Mag_UsualEqRhs instance. More...
 
G4MagIntegratorStepper * magIntegratorStepper
 Stepper, selectable depending on smoothness of the field etc. More...
 
G4ChordFinder * chordFinder
 Chord manager. More...
 
G4FieldManager * fieldManager
 Field manager. More...
 
G4MagInt_Driver * magIntDriver
 EM field integrator driver (optional) - only for EM fields. More...
 

Detailed Description

A holder for all the Geant4 field related objects.

These are the objects that are required for a magnetic field other than the magnetic field itself. If owns all objects apart from the G4MagneticField. This is used purely to construct the other objects or as a reference to which field they're based on.

Author
Laurie Nevay

Definition at line 52 of file BDSFieldObjects.hh.

Constructor & Destructor Documentation

◆ BDSFieldObjects() [1/4]

BDSFieldObjects::BDSFieldObjects ( const BDSFieldObjects other)
delete

Avoid shallow pointer copy and possible double deletion. Could possibly implement this with the info and the field factory.

◆ BDSFieldObjects() [2/4]

BDSFieldObjects::BDSFieldObjects ( const BDSFieldInfo infoIn,
G4Field *  fieldIn,
G4EquationOfMotion *  equationOfMotionIn,
G4MagIntegratorStepper *  magIntegratorStepperIn,
G4ChordFinder *  chordFinderIn,
G4FieldManager *  fieldManagerIn 
)

A field is required to build the required objects to manage and use it.

Definition at line 36 of file BDSFieldObjects.cc.

◆ BDSFieldObjects() [3/4]

BDSFieldObjects::BDSFieldObjects ( const BDSFieldInfo infoIn,
G4ElectroMagneticField *  fieldIn,
G4EquationOfMotion *  equationOfMotionIn,
G4MagIntegratorStepper *  magIntegratorStepperIn 
)

Alternative constructor for the special case of an electro-magnetic field which doesn't follow the same hierarchy of classes as magnetic fields. This can also be used for a second argument of G4MagneticField as this inherits G4ElectroMagneticField.

Definition at line 51 of file BDSFieldObjects.cc.

References chordFinder, BDSFieldInfo::ChordStepMinimum(), field, fieldManager, info, BDSGlobalConstants::Instance(), magIntDriver, and magIntegratorStepper.

Here is the call graph for this function:

◆ BDSFieldObjects() [4/4]

BDSFieldObjects::BDSFieldObjects ( const BDSFieldInfo infoIn,
G4MagneticField *  fieldIn,
G4EquationOfMotion *  equationOfMotionIn,
G4MagIntegratorStepper *  magIntegratorStepperIn 
)

In Geant4.10.5.b01, the field class inheritance has changed and G4MagneticField no longer inherits G4ElectroMagneticField.

Definition at line 82 of file BDSFieldObjects.cc.

References chordFinder, BDSFieldInfo::ChordStepMinimum(), field, fieldManager, info, BDSGlobalConstants::Instance(), magIntDriver, and magIntegratorStepper.

Here is the call graph for this function:

◆ ~BDSFieldObjects()

BDSFieldObjects::~BDSFieldObjects ( )

Destructor deletes all objects apart from the magnetic field.

Definition at line 110 of file BDSFieldObjects.cc.

References chordFinder, equationOfMotion, field, fieldManager, and magIntegratorStepper.

Member Function Documentation

◆ AttachToVolume() [1/2]

void BDSFieldObjects::AttachToVolume ( const std::vector< G4LogicalVolume * > &  volumes,
G4bool  penetrateToDaughterVolumes = true 
) const

Interface to easily attach to logical volumes.

Definition at line 133 of file BDSFieldObjects.cc.

References AttachToVolume().

Here is the call graph for this function:

◆ AttachToVolume() [2/2]

void BDSFieldObjects::AttachToVolume ( G4LogicalVolume *  volume,
G4bool  penetrateToDaughterVolumes = true 
) const

Interface to easily attach to logical volume.

Definition at line 120 of file BDSFieldObjects.cc.

References AttachUserLimitsToVolume(), fieldManager, info, and BDSFieldInfo::UserLimits().

Referenced by AttachToVolume().

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

◆ AttachUserLimitsToVolume()

void BDSFieldObjects::AttachUserLimitsToVolume ( G4LogicalVolume *  volume,
G4UserLimits *  userLimits,
G4bool  penetrateToDaughterVolumes = true 
) const

Attach user limits to a volume and optionally recurse to daughters. Note this will override any existing G4UserLimits on the volume or daughters. We rely on BDSFieldInfo::defaultUL coming from BDSGlobalConstants which will pick up kinetic energy limits.

Definition at line 140 of file BDSFieldObjects.cc.

References AttachUserLimitsToVolume().

Referenced by AttachToVolume(), and AttachUserLimitsToVolume().

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

◆ GetChordFinder()

G4ChordFinder * BDSFieldObjects::GetChordFinder ( ) const
inline

Accessor.

Definition at line 95 of file BDSFieldObjects.hh.

References chordFinder.

◆ GetEquationOfMotion()

G4EquationOfMotion * BDSFieldObjects::GetEquationOfMotion ( ) const
inline

Accessor.

Definition at line 93 of file BDSFieldObjects.hh.

References equationOfMotion.

◆ GetField()

G4Field * BDSFieldObjects::GetField ( ) const
inline

Accessor.

Definition at line 92 of file BDSFieldObjects.hh.

References field.

◆ GetFieldManager()

G4FieldManager * BDSFieldObjects::GetFieldManager ( ) const
inline

Accessor.

Definition at line 96 of file BDSFieldObjects.hh.

References fieldManager.

◆ GetInfo()

const BDSFieldInfo * BDSFieldObjects::GetInfo ( ) const
inline

Accessor.

Definition at line 91 of file BDSFieldObjects.hh.

References info.

◆ GetIntegrator()

G4MagIntegratorStepper * BDSFieldObjects::GetIntegrator ( ) const
inline

Accessor.

Definition at line 94 of file BDSFieldObjects.hh.

References magIntegratorStepper.

◆ GetMagIntDriver()

G4MagInt_Driver * BDSFieldObjects::GetMagIntDriver ( ) const
inline

Accessor.

Definition at line 97 of file BDSFieldObjects.hh.

References magIntDriver.

Field Documentation

◆ chordFinder

G4ChordFinder* BDSFieldObjects::chordFinder
private

Chord manager.

Definition at line 130 of file BDSFieldObjects.hh.

Referenced by BDSFieldObjects(), GetChordFinder(), and ~BDSFieldObjects().

◆ equationOfMotion

G4EquationOfMotion* BDSFieldObjects::equationOfMotion
private

Equation of motion, typically G4Mag_UsualEqRhs instance.

Definition at line 124 of file BDSFieldObjects.hh.

Referenced by GetEquationOfMotion(), and ~BDSFieldObjects().

◆ field

G4Field* BDSFieldObjects::field
private

Reference to field this instance is based on.

Definition at line 121 of file BDSFieldObjects.hh.

Referenced by BDSFieldObjects(), GetField(), and ~BDSFieldObjects().

◆ fieldManager

G4FieldManager* BDSFieldObjects::fieldManager
private

Field manager.

Definition at line 133 of file BDSFieldObjects.hh.

Referenced by AttachToVolume(), BDSFieldObjects(), GetFieldManager(), and ~BDSFieldObjects().

◆ info

const BDSFieldInfo* BDSFieldObjects::info
private

The complete information required to build this field.

Definition at line 118 of file BDSFieldObjects.hh.

Referenced by AttachToVolume(), BDSFieldObjects(), and GetInfo().

◆ magIntDriver

G4MagInt_Driver* BDSFieldObjects::magIntDriver
private

EM field integrator driver (optional) - only for EM fields.

Definition at line 136 of file BDSFieldObjects.hh.

Referenced by BDSFieldObjects(), and GetMagIntDriver().

◆ magIntegratorStepper

G4MagIntegratorStepper* BDSFieldObjects::magIntegratorStepper
private

Stepper, selectable depending on smoothness of the field etc.

Definition at line 127 of file BDSFieldObjects.hh.

Referenced by BDSFieldObjects(), GetIntegrator(), and ~BDSFieldObjects().


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