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 
12 #include "Acts/Utilities/Units.hpp"
14 
15 #include <iostream>
16 
17 #include "PropagationAlgorithm.hpp"
18 
19 namespace po = boost::program_options;
20 using namespace Acts::UnitLiterals;
21 
22 namespace ActsExamples {
23 
24 namespace Options {
25 
29 template <typename aopt_t>
30 void addPropagationOptions(aopt_t& opt) {
31  opt.add_options()(
32  "prop-debug", po::value<bool>()->default_value(false),
33  "Run in debug mode, will create propagation screen output.")(
34  "prop-step-collection",
35  po::value<std::string>()->default_value("propagation-steps"),
36  "Propgation step collection.")(
37  "prop-stepper", po::value<int>()->default_value(1),
38  "Propgation type: 0 (StraightLine), 1 (Eigen), 2 (Atlas).")(
39  "prop-mode", po::value<int>()->default_value(0),
40  "Propgation modes: 0 (inside-out), 1 (surface to surface).")(
41  "prop-cov", po::value<bool>()->default_value(false),
42  "Propagate (random) test covariances.")(
43  "prop-energyloss", po::value<bool>()->default_value(true),
44  "Apply energy loss correction - in extrapolation mode only.")(
45  "prop-scattering", po::value<bool>()->default_value(true),
46  "Apply scattering correction - in extrapolation mode only.")(
47  "prop-record-material", po::value<bool>()->default_value(true),
48  "Record the material interaction and - in extrapolation mode only.")(
49  "prop-material-collection",
50  po::value<std::string>()->default_value("propagation-material"),
51  "Propagation material collection.")(
52  "prop-ntests", po::value<size_t>()->default_value(1000),
53  "Number of tests performed.")(
54  "prop-d0-sigma", po::value<double>()->default_value(15_um),
55  "Sigma of the transverse impact parameter [in mm].")(
56  "prop-z0-sigma", po::value<double>()->default_value(55_mm),
57  "Sigma of the longitudinal impact parameter [in mm].")(
58  "prop-phi-sigma", po::value<double>()->default_value(0.001),
59  "Sigma of the azimuthal angle [in rad].")(
60  "prop-theta-sigma", po::value<double>()->default_value(0.001),
61  "Sigma of the polar angle [in rad].")(
62  "prop-qp-sigma", po::value<double>()->default_value(0.0001 / 1_GeV),
63  "Sigma of the signed inverse momentum [in GeV^{-1}].")(
64  "prop-t-sigma", po::value<double>()->default_value(1_ns),
65  "Sigma of the time parameter [in ns].")(
66  "prop-corr-offd",
67  po::value<read_range>()->multitoken()->default_value({}),
68  "The 15 off-diagonal correlation rho(d0,z0), rho(d0,phi), [...], "
69  "rho(z0,phi), rho(z0, theta), [...], rho(qop,t). Row-wise.")(
70  "prop-phi-range",
71  po::value<read_range>()->multitoken()->default_value({-M_PI, M_PI}),
72  "Azimutal angle phi range for proprapolated tracks.")(
73  "prop-eta-range",
74  po::value<read_range>()->multitoken()->default_value({-4., 4.}),
75  "Pseudorapidity range for proprapolated tracks.")(
76  "prop-pt-range",
77  po::value<read_range>()->multitoken()->default_value({100_MeV, 100_GeV}),
78  "Transverse momentum range for proprapolated tracks [in GeV].")(
79  "prop-max-stepsize", po::value<double>()->default_value(3_m),
80  "Maximum step size for the propagation [in mm].")(
81  "prop-pt-loopers", po::value<double>()->default_value(300_MeV),
82  "Transverse momentum below which loops are being detected [in GeV].");
83 }
84 
94 template <typename vmap_t, typename propagator_t>
96 readPropagationConfig(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;
139  pAlgConfig.d0Sigma * pAlgConfig.d0Sigma;
142  pAlgConfig.z0Sigma * pAlgConfig.z0Sigma;
145  pAlgConfig.phiSigma * pAlgConfig.phiSigma;
148  pAlgConfig.thetaSigma * pAlgConfig.thetaSigma;
151  pAlgConfig.qpSigma * pAlgConfig.qpSigma;
154  pAlgConfig.tSigma * pAlgConfig.tSigma;
155 
156  // Read if the offdiagonal parameters have been read
157  auto readOffd = vm["prop-corr-offd"].template as<read_range>();
158  // Only if they are properly defined, assign
159  if (readOffd.size() == 15) {
161  Acts::BoundIndices::eBoundLoc1) = readOffd[0];
163  Acts::BoundIndices::eBoundPhi) = readOffd[1];
165  Acts::BoundIndices::eBoundTheta) = readOffd[2];
167  Acts::BoundIndices::eBoundQOverP) = readOffd[3];
169  Acts::BoundIndices::eBoundTime) = readOffd[4];
171  Acts::BoundIndices::eBoundPhi) = readOffd[5];
173  Acts::BoundIndices::eBoundTheta) = readOffd[6];
175  Acts::BoundIndices::eBoundQOverP) = readOffd[7];
177  Acts::BoundIndices::eBoundTime) = readOffd[8];
179  Acts::BoundIndices::eBoundTheta) = readOffd[9];
181  Acts::BoundIndices::eBoundQOverP) = readOffd[10];
183  Acts::BoundIndices::eBoundTime) = readOffd[11];
185  Acts::BoundIndices::eBoundQOverP) = readOffd[12];
187  Acts::BoundIndices::eBoundTime) = readOffd[13];
189  Acts::BoundIndices::eBoundTime) = readOffd[14];
190  } else {
200  }
201  }
202 
203  return pAlgConfig;
204 }
205 
206 } // namespace Options
207 } // namespace ActsExamples