File indexing completed on 2025-01-18 09:13:10
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Plugins/Geant4/Geant4DetectorElement.hpp"
0014 #include "Acts/Surfaces/PlaneSurface.hpp"
0015 #include "Acts/Surfaces/RectangleBounds.hpp"
0016 #include "Acts/Surfaces/Surface.hpp"
0017
0018 #include <memory>
0019 #include <utility>
0020
0021
0022 class G4VPhysicalVolume {};
0023
0024 Acts::GeometryContext tContext;
0025
0026 BOOST_AUTO_TEST_SUITE(Geant4Plugin)
0027
0028 BOOST_AUTO_TEST_CASE(Geant4DetectorElement_construction) {
0029
0030 auto g4physVol = std::make_shared<G4VPhysicalVolume>();
0031
0032
0033 auto rBounds = std::make_shared<Acts::RectangleBounds>(10., 10.);
0034 auto rTransform = Acts::Transform3::Identity();
0035 rTransform.pretranslate(Acts::Vector3(0., 0., 10));
0036 auto rSurface = Acts::Surface::makeShared<Acts::PlaneSurface>(
0037 rTransform, std::move(rBounds));
0038
0039 Acts::Geant4DetectorElement g4DetElement(rSurface, *g4physVol.get(),
0040 rTransform, 0.1);
0041
0042 BOOST_CHECK_EQUAL(g4DetElement.thickness(), 0.1);
0043 BOOST_CHECK_EQUAL(&g4DetElement.surface(), rSurface.get());
0044 BOOST_CHECK_EQUAL(&g4DetElement.g4PhysicalVolume(), g4physVol.get());
0045 BOOST_CHECK(
0046 g4DetElement.transform(tContext).isApprox(rSurface->transform(tContext)));
0047 }
0048
0049 BOOST_AUTO_TEST_SUITE_END()