17 constexpr
size_t kDefaultSize = 1 << 15;
22 const std::function<
size_t(std::array<size_t, 2> binsRZ,
23 std::array<size_t, 2> nBinsRZ)>&
29 std::vector<double> rPos;
30 std::vector<double> zPos;
32 std::vector<Acts::Vector2>
bField;
34 rPos.reserve(kDefaultSize);
35 zPos.reserve(kDefaultSize);
36 bField.reserve(kDefaultSize);
38 std::ifstream map_file(fieldMapFile.c_str(),
std::ios::in);
40 double r = 0.,
z = 0.;
41 double br = 0., bz = 0.;
42 while (std::getline(map_file, line)) {
43 if (line.empty() || line[0] ==
'%' || line[0] ==
'#' ||
44 line.find_first_not_of(
' ') == std::string::npos) {
48 std::istringstream
tmp(line);
49 tmp >> r >>
z >> br >> bz;
57 bField.shrink_to_fit();
60 BFieldUnit, firstQuadrant);
65 const std::function<
size_t(std::array<size_t, 3> binsXYZ,
66 std::array<size_t, 3> nBinsXYZ)>&
72 std::vector<double> xPos;
73 std::vector<double> yPos;
74 std::vector<double> zPos;
76 std::vector<Acts::Vector3>
bField;
78 xPos.reserve(kDefaultSize);
79 yPos.reserve(kDefaultSize);
80 zPos.reserve(kDefaultSize);
81 bField.reserve(kDefaultSize);
83 std::ifstream map_file(fieldMapFile.c_str(),
std::ios::in);
85 double x = 0.,
y = 0.,
z = 0.;
86 double bx = 0., by = 0., bz = 0.;
87 while (std::getline(map_file, line)) {
88 if (line.empty() || line[0] ==
'%' || line[0] ==
'#' ||
89 line.find_first_not_of(
' ') == std::string::npos) {
93 std::istringstream
tmp(line);
94 tmp >> x >>
y >>
z >> bx >> by >> bz;
101 xPos.shrink_to_fit();
102 yPos.shrink_to_fit();
103 zPos.shrink_to_fit();
104 bField.shrink_to_fit();
106 lengthUnit, BFieldUnit, firstOctant);