Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-06 09:23:55

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/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/ReferenceGenerators.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;
0024 
0025 GeometryContext tContext;
0026 
0027 auto rBounds = std::make_shared<RectangleBounds>(10, 20);
0028 auto sTransform = Transform3::Identity();
0029 auto pSurface = Surface::makeShared<PlaneSurface>(
0030     sTransform.pretranslate(Vector3(20., 20., 100.)), std::move(rBounds));
0031 
0032 namespace ActsTests {
0033 
0034 BOOST_AUTO_TEST_SUITE(DetectorSuite)
0035 
0036 BOOST_AUTO_TEST_CASE(CenterReference) {
0037   // Simply return the cetner
0038   auto center = CenterReferenceGenerator{}.references(tContext, *pSurface);
0039   BOOST_CHECK_EQUAL(center.size(), 1u);
0040   BOOST_CHECK(center.front().isApprox(Vector3(20., 20., 100.)));
0041 }
0042 
0043 BOOST_AUTO_TEST_CASE(BinningPositionReference) {
0044   // Simply return binning position, we test only the behavior of the generator
0045   // not the output
0046   auto referencePosition =
0047       AxisDirectionReferenceGenerator<AxisDirection::AxisZ>{}.references(
0048           tContext, *pSurface);
0049   BOOST_CHECK_EQUAL(referencePosition.size(), 1u);
0050 }
0051 
0052 BOOST_AUTO_TEST_CASE(PolyhedronReference) {
0053   // Simply return binning position, we test only the behavior of the generator
0054   // not the output
0055   auto referencePositions =
0056       PolyhedronReferenceGenerator{}.references(tContext, *pSurface);
0057   // 4 corners without center of gravity
0058   BOOST_CHECK_EQUAL(referencePositions.size(), 4u);
0059 }
0060 
0061 BOOST_AUTO_TEST_SUITE_END()
0062 
0063 }  // namespace ActsTests