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 
12 #include "Acts/Utilities/Units.hpp"
17 
18 #include <utility>
19 
20 #include <boost/program_options.hpp>
21 
22 namespace ActsExamples {
23 namespace Options {
24 
28 void addFatrasOptions(Description& desc);
29 
35 template <typename simulator_t>
37  const Variables& variables, simulator_t&& simulator) {
38  using namespace Acts::UnitLiterals;
41 
44 
45  Config cfg(std::forward<simulator_t>(simulator));
46 
47  // simulation particle cuts both for input and physics lists output
48  const auto pmin = variables["fatras-pmin-gev"].as<double>() * 1_GeV;
49  cfg.simulator.selectCharged.template get<PMin>().valMin = pmin;
50  cfg.simulator.selectNeutral.template get<PMin>().valMin = pmin;
51  cfg.simulator.charged.physics =
53 
54  // all physics process are enabled by default
55  if (not variables["fatras-em-scattering"].as<bool>()) {
56  cfg.simulator.charged.physics
57  .template disable<ActsFatras::detail::StandardScattering>();
58  }
59  if (not variables["fatras-em-ionisation"].as<bool>()) {
60  cfg.simulator.charged.physics
61  .template disable<ActsFatras::detail::StandardBetheBloch>();
62  }
63  if (not variables["fatras-em-radiation"].as<bool>()) {
64  cfg.simulator.charged.physics
65  .template disable<ActsFatras::detail::StandardBetheHeitler>();
66  }
67 
68  // select hit surfaces for charged particles
69  const std::string hits = variables["fatras-hits"].as<std::string>();
70  if (hits == "sensitive") {
71  ACTS_DEBUG("Configure hits on sensitive surfaces");
72  cfg.simulator.charged.selectHitSurface.sensitive = true;
73  cfg.simulator.charged.selectHitSurface.material = false;
74  cfg.simulator.charged.selectHitSurface.passive = false;
75  } else if (hits == "material") {
76  ACTS_DEBUG("Configure hits on material surfaces");
77  cfg.simulator.charged.selectHitSurface.sensitive = false;
78  cfg.simulator.charged.selectHitSurface.material = true;
79  cfg.simulator.charged.selectHitSurface.passive = false;
80  } else if (hits == "all") {
81  ACTS_DEBUG("Configure hits on all surfaces");
82  cfg.simulator.charged.selectHitSurface.sensitive = false;
83  cfg.simulator.charged.selectHitSurface.material = false;
84  // this includes sensitive and material surfaces
85  cfg.simulator.charged.selectHitSurface.passive = true;
86  } else {
87  ACTS_WARNING("Invalid hits configuration '" << hits << "'");
88  // none or unknown type -> record nothing
89  cfg.simulator.charged.selectHitSurface.sensitive = false;
90  cfg.simulator.charged.selectHitSurface.material = false;
91  cfg.simulator.charged.selectHitSurface.passive = false;
92  }
93 
94  return cfg;
95 }
96 
97 } // namespace Options
98 } // namespace ActsExamples