9 #include <boost/program_options.hpp>
18 namespace po = boost::program_options;
29 int main(
int argc,
char* argv[]) {
35 desc.add_options()(
"bf-file-out",
37 "Set this name for an output root file.")(
39 "Set this name for the tree in the out file.")(
41 "Please set this flag to true, if you want to print out the field map in "
42 "cylinder coordinates (r,z). The default are cartesian coordinates "
45 "[optional] range which the bfield map should be written out in either r "
47 "coordinates) or x/y (cartesian coordinates) in [mm]. In case no value "
48 "is handed over the whole map will be written out. Please "
49 "hand over by simply seperating the values by space")(
51 "[optional] range which the bfield map should be written out in z in "
52 "[mm].In case no value is handed over for 'bf-rRange' and 'bf-zRange the "
53 "whole map will be written out. "
54 "Please hand over by simply seperating the values by space")(
56 "[optional] The number of bins in r. This parameter only needs to be "
57 "specified if 'bf-rRange' and 'bf-zRange' are given.")(
59 "[optional] The number of bins in z. This parameter only needs to be "
60 "specified if 'bf-rRange' and 'bf-zRange' are given.")(
62 "[optional] The number of bins in phi. This parameter only needs to be "
63 "specified if 'bf-rRange' and 'bf-zRange' are given and 'bf-out-rz' is "
75 typename std::decay_t<decltype(bField)>::element_type;
76 if constexpr (!std::is_same_v<field_type, InterpolatedBFieldMap2D> &&
77 !std::is_same_v<field_type, InterpolatedBFieldMap3D>) {
78 std::cout <<
"Bfield map could not be read. Exiting." << std::endl;
81 FW::BField::writeField<field_type>(vm,
bField);