20 using namespace Acts::UnitLiterals;
22 int main(
int argc,
char* argv[]) {
23 size_t iters_map = 5
e2;
24 size_t iters_solenoid = 3;
25 size_t runs_solenoid = 1000;
27 iters_map = std::stoi(argv[1]);
30 iters_solenoid = std::stoi(argv[2]);
33 runs_solenoid = std::stoi(argv[3]);
36 const double L = 5.8_m;
37 const double R = (2.56 + 2.46) * 0.5 * 0.5_m;
38 const size_t nCoils = 1154;
45 double zMin = 2 * (-L / 2.);
46 double zMax = 2 * (L / 2.);
49 std::cout <<
"Building interpolated field map" << std::endl;
55 auto bFieldMap = BField_t(std::move(cfg));
58 std::uniform_real_distribution<> zDist(1.5 * (-L / 2.), 1.5 * L / 2.);
59 std::uniform_real_distribution<> rDist(0, R * 1.5);
62 const double z = zDist(rng),
r = rDist(rng),
phi =
phiDist(rng);
63 return {
r * std::cos(
phi),
r * std::sin(
phi), z};
68 std::cout <<
"Benchmarking random SolenoidBField lookup: " << std::flush;
72 std::cout << solenoid_result << std::endl;
82 std::cout <<
"Benchmarking cached interpolated field lookup: " << std::flush;
83 const auto fixedPos = genPos();
85 [&] {
return bFieldMap.getField(fixedPos); }, iters_map);
86 std::cout << map_cached_result << std::endl;
91 std::cout <<
"Benchmarking random interpolated field lookup: " << std::flush;
93 [&] {
return bFieldMap.getField(genPos()); }, iters_map);
94 std::cout << map_rand_result << std::endl;