BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
All info required to build complete field of any type. More...
#include <BDSFieldInfo.hh>
Public Member Functions | |
BDSFieldInfo () | |
Default constructor for zero field effectively. | |
BDSFieldInfo (BDSFieldType fieldTypeIn, G4double brhoIn, BDSIntegratorType integratorTypeIn, BDSMagnetStrength *magnetStrengthIn=nullptr, G4bool provideGlobalTransformIn=true, const G4Transform3D &transformIn=G4Transform3D(), const G4String &magneticFieldFilePathIn="", BDSFieldFormat magneticFieldFormatIn=BDSFieldFormat::bdsim1d, BDSInterpolatorType magneticInterpolatorTypeIn=BDSInterpolatorType::nearest3d, const G4String &electricFieldFilePathIn="", BDSFieldFormat electricFieldFormatIn=BDSFieldFormat::bdsim1d, BDSInterpolatorType electricInterpolatorTypeIn=BDSInterpolatorType::nearest3d, G4bool cacheTransformsIn=false, G4double eScalingIn=1.0, G4double bScalingIn=1.0, G4double timeOffsetIn=0, G4bool autoScaleIn=false, G4UserLimits *stepLimitIn=nullptr, G4double poleTipRadiusIn=1, G4double beamPipeRadiusIn=0, G4bool left=true, const G4String &magneticSubFieldNameIn="", const G4String &electricSubFieldNameIn="") | |
BDSFieldInfo (const BDSFieldInfo &other) | |
Copy constructor. | |
BDSFieldInfo & | operator= (const BDSFieldInfo &)=delete |
Assignment operator not used. | |
G4Transform3D | Transform () const |
Transform for the field definition only. | |
G4Transform3D | TransformBeamline () const |
Transform from the curvilinear coordinates to the beam line component. | |
G4Transform3D | TransformComplete () const |
Compound transform of field + beam line transform. | |
void | SetFieldType (BDSFieldType fieldTypeIn) |
Set Transform - could be done afterwards once instance of this class is passed around. | |
void | SetIntegratorType (BDSIntegratorType typeIn) |
void | SetProvideGlobalTransform (G4bool provideGlobalTransformIn) |
void | SetMagneticInterpolatorType (BDSInterpolatorType typeIn) |
void | SetMagneticArrayReflectionType (const BDSArrayReflectionTypeSet &typeIn) |
void | SetElectricArrayReflectionType (const BDSArrayReflectionTypeSet &typeIn) |
void | SetBScaling (G4double bScalingIn) |
void | SetAutoScale (G4bool autoScaleIn) |
void | SetScalingRadius (G4double poleTipRadiusIn) |
void | SetBeamPipeRadius (G4double beamPipeRadiusIn) |
void | SetChordStepMinimum (G4double chordStepMinimumIn) |
void | SetSecondFieldOnLeft (G4bool leftIn) |
void | SetMagneticSubField (const G4String &mfnIn) |
void | SetElectricSubField (const G4String &efnIn) |
void | SetUsePlacementWorldTransform (G4bool use) |
void | SetModulatorInfo (BDSModulatorInfo *modulatorInfoIn) |
void | CompoundBScaling (G4double extraBScalingIn) |
*= for BScaling. | |
void | CompoundEScaling (G4double extraEScalingIn) |
*= for EScaling. | |
void | SetTransform (const G4Transform3D &transformIn) |
Set the field definition transform. | |
void | SetTransformBeamline (const G4Transform3D &transformIn) |
Set the beam line transform. | |
void | SetUserLimits (G4UserLimits *userLimitsIn) |
Delete and replace the user limits which this class owns (only if not default ul). | |
void | SetNameOfParserDefinition (const G4String &nameIn) |
void | UpdateUserLimitsLengthMaximumStepSize (G4double maximumStepSize, G4bool warn=false) const |
void | Translate (const G4ThreeVector &translationIn) |
void | CacheTransforms (G4bool cacheTransformsIn) |
Turn on or off transform caching. | |
BDSFieldType | FieldType () const |
Accessor. | |
G4double | BRho () const |
Accessor. | |
BDSIntegratorType | IntegratorType () const |
Accessor. | |
BDSMagnetStrength * | MagnetStrength () const |
Accessor. | |
G4bool | ProvideGlobal () const |
Accessor. | |
G4String | MagneticFile () const |
Accessor. | |
BDSFieldFormat | MagneticFormat () const |
Accessor. | |
BDSInterpolatorType | MagneticInterpolatorType () const |
Accessor. | |
G4String | ElectricFile () const |
Accessor. | |
BDSFieldFormat | ElectricFormat () const |
Accessor. | |
BDSInterpolatorType | ElectricInterpolatorType () const |
Accessor. | |
G4bool | CacheTransforms () const |
Accessor. | |
G4double | EScaling () const |
Accessor. | |
G4double | BScaling () const |
Accessor. | |
G4double | TimeOffset () const |
Accessor. | |
G4bool | AutoScale () const |
Accessor. | |
G4UserLimits * | UserLimits () const |
Accessor. | |
G4double | PoleTipRadius () const |
Accessor. | |
G4double | BeamPipeRadius () const |
Accessor. | |
G4double | ChordStepMinimum () const |
Accessor. | |
G4double | Tilt () const |
Accessor. | |
G4bool | SecondFieldOnLeft () const |
Accessor. | |
G4String | MagneticSubFieldName () const |
Accessor. | |
G4String | ElectricSubFieldName () const |
Accessor. | |
G4String | NameOfParserDefinition () const |
Accessor. | |
G4bool | UsePlacementWorldTransform () const |
Accessor. | |
const BDSArrayReflectionTypeSet & | MagneticArrayReflectionType () const |
Accessor. | |
const BDSArrayReflectionTypeSet & | ElectricArrayReflectionType () const |
Accessor. | |
BDSModulatorInfo * | ModulatorInfo () const |
Accessor. | |
Static Public Attributes | |
static G4UserLimits * | defaultUL = nullptr |
Cache of default user limits. | |
Static Private Attributes | |
static const G4ThreeVector | defaultUnitDirection |
Friends | |
std::ostream & | operator<< (std::ostream &out, BDSFieldInfo const &info) |
output stream | |
All info required to build complete field of any type.
With an instance of this class, the field factory should be able to create the desired fully functional field with all required associated Geant4 objects.
Owns the magnetic strength instance & cavity info instance.
Owns G4ThreeVector for unitDirection. It's a pointer to save memory on average.
Pole tip radius is used for normalisation purposes for outer yoke fields. Beam pipe radius is used to decide whether there's a gap between the pole and the beam pipe and therefore to use a normal inner field for that part.
Transforms are optional to save memory. The complete required transform is stored as 2 optional bits - the transform from the curvilinear reference frame to that of the specific component (tilt + offset), as well as the transform of the field definition itself (e.g. a field map maybe rotated 90 degrees). The full transform is the compound of these. They're kept separate in case we want to wrap multiple instances (with individual field transforms) in one holder instance (with the beam line transform).
Definition at line 65 of file BDSFieldInfo.hh.
BDSFieldInfo::BDSFieldInfo | ( | ) |
Default constructor for zero field effectively.
Definition at line 40 of file BDSFieldInfo.cc.
BDSFieldInfo::BDSFieldInfo | ( | BDSFieldType | fieldTypeIn, |
G4double | brhoIn, | ||
BDSIntegratorType | integratorTypeIn, | ||
BDSMagnetStrength * | magnetStrengthIn = nullptr , |
||
G4bool | provideGlobalTransformIn = true , |
||
const G4Transform3D & | transformIn = G4Transform3D() , |
||
const G4String & | magneticFieldFilePathIn = "" , |
||
BDSFieldFormat | magneticFieldFormatIn = BDSFieldFormat::bdsim1d , |
||
BDSInterpolatorType | magneticInterpolatorTypeIn = BDSInterpolatorType::nearest3d , |
||
const G4String & | electricFieldFilePathIn = "" , |
||
BDSFieldFormat | electricFieldFormatIn = BDSFieldFormat::bdsim1d , |
||
BDSInterpolatorType | electricInterpolatorTypeIn = BDSInterpolatorType::nearest3d , |
||
G4bool | cacheTransformsIn = false , |
||
G4double | eScalingIn = 1.0 , |
||
G4double | bScalingIn = 1.0 , |
||
G4double | timeOffsetIn = 0 , |
||
G4bool | autoScaleIn = false , |
||
G4UserLimits * | stepLimitIn = nullptr , |
||
G4double | poleTipRadiusIn = 1 , |
||
G4double | beamPipeRadiusIn = 0 , |
||
G4bool | left = true , |
||
const G4String & | magneticSubFieldNameIn = "" , |
||
const G4String & | electricSubFieldNameIn = "" |
||
) |
Definition at line 74 of file BDSFieldInfo.cc.
BDSFieldInfo::~BDSFieldInfo | ( | ) |
Definition at line 137 of file BDSFieldInfo.cc.
BDSFieldInfo::BDSFieldInfo | ( | const BDSFieldInfo & | other | ) |
Copy constructor.
Definition at line 145 of file BDSFieldInfo.cc.
References transform, and transformBeamline.
|
inline |
Accessor.
Definition at line 116 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 119 of file BDSFieldInfo.hh.
References beamPipeRadius.
Referenced by BDSFieldFactory::CreateCavityFringe(), BDSFieldFactory::CreateFieldMagRaw(), BDSFieldFactory::CreateIntegratorMag(), and BDSFieldFactory::CreateRMatrix().
|
inline |
Accessor.
Definition at line 102 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMagRaw(), BDSFieldFactory::CreateIntegratorMag(), and BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 114 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEMField(), and BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 112 of file BDSFieldInfo.hh.
|
inline |
Turn on or off transform caching.
Definition at line 177 of file BDSFieldInfo.hh.
|
inline |
Accessor.
Definition at line 120 of file BDSFieldInfo.hh.
Referenced by BDSFieldObjects::BDSFieldObjects().
|
inline |
*= for BScaling.
Definition at line 155 of file BDSFieldInfo.hh.
Referenced by BDSComponentFactory::SetFieldDefinitions().
|
inline |
*= for EScaling.
Definition at line 157 of file BDSFieldInfo.hh.
|
inline |
Accessor.
Definition at line 128 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEField(), and BDSFieldLoader::LoadEMField().
|
inline |
Accessor.
Definition at line 109 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::EFilePathOK(), BDSFieldLoader::LoadEField(), and BDSFieldLoader::LoadEMField().
|
inline |
Accessor.
Definition at line 110 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEField(), and BDSFieldLoader::LoadEMField().
|
inline |
Accessor.
Definition at line 111 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEField(), and BDSFieldLoader::LoadEMField().
|
inline |
Accessor.
Definition at line 124 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateFieldERaw().
|
inline |
Accessor.
Definition at line 113 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEField(), and BDSFieldLoader::LoadEMField().
|
inline |
Accessor.
Definition at line 101 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateField(), BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldIrregular(), and BDSFieldFactory::CreateFieldMagRaw().
|
inline |
Accessor.
Definition at line 103 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateIntegratorEM(), and BDSFieldFactory::CreateIntegratorMag().
|
inline |
Accessor.
Definition at line 127 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEMField(), and BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 106 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::BFilePathOK(), BDSFieldLoader::LoadEMField(), and BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 107 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEMField(), and BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 108 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::LoadEMField(), and BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 123 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateFieldMagRaw().
|
inline |
Accessor.
Definition at line 104 of file BDSFieldInfo.hh.
Referenced by BDSUndulator::Build(), BDSMagnet::BuildOuterField(), BDSFieldFactory::CreateCavityFringe(), BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMag(), BDSFieldFactory::CreateFieldMagRaw(), BDSFieldFactory::CreateRMatrix(), and BDSFieldFactory::CreateTeleporter().
|
inline |
Accessor.
Definition at line 129 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMagRaw(), and BDSComponentFactory::SetModulatorDefinition().
|
inline |
Accessor.
Definition at line 125 of file BDSFieldInfo.hh.
Referenced by BDSFieldLoader::BFilePathOK(), BDS::BuildPlacementGeometry(), BDSFieldFactory::CreateField(), BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMagRaw(), BDSFieldFactory::CreateModulator(), BDSFieldLoader::EFilePathOK(), BDSFieldLoader::LoadEField(), BDSFieldLoader::LoadEMField(), and BDSFieldLoader::LoadMagField().
|
inline |
Accessor.
Definition at line 118 of file BDSFieldInfo.hh.
References poleTipRadius.
Referenced by BDSFieldFactory::CreateFieldMagRaw().
|
inline |
Accessor.
Definition at line 105 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateFieldE(), BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldMag(), and BDSComponentFactory::SetFieldDefinitions().
|
inline |
Accessor.
Definition at line 122 of file BDSFieldInfo.hh.
References secondFieldOnLeft.
Referenced by BDSFieldFactory::CreateFieldMagRaw().
|
inline |
Definition at line 144 of file BDSFieldInfo.hh.
|
inline |
Definition at line 146 of file BDSFieldInfo.hh.
|
inline |
Definition at line 143 of file BDSFieldInfo.hh.
|
inline |
Definition at line 147 of file BDSFieldInfo.hh.
|
inline |
Definition at line 142 of file BDSFieldInfo.hh.
|
inline |
Definition at line 150 of file BDSFieldInfo.hh.
|
inline |
Set Transform - could be done afterwards once instance of this class is passed around.
Definition at line 137 of file BDSFieldInfo.hh.
Referenced by BDSComponentFactory::PrepareMagnetOuterFieldInfo().
|
inline |
Definition at line 138 of file BDSFieldInfo.hh.
|
inline |
Definition at line 141 of file BDSFieldInfo.hh.
|
inline |
Definition at line 140 of file BDSFieldInfo.hh.
|
inline |
Definition at line 149 of file BDSFieldInfo.hh.
|
inline |
Definition at line 152 of file BDSFieldInfo.hh.
|
inline |
Definition at line 165 of file BDSFieldInfo.hh.
|
inline |
Definition at line 139 of file BDSFieldInfo.hh.
|
inline |
Definition at line 145 of file BDSFieldInfo.hh.
|
inline |
Definition at line 148 of file BDSFieldInfo.hh.
void BDSFieldInfo::SetTransform | ( | const G4Transform3D & | transformIn | ) |
Set the field definition transform.
Definition at line 291 of file BDSFieldInfo.cc.
References transform.
Referenced by BDSMagnet::BuildVacuumField().
void BDSFieldInfo::SetTransformBeamline | ( | const G4Transform3D & | transformIn | ) |
Set the beam line transform.
Definition at line 297 of file BDSFieldInfo.cc.
References transformBeamline.
Referenced by BDSComponentFactory::SetFieldDefinitions().
|
inline |
Definition at line 151 of file BDSFieldInfo.hh.
void BDSFieldInfo::SetUserLimits | ( | G4UserLimits * | userLimitsIn | ) |
Delete and replace the user limits which this class owns (only if not default ul).
Definition at line 193 of file BDSFieldInfo.cc.
References defaultUL.
|
inline |
Accessor.
Definition at line 121 of file BDSFieldInfo.hh.
References tilt.
Referenced by BDSFieldFactory::CreateIntegratorMag().
|
inline |
Accessor.
Definition at line 115 of file BDSFieldInfo.hh.
G4Transform3D BDSFieldInfo::Transform | ( | ) | const |
Transform for the field definition only.
Definition at line 276 of file BDSFieldInfo.cc.
References transform.
Referenced by BDSMagnet::BuildVacuumField(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMagRaw(), BDSFieldLoader::LoadEField(), BDSFieldLoader::LoadEMField(), BDSFieldLoader::LoadMagField(), and TransformComplete().
G4Transform3D BDSFieldInfo::TransformBeamline | ( | ) | const |
Transform from the curvilinear coordinates to the beam line component.
Definition at line 281 of file BDSFieldInfo.cc.
References transformBeamline.
Referenced by BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMagRaw(), and TransformComplete().
G4Transform3D BDSFieldInfo::TransformComplete | ( | ) | const |
Compound transform of field + beam line transform.
Definition at line 286 of file BDSFieldInfo.cc.
References Transform(), and TransformBeamline().
Referenced by BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMagRaw(), and BDSFieldFactory::CreateTeleporter().
void BDSFieldInfo::Translate | ( | const G4ThreeVector & | translationIn | ) |
Translate - adds an additional translation to the transform member variable. May only be known at assembly time given parameterised geometry. Used by AWAKE Spectrometer only.
Definition at line 264 of file BDSFieldInfo.cc.
References transform.
Referenced by BDSMagnet::BuildOuterField().
void BDSFieldInfo::UpdateUserLimitsLengthMaximumStepSize | ( | G4double | maximumStepSize, |
G4bool | warn = false |
||
) | const |
Update the user limits object (stepLimit) to the minimum of the current and supplied maximum step size. Mutable, so can be called on const object.
Definition at line 200 of file BDSFieldInfo.cc.
References BDS::CreateUserLimits(), and defaultUL.
Referenced by BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), and BDSFieldFactory::CreateFieldMagRaw().
|
inline |
Accessor.
Definition at line 126 of file BDSFieldInfo.hh.
Referenced by BDSFieldFactory::CreateFieldE(), BDSFieldFactory::CreateFieldEM(), and BDSFieldFactory::CreateFieldMag().
|
inline |
Accessor.
Definition at line 117 of file BDSFieldInfo.hh.
Referenced by BDSFieldObjects::AttachToVolume().
|
friend |
output stream
Definition at line 222 of file BDSFieldInfo.cc.
|
private |
Definition at line 203 of file BDSFieldInfo.hh.
|
private |
Optional radius of beam pipe.
Definition at line 206 of file BDSFieldInfo.hh.
Referenced by BeamPipeRadius().
|
private |
Definition at line 186 of file BDSFieldInfo.hh.
|
private |
Definition at line 201 of file BDSFieldInfo.hh.
|
private |
Definition at line 199 of file BDSFieldInfo.hh.
|
private |
Definition at line 207 of file BDSFieldInfo.hh.
|
static |
Cache of default user limits.
Definition at line 182 of file BDSFieldInfo.hh.
Referenced by SetUserLimits(), and UpdateUserLimitsLengthMaximumStepSize().
|
staticprivate |
Definition at line 221 of file BDSFieldInfo.hh.
|
private |
Definition at line 198 of file BDSFieldInfo.hh.
|
private |
Definition at line 195 of file BDSFieldInfo.hh.
|
private |
Definition at line 196 of file BDSFieldInfo.hh.
|
private |
Definition at line 197 of file BDSFieldInfo.hh.
|
private |
Definition at line 211 of file BDSFieldInfo.hh.
|
private |
Definition at line 200 of file BDSFieldInfo.hh.
|
private |
Definition at line 185 of file BDSFieldInfo.hh.
|
private |
Definition at line 187 of file BDSFieldInfo.hh.
|
private |
Definition at line 194 of file BDSFieldInfo.hh.
|
private |
Definition at line 191 of file BDSFieldInfo.hh.
|
private |
Definition at line 192 of file BDSFieldInfo.hh.
|
private |
Definition at line 193 of file BDSFieldInfo.hh.
|
private |
Definition at line 210 of file BDSFieldInfo.hh.
|
private |
Definition at line 188 of file BDSFieldInfo.hh.
|
private |
Definition at line 213 of file BDSFieldInfo.hh.
|
private |
Definition at line 218 of file BDSFieldInfo.hh.
|
private |
Radius at which point the field will be scaled to.
Definition at line 205 of file BDSFieldInfo.hh.
Referenced by PoleTipRadius().
|
private |
Definition at line 189 of file BDSFieldInfo.hh.
|
private |
Flag for case of two-beam field - if not left, it's right.
Definition at line 209 of file BDSFieldInfo.hh.
Referenced by SecondFieldOnLeft().
|
mutableprivate |
Definition at line 204 of file BDSFieldInfo.hh.
|
private |
|
private |
Definition at line 202 of file BDSFieldInfo.hh.
|
private |
Transform w.r.t. solid field will be attached to.
Definition at line 190 of file BDSFieldInfo.hh.
Referenced by BDSFieldInfo(), SetTransform(), Transform(), and Translate().
|
private |
Transform from curvilinear frame to this field - ie beam line bit only.
Definition at line 216 of file BDSFieldInfo.hh.
Referenced by BDSFieldInfo(), SetTransformBeamline(), and TransformBeamline().
|
private |
Definition at line 212 of file BDSFieldInfo.hh.