Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-23 08:24:05

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/unit_test.hpp>
0010 
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 #include "Acts/EventData/TrackParameterHelpers.hpp"
0013 #include "ActsTests/CommonHelpers/FloatComparisons.hpp"
0014 
0015 using namespace Acts;
0016 
0017 namespace ActsTests {
0018 
0019 BOOST_AUTO_TEST_SUITE(EventDataSuite)
0020 
0021 BOOST_AUTO_TEST_CASE(isBoundVectorValiTest) {
0022   BOOST_CHECK(!isBoundVectorValid({1, 2, 3, 4, 5, 6}, true));
0023   BOOST_CHECK(isBoundVectorValid({1, 2, 1, 1, 5, 6}, true));
0024 }
0025 
0026 BOOST_AUTO_TEST_CASE(isFreeVectorValidTest) {
0027   BOOST_CHECK(!isFreeVectorValid({1, 2, 3, 4, 5, 6, 7, 8}));
0028   BOOST_CHECK(isFreeVectorValid({1, 2, 3, 4, 1, 0, 0, 8}));
0029 }
0030 
0031 BOOST_AUTO_TEST_CASE(normalizeBoundParametersTest) {
0032   CHECK_CLOSE_OR_SMALL(normalizeBoundParameters({1, 2, 3, 4, 5, 6}),
0033                        BoundVector(1, 2, -0.141593, 2.28319, 5, 6), 1e-3, 1e-3);
0034 }
0035 
0036 BOOST_AUTO_TEST_CASE(addBoundParametersTest) {
0037   CHECK_CLOSE_OR_SMALL(
0038       addBoundParameters({1, 2, 3, 4, 5, 6}, {0, 0, 0, 0, 0, 0}),
0039       normalizeBoundParameters({1, 2, 3, 4, 5, 6}), 1e-3, 1e-3);
0040   CHECK_CLOSE_OR_SMALL(
0041       addBoundParameters({1, 2, 3, 4, 5, 6}, {0, 0, 1, 1, 0, 0}),
0042       normalizeBoundParameters({1, 2, 4, 5, 5, 6}), 1e-3, 1e-3);
0043 }
0044 
0045 BOOST_AUTO_TEST_CASE(subtractBoundParametersTest) {
0046   CHECK_CLOSE_OR_SMALL(
0047       subtractBoundParameters({1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}),
0048       BoundVector(0, 0, 0, 0, 0, 0), 1e-3, 1e-3);
0049   CHECK_CLOSE_OR_SMALL(
0050       addBoundParameters(
0051           subtractBoundParameters({1, 2, 3, 4, 5, 6}, {0, 0, 1, 1, 0, 0}),
0052           {0, 0, 1, 1, 0, 0}),
0053       normalizeBoundParameters({1, 2, 3, 4, 5, 6}), 1e-3, 1e-3);
0054 }
0055 
0056 BOOST_AUTO_TEST_SUITE_END()
0057 
0058 }  // namespace ActsTests