BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
BDSFieldLoader Class Reference

A loader for various field map formats. More...

#include <BDSFieldLoader.hh>

Collaboration diagram for BDSFieldLoader:
Collaboration graph

Public Member Functions

void DeleteArrays ()
 
BDSFieldMagInterpolated * LoadMagField (const BDSFieldInfo &info, const BDSMagnetStrength *scalingStrength=nullptr, const G4String &scalingKey="none")
 Main interface to load a magnetic field.
 
BDSFieldEInterpolated * LoadEField (const BDSFieldInfo &info)
 Main interface to load an electric field.
 
BDSFieldEMInterpolated * LoadEMField (const BDSFieldInfo &info)
 Main interface to load an electro-magnetic field.
 

Static Public Member Functions

static BDSFieldLoader * Instance ()
 Singleton accessor.
 

Private Member Functions

 BDSFieldLoader ()
 Private default constructor as singleton.
 
void CreateOperators (const BDSArrayReflectionTypeSet *reflectionTypes, const BDSArray4DCoords *existingArray, BDSArrayOperatorIndex *&indexOperator, BDSArrayOperatorValue *&valueOperator) const
 
void ReportIfProblemWithReflection (const BDSArrayInfo &info, const std::array< G4bool, 4 > &operatesOnXYZT, G4double tolerance=0.05) const
 
G4bool NeedToProvideTransform (const BDSArrayReflectionTypeSet *reflectionTypes) const
 
