11 #ifndef eASTMagneticField_h
12 #define eASTMagneticField_h 1
14 #include "G4MagneticField.hh"
15 #include "G4GenericMessenger.hh"
16 #include "G4SystemOfUnits.hh"
17 #include "G4UnitsTable.hh"
22 class G4EquationOfMotion;
23 class G4MagIntegratorStepper;
26 class G4PropagatorInField;
87 fFieldUnit = G4UnitDefinition::GetValueOf(unit);
91 fGridUnit[i] = G4UnitDefinition::GetValueOf(unit);
93 G4cerr <<
"ERROR: cannot set magnetic field grid unit" << G4endl;
97 if (i <
fGridExtent.size() && extent.x() < extent.y() && extent.z() > 0.0) {
98 fGridExtent[i] = std::make_tuple(extent.x(), extent.y(), extent.z());
100 G4cerr <<
"ERROR: cannot set magnetic field grid extent" << G4endl;
107 std::vector<std::vector<std::vector<std::vector<double>>>>
fMap;
130 return p[0] + x * (
p[1] -
p[0]);
147 return p[1] + 0.5 * x * (
p[2] -
p[0] +
148 x * (2. *
p[0] - 5. *
p[1] + 4. *
p[2] -
p[3] +
149 x * (3. * (
p[1] -
p[2]) +
p[3] -
p[0])));
188 for (
auto &map:
fMaps) {
189 map.AddFieldValue(point, field);
195 for (
auto &map:
fMaps) {
196 map.PrintFieldValue(point);
208 std::vector<eASTMagneticFieldMap>
fMaps;