9 #include <boost/test/unit_test.hpp>
18 #include "G4LogicalVolume.hh"
19 #include "G4PVPlacement.hh"
20 #include "G4RotationMatrix.hh"
21 #include "G4SystemOfUnits.hh"
22 #include "G4ThreeVector.hh"
23 #include "G4Transform3D.hh"
28 BOOST_AUTO_TEST_SUITE(Geant4Plugin)
31 G4Box* worldS =
new G4Box(
"world", 100, 100, 100);
33 G4LogicalVolume* worldLV =
new G4LogicalVolume(worldS,
nullptr,
"World");
35 G4Box* boxS =
new G4Box(
"box", 10, 20, 20);
36 G4LogicalVolume* boxLV =
new G4LogicalVolume(boxS,
nullptr,
"World");
38 "Box", worldLV,
false, 0,
true);
44 std::make_shared<Acts::Geant4PhysicalVolumeSelectors::NameSelector>(
45 std::vector<std::string>{
"ox"},
false);
52 factory.
construct(cache, nominal, *boxPV, options);
54 BOOST_CHECK_EQUAL(cache.sensitiveSurfaces.size(), 1
u);
55 BOOST_CHECK_EQUAL(cache.passiveSurfaces.size(), 0
u);
58 BOOST_CHECK(
surface->type() == Acts::Surface::SurfaceType::Plane);
62 G4Box* worldS =
new G4Box(
"world", 1000, 1000, 1000);
64 G4LogicalVolume* worldLV =
new G4LogicalVolume(worldS,
nullptr,
"World");
67 new G4Tubs(
"cylinder", 99, 100, 100, -M_PI * CLHEP::radian,
68 2 * M_PI * CLHEP::radian);
70 G4LogicalVolume* cylinderLV =
71 new G4LogicalVolume(cylinderS,
nullptr,
"World");
73 new G4PVPlacement(
nullptr, G4ThreeVector(), cylinderLV,
"Cylinder",
74 worldLV,
false, 0,
true);
80 std::make_shared<Acts::Geant4PhysicalVolumeSelectors::NameSelector>(
81 std::vector<std::string>{
"yl"},
false);
88 factory.
construct(cache, nominal, *cylinderPV, options);
90 BOOST_CHECK_EQUAL(cache.sensitiveSurfaces.size(), 1
u);
91 BOOST_CHECK_EQUAL(cache.passiveSurfaces.size(), 0
u);
94 BOOST_CHECK(
surface->type() == Acts::Surface::SurfaceType::Cylinder);
97 BOOST_AUTO_TEST_SUITE_END()