9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
15 #include "Acts/MagneticField/SharedBFieldMap.hpp"
16 #include "Acts/MagneticField/concept/AnyFieldLookup.hpp"
29 #include "PropagationTestHelper.hpp"
32 namespace tt = boost::test_tools;
40 namespace IntegrationTest {
44 std::function<
size_t(std::array<size_t, 3> binsXYZ,
45 std::array<size_t, 3> nBinsXYZ)>
47 std::string fieldMapFile =
"Field.txt",
double lengthUnit = 1.,
48 double BFieldUnit = 1.,
size_t nPoints = 100000,
bool firstOctant =
false) {
51 std::vector<double> xPos;
52 std::vector<double> yPos;
53 std::vector<double> zPos;
55 std::vector<Acts::Vector3D>
bField;
57 xPos.reserve(nPoints);
58 yPos.reserve(nPoints);
59 zPos.reserve(nPoints);
60 bField.reserve(nPoints);
62 std::ifstream map_file(fieldMapFile.c_str(),
std::ios::in);
64 double x = 0.,
y = 0.,
z = 0.;
65 double bx = 0., by = 0., bz = 0.;
67 if (line.empty() || line[0] ==
'%' || line[0] ==
'#' ||
68 line.find_first_not_of(
' ') == std::string::npos)
71 std::istringstream tmp(line);
72 tmp >> x >>
y >>
z >> bx >> by >> bz;
80 return fieldMapperXYZ(localToGlobalBin, xPos, yPos, zPos, bField, lengthUnit,
81 BFieldUnit, firstOctant);
86 std::string fieldMapFile =
"Field.txt") {
88 Concepts ::AnyFieldLookup<> mapper;
93 [](std::array<size_t, 3> binsXYZ, std::array<size_t, 3> nBinsXYZ) {
94 return (binsXYZ.at(0) * (nBinsXYZ.at(1) * nBinsXYZ.at(2)) +
95 binsXYZ.at(1) * nBinsXYZ.at(2) + binsXYZ.at(2));
97 fieldMapFile, lengthUnit, BFieldUnit);
101 config.mapper = std::move(mapper);
103 return std::make_shared<const InterpolatedBFieldMap>(std::move(config));
126 #include "PropagationTestBase.hpp"