EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
9
#include "
Acts/Propagator/StraightLineStepper.hpp
"
10
11
#include "
Acts/EventData/detail/TransformationBoundToFree.hpp
"
12
#include "
Acts/Propagator/detail/CovarianceEngine.hpp
"
13
14
namespace
Acts {
15
16
std::tuple<BoundTrackParameters, BoundMatrix, double>
17
StraightLineStepper::boundState
(
State
& state,
const
Surface
&
surface
)
const
{
18
FreeVector
parameters
;
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>
34
StraightLineStepper::curvilinearState
(
State
& state)
const
{
35
FreeVector
parameters
;
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
;
44
return
detail::curvilinearState
(
45
state.
cov
, state.
jacobian
, state.
jacTransport
, state.
derivative
,
46
state.
jacToGlobal
, parameters, state.
covTransport
, state.
pathAccumulated
);
47
}
48
49
void
StraightLineStepper::update
(
State
& state,
const
FreeVector
&
parameters
,
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
67
void
StraightLineStepper::covarianceTransport
(
State
& state)
const
{
68
detail::covarianceTransport
(state.
cov
, state.
jacobian
, state.
jacTransport
,
69
state.
derivative
, state.
jacToGlobal
, state.
dir
);
70
}
71
72
void
StraightLineStepper::covarianceTransport
(
State
& state,
73
const
Surface
&
surface
)
const
{
74
FreeVector
parameters
;
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
;
83
detail::covarianceTransport
(state.
geoContext
, state.
cov
, state.
jacobian
,
84
state.
jacTransport
, state.
derivative
,
85
state.
jacToGlobal
, parameters, surface);
86
}
87
88
void
StraightLineStepper::resetState
(
State
& state,
89
const
BoundVector
& boundParams,
90
const
BoundSymMatrix
&
cov
,
91
const
Surface
&
surface
,
92
const
NavigationDirection
navDir
,
93
const
double
stepSize
)
const
{
94
// Update the stepping state
95
update
(state,
96
detail::transformBoundToFreeParameters
(surface, state.
geoContext
,
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
acts
blob
sPHENIX
Core
src
Propagator
StraightLineStepper.cpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:24
using
1.8.2 with
EIC GitHub integration