Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-24 08:20:53

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/Surfaces/PlaneSurface.hpp"
0012 #include "Acts/Surfaces/RectangleBounds.hpp"
0013 #include "Acts/Surfaces/Surface.hpp"
0014 #include "ActsPlugins/GeoModel/GeoModelDetectorElement.hpp"
0015 
0016 #include <GeoModelKernel/GeoBox.h>
0017 #include <GeoModelKernel/GeoFullPhysVol.h>
0018 #include <GeoModelKernel/GeoLogVol.h>
0019 #include <GeoModelKernel/GeoMaterial.h>
0020 
0021 using namespace Acts;
0022 using namespace ActsPlugins;
0023 
0024 namespace ActsTests {
0025 
0026 BOOST_AUTO_TEST_SUITE(GeoModelSuite)
0027 
0028 BOOST_AUTO_TEST_CASE(GeoModelDetectorElementConstruction) {
0029   auto material = make_intrusive<GeoMaterial>("Material", 1.0);
0030   // Let's create a GeoFullPhysVol object
0031 
0032   // (BOX object)
0033   auto boxXY = make_intrusive<GeoBox>(100, 200, 2);
0034   auto logXY = make_intrusive<GeoLogVol>("LogVolumeXY", boxXY, material);
0035   auto fphysXY = make_intrusive<GeoFullPhysVol>(logXY);
0036   auto rBounds = std::make_shared<RectangleBounds>(100, 200);
0037 
0038   PVConstLink physXY{fphysXY};
0039   auto elementXY = GeoModelDetectorElement::createDetectorElement<PlaneSurface>(
0040       physXY, rBounds, Transform3::Identity(), 2.0);
0041 
0042   const Surface& surface = elementXY->surface();
0043   BOOST_CHECK(surface.type() == Surface::SurfaceType::Plane);
0044 }
0045 
0046 BOOST_AUTO_TEST_SUITE_END()
0047 
0048 }  // namespace ActsTests