ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PropagationOptions.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PropagationOptions.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017 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 
15 #include "Acts/Utilities/Units.hpp"
16 #include "PropagationAlgorithm.hpp"
17 
18 namespace po = boost::program_options;
19 using namespace Acts::UnitLiterals;
20 
21 namespace FW {
22 
23 namespace Options {
24 
28 template <typename aopt_t>
29 void addPropagationOptions(aopt_t& opt) {
30  opt.add_options()(
31  "prop-debug", po::value<bool>()->default_value(false),
32  "Run in debug mode, will create propagation screen output.")(
33  "prop-step-collection",
34  po::value<std::string>()->default_value("propagation-steps"),
35  "Propgation step collection.")(
36  "prop-stepper", po::value<int>()->default_value(1),
37  "Propgation type: 0 (StraightLine), 1 (Eigen), 2 (Atlas).")(
38  "prop-mode", po::value<int>()->default_value(0),
39  "Propgation modes: 0 (inside-out), 1 (surface to surface).")(
40  "prop-cov", po::value<bool>()->default_value(false),
41  "Propagate (random) test covariances.")(
42  "prop-energyloss", po::value<bool>()->default_value(true),
43  "Apply energy loss correction - in extrapolation mode only.")(
44  "prop-scattering", po::value<bool>()->default_value(true),
45  "Apply scattering correction - in extrapolation mode only.")(
46  "prop-record-material", po::value<bool>()->default_value(true),
47  "Record the material interaction and - in extrapolation mode only.")(
48  "prop-material-collection",
49  po::value<std::string>()->default_value("propagation-material"),
50  "Propagation material collection.")(
51  "prop-ntests", po::value<size_t>()->default_value(1000),
52  "Number of tests performed.")(
53  "prop-d0-sigma", po::value<double>()->default_value(15_um),
54  "Sigma of the transverse impact parameter [in mm].")(
55  "prop-z0-sigma", po::value<double>()->default_value(55_mm),
56  "Sigma of the longitudinal impact parameter [in mm].")(
57  "prop-phi-sigma", po::value<double>()->default_value(0.001),
58  "Sigma of the azimuthal angle [in rad].")(
59  "prop-theta-sigma", po::value<double>()->default_value(0.001),
60  "Sigma of the polar angle [in rad].")(
61  "prop-qp-sigma", po::value<double>()->default_value(0.0001 / 1_GeV),
62  "Sigma of the signed inverse momentum [in GeV^{-1}].")(
63  "prop-t-sigma", po::value<double>()->default_value(1_ns),
64  "Sigma of the time parameter [in ns].")(
65  "prop-corr-offd",
66  po::value<read_range>()->multitoken()->default_value({}),
67  "The 15 off-diagonal correlation rho(d0,z0), rho(d0,phi), [...], "
68  "rho(z0,phi), rho(z0, theta), [...], rho(qop,t). Row-wise.")(
69  "prop-phi-range",
70  po::value<read_range>()->multitoken()->default_value({-M_PI, M_PI}),
71  "Azimutal angle phi range for proprapolated tracks.")(
72  "prop-eta-range",
73  po::value<read_range>()->multitoken()->default_value({-4., 4.}),
74  "Pseudorapidity range for proprapolated tracks.")(
75  "prop-pt-range",
76  po::value<read_range>()->multitoken()->default_value({100_MeV, 100_GeV}),
77  "Transverse momentum range for proprapolated tracks [in GeV].")(
78  "prop-max-stepsize", po::value<double>()->default_value(3_m),
79  "Maximum step size for the propagation [in mm].")(
80  "prop-pt-loopers", po::value<double>()->default_value(300_MeV),
81  "Transverse momentum below which loops are being detected [in GeV].");
82 }
83 
94 template <typename vmap_t, typename propagator_t>
96  const vmap_t& vm, propagator_t propagator) {
98  std::move(propagator));
99 
100  read_range iphir = vm["prop-phi-range"].template as<read_range>();
101  read_range ietar = vm["prop-eta-range"].template as<read_range>();
102  read_range iptr = vm["prop-pt-range"].template as<read_range>();
103 
105  pAlgConfig.energyLoss = vm["prop-energyloss"].template as<bool>();
106  pAlgConfig.multipleScattering = vm["prop-scattering"].template as<bool>();
107  pAlgConfig.recordMaterialInteractions =
108  vm["prop-record-material"].template as<bool>();
109 
111  pAlgConfig.debugOutput = vm["prop-debug"].template as<bool>();
112  pAlgConfig.ntests = vm["prop-ntests"].template as<size_t>();
113  pAlgConfig.mode = vm["prop-mode"].template as<int>();
114  pAlgConfig.d0Sigma = vm["prop-d0-sigma"].template as<double>() * 1_mm;
115  pAlgConfig.z0Sigma = vm["prop-z0-sigma"].template as<double>() * 1_mm;
116  pAlgConfig.phiSigma = vm["prop-phi-sigma"].template as<double>();
117  pAlgConfig.thetaSigma = vm["prop-theta-sigma"].template as<double>();
118  pAlgConfig.qpSigma = vm["prop-qp-sigma"].template as<double>() / 1_GeV;
119  pAlgConfig.tSigma = vm["prop-t-sigma"].template as<double>() * 1_ns;
120 
121  pAlgConfig.phiRange = {iphir[0], iphir[1]};
122  pAlgConfig.etaRange = {ietar[0], ietar[1]};
123  pAlgConfig.ptRange = {iptr[0] * 1_GeV, iptr[1] * 1_GeV};
124  pAlgConfig.ptLoopers = vm["prop-pt-loopers"].template as<double>() * 1_GeV;
125  pAlgConfig.maxStepSize = vm["prop-max-stepsize"].template as<double>() * 1_mm;
126 
127  pAlgConfig.propagationStepCollection =
128  vm["prop-step-collection"].template as<std::string>();
129  pAlgConfig.propagationMaterialCollection =
130  vm["prop-material-collection"].template as<std::string>();
131 
133  if (vm["prop-cov"].template as<bool>()) {
135  pAlgConfig.covarianceTransport = true;
138  pAlgConfig.d0Sigma * pAlgConfig.d0Sigma;
140  pAlgConfig.z0Sigma * pAlgConfig.z0Sigma;
142  pAlgConfig.phiSigma * pAlgConfig.phiSigma;
144  pAlgConfig.thetaSigma * pAlgConfig.thetaSigma;
146  pAlgConfig.qpSigma * pAlgConfig.qpSigma;
148  pAlgConfig.tSigma * pAlgConfig.tSigma;
149 
150  // Read if the offdiagonal parameters have been read
151  auto readOffd = vm["prop-corr-offd"].template as<read_range>();
152  // Only if they are properly defined, assign
153  if (readOffd.size() == 15) {
155  readOffd[0];
157  readOffd[1];
159  readOffd[2];
161  readOffd[3];
163  readOffd[4];
165  readOffd[5];
167  readOffd[6];
169  readOffd[7];
171  readOffd[8];
173  readOffd[9];
175  readOffd[10];
177  readOffd[11];
179  readOffd[12];
181  readOffd[13];
183  readOffd[14];
184  } else {
189  -0.8;
191  }
192  }
193 
194  return pAlgConfig;
195 }
196 
197 } // namespace Options
198 } // namespace FW