Analysis Software
Documentation for sPHENIX simulation 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 
41  if (not vm["output-dir"].empty()) {
42  cfg.outputDir = vm["output-dir"].as<std::string>();
43  }
44  return cfg;
45 }
46 
51  if (not vm["output-dir"].empty()) {
52  cfg.outputDir = vm["output-dir"].as<std::string>();
53  }
54  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
55  return cfg;
56 }
57 
62  if (not vm["output-dir"].empty()) {
63  cfg.outputDir = vm["output-dir"].as<std::string>();
64  }
65  // cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
66  return cfg;
67 }
68 
73  if (not vm["output-dir"].empty()) {
74  cfg.outputDir = vm["output-dir"].as<std::string>();
75  }
76  cfg.outputPrecision = vm["csv-output-precision"].as<size_t>();
77  cfg.writePerEvent = (vm.count("csv-tg-perevent") != 0u);
78  return cfg;
79 }