Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VolumeBoundsTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file VolumeBoundsTests.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 <boost/test/unit_test.hpp>
10 
13 
14 namespace tt = boost::test_tools;
15 
16 namespace Acts {
17 
18 namespace Test {
19 
20 BOOST_AUTO_TEST_SUITE(Volumes)
21 
22 BOOST_AUTO_TEST_CASE(VolumeBoundsTest) {
23  // Tests if the planes are correctly oriented
24  // s_planeXY
25  // s_planeYZ
26  // s_planeZX
27 
28  Vector3 xaxis(1., 0., 0.);
29  Vector3 yaxis(0., 1., 0.);
30  Vector3 zaxis(0., 0., 1.);
31 
32  auto rotXY = s_planeXY.rotation();
33  BOOST_CHECK(rotXY.col(0).isApprox(xaxis));
34  BOOST_CHECK(rotXY.col(1).isApprox(yaxis));
35  BOOST_CHECK(rotXY.col(2).isApprox(zaxis));
36 
37  auto rotYZ = s_planeYZ.rotation();
38  BOOST_CHECK(rotYZ.col(0).isApprox(yaxis));
39  BOOST_CHECK(rotYZ.col(1).isApprox(zaxis));
40  BOOST_CHECK(rotYZ.col(2).isApprox(xaxis));
41 
42  auto rotZX = s_planeZX.rotation();
43  BOOST_CHECK(rotZX.col(0).isApprox(zaxis));
44  BOOST_CHECK(rotZX.col(1).isApprox(xaxis));
45  BOOST_CHECK(rotZX.col(2).isApprox(yaxis));
46 }
47 
48 BOOST_AUTO_TEST_SUITE_END()
49 
50 } // namespace Test
51 
52 } // namespace Acts