Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TelescopeDetectorWithOptions.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TelescopeDetectorWithOptions.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022 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 
12 
13 #include <boost/program_options.hpp>
14 
15 namespace ActsExamples {
16 
20  using namespace Options;
21 
22  auto opt = desc.add_options();
23  opt("geo-tele-positions",
24  value<VariableReals>()->default_value({{0, 30, 60, 120, 150, 180}}),
25  "Telescope detector Input: the layers positions in the longitudinal "
26  "direction in mm");
27  opt("geo-tele-stereos",
28  value<VariableReals>()->default_value({{0, 0, 0, 0, 0, 0}}),
29  "Telescope detector Input: the layers stereo angle around the "
30  "longitudinal "
31  "direction in rad");
32  opt("geo-tele-offsets", value<Reals<2>>()->default_value({{0, 0}}),
33  "Telescope detector Input: the layers offsets in the transverse plane "
34  "in "
35  "mm. Same values for "
36  "all layers");
37  opt("geo-tele-bounds", value<Reals<2>>()->default_value({{25, 100}}),
38  "Telescope detector Input: the values for surface bounds in mm: "
39  "(halfX, halfY) - plane surface, (minR, maxR) - disc surface");
40  opt("geo-tele-thickness", value<double>()->default_value(80),
41  "Telescope detector Input: the silicon material thickness of "
42  "each layer in um. Same value for all layers");
43  opt("geo-tele-surface", value<int>()->default_value(0),
44  "Telescope detector Input: the detector surface type: 0 - plane "
45  "surface, "
46  "1 - disc surface");
47  opt("geo-tele-alignaxis", value<int>()->default_value(2),
48  "Telescope detector Input: the detector is placed along which "
49  "axis: 0 - x axis, 1 - y axis, 2 - z axis");
50 }
51 
53  const boost::program_options::variables_map& vm,
54  std::shared_ptr<const Acts::IMaterialDecorator> /*mdecorator*/)
55  -> std::pair<TrackingGeometryPtr, ContextDecorators> {
57 
58  cfg.positions = vm["geo-tele-positions"]
59  .template as<ActsExamples::Options::VariableReals>()
60  .values;
61  cfg.stereos = vm["geo-tele-stereos"]
62  .template as<ActsExamples::Options::VariableReals>()
63  .values;
64  cfg.offsets =
65  vm["geo-tele-offsets"].template as<ActsExamples::Options::Reals<2>>();
66  // The bounds values are taken as (halfX, halfY) for plane surface and
67  // (minR, maxR) for disc surface
68  cfg.bounds =
69  vm["geo-tele-bounds"].template as<ActsExamples::Options::Reals<2>>();
70  // Translate the thickness in unit of mm
71  cfg.thickness = vm["geo-tele-thickness"].template as<double>() * 0.001;
72  cfg.surfaceType = vm["geo-tele-surface"].template as<int>();
73  cfg.binValue = vm["geo-tele-alignaxis"].template as<int>();
74 
75  return m_detector.finalize(cfg, {});
76 }
77 
78 } // namespace ActsExamples