BDSArray1DCoords * CreateArrayReflected (BDSArray1DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSArray2DCoords * CreateArrayReflected (BDSArray2DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSArray3DCoords * CreateArrayReflected (BDSArray3DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSArray4DCoords * CreateArrayReflected (BDSArray4DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSInterpolator1D * CreateInterpolator1D (BDSArray1DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 1D interpolator for an array.
 
BDSInterpolator2D * CreateInterpolator2D (BDSArray2DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 2D interpolator for an array.
 
BDSInterpolator3D * CreateInterpolator3D (BDSArray3DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 3D interpolator for an array.
 
BDSInterpolator4D * CreateInterpolator4D (BDSArray4DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 4D interpolator for an array.
 
BDSFieldMagInterpolated * LoadBDSIM1DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 1D BDSIM format magnetic field.
 
BDSFieldMagInterpolated * LoadBDSIM2DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 2D BDSIM format magnetic field.
 
BDSFieldMagInterpolated * LoadBDSIM3DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 3D BDSIM format magnetic field.
 
BDSFieldMagInterpolated * LoadBDSIM4DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 4D BDSIM format magnetic field.
 
BDSFieldMagInterpolated * LoadPoissonSuperFishB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 2D poisson superfish B field map.
 
BDSFieldMagInterpolated * LoadPoissonSuperFishBQuad (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 
BDSFieldMagInterpolated * LoadPoissonSuperFishBDipole (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 
BDSFieldEInterpolated * LoadBDSIM1DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 1D BDSIM format electric field.
 
BDSFieldEInterpolated * LoadBDSIM2DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 2D BDSIM format electric field.
 
BDSFieldEInterpolated * LoadBDSIM3DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 3D BDSIM format electric field.
 
BDSFieldEInterpolated * LoadBDSIM4DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 4D BDSIM format electric field.
 
BDSFieldEMInterpolated * LoadBDSIM1DEM (const G4String &eFilePath, const G4String &bFilePath, BDSInterpolatorType eInterpolatorType, BDSInterpolatorType bInterpolatorType, const G4Transform3D &transform, G4double eScaling, G4double bScaling, const BDSArrayReflectionTypeSet *eReflection=nullptr, const BDSArrayReflectionTypeSet *bReflection=nullptr)
 Load a 1D BDSIM format electro-magnetic field.
 
BDSFieldEMInterpolated * LoadBDSIM2DEM (const G4String &eFilePath, const G4String &bFilePath, BDSInterpolatorType eInterpolatorType, BDSInterpolatorType bInterpolatorType, const G4Transform3D &transform, G4double eScaling, G4double bScaling, const BDSArrayReflectionTypeSet *eReflection=nullptr, const BDSArrayReflectionTypeSet *bReflection=nullptr)
 Load a 2D BDSIM format electro-magnetic field.
 
BDSFieldEMInterpolated * LoadBDSIM3DEM (const G4String &eFilePath, const G4String &bFilePath, BDSInterpolatorType eInterpolatorType, BDSInterpolatorType bInterpolatorType, const G4Transform3D &transform, G4double eScaling, G4double bScaling, const BDSArrayReflectionTypeSet *eReflection=nullptr, const BDSArrayReflectionTypeSet *bReflection=nullptr)
 Load a 3D BDSIM format electro-magnetic field.
 
BDSFieldEMInterpolated * LoadBDSIM4DEM (const G4String &eFilePath, const G4String &bFilePath, BDSInterpolatorType eInterpolatorType, BDSInterpolatorType bInterpolatorType, const G4Transform3D &transform, G4double eScaling, G4double bScaling, const BDSArrayReflectionTypeSet *eReflection=nullptr, const BDSArrayReflectionTypeSet *bReflection=nullptr)
 Load a 4D BDSIM format electro-magnetic field.
 
BDSArray1DCoords * Get1DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr.
 
BDSArray2DCoords * Get2DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr.
 
BDSArray3DCoords * Get3DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr.
 
BDSArray4DCoords * Get4DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr.
 
BDSArray2DCoords * LoadPoissonMag2D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal).
 
BDSArray1DCoords * LoadBDSIM1D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal).
 
BDSArray2DCoords * LoadBDSIM2D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal).
 
BDSArray3DCoords * LoadBDSIM3D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal).
 
BDSArray4DCoords * LoadBDSIM4D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal).
 

Static Private Member Functions

static void BFilePathOK (const BDSFieldInfo &info)
 Check file path isn't empty and throw exception if it is.
 
static void EFilePathOK (const BDSFieldInfo &info)
 Check file path isn't empty and throw exception if it is.
 

Private Attributes

std::map< G4String, BDSArray1DCoords * > arrays1d
 Map of cached field map array.
 
std::map< G4String, BDSArray2DCoords * > arrays2d
 Map of cached field map array.
 
std::map< G4String, BDSArray3DCoords * > arrays3d
 Map of cached field map array.
 
std::map< G4String, BDSArray4DCoords * > arrays4d
 Map of cached field map array.
 

Static Private Attributes

static BDSFieldLoader * instance = nullptr
 Singleton instance.
 

Detailed Description

A loader for various field map formats.

A factory to use the appropriate file loader for different field map formats and construct into required field including the correct interpolator and possible reflections.

This is a singleton as the field loader owns the loaded data arrays and reuses them wrapping them in interpolators multiple times if needed. For this reason there should be only one field loader.

Author
Laurie Nevay

Definition at line 61 of file BDSFieldLoader.hh.

Constructor & Destructor Documentation

◆ ~BDSFieldLoader()

BDSFieldLoader::~BDSFieldLoader ( )

Definition at line 115 of file BDSFieldLoader.cc.

◆ BDSFieldLoader()

BDSFieldLoader::BDSFieldLoader ( )
private

Private default constructor as singleton.

Definition at line 112 of file BDSFieldLoader.cc.

Referenced by Instance().

Here is the caller graph for this function:

Member Function Documentation

◆ BFilePathOK()

void BDSFieldLoader::BFilePathOK ( const BDSFieldInfo &  info)
staticprivate

Check file path isn't empty and throw exception if it is.

Definition at line 319 of file BDSFieldLoader.cc.

References BDSFieldInfo::MagneticFile(), and BDSFieldInfo::NameOfParserDefinition().

Referenced by LoadEMField(), and LoadMagField().

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

◆ CreateArrayReflected() [1/4]

BDSArray1DCoords * BDSFieldLoader::CreateArrayReflected ( BDSArray1DCoords *  existingArray,
const BDSArrayReflectionTypeSet *  reflectionType 
) const
private

Definition at line 751 of file BDSFieldLoader.cc.

◆ CreateArrayReflected() [2/4]

BDSArray2DCoords * BDSFieldLoader::CreateArrayReflected ( BDSArray2DCoords *  existingArray,
const BDSArrayReflectionTypeSet *  reflectionType 
) const
private

Definition at line 764 of file BDSFieldLoader.cc.

◆ CreateArrayReflected() [3/4]

BDSArray3DCoords * BDSFieldLoader::CreateArrayReflected ( BDSArray3DCoords *  existingArray,
const BDSArrayReflectionTypeSet *  reflectionType 
) const
private

Definition at line 777 of file BDSFieldLoader.cc.

◆ CreateArrayReflected() [4/4]

BDSArray4DCoords * BDSFieldLoader::CreateArrayReflected ( BDSArray4DCoords *  existingArray,
const BDSArrayReflectionTypeSet *  reflectionType 
) const
private

Definition at line 790 of file BDSFieldLoader.cc.

◆ CreateInterpolator1D()

BDSInterpolator1D * BDSFieldLoader::CreateInterpolator1D ( BDSArray1DCoords *  array,
BDSInterpolatorType  interpolatorType 
) const
private

Create the appropriate 1D interpolator for an array.

Definition at line 502 of file BDSFieldLoader.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by LoadBDSIM1DB(), LoadBDSIM1DE(), and LoadBDSIM1DEM().

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

◆ CreateInterpolator2D()

BDSInterpolator2D * BDSFieldLoader::CreateInterpolator2D ( BDSArray2DCoords *  array,
BDSInterpolatorType  interpolatorType 
) const
private

Create the appropriate 2D interpolator for an array.

Definition at line 522 of file BDSFieldLoader.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by LoadBDSIM2DB(), LoadBDSIM2DE(), LoadBDSIM2DEM(), LoadPoissonSuperFishB(), LoadPoissonSuperFishBDipole(), and LoadPoissonSuperFishBQuad().

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

◆ CreateInterpolator3D()

BDSInterpolator3D * BDSFieldLoader::CreateInterpolator3D ( BDSArray3DCoords *  array,
BDSInterpolatorType  interpolatorType 
) const
private

Create the appropriate 3D interpolator for an array.

Definition at line 542 of file BDSFieldLoader.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by LoadBDSIM3DB(), LoadBDSIM3DE(), and LoadBDSIM3DEM().

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

◆ CreateInterpolator4D()

BDSInterpolator4D * BDSFieldLoader::CreateInterpolator4D ( BDSArray4DCoords *  array,
BDSInterpolatorType  interpolatorType 
) const
private

Create the appropriate 4D interpolator for an array.

Definition at line 562 of file BDSFieldLoader.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by LoadBDSIM4DB(), LoadBDSIM4DE(), and LoadBDSIM4DEM().

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

◆ CreateOperators()

void BDSFieldLoader::CreateOperators ( const BDSArrayReflectionTypeSet *  reflectionTypes,
const BDSArray4DCoords *  existingArray,
BDSArrayOperatorIndex *&  indexOperator,
BDSArrayOperatorValue *&  valueOperator 
) const
private

Create the appropriate array operators (index and value) and assign to the pointers given by reference. Assumes valid pointer for reflectionTypes argument.

Definition at line 582 of file BDSFieldLoader.cc.

References BDSArray4DCoords::DimensionIndex(), BDSArrayOperatorIndex::Name(), BDSArrayOperatorValue::Name(), BDSArrayOperatorIndex::OperatesOnXYZT(), BDS::ProblemWithArrayReflectionCombination(), and ReportIfProblemWithReflection().

Here is the call graph for this function:

◆ DeleteArrays()

void BDSFieldLoader::DeleteArrays ( )

Definition at line 121 of file BDSFieldLoader.cc.

◆ EFilePathOK()

void BDSFieldLoader::EFilePathOK ( const BDSFieldInfo &  info)
staticprivate

Check file path isn't empty and throw exception if it is.

Definition at line 329 of file BDSFieldLoader.cc.

References BDSFieldInfo::ElectricFile(), and BDSFieldInfo::NameOfParserDefinition().

Referenced by LoadEField(), and LoadEMField().

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

◆ Get1DCached()

BDSArray1DCoords * BDSFieldLoader::Get1DCached ( const G4String &  filePath)
private

Return the cached array if there is one - may return nullptr.

Definition at line 339 of file BDSFieldLoader.cc.

References arrays1d.

Referenced by LoadBDSIM1D().

Here is the caller graph for this function:

◆ Get2DCached()

BDSArray2DCoords * BDSFieldLoader::Get2DCached ( const G4String &  filePath)
private

Return the cached array if there is one - may return nullptr.

Definition at line 348 of file BDSFieldLoader.cc.

References arrays2d.

Referenced by LoadBDSIM2D(), and LoadPoissonMag2D().

Here is the caller graph for this function:

◆ Get3DCached()

BDSArray3DCoords * BDSFieldLoader::Get3DCached ( const G4String &  filePath)
private

Return the cached array if there is one - may return nullptr.

Definition at line 357 of file BDSFieldLoader.cc.

References arrays3d.

Referenced by LoadBDSIM3D().

Here is the caller graph for this function:

◆ Get4DCached()

BDSArray4DCoords * BDSFieldLoader::Get4DCached ( const G4String &  filePath)
private

Return the cached array if there is one - may return nullptr.

Definition at line 366 of file BDSFieldLoader.cc.

References arrays4d.

Referenced by LoadBDSIM4D().

Here is the caller graph for this function:

◆ Instance()

BDSFieldLoader * BDSFieldLoader::Instance ( )
static

Singleton accessor.

Definition at line 105 of file BDSFieldLoader.cc.

References BDSFieldLoader(), and instance.

Referenced by BDSFieldFactory::CreateFieldEM(), BDSFieldFactory::CreateFieldERaw(), BDSFieldFactory::CreateFieldMagRaw(), BDSIM::~BDSIM(), and BDSIMLink::~BDSIMLink().

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

◆ LoadBDSIM1D()

BDSArray1DCoords * BDSFieldLoader::LoadBDSIM1D ( const G4String &  filePath)
private

Utility function to use the right templated loader class (gz or normal).

Definition at line 400 of file BDSFieldLoader.cc.

References arrays1d, Get1DCached(), and BDSFieldLoaderBDSIM< T >::Load1D().

Referenced by LoadBDSIM1DB(), LoadBDSIM1DE(), and LoadBDSIM1DEM().

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

◆ LoadBDSIM1DB()

BDSFieldMagInterpolated * BDSFieldLoader::LoadBDSIM1DB ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 1D BDSIM format magnetic field.

Definition at line 803 of file BDSFieldLoader.cc.

References CreateInterpolator1D(), and LoadBDSIM1D().

Referenced by LoadMagField().

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

◆ LoadBDSIM1DE()

BDSFieldEInterpolated * BDSFieldLoader::LoadBDSIM1DE ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 1D BDSIM format electric field.

Definition at line 906 of file BDSFieldLoader.cc.

References CreateInterpolator1D(), and LoadBDSIM1D().

Referenced by LoadEField().

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

◆ LoadBDSIM1DEM()

BDSFieldEMInterpolated * BDSFieldLoader::LoadBDSIM1DEM ( const G4String &  eFilePath,
const G4String &  bFilePath,
BDSInterpolatorType  eInterpolatorType,
BDSInterpolatorType  bInterpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  eReflection = nullptr,
const BDSArrayReflectionTypeSet *  bReflection = nullptr 
)
private

Load a 1D BDSIM format electro-magnetic field.

Definition at line 962 of file BDSFieldLoader.cc.

References CreateInterpolator1D(), and LoadBDSIM1D().

Referenced by LoadEMField().

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

◆ LoadBDSIM2D()

BDSArray2DCoords * BDSFieldLoader::LoadBDSIM2D ( const G4String &  filePath)
private

Utility function to use the right templated loader class (gz or normal).

Definition at line 427 of file BDSFieldLoader.cc.

References arrays2d, Get2DCached(), and BDSFieldLoaderBDSIM< T >::Load2D().

Referenced by LoadBDSIM2DB(), LoadBDSIM2DE(), and LoadBDSIM2DEM().

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

◆ LoadBDSIM2DB()

BDSFieldMagInterpolated * BDSFieldLoader::LoadBDSIM2DB ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 2D BDSIM format magnetic field.

Definition at line 818 of file BDSFieldLoader.cc.

References CreateInterpolator2D(), and LoadBDSIM2D().

Referenced by LoadMagField().

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

◆ LoadBDSIM2DE()

BDSFieldEInterpolated * BDSFieldLoader::LoadBDSIM2DE ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 2D BDSIM format electric field.

Definition at line 920 of file BDSFieldLoader.cc.

References CreateInterpolator2D(), and LoadBDSIM2D().

Referenced by LoadEField().

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

◆ LoadBDSIM2DEM()

BDSFieldEMInterpolated * BDSFieldLoader::LoadBDSIM2DEM ( const G4String &  eFilePath,
const G4String &  bFilePath,
BDSInterpolatorType  eInterpolatorType,
BDSInterpolatorType  bInterpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  eReflection = nullptr,
const BDSArrayReflectionTypeSet *  bReflection = nullptr 
)
private

Load a 2D BDSIM format electro-magnetic field.

Definition at line 985 of file BDSFieldLoader.cc.

References CreateInterpolator2D(), and LoadBDSIM2D().

Referenced by LoadEMField().

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

◆ LoadBDSIM3D()

BDSArray3DCoords * BDSFieldLoader::LoadBDSIM3D ( const G4String &  filePath)
private

Utility function to use the right templated loader class (gz or normal).

Definition at line 452 of file BDSFieldLoader.cc.

References arrays3d, Get3DCached(), and BDSFieldLoaderBDSIM< T >::Load3D().

Referenced by LoadBDSIM3DB(), LoadBDSIM3DE(), and LoadBDSIM3DEM().

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

◆ LoadBDSIM3DB()

BDSFieldMagInterpolated * BDSFieldLoader::LoadBDSIM3DB ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 3D BDSIM format magnetic field.

Definition at line 832 of file BDSFieldLoader.cc.

References CreateInterpolator3D(), and LoadBDSIM3D().

Referenced by LoadMagField().

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

◆ LoadBDSIM3DE()

BDSFieldEInterpolated * BDSFieldLoader::LoadBDSIM3DE ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 3D BDSIM format electric field.

Definition at line 934 of file BDSFieldLoader.cc.

References CreateInterpolator3D(), and LoadBDSIM3D().

Referenced by LoadEField().

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

◆ LoadBDSIM3DEM()

BDSFieldEMInterpolated * BDSFieldLoader::LoadBDSIM3DEM ( const G4String &  eFilePath,
const G4String &  bFilePath,
BDSInterpolatorType  eInterpolatorType,
BDSInterpolatorType  bInterpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  eReflection = nullptr,
const BDSArrayReflectionTypeSet *  bReflection = nullptr 
)
private

Load a 3D BDSIM format electro-magnetic field.

Definition at line 1008 of file BDSFieldLoader.cc.

References CreateInterpolator3D(), and LoadBDSIM3D().

Referenced by LoadEMField().

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

◆ LoadBDSIM4D()

BDSArray4DCoords * BDSFieldLoader::LoadBDSIM4D ( const G4String &  filePath)
private

Utility function to use the right templated loader class (gz or normal).

Definition at line 477 of file BDSFieldLoader.cc.

References arrays4d, Get4DCached(), and BDSFieldLoaderBDSIM< T >::Load4D().

Referenced by LoadBDSIM4DB(), LoadBDSIM4DE(), and LoadBDSIM4DEM().

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

◆ LoadBDSIM4DB()

BDSFieldMagInterpolated * BDSFieldLoader::LoadBDSIM4DB ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 4D BDSIM format magnetic field.

Definition at line 846 of file BDSFieldLoader.cc.

References CreateInterpolator4D(), and LoadBDSIM4D().

Referenced by LoadMagField().

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

◆ LoadBDSIM4DE()

BDSFieldEInterpolated * BDSFieldLoader::LoadBDSIM4DE ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 4D BDSIM format electric field.

Definition at line 948 of file BDSFieldLoader.cc.

References CreateInterpolator4D(), and LoadBDSIM4D().

Referenced by LoadEField().

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

◆ LoadBDSIM4DEM()

BDSFieldEMInterpolated * BDSFieldLoader::LoadBDSIM4DEM ( const G4String &  eFilePath,
const G4String &  bFilePath,
BDSInterpolatorType  eInterpolatorType,
BDSInterpolatorType  bInterpolatorType,
const G4Transform3D &  transform,
G4double  eScaling,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  eReflection = nullptr,
const BDSArrayReflectionTypeSet *  bReflection = nullptr 
)
private

Load a 4D BDSIM format electro-magnetic field.

Definition at line 1031 of file BDSFieldLoader.cc.

References CreateInterpolator4D(), and LoadBDSIM4D().

Referenced by LoadEMField().

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

◆ LoadEField()

BDSFieldEInterpolated * BDSFieldLoader::LoadEField ( const BDSFieldInfo &  info)

◆ LoadEMField()

BDSFieldEMInterpolated * BDSFieldLoader::LoadEMField ( const BDSFieldInfo &  info)

◆ LoadMagField()

BDSFieldMagInterpolated * BDSFieldLoader::LoadMagField ( const BDSFieldInfo &  info,
const BDSMagnetStrength *  scalingStrength = nullptr,
const G4String &  scalingKey = "none" 
)

◆ LoadPoissonMag2D()

BDSArray2DCoords * BDSFieldLoader::LoadPoissonMag2D ( const G4String &  filePath)
private

Utility function to use the right templated loader class (gz or normal).

Definition at line 375 of file BDSFieldLoader.cc.

References arrays2d, Get2DCached(), and BDSFieldLoaderPoisson< T >::LoadMag2D().

Referenced by LoadPoissonSuperFishB(), LoadPoissonSuperFishBDipole(), and LoadPoissonSuperFishBQuad().

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

◆ LoadPoissonSuperFishB()

BDSFieldMagInterpolated * BDSFieldLoader::LoadPoissonSuperFishB ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Load a 2D poisson superfish B field map.

Definition at line 860 of file BDSFieldLoader.cc.

References CreateInterpolator2D(), and LoadPoissonMag2D().

Referenced by LoadMagField().

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

◆ LoadPoissonSuperFishBDipole()

BDSFieldMagInterpolated * BDSFieldLoader::LoadPoissonSuperFishBDipole ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Similar to LoadPoissonSuperFishB() but with appropriate reflections for a map for the positive quadrant reflected to all quadrants.

Definition at line 891 of file BDSFieldLoader.cc.

References CreateInterpolator2D(), and LoadPoissonMag2D().

Referenced by LoadMagField().

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

◆ LoadPoissonSuperFishBQuad()

BDSFieldMagInterpolated * BDSFieldLoader::LoadPoissonSuperFishBQuad ( const G4String &  filePath,
BDSInterpolatorType  interpolatorType,
const G4Transform3D &  transform,
G4double  bScaling,
const BDSArrayReflectionTypeSet *  reflection = nullptr 
)
private

Similar to LoadPoissonSuperFishB() but the data below y = x is reflected and the data relfected from one quadrant to all four at the array level.

Definition at line 874 of file BDSFieldLoader.cc.

References CreateInterpolator2D(), LoadPoissonMag2D(), BDSArray4DCoords::XStep(), and BDSArray4DCoords::YStep().

Referenced by LoadMagField().

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

◆ NeedToProvideTransform()

G4bool BDSFieldLoader::NeedToProvideTransform ( const BDSArrayReflectionTypeSet *  reflectionTypes) const
private

Small utility to check the pointer is valid and if it is that it's also not empty. Returns true only if it's value and not empty.

Definition at line 738 of file BDSFieldLoader.cc.

◆ ReportIfProblemWithReflection()

void BDSFieldLoader::ReportIfProblemWithReflection ( const BDSArrayInfo &  info,
const std::array< G4bool, 4 > &  operatesOnXYZT,
G4double  tolerance = 0.05 
) const
private

Print a warning if the array info says the zero-point in array coordinates is not within the tolerance value. Only do this for dimensions where index operating is applied as given by operatesOnXYZT.

Definition at line 720 of file BDSFieldLoader.cc.

Referenced by CreateOperators().

Here is the caller graph for this function:

Field Documentation

◆ arrays1d

std::map<G4String, BDSArray1DCoords*> BDSFieldLoader::arrays1d
private

Map of cached field map array.

Definition at line 276 of file BDSFieldLoader.hh.

Referenced by Get1DCached(), and LoadBDSIM1D().

◆ arrays2d

std::map<G4String, BDSArray2DCoords*> BDSFieldLoader::arrays2d
private

Map of cached field map array.

Definition at line 277 of file BDSFieldLoader.hh.

Referenced by Get2DCached(), LoadBDSIM2D(), and LoadPoissonMag2D().

◆ arrays3d

std::map<G4String, BDSArray3DCoords*> BDSFieldLoader::arrays3d
private

Map of cached field map array.

Definition at line 278 of file BDSFieldLoader.hh.

Referenced by Get3DCached(), and LoadBDSIM3D().

◆ arrays4d

std::map<G4String, BDSArray4DCoords*> BDSFieldLoader::arrays4d
private

Map of cached field map array.

Definition at line 279 of file BDSFieldLoader.hh.

Referenced by Get4DCached(), and LoadBDSIM4D().

◆ instance

BDSFieldLoader * BDSFieldLoader::instance = nullptr
staticprivate

Singleton instance.

Definition at line 87 of file BDSFieldLoader.hh.

Referenced by Instance().


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