BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Loader for BDSIM format fields. More...
#include <BDSFieldLoaderBDSIM.hh>
Data Structures | |
struct | DimensionKeys |
Public Member Functions | |
BDSArray4DCoords * | Load4D (const G4String &fileName) |
Load a 4D array. | |
BDSArray3DCoords * | Load3D (const G4String &fileName) |
Load a 3D array. | |
BDSArray2DCoords * | Load2D (const G4String &fileName) |
Load a 2D array. | |
BDSArray1DCoords * | Load1D (const G4String &fileName) |
Load a 1D array. | |
Private Member Functions | |
void | CleanUp () |
Ensure any member variables are reset between usages. | |
void | Terminate (const G4String &message="") |
Close file and exit program in case of an error. | |
void | Load (const G4String &fileName, const unsigned int nDim) |
General loader for any number of dimensions. | |
void | ProcessData (const std::string &line, const unsigned long xIndex, const unsigned long yIndex=0, const unsigned long zIndex=0) |
Private Attributes | |
T | file |
Templated iostream for std::ifstream and gzstream as well. | |
unsigned long | nColumns |
Number of columns to read. | |
std::vector< G4float > | lineData |
Vector to store line data during loading. | |
BDSFieldValue | fv |
Temporary field value. | |
std::map< G4String, double > | header |
Header keys and values. | |
BDSArray4DCoords * | result |
Resultant array from loading. | |
G4String | loopOrder |
String for looping order when loading. | |
const std::vector< G4String > | headerMustBePositiveKeys |
unsigned long | indexOfFirstFieldValue |
std::map< BDSDimensionType, DimensionKeys > | dimKeyMap |
std::map< BDSDimensionType, G4double > | dimUnitsMap |
Loader for BDSIM format fields.
Loaders are given through specific public methods so the exact type can be returned.
The input stream type is templated.
This can exit the program if an invalid specification is loaded.
Definition at line 54 of file BDSFieldLoaderBDSIM.hh.
BDSFieldLoaderBDSIM< T >::BDSFieldLoaderBDSIM |
Definition at line 50 of file BDSFieldLoaderBDSIM.cc.
BDSFieldLoaderBDSIM< T >::~BDSFieldLoaderBDSIM |
Definition at line 72 of file BDSFieldLoaderBDSIM.cc.
|
private |
Ensure any member variables are reset between usages.
Definition at line 76 of file BDSFieldLoaderBDSIM.cc.
|
private |
General loader for any number of dimensions.
Definition at line 129 of file BDSFieldLoaderBDSIM.cc.
References BDS::DetermineDimensionType(), and BDS::LowerCase().
BDSArray1DCoords * BDSFieldLoaderBDSIM< T >::Load1D | ( | const G4String & | fileName | ) |
Load a 1D array.
Definition at line 101 of file BDSFieldLoaderBDSIM.cc.
Referenced by BDSFieldLoader::LoadBDSIM1D().
BDSArray2DCoords * BDSFieldLoaderBDSIM< T >::Load2D | ( | const G4String & | fileName | ) |
Load a 2D array.
Definition at line 108 of file BDSFieldLoaderBDSIM.cc.
Referenced by BDSFieldLoader::LoadBDSIM2D().
BDSArray3DCoords * BDSFieldLoaderBDSIM< T >::Load3D | ( | const G4String & | fileName | ) |
Load a 3D array.
Definition at line 115 of file BDSFieldLoaderBDSIM.cc.
Referenced by BDSFieldLoader::LoadBDSIM3D().
BDSArray4DCoords * BDSFieldLoaderBDSIM< T >::Load4D | ( | const G4String & | fileName | ) |
Load a 4D array.
Definition at line 122 of file BDSFieldLoaderBDSIM.cc.
Referenced by BDSFieldLoader::LoadBDSIM4D().
|
private |
Process on line of data. Index of 0 corresponds to a default value of field of 0. This allows various dimensional loading to use the same function.
Definition at line 420 of file BDSFieldLoaderBDSIM.cc.
|
private |
Close file and exit program in case of an error.
Definition at line 94 of file BDSFieldLoaderBDSIM.cc.
|
private |
Definition at line 102 of file BDSFieldLoaderBDSIM.hh.
|
private |
Definition at line 103 of file BDSFieldLoaderBDSIM.hh.
|
private |
Templated iostream for std::ifstream and gzstream as well.
Definition at line 84 of file BDSFieldLoaderBDSIM.hh.
|
private |
Temporary field value.
Definition at line 89 of file BDSFieldLoaderBDSIM.hh.
|
private |
Header keys and values.
Definition at line 90 of file BDSFieldLoaderBDSIM.hh.
|
private |
Definition at line 93 of file BDSFieldLoaderBDSIM.hh.
|
private |
Definition at line 94 of file BDSFieldLoaderBDSIM.hh.
|
private |
Vector to store line data during loading.
Definition at line 88 of file BDSFieldLoaderBDSIM.hh.
|
private |
String for looping order when loading.
Definition at line 92 of file BDSFieldLoaderBDSIM.hh.
|
private |
Number of columns to read.
Number of columns to read.
Definition at line 87 of file BDSFieldLoaderBDSIM.hh.
|
private |
Resultant array from loading.
Definition at line 91 of file BDSFieldLoaderBDSIM.hh.