From 26a4a8ff14813b43f3f36fceebee5fc8fdabe8c9 Mon Sep 17 00:00:00 2001 From: Giacomo Alocco <40990466+galocco@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:50:59 +0200 Subject: [PATCH] refactor: set convertMaterial as configurable (#3604) The default value of convertMaterial is false to allow the conversion of all materials (not only primitives). convertMaterial can now be set in the createSurface python binding. --- Examples/Python/src/Geant4Component.cpp | 4 +++- .../Acts/Plugins/Geant4/Geant4DetectorSurfaceFactory.hpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Examples/Python/src/Geant4Component.cpp b/Examples/Python/src/Geant4Component.cpp index 14e7b138888..ff34da94cc0 100644 --- a/Examples/Python/src/Geant4Component.cpp +++ b/Examples/Python/src/Geant4Component.cpp @@ -334,7 +334,8 @@ PYBIND11_MODULE(ActsPythonBindingsGeant4, mod) { const std::vector& sensitiveMatches, const std::vector& - passiveMatches) { + passiveMatches, + bool convertMaterial) { // Initiate the detector construction & retrieve world ActsExamples::GdmlDetectorConstruction gdmlContruction(gdmlFileName); const auto* world = gdmlContruction.Construct(); @@ -351,6 +352,7 @@ PYBIND11_MODULE(ActsPythonBindingsGeant4, mod) { Acts::Geant4DetectorSurfaceFactory::Options options; options.sensitiveSurfaceSelector = sensitiveSelectors; options.passiveSurfaceSelector = passiveSelectors; + options.convertMaterial = convertMaterial; G4Transform3D nominal; Acts::Geant4DetectorSurfaceFactory factory; diff --git a/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4DetectorSurfaceFactory.hpp b/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4DetectorSurfaceFactory.hpp index fae8fc20fea..d06c77412e4 100644 --- a/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4DetectorSurfaceFactory.hpp +++ b/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4DetectorSurfaceFactory.hpp @@ -67,7 +67,7 @@ class Geant4DetectorSurfaceFactory { /// Convert the length scale ActsScalar scaleConversion = 1.; /// Convert the material - bool convertMaterial = true; + bool convertMaterial = false; /// Converted material thickness (< 0 indicates keeping original thickness) ActsScalar convertedMaterialThickness = -1; /// A selector for sensitive surfaces