ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProtoLayerTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ProtoLayerTests.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 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 <cmath>
13 
16 
17 namespace Acts {
18 
19 namespace Test {
20 namespace Layers {
21 BOOST_AUTO_TEST_SUITE(Layers)
22 
23 BOOST_AUTO_TEST_CASE(ProtoLayer_radialDistance) {
24  ProtoLayer pl;
25 
26  Vector3D p1(10, 0, 0);
27  Vector3D p2(0, 10, 0);
28  CHECK_CLOSE_REL(pl.radialDistance(p1, p2), sqrt(50), 1e-6);
29 
30  Vector3D p3(-5, 5, 0);
31  Vector3D p4(5, 5, 0);
32  CHECK_CLOSE_REL(pl.radialDistance(p3, p4), 5, 1e-6);
33 
34  Vector3D p5(6, 6, 0);
35  Vector3D p6(8, 9, 0);
36  CHECK_CLOSE_REL(pl.radialDistance(p5, p6), sqrt(6 * 6 + 6 * 6), 1e-6);
37 
38  Vector3D p7(0, 10, 0);
39  Vector3D p8(5, 5, 0);
40  CHECK_CLOSE_REL(pl.radialDistance(p7, p8), sqrt(50), 1e-6);
41 
42  Vector3D p9(13, 2, 0);
43  Vector3D p10(13, -2, 0);
44  CHECK_CLOSE_REL(pl.radialDistance(p9, p10), 13, 1e-6);
45 }
46 
47 BOOST_AUTO_TEST_SUITE_END()
48 } // namespace Layers
49 } // namespace Test
50 
51 } // namespace Acts