18 #include <boost/program_options.hpp>
20 namespace po = boost::program_options;
27 int main(
int argc,
char* argv[]) {
33 desc.add_options()(
"bf-file-out",
34 value<std::string>()->default_value(
"BFieldOut.root"),
35 "Set this name for an output root file.")(
36 "bf-map-out", value<std::string>()->default_value(
"bField"),
37 "Set this name for the tree in the out file.")(
38 "bf-out-rz", value<bool>()->default_value(
false),
39 "Please set this flag to true, if you want to print out the field map in "
40 "cylinder coordinates (r,z). The default are cartesian coordinates "
43 "[optional] range which the bfield map should be written out in either r "
45 "coordinates) or x/y (cartesian coordinates) in [mm]. In case no value "
46 "is handed over the whole map will be written out. Please "
47 "hand over by simply separating the values by space")(
49 "[optional] range which the bfield map should be written out in z in "
50 "[mm].In case no value is handed over for 'bf-rRange' and 'bf-zRange the "
51 "whole map will be written out. "
52 "Please hand over by simply separating the values by space")(
53 "bf-rBins", value<size_t>()->default_value(200),
54 "[optional] The number of bins in r. This parameter only needs to be "
55 "specified if 'bf-rRange' and 'bf-zRange' are given.")(
56 "bf-ZBins", value<size_t>()->default_value(300),
57 "[optional] The number of bins in z. This parameter only needs to be "
58 "specified if 'bf-rRange' and 'bf-zRange' are given.")(
59 "bf-PhiBins", value<size_t>()->default_value(100),
60 "[optional] The number of bins in phi. This parameter only needs to be "
61 "specified if 'bf-rRange' and 'bf-zRange' are given and 'bf-out-rz' is "
74 std::cout <<
"Bfield map could not be read. Exiting." << std::endl;
82 if (vm[
"bf-out-rz"].
template as<bool>()) {
83 writerConfig.
gridType = GridType::rz;
85 writerConfig.
gridType = GridType::xyz;
87 writerConfig.
treeName = vm[
"bf-map-out"].template as<std::string>();
88 writerConfig.
fileName = vm[
"bf-file-out"].template as<std::string>();
90 std::cout <<
"setting rBounds" << std::endl;
91 if (vm.count(
"bf-rRange") != 0
u && vm.count(
"bf-zRange") != 0
u) {
93 vm[
"bf-rRange"].template as<ActsExamples::Options::Reals<2>>();
95 vm[
"bf-zRange"].template as<ActsExamples::Options::Reals<2>>();
104 writerConfig.
zBounds = zBounds;
106 writerConfig.
rBins = vm[
"bf-rBins"].template as<size_t>();
107 writerConfig.
zBins = vm[
"bf-ZBins"].template as<size_t>();
108 writerConfig.
phiBins = vm[
"bf-PhiBins"].template as<size_t>();