BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
A holder for all the Geant4 field related objects. More...
#include <BDSFieldObjects.hh>
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. | |
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. | |
void | AttachToVolume (G4LogicalVolume *volume, G4bool penetrateToDaughterVolumes=true) const |
Interface to easily attach to logical volume. | |
void | AttachToVolume (const std::vector< G4LogicalVolume * > &volumes, G4bool penetrateToDaughterVolumes=true) const |
Interface to easily attach to logical volumes. | |
void | AttachUserLimitsToVolume (G4LogicalVolume *volume, G4UserLimits *userLimits, G4bool penetrateToDaughterVolumes=true) const |
const BDSFieldInfo * | GetInfo () const |
Accessor. | |
G4Field * | GetField () const |
Accessor. | |
G4EquationOfMotion * | GetEquationOfMotion () const |
Accessor. | |
G4MagIntegratorStepper * | GetIntegrator () const |
Accessor. | |
G4ChordFinder * | GetChordFinder () const |
Accessor. | |
G4FieldManager * | GetFieldManager () const |
Accessor. | |
G4MagInt_Driver * | GetMagIntDriver () const |
Accessor. | |
Private Attributes | |
const BDSFieldInfo * | info |
The complete information required to build this field. | |
G4Field * | field |
Reference to field this instance is based on. | |
G4EquationOfMotion * | equationOfMotion |
Equation of motion, typically G4Mag_UsualEqRhs instance. | |
G4MagIntegratorStepper * | magIntegratorStepper |
Stepper, selectable depending on smoothness of the field etc. | |
G4ChordFinder * | chordFinder |
Chord manager. | |
G4FieldManager * | fieldManager |
Field manager. | |
G4MagInt_Driver * | magIntDriver |
EM field integrator driver (optional) - only for EM fields. | |
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.
Definition at line 52 of file BDSFieldObjects.hh.
|
delete |
Avoid shallow pointer copy and possible double deletion. Could possibly implement this with the info and the field factory.
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::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.
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.
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.
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().
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().
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().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Chord manager.
Definition at line 130 of file BDSFieldObjects.hh.
Referenced by BDSFieldObjects(), GetChordFinder(), and ~BDSFieldObjects().
|
private |
Equation of motion, typically G4Mag_UsualEqRhs instance.
Definition at line 124 of file BDSFieldObjects.hh.
Referenced by GetEquationOfMotion(), and ~BDSFieldObjects().
|
private |
Reference to field this instance is based on.
Definition at line 121 of file BDSFieldObjects.hh.
Referenced by BDSFieldObjects(), GetField(), and ~BDSFieldObjects().
|
private |
Field manager.
Definition at line 133 of file BDSFieldObjects.hh.
Referenced by AttachToVolume(), BDSFieldObjects(), GetFieldManager(), and ~BDSFieldObjects().
|
private |
The complete information required to build this field.
Definition at line 118 of file BDSFieldObjects.hh.
Referenced by AttachToVolume(), BDSFieldObjects(), and GetInfo().
|
private |
EM field integrator driver (optional) - only for EM fields.
Definition at line 136 of file BDSFieldObjects.hh.
Referenced by BDSFieldObjects(), and GetMagIntDriver().
|
private |
Stepper, selectable depending on smoothness of the field etc.
Definition at line 127 of file BDSFieldObjects.hh.
Referenced by BDSFieldObjects(), GetIntegrator(), and ~BDSFieldObjects().