BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
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 ()
 
BDSFieldMagInterpolatedLoadMagField (const BDSFieldInfo &info, const BDSMagnetStrength *scalingStrength=nullptr, const G4String &scalingKey="none")
 Main interface to load a magnetic field. More...
 
BDSFieldEInterpolatedLoadEField (const BDSFieldInfo &info)
 Main interface to load an electric field. More...
 
BDSFieldEMInterpolatedLoadEMField (const BDSFieldInfo &info)
 Main interface to load an electro-magnetic field. More...
 

Static Public Member Functions

static BDSFieldLoaderInstance ()
 Singleton accessor. More...
 

Private Member Functions

 BDSFieldLoader ()
 Private default constructor as singleton. More...
 
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
 
BDSArray1DCoordsCreateArrayReflected (BDSArray1DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSArray2DCoordsCreateArrayReflected (BDSArray2DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSArray3DCoordsCreateArrayReflected (BDSArray3DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSArray4DCoordsCreateArrayReflected (BDSArray4DCoords *existingArray, const BDSArrayReflectionTypeSet *reflectionType) const
 
BDSInterpolator1DCreateInterpolator1D (BDSArray1DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 1D interpolator for an array. More...
 
BDSInterpolator2DCreateInterpolator2D (BDSArray2DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 2D interpolator for an array. More...
 
BDSInterpolator3DCreateInterpolator3D (BDSArray3DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 3D interpolator for an array. More...
 
BDSInterpolator4DCreateInterpolator4D (BDSArray4DCoords *array, BDSInterpolatorType interpolatorType) const
 Create the appropriate 4D interpolator for an array. More...
 
BDSFieldMagInterpolatedLoadBDSIM1DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 1D BDSIM format magnetic field. More...
 
BDSFieldMagInterpolatedLoadBDSIM2DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 2D BDSIM format magnetic field. More...
 
BDSFieldMagInterpolatedLoadBDSIM3DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 3D BDSIM format magnetic field. More...
 
BDSFieldMagInterpolatedLoadBDSIM4DB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 4D BDSIM format magnetic field. More...
 
BDSFieldMagInterpolatedLoadPoissonSuperFishB (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 2D poisson superfish B field map. More...
 
BDSFieldMagInterpolatedLoadPoissonSuperFishBQuad (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 
BDSFieldMagInterpolatedLoadPoissonSuperFishBDipole (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double bScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 
BDSFieldEInterpolatedLoadBDSIM1DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 1D BDSIM format electric field. More...
 
BDSFieldEInterpolatedLoadBDSIM2DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 2D BDSIM format electric field. More...
 
BDSFieldEInterpolatedLoadBDSIM3DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 3D BDSIM format electric field. More...
 
BDSFieldEInterpolatedLoadBDSIM4DE (const G4String &filePath, BDSInterpolatorType interpolatorType, const G4Transform3D &transform, G4double eScaling, const BDSArrayReflectionTypeSet *reflection=nullptr)
 Load a 4D BDSIM format electric field. More...
 
BDSFieldEMInterpolatedLoadBDSIM1DEM (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. More...
 
BDSFieldEMInterpolatedLoadBDSIM2DEM (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. More...
 
BDSFieldEMInterpolatedLoadBDSIM3DEM (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. More...
 
BDSFieldEMInterpolatedLoadBDSIM4DEM (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. More...
 
BDSArray1DCoordsGet1DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr. More...
 
BDSArray2DCoordsGet2DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr. More...
 
BDSArray3DCoordsGet3DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr. More...
 
BDSArray4DCoordsGet4DCached (const G4String &filePath)
 Return the cached array if there is one - may return nullptr. More...
 
BDSArray2DCoordsLoadPoissonMag2D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal). More...
 
BDSArray1DCoordsLoadBDSIM1D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal). More...
 
BDSArray2DCoordsLoadBDSIM2D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal). More...
 
BDSArray3DCoordsLoadBDSIM3D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal). More...
 
BDSArray4DCoordsLoadBDSIM4D (const G4String &filePath)
 Utility function to use the right templated loader class (gz or normal). More...
 

Static Private Member Functions

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

Private Attributes

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

Static Private Attributes

static BDSFieldLoaderinstance = nullptr
 Singleton instance. More...
 

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 62 of file BDSFieldLoader.hh.

Constructor & Destructor Documentation

◆ ~BDSFieldLoader()

BDSFieldLoader::~BDSFieldLoader ( )

Definition at line 116 of file BDSFieldLoader.cc.

◆ BDSFieldLoader()

BDSFieldLoader::BDSFieldLoader ( )
private

Private default constructor as singleton.

Definition at line 113 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 320 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 752 of file BDSFieldLoader.cc.

◆ CreateArrayReflected() [2/4]

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

Definition at line 765 of file BDSFieldLoader.cc.

◆ CreateArrayReflected() [3/4]

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

Definition at line 778 of file BDSFieldLoader.cc.

◆ CreateArrayReflected() [4/4]

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

Definition at line 791 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 503 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 523 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 543 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 563 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 583 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 122 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 330 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 340 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 349 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 358 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 367 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 106 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 401 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 804 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 907 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 963 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 428 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 819 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 921 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 986 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 453 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 833 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 935 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 1009 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 478 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 847 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 949 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 1032 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 376 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 861 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 892 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 875 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 739 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 721 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 277 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 278 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 279 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 280 of file BDSFieldLoader.hh.

Referenced by Get4DCached(), and LoadBDSIM4D().

◆ instance

BDSFieldLoader * BDSFieldLoader::instance = nullptr
staticprivate

Singleton instance.

Definition at line 88 of file BDSFieldLoader.hh.

Referenced by Instance().


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