Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JsonOptionsWriter.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JsonOptionsWriter.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 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 
15  using namespace boost::program_options;
16 
17  desc.add_options()(
18  "json-output-precision",
19  value<size_t>()->default_value(std::numeric_limits<float>::max_digits10),
20  "Floating number output precision.")("json-write-sf-boundaries",
21  bool_switch(),
22  "Write tracking boundary surfaces.")(
23  "json-write-sf-approach", bool_switch(),
24  "Write tracking geometry approach surfaces.")(
25  "json-write-sf-layer", bool_switch(),
26  "Write tracking geometry layer surfaces.")(
27  "json-write-sf-sensitive", bool_switch(),
28  "Write tracking geometry sensitive surfaces.")(
29  "json-write-sf-names-only", bool_switch(),
30  "Write only names of tracking geometry surfaces.");
31 }
32 
37  if (not vm["output-dir"].empty()) {
38  cfg.outputDir = vm["output-dir"].as<std::string>();
39  }
40  cfg.outputPrecision = vm["json-output-precision"].as<size_t>();
41  cfg.writeLayer = vm["json-write-sf-layer"].as<bool>();
42  cfg.writeApproach = vm["json-write-sf-approach"].as<bool>();
43  cfg.writeSensitive = vm["json-write-sf-sensitive"].as<bool>();
44  cfg.writeBoundary = vm["json-write-sf-boundaries"].as<bool>();
45  cfg.writeOnlyNames = vm["json-write-sf-names-only"].as<bool>();
46 
47  return cfg;
48 }