Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:21:45

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/MeasurementHelpers.hpp"
0013 
0014 using namespace Acts;
0015 
0016 namespace ActsTests {
0017 
0018 BOOST_AUTO_TEST_SUITE(EventDataSuite)
0019 
0020 BOOST_AUTO_TEST_CASE(visit_measurement_test) {
0021   // Overallocated full size parameter vector and covariance
0022   BoundVector parFull = BoundVector::Random();
0023   BoundMatrix covFull = BoundMatrix::Random();
0024   // constant variants
0025   const auto& parFullConst = parFull;
0026   const auto& covFullConst = covFull;
0027 
0028   for (BoundVector::Index dim = 1; dim <= parFull.size(); ++dim) {
0029     visit_measurement(parFull, covFull, dim, [&](auto param, auto cov) {
0030       BOOST_CHECK_EQUAL(param, parFull.head(dim));
0031       BOOST_CHECK_EQUAL(cov, covFull.topLeftCorner(dim, dim));
0032     });
0033     visit_measurement(parFull, covFull, dim,
0034                       [&](const auto& param, const auto& cov) {
0035                         BOOST_CHECK_EQUAL(param, parFull.head(dim));
0036                         BOOST_CHECK_EQUAL(cov, covFull.topLeftCorner(dim, dim));
0037                       });
0038     visit_measurement(parFullConst, covFullConst, dim,
0039                       [&](const auto& param, const auto& cov) {
0040                         BOOST_CHECK_EQUAL(param, parFullConst.head(dim));
0041                         BOOST_CHECK_EQUAL(cov,
0042                                           covFullConst.topLeftCorner(dim, dim));
0043                       });
0044   }
0045 }
0046 
0047 BOOST_AUTO_TEST_SUITE_END()
0048 
0049 }  // namespace ActsTests