ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FatrasOptions.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FatrasOptions.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-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 
9 #pragma once
10 
11 #include <boost/program_options.hpp>
12 #include <utility>
13 
17 #include "Acts/Utilities/Units.hpp"
20 
21 namespace FW {
22 namespace Options {
23 
28 
34 template <typename simulator_t>
36  const Variables& variables, simulator_t&& simulator) {
37  using namespace Acts::UnitLiterals;
40 
43 
44  Config cfg(std::forward<simulator_t>(simulator));
45 
46  // simulation particle cuts both for input and physics lists output
47  const auto pmin = variables["fatras-pmin-gev"].as<double>() * 1_GeV;
48  cfg.simulator.selectCharged.template get<PMin>().valMin = pmin;
49  cfg.simulator.selectNeutral.template get<PMin>().valMin = pmin;
50  cfg.simulator.charged.physics =
52 
53  // all physics process are enabled by default
54  if (not variables["fatras-em-scattering"].as<bool>()) {
55  cfg.simulator.charged.physics
56  .template disable<ActsFatras::detail::StandardScattering>();
57  }
58  if (not variables["fatras-em-ionisation"].as<bool>()) {
59  cfg.simulator.charged.physics
60  .template disable<ActsFatras::detail::StandardBetheBloch>();
61  }
62  if (not variables["fatras-em-radiation"].as<bool>()) {
63  cfg.simulator.charged.physics
64  .template disable<ActsFatras::detail::StandardBetheHeitler>();
65  }
66 
67  // select hit surfaces for charged particles
68  const std::string hits = variables["fatras-hits"].as<std::string>();
69  if (hits == "sensitive") {
70  ACTS_DEBUG("Configure hits on sensitive surfaces");
71  cfg.simulator.charged.selectHitSurface.sensitive = true;
72  cfg.simulator.charged.selectHitSurface.material = false;
73  cfg.simulator.charged.selectHitSurface.passive = false;
74  } else if (hits == "material") {
75  ACTS_DEBUG("Configure hits on material surfaces");
76  cfg.simulator.charged.selectHitSurface.sensitive = false;
77  cfg.simulator.charged.selectHitSurface.material = true;
78  cfg.simulator.charged.selectHitSurface.passive = false;
79  } else if (hits == "all") {
80  ACTS_DEBUG("Configure hits on all surfaces");
81  cfg.simulator.charged.selectHitSurface.sensitive = false;
82  cfg.simulator.charged.selectHitSurface.material = false;
83  // this includes sensitive and material surfaces
84  cfg.simulator.charged.selectHitSurface.passive = true;
85  } else {
86  ACTS_WARNING("Invalid hits configuration '" << hits << "'");
87  // none or unknown type -> record nothing
88  cfg.simulator.charged.selectHitSurface.sensitive = false;
89  cfg.simulator.charged.selectHitSurface.material = false;
90  cfg.simulator.charged.selectHitSurface.passive = false;
91  }
92 
93  return cfg;
94 }
95 
96 } // namespace Options
97 } // namespace FW