ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObjWriterOptions.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ObjWriterOptions.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2018 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 
9 #pragma once
10 
11 #include <iostream>
12 
17 
18 namespace po = boost::program_options;
19 
20 namespace FW {
21 
22 namespace Options {
23 
29 template <typename aopt_t>
30 void addObjWriterOptions(aopt_t& opt) {
31  opt.add_options()("obj-tg-fileheader",
32  po::value<std::string>()->default_value(""),
33  "The (optional) file header for the tracking geometry.")(
34  "obj-tg-sensitiveheader", po::value<std::string>()->default_value(""),
35  "The (optional) header in front of sensitive sensors.")(
36  "obj-tg-layerheader", po::value<std::string>()->default_value(""),
37  "The (optional) header in front of layer surfaces.")(
38  "obj-sf-fileheader", po::value<std::string>()->default_value(""),
39  "The (optional) file header for the surface writer.")(
40  "obj-sf-phisegments", po::value<int>()->default_value(72),
41  "Number of phi segments to approximate curves.")(
42  "obj-sf-outputPrecission", po::value<int>()->default_value(6),
43  "Floating number output precission.")(
44  "obj-sf-outputScalor", po::value<double>()->default_value(1.),
45  "Scale factor to be applied.")("obj-sf-outputThickness",
46  po::value<double>()->default_value(1.),
47  "The surface thickness.")(
48  "obj-sf-outputSensitive", po::value<bool>()->default_value(true),
49  "Write sensitive surfaces.")("obj-sf-outputLayers",
50  po::value<bool>()->default_value(true),
51  "Write layer surfaces.");
52 }
53 
55 template <class AMAP>
57  const AMAP& vm, const std::string& name,
59  FW::Obj::ObjTrackingGeometryWriter::Config objTgConfig(name, loglevel);
60  objTgConfig.filePrefix = vm["obj-tg-fileheader"].template as<std::string>();
61  objTgConfig.sensitiveGroupPrefix =
62  vm["obj-tg-sensitiveheader"].template as<std::string>();
63  objTgConfig.layerPrefix = vm["obj-tg-layerheader"].template as<std::string>();
64  return objTgConfig;
65 }
66 
67 template <class AMAP>
69  const AMAP& vm, const std::string& name, Acts::Logging::Level loglevel) {
70  FW::Obj::ObjSurfaceWriter::Config objSfConfig(name,
71  loglevel = Acts::Logging::INFO);
72  objSfConfig.filePrefix = vm["obj-sf-fileheader"].template as<std::string>();
73  objSfConfig.outputPhiSegemnts = vm["obj-sf-phisegments"].template as<int>();
74  objSfConfig.outputPrecision =
75  vm["obj-sf-outputPrecission"].template as<int>();
76  objSfConfig.outputScalor = vm["obj-sf-outputScalor"].template as<double>();
77  objSfConfig.outputThickness =
78  vm["obj-sf-outputThickness"].template as<double>();
79  objSfConfig.outputSensitive =
80  vm["obj-sf-outputSensitive"].template as<bool>();
81  objSfConfig.outputLayerSurface =
82  vm["obj-sf-outputLayers"].template as<bool>();
83  return objSfConfig;
84 }
85 
86 } // namespace Options
87 } // namespace FW