22#include "BDSArrayReflectionType.hh"
23#include "BDSFieldFormat.hh"
24#include "BDSFieldType.hh"
25#include "BDSIntegratorType.hh"
26#include "BDSInterpolatorType.hh"
29#include "G4Transform3D.hh"
30#include "G4ThreeVector.hh"
74 G4bool provideGlobalTransformIn =
true,
75 const G4Transform3D& transformIn = G4Transform3D(),
76 const G4String& magneticFieldFilePathIn =
"",
79 const G4String& electricFieldFilePathIn =
"",
82 G4bool cacheTransformsIn =
false,
83 G4double eScalingIn = 1.0,
84 G4double bScalingIn = 1.0,
85 G4double timeOffsetIn = 0,
86 G4bool autoScaleIn =
false,
87 G4UserLimits* stepLimitIn =
nullptr,
88 G4double poleTipRadiusIn = 1,
89 G4double beamPipeRadiusIn = 0,
91 const G4String& magneticSubFieldNameIn =
"",
92 const G4String& electricSubFieldNameIn =
"");
102 inline G4double
BRho()
const {
return brho;}
113 inline G4double
EScaling()
const {
return eScaling;}
114 inline G4double
BScaling()
const {
return bScaling;}
138 inline void SetIntegratorType(
BDSIntegratorType typeIn) {integratorType = typeIn;}
139 inline void SetProvideGlobalTransform(G4bool provideGlobalTransformIn) {provideGlobalTransform = provideGlobalTransformIn;}
140 inline void SetMagneticInterpolatorType(
BDSInterpolatorType typeIn) {magneticInterpolatorType = typeIn;}
141 inline void SetMagneticArrayReflectionType(
const BDSArrayReflectionTypeSet& typeIn) {magneticArrayReflectionTypeSet = typeIn;}
142 inline void SetElectricArrayReflectionType(
const BDSArrayReflectionTypeSet& typeIn) {electricArrayReflectionTypeSet = typeIn;}
143 inline void SetBScaling(G4double bScalingIn) {bScaling = bScalingIn;}
144 inline void SetAutoScale(G4bool autoScaleIn) {autoScale = autoScaleIn;}
145 inline void SetScalingRadius(G4double poleTipRadiusIn) {
poleTipRadius = poleTipRadiusIn;}
146 inline void SetBeamPipeRadius(G4double beamPipeRadiusIn) {
beamPipeRadius = beamPipeRadiusIn;}
147 inline void SetChordStepMinimum(G4double chordStepMinimumIn) {chordStepMinimum = chordStepMinimumIn;}
149 inline void SetMagneticSubField(
const G4String& mfnIn) {magneticSubFieldName = mfnIn;}
150 inline void SetElectricSubField(
const G4String& efnIn) {electricSubFieldName = efnIn;}
151 inline void SetUsePlacementWorldTransform(G4bool use) {usePlacementWorldTransform = use;}
152 inline void SetModulatorInfo(
BDSModulatorInfo* modulatorInfoIn) {modulatorInfo = modulatorInfoIn;}
165 void SetNameOfParserDefinition(
const G4String& nameIn) {nameOfParserDefinition = nameIn;}
170 G4bool warn =
false)
const;
174 void Translate(
const G4ThreeVector& translationIn);
177 inline void CacheTransforms(G4bool cacheTransformsIn) {cacheTransforms = cacheTransformsIn;}
189 G4bool provideGlobalTransform;
191 G4String magneticFieldFilePath;
194 BDSArrayReflectionTypeSet magneticArrayReflectionTypeSet;
195 G4String electricFieldFilePath;
198 BDSArrayReflectionTypeSet electricArrayReflectionTypeSet;
199 G4bool cacheTransforms;
204 mutable G4UserLimits* stepLimit;
207 G4double chordStepMinimum;
210 G4String magneticSubFieldName;
211 G4String electricSubFieldName;
212 G4bool usePlacementWorldTransform;
218 G4String nameOfParserDefinition;
221 const static G4ThreeVector defaultUnitDirection;
All info required to build complete field of any type.
void CacheTransforms(G4bool cacheTransformsIn)
Turn on or off transform caching.
BDSFieldInfo & operator=(const BDSFieldInfo &)=delete
Assignment operator not used.
G4double beamPipeRadius
Optional radius of beam pipe.
G4String MagneticSubFieldName() const
Accessor.
void CompoundEScaling(G4double extraEScalingIn)
*= for EScaling.
void UpdateUserLimitsLengthMaximumStepSize(G4double maximumStepSize, G4bool warn=false) const
static G4UserLimits * defaultUL
Cache of default user limits.
G4Transform3D * transformBeamline
Transform from curvilinear frame to this field - ie beam line bit only.
G4double BScaling() const
Accessor.
const BDSArrayReflectionTypeSet & ElectricArrayReflectionType() const
Accessor.
G4double TimeOffset() const
Accessor.
BDSFieldFormat MagneticFormat() const
Accessor.
G4double ChordStepMinimum() const
Accessor.
G4Transform3D TransformComplete() const
Compound transform of field + beam line transform.
G4String NameOfParserDefinition() const
Accessor.
G4String ElectricFile() const
Accessor.
void SetTransformBeamline(const G4Transform3D &transformIn)
Set the beam line transform.
BDSInterpolatorType ElectricInterpolatorType() const
Accessor.
void CompoundBScaling(G4double extraBScalingIn)
*= for BScaling.
G4bool SecondFieldOnLeft() const
Accessor.
BDSInterpolatorType MagneticInterpolatorType() const
Accessor.
G4double poleTipRadius
Radius at which point the field will be scaled to.
G4double EScaling() const
Accessor.
G4double PoleTipRadius() const
Accessor.
G4double tilt
Cache of tilt of field.
G4bool ProvideGlobal() const
Accessor.
void SetFieldType(BDSFieldType fieldTypeIn)
Set Transform - could be done afterwards once instance of this class is passed around.
G4String MagneticFile() const
Accessor.
G4bool CacheTransforms() const
Accessor.
friend std::ostream & operator<<(std::ostream &out, BDSFieldInfo const &info)
output stream
BDSIntegratorType IntegratorType() const
Accessor.
void SetTransform(const G4Transform3D &transformIn)
Set the field definition transform.
G4double BeamPipeRadius() const
Accessor.
G4String ElectricSubFieldName() const
Accessor.
G4Transform3D Transform() const
Transform for the field definition only.
G4bool UsePlacementWorldTransform() const
Accessor.
BDSFieldFormat ElectricFormat() const
Accessor.
const BDSArrayReflectionTypeSet & MagneticArrayReflectionType() const
Accessor.
G4UserLimits * UserLimits() const
Accessor.
G4bool secondFieldOnLeft
Flag for case of two-beam field - if not left, it's right.
void Translate(const G4ThreeVector &translationIn)
BDSModulatorInfo * ModulatorInfo() const
Accessor.
G4double Tilt() const
Accessor.
BDSFieldType FieldType() const
Accessor.
BDSMagnetStrength * MagnetStrength() const
Accessor.
G4double BRho() const
Accessor.
G4bool AutoScale() const
Accessor.
G4Transform3D TransformBeamline() const
Transform from the curvilinear coordinates to the beam line component.
void SetUserLimits(G4UserLimits *userLimitsIn)
Delete and replace the user limits which this class owns (only if not default ul).
G4Transform3D * transform
Transform w.r.t. solid field will be attached to.
BDSFieldInfo()
Default constructor for zero field effectively.
Efficient storage of magnet strengths.
Holder class for all information required to describe a modulator.