25 std::array<size_t, 2> nBinsRZ)>
27 std::string fieldMapFile,
double lengthUnit,
double BFieldUnit,
28 size_t nPoints,
bool firstQuadrant) {
31 std::vector<double> rPos;
32 std::vector<double> zPos;
34 std::vector<Acts::Vector2D>
bField;
36 rPos.reserve(nPoints);
37 zPos.reserve(nPoints);
38 bField.reserve(nPoints);
40 std::ifstream map_file(fieldMapFile.c_str(),
std::ios::in);
42 double r = 0.,
z = 0.;
43 double br = 0., bz = 0.;
44 while (std::getline(map_file, line)) {
45 if (line.empty() || line[0] ==
'%' || line[0] ==
'#' ||
46 line.find_first_not_of(
' ') == std::string::npos)
49 std::istringstream
tmp(line);
50 tmp >> r >>
z >> br >> bz;
58 BFieldUnit, firstQuadrant);
66 std::array<size_t, 3> nBinsXYZ)>
68 std::string fieldMapFile,
double lengthUnit,
double BFieldUnit,
69 size_t nPoints,
bool firstOctant) {
72 std::vector<double> xPos;
73 std::vector<double> yPos;
74 std::vector<double> zPos;
76 std::vector<Acts::Vector3D>
bField;
78 xPos.reserve(nPoints);
79 yPos.reserve(nPoints);
80 zPos.reserve(nPoints);
81 bField.reserve(nPoints);
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)
92 std::istringstream
tmp(line);
93 tmp >> x >>
y >>
z >> bx >> by >> bz;
97 bField.push_back(Acts::Vector3D(bx, by, bz));
102 lengthUnit, BFieldUnit, firstOctant);
107 Acts::detail::EquidistantAxis>>
110 std::array<size_t, 2> nBinsRZ)>
112 std::string fieldMapFile, std::string treeName,
double lengthUnit,
113 double BFieldUnit,
bool firstQuadrant) {
116 std::vector<double> rPos;
117 std::vector<double> zPos;
119 std::vector<Acts::Vector2D>
bField;
121 TFile* inputFile = TFile::Open(fieldMapFile.c_str());
122 TTree*
tree = (TTree*)inputFile->Get(treeName.c_str());
123 Int_t entries = tree->GetEntries();
128 tree->SetBranchAddress(
"r", &r);
129 tree->SetBranchAddress(
"z", &z);
131 tree->SetBranchAddress(
"Br", &Br);
132 tree->SetBranchAddress(
"Bz", &Bz);
135 rPos.reserve(entries);
136 zPos.reserve(entries);
137 bField.reserve(entries);
139 for (
int i = 0; i < entries; i++) {
143 bField.push_back(Acts::Vector2D(Br, Bz));
148 BFieldUnit, firstQuadrant);
156 std::array<size_t, 3> nBinsXYZ)>
158 std::string fieldMapFile, std::string treeName,
double lengthUnit,
159 double BFieldUnit,
bool firstOctant) {
162 std::vector<double> xPos;
163 std::vector<double> yPos;
164 std::vector<double> zPos;
166 std::vector<Acts::Vector3D>
bField;
168 TFile* inputFile = TFile::Open(fieldMapFile.c_str());
169 TTree*
tree = (TTree*)inputFile->Get(treeName.c_str());
170 Int_t entries = tree->GetEntries();
175 tree->SetBranchAddress(
"x", &x);
176 tree->SetBranchAddress(
"y", &y);
177 tree->SetBranchAddress(
"z", &z);
179 tree->SetBranchAddress(
"Bx", &Bx);
180 tree->SetBranchAddress(
"By", &By);
181 tree->SetBranchAddress(
"Bz", &Bz);
184 xPos.reserve(entries);
185 yPos.reserve(entries);
186 zPos.reserve(entries);
187 bField.reserve(entries);
189 for (
int i = 0; i < entries; i++) {
194 bField.push_back(Acts::Vector3D(Bx, By, Bz));
199 lengthUnit, BFieldUnit, firstOctant);