Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:13:10

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