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
TransformBoundToFreeTests.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TransformBoundToFreeTests.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 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 <boost/test/data/test_case.hpp>
10
#include <boost/test/unit_test.hpp>
11
12
#include "
Acts/EventData/detail/TransformationBoundToFree.hpp
"
13
#include "
Acts/Tests/CommonHelpers/FloatComparisons.hpp
"
14
#include "
Acts/Utilities/UnitVectors.hpp
"
15
#include "
Acts/Utilities/Units.hpp
"
16
17
#include <cmath>
18
#include <limits>
19
20
#include "
TrackParametersDatasets.hpp
"
21
22
using namespace
Acts;
23
using namespace
Acts::UnitLiterals;
24
25
namespace
{
26
constexpr
auto
eps
=
std::numeric_limits<FreeScalar>::epsilon
();
27
}
28
29
BOOST_AUTO_TEST_SUITE(TransformBoundToFree)
30
31
BOOST_DATA_TEST_CASE
(
32
Parameters
,
33
surfaces* posSymmetric* posSymmetric* ts* phis* thetas*
ps
* qsNonZero,
34
surface
, l0, l1,
time
,
phi
,
theta
,
p
, q) {
35
GeometryContext
geoCtx
;
36
37
Vector2D
loc(l0, l1);
38
Vector3D
dir =
makeDirectionUnitFromPhiTheta
(phi, theta);
39
// transform reference position
40
Vector3D
pos
= surface->localToGlobal(geoCtx, loc, dir);
41
42
const
auto
qOverP = q /
p
;
43
44
// construct bound parameters
45
BoundVector
bv = BoundVector::Zero();
46
bv[
eBoundLoc0
] = l0;
47
bv[
eBoundLoc1
] = l1;
48
bv[
eBoundTime
] =
time
;
49
bv[
eBoundPhi
] =
phi
;
50
bv[
eBoundTheta
] =
theta
;
51
bv[
eBoundQOverP
] = qOverP;
52
53
// convert to free parameters
54
FreeVector
fv
=
detail::transformBoundToFreeParameters
(*surface, geoCtx, bv);
55
56
CHECK_CLOSE_OR_SMALL
(fv.segment<3>(
eFreePos0
), pos,
eps
,
eps
);
57
CHECK_CLOSE_OR_SMALL
(fv[
eFreeTime
], bv[
eBoundTime
],
eps
,
eps
);
58
CHECK_CLOSE_REL
(fv.segment<3>(
eFreeDir0
).norm(), 1,
eps
);
59
CHECK_CLOSE_OR_SMALL
(fv.segment<3>(
eFreeDir0
), dir,
eps
,
eps
);
60
CHECK_CLOSE_OR_SMALL
(fv[
eFreeQOverP
], bv[
eBoundQOverP
],
eps
,
eps
);
61
}
62
63
BOOST_AUTO_TEST_SUITE_END()
acts
blob
sPHENIX
Tests
UnitTests
Core
EventData
TransformBoundToFreeTests.cpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:26
using
1.8.2 with
EIC GitHub integration