16 #include <boost/program_options.hpp>
20 namespace po = boost::program_options;
31 int main(
int argc,
char* argv[]) {
37 desc.add_options()(
"bf-file-out",
38 value<std::string>()->default_value(
"BFieldOut.root"),
39 "Set this name for an output root file.")(
40 "bf-map-out", value<std::string>()->default_value(
"bField"),
41 "Set this name for the tree in the out file.")(
42 "bf-out-rz", value<bool>()->default_value(
false),
43 "Please set this flag to true, if you want to print out the field map in "
44 "cylinder coordinates (r,z). The default are cartesian coordinates "
46 "bf-rRange", value<read_range>()->multitoken(),
47 "[optional] range which the bfield map should be written out in either r "
49 "coordinates) or x/y (cartesian coordinates) in [mm]. In case no value "
50 "is handed over the whole map will be written out. Please "
51 "hand over by simply seperating the values by space")(
52 "bf-zRange", value<read_range>()->multitoken(),
53 "[optional] range which the bfield map should be written out in z in "
54 "[mm].In case no value is handed over for 'bf-rRange' and 'bf-zRange the "
55 "whole map will be written out. "
56 "Please hand over by simply seperating the values by space")(
57 "bf-rBins", value<size_t>()->default_value(200),
58 "[optional] The number of bins in r. This parameter only needs to be "
59 "specified if 'bf-rRange' and 'bf-zRange' are given.")(
60 "bf-ZBins", value<size_t>()->default_value(300),
61 "[optional] The number of bins in z. This parameter only needs to be "
62 "specified if 'bf-rRange' and 'bf-zRange' are given.")(
63 "bf-PhiBins", value<size_t>()->default_value(100),
64 "[optional] The number of bins in phi. This parameter only needs to be "
65 "specified if 'bf-rRange' and 'bf-zRange' are given and 'bf-out-rz' is "
77 typename std::decay_t<decltype(bField)>::element_type;
78 if constexpr (!std::is_same_v<field_type, InterpolatedBFieldMap2D> &&
79 !std::is_same_v<field_type, InterpolatedBFieldMap3D>) {
80 std::cout <<
"Bfield map could not be read. Exiting." << std::endl;
83 ActsExamples::BField::writeField<field_type>(vm,
bField);