EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CsvOptionsWriter.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CsvOptionsWriter.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
11 #include <limits>
12 
13 #include <boost/program_options.hpp>
14 #include <dfe/dfe_io_dsv.hpp>
15 
18  using namespace boost::program_options;
19 
20  desc.add_options()(
21  "csv-output-precision",
22  value<size_t>()->default_value(std::numeric_limits<float>::max_digits10),
23  "Floating number output precision.")(
24  "csv-tg-perevent", bool_switch(), "Write tracking geometry per event.");
25 }
26 
31  if (not vm["output-dir"].empty()) {
32  cfg.outputDir = vm["output-dir"].as<std::string>();
33  }
34  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
35  return cfg;
36 }
37 
42  if (not vm["output-dir"].empty()) {
43  cfg.outputDir = vm["output-dir"].as<std::string>();
44  }
45  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
46  return cfg;
47 }
48 
53  if (not vm["output-dir"].empty()) {
54  cfg.outputDir = vm["output-dir"].as<std::string>();
55  }
56  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
57  cfg.writePerEvent = vm.count("csv-tg-perevent");
58  return cfg;
59 }