File indexing completed on 2025-12-16 09:25:33
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/Surfaces/PlaneSurface.hpp"
0014 #include "Acts/Surfaces/RectangleBounds.hpp"
0015 #include "Acts/Surfaces/Surface.hpp"
0016 #include "ActsPlugins/Geant4/Geant4DetectorElement.hpp"
0017
0018 #include <memory>
0019 #include <utility>
0020
0021 using namespace Acts;
0022 using namespace ActsPlugins;
0023
0024
0025 class G4VPhysicalVolume {};
0026
0027 GeometryContext tContext;
0028
0029 namespace ActsTests {
0030
0031 BOOST_AUTO_TEST_SUITE(Geant4Suite)
0032
0033 BOOST_AUTO_TEST_CASE(Geant4DetectorElement_construction) {
0034
0035 auto g4physVol = std::make_shared<G4VPhysicalVolume>();
0036
0037
0038 auto rBounds = std::make_shared<RectangleBounds>(10., 10.);
0039 auto rTransform = Transform3::Identity();
0040 rTransform.pretranslate(Vector3(0., 0., 10));
0041 auto rSurface =
0042 Surface::makeShared<PlaneSurface>(rTransform, std::move(rBounds));
0043
0044 Geant4DetectorElement g4DetElement(rSurface, *g4physVol, rTransform, 0.1);
0045
0046 BOOST_CHECK_EQUAL(g4DetElement.thickness(), 0.1);
0047 BOOST_CHECK_EQUAL(&g4DetElement.surface(), rSurface.get());
0048 BOOST_CHECK_EQUAL(&g4DetElement.g4PhysicalVolume(), g4physVol.get());
0049 BOOST_CHECK(
0050 g4DetElement.transform(tContext).isApprox(rSurface->transform(tContext)));
0051 }
0052
0053 BOOST_AUTO_TEST_SUITE_END()
0054
0055 }