Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:34

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/Algebra.hpp"
0012 #include "Acts/Detector/detail/ReferenceGenerators.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Surfaces/PlaneSurface.hpp"
0015 #include "Acts/Surfaces/RectangleBounds.hpp"
0016 #include "Acts/Surfaces/Surface.hpp"
0017 #include "Acts/Utilities/BinningType.hpp"
0018 
0019 #include <memory>
0020 #include <utility>
0021 #include <vector>
0022 
0023 using namespace Acts::Experimental::detail;
0024 
0025 Acts::GeometryContext tContext;
0026 
0027 auto rBounds = std::make_shared<Acts::RectangleBounds>(10, 20);
0028 auto sTransform = Acts::Transform3::Identity();
0029 auto pSurface = Acts::Surface::makeShared<Acts::PlaneSurface>(
0030     sTransform.pretranslate(Acts::Vector3(20., 20., 100.)), std::move(rBounds));
0031 
0032 BOOST_AUTO_TEST_SUITE(Detector)
0033 
0034 BOOST_AUTO_TEST_CASE(CenterReference) {
0035   // Simply return the cetner
0036   auto center = CenterReferenceGenerator{}.references(tContext, *pSurface);
0037   BOOST_CHECK_EQUAL(center.size(), 1u);
0038   BOOST_CHECK(center.front().isApprox(Acts::Vector3(20., 20., 100.)));
0039 }
0040 
0041 BOOST_AUTO_TEST_CASE(BinningPositionReference) {
0042   // Simply return binning position, we test only the behavior of the generator
0043   // not the output
0044   auto referencePosition =
0045       AxisDirectionReferenceGenerator<Acts::AxisDirection::AxisZ>{}.references(
0046           tContext, *pSurface);
0047   BOOST_CHECK_EQUAL(referencePosition.size(), 1u);
0048 }
0049 
0050 BOOST_AUTO_TEST_CASE(PolyhedronReference) {
0051   // Simply return binning position, we test only the behavior of the generator
0052   // not the output
0053   auto referencePositions =
0054       PolyhedronReferenceGenerator<>{}.references(tContext, *pSurface);
0055   // 4 corners with center of gravity
0056   BOOST_CHECK_EQUAL(referencePositions.size(), 5u);
0057 }
0058 
0059 BOOST_AUTO_TEST_SUITE_END()