ECCE @ 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 <boost/program_options.hpp>
12 #include <dfe/dfe_io_dsv.hpp>
13 #include <limits>
14 
16  using namespace boost::program_options;
17 
18  desc.add_options()(
19  "csv-output-precision",
20  value<size_t>()->default_value(std::numeric_limits<float>::max_digits10),
21  "Floating number output precision.")(
22  "csv-tg-perevent", bool_switch(), "Write tracking geometry per event.");
23 }
24 
26  const FW::Options::Variables& vm) {
28  if (not vm["output-dir"].empty()) {
29  cfg.outputDir = vm["output-dir"].as<std::string>();
30  }
31  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
32  return cfg;
33 }
34 
37  const FW::Options::Variables& vm) {
39  if (not vm["output-dir"].empty()) {
40  cfg.outputDir = vm["output-dir"].as<std::string>();
41  }
42  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
43  return cfg;
44 }
45 
48  const FW::Options::Variables& vm) {
50  if (not vm["output-dir"].empty()) {
51  cfg.outputDir = vm["output-dir"].as<std::string>();
52  }
53  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
54  cfg.writePerEvent = vm.count("csv-tg-perevent");
55  return cfg;
56 }