14 #include <boost/program_options.hpp>
16 namespace ActsExamples {
19 template <
typename bfield_t>
20 void writeField(boost::program_options::variables_map vm,
21 std::shared_ptr<const bfield_t>
bField) {
24 using GridType =
typename Writer::GridType;
28 if (vm[
"bf-out-rz"].
template as<bool>()) {
29 writerConfig.gridType = GridType::rz;
31 writerConfig.gridType = GridType::xyz;
33 writerConfig.treeName = vm[
"bf-map-out"].template as<std::string>();
34 writerConfig.fileName = vm[
"bf-file-out"].template as<std::string>();
35 writerConfig.bField =
bField;
36 std::cout <<
"setting rBounds" << std::endl;
37 if (vm.count(
"bf-rRange") && vm.count(
"bf-zRange")) {
38 auto rBounds = vm[
"bf-rRange"].template as<read_range>();
39 auto zBounds = vm[
"bf-zRange"].template as<read_range>();
41 rBounds[1] * Acts::UnitConstants::mm}};
43 zBounds[1] * Acts::UnitConstants::mm}};
45 writerConfig.rBins = vm[
"bf-rBins"].template as<size_t>();
46 writerConfig.zBins = vm[
"bf-ZBins"].template as<size_t>();
47 writerConfig.phiBins = vm[
"bf-PhiBins"].template as<size_t>();