EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StraightLineStepper.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file StraightLineStepper.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019-2020 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 
10 
13 
14 namespace Acts {
15 
16 std::tuple<BoundTrackParameters, BoundMatrix, double>
19  parameters[eFreePos0] = state.pos[ePos0];
20  parameters[eFreePos1] = state.pos[ePos1];
21  parameters[eFreePos2] = state.pos[ePos2];
22  parameters[eFreeTime] = state.t;
23  parameters[eFreeDir0] = state.dir[eMom0];
24  parameters[eFreeDir1] = state.dir[eMom1];
25  parameters[eFreeDir2] = state.dir[eMom2];
26  parameters[eFreeQOverP] = state.q / state.p;
27  return detail::boundState(state.geoContext, state.cov, state.jacobian,
28  state.jacTransport, state.derivative,
29  state.jacToGlobal, parameters, state.covTransport,
30  state.pathAccumulated, surface);
31 }
32 
33 std::tuple<CurvilinearTrackParameters, BoundMatrix, double>
36  parameters[eFreePos0] = state.pos[ePos0];
37  parameters[eFreePos1] = state.pos[ePos1];
38  parameters[eFreePos2] = state.pos[ePos2];
39  parameters[eFreeTime] = state.t;
40  parameters[eFreeDir0] = state.dir[eMom0];
41  parameters[eFreeDir1] = state.dir[eMom1];
42  parameters[eFreeDir2] = state.dir[eMom2];
43  parameters[eFreeQOverP] = state.q / state.p;
45  state.cov, state.jacobian, state.jacTransport, state.derivative,
46  state.jacToGlobal, parameters, state.covTransport, state.pathAccumulated);
47 }
48 
50  const Covariance& covariance) const {
51  state.pos = parameters.template segment<3>(eFreePos0);
52  state.dir = parameters.template segment<3>(eFreeDir0).normalized();
53  state.p = std::abs(1. / parameters[eFreeQOverP]);
54  state.t = parameters[eFreeTime];
55  state.cov = covariance;
56 }
57 
58 void StraightLineStepper::update(State& state, const Vector3D& uposition,
59  const Vector3D& udirection, double up,
60  double time) const {
61  state.pos = uposition;
62  state.dir = udirection.normalized();
63  state.p = up;
64  state.t = time;
65 }
66 
69  state.derivative, state.jacToGlobal, state.dir);
70 }
71 
73  const Surface& surface) const {
75  parameters[eFreePos0] = state.pos[ePos0];
76  parameters[eFreePos1] = state.pos[ePos1];
77  parameters[eFreePos2] = state.pos[ePos2];
78  parameters[eFreeTime] = state.t;
79  parameters[eFreeDir0] = state.dir[eMom0];
80  parameters[eFreeDir1] = state.dir[eMom1];
81  parameters[eFreeDir2] = state.dir[eMom2];
82  parameters[eFreeQOverP] = state.q / state.p;
84  state.jacTransport, state.derivative,
85  state.jacToGlobal, parameters, surface);
86 }
87 
89  const BoundVector& boundParams,
90  const BoundSymMatrix& cov,
91  const Surface& surface,
93  const double stepSize) const {
94  // Update the stepping state
95  update(state,
97  boundParams),
98  cov);
99  state.navDir = navDir;
100  state.stepSize = ConstrainedStep(stepSize);
101  state.pathAccumulated = 0.;
102 
103  // Reinitialize the stepping jacobian
104  surface.initJacobianToGlobal(state.geoContext, state.jacToGlobal,
105  position(state), direction(state), boundParams);
106  state.jacobian = BoundMatrix::Identity();
107  state.jacTransport = FreeMatrix::Identity();
108  state.derivative = FreeVector::Zero();
109 }
110 
111 } // namespace Acts