ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PropagationAlgorithm.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PropagationAlgorithm.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 <cmath>
12 #include <limits>
13 #include <memory>
14 #include <optional>
15 
33 #include "Acts/Utilities/Units.hpp"
34 
35 using namespace Acts::UnitLiterals;
36 
37 namespace FW {
38 
41 
46  std::pair<std::pair<Acts::Vector3D, Acts::Vector3D>, RecordedMaterial>;
47 
49 using PropagationOutput =
50  std::pair<std::vector<Acts::detail::Step>, RecordedMaterial>;
51 
59 template <typename propagator_t>
61  public:
62  struct Config {
63  // create a config object with the propagator
64  Config(propagator_t prop) : propagator(std::move(prop)) {}
65 
68 
70  std::shared_ptr<RandomNumbers> randomNumberSvc = nullptr;
71 
73  int mode = 0;
75  bool debugOutput = false;
77  bool energyLoss = false;
79  bool multipleScattering = false;
81  bool recordMaterialInteractions = false;
82 
84  size_t ntests = 100;
86  double d0Sigma = 15_um;
88  double z0Sigma = 55_mm;
90  double phiSigma = 0.0001;
92  double thetaSigma = 0.0001;
94  double qpSigma = 0.00001 / 1_GeV;
96  double tSigma = 1_ns;
98  std::pair<double, double> phiRange = {-M_PI, M_PI};
100  std::pair<double, double> etaRange = {-4., 4.};
102  std::pair<double, double> ptRange = {100_MeV, 100_GeV};
104  double ptLoopers = 300_MeV;
105 
107  double maxStepSize = 3_m;
108 
110  std::string propagationStepCollection = "PropagationSteps";
111 
113  std::string propagationMaterialCollection = "RecordedMaterialTracks";
114 
116  bool covarianceTransport = false;
117 
119  Acts::BoundVector covariances = Acts::BoundVector::Zero();
120 
122  Acts::BoundSymMatrix correlations = Acts::BoundSymMatrix::Identity();
123  };
124 
128  PropagationAlgorithm(const Config& cnf, Acts::Logging::Level loglevel);
129 
133  FW::ProcessCode execute(const AlgorithmContext& context) const final override;
134 
135  private:
137 
141  std::optional<Acts::BoundSymMatrix> generateCovariance(
142  FW::RandomEngine& rnd, std::normal_distribution<double>& gauss) const;
143 
147  // @tparam parameters_t type of the parameters objects (charged/neutra;)
154  template <typename parameters_t>
155  PropagationOutput executeTest(
156  const AlgorithmContext& context, const parameters_t& startParameters,
157  double pathLength = std::numeric_limits<double>::max()) const;
158 };
159 
160 #include "PropagationAlgorithm.ipp"
161 
162 } // namespace FW