83 void GetFieldValue(
const double pos[3], G4double* bfield)
const override;
91 dipole_x, dipole_y, dipole_z,
94 cartesian_3d, cartesian_3d_quadrant
97 Symmetry symmetry = Symmetry::dipole_z;
103 std::array<unsigned, 3> np = {0, 0, 0};
104 std::array<double, 3> startMap = {0.0, 0.0, 0.0};
105 std::array<double, 3> endMap = {0.0, 0.0, 0.0};
106 std::array<double, 3> cellSize = {1.0, 1.0, 1.0};
111 double unitFactor = 1.0;
113 std::vector<Column> columns;
116 std::vector<float> B1;
117 std::vector<float> B2;
118 std::vector<float> B3;
121 double mapOrigin[3] = {0.0, 0.0, 0.0};
122 double mapRotation[3] = {0.0, 0.0, 0.0};
123 double sinAlpha = 0.0, cosAlpha = 1.0;
124 double sinBeta = 0.0, cosBeta = 1.0;
125 double sinGamma = 0.0, cosGamma = 1.0;
128 inline std::size_t idx2(
unsigned i0,
unsigned i1)
const {
return static_cast<std::size_t
>(i0) * np[1] + i1; }
129 inline std::size_t idx3(
unsigned i0,
unsigned i1,
unsigned i2)
const {
130 return (
static_cast<std::size_t
>(i0) * np[1] + i1) * np[2] + i2;
134 void value_dipole(
const double x[3],
double* bfield)
const;
135 void value_cylindrical(
const double x[3],
double* bfield)
const;
136 void value_phi_segmented(
const double x[3],
double* bfield)
const;
137 void value_cartesian3d(
const double x[3],
double* bfield)
const;
140 void rotate_field(
double* bfield)
const;
143 std::string param_string(
const std::string& key,
const std::string& dflt)
const;
144 double param_g4number(
const std::string& key,
const std::string& dflt)
const;
147 int axis_of_coordinate(
const std::string& name)
const;
150 void load_coordinate(
const std::string& key);
153 void load_map_file();
156 std::string field_maps_directory()
const;
void GetFieldValue(const double pos[3], G4double *bfield) const override
Compute the field at the lab-frame point pos, writing {Bx,By,Bz} (Geant4 units) into bfield.