Skip to content

Commit

Permalink
refactor: set convertMaterial as configurable (acts-project#3604)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
galocco authored Oct 7, 2024
1 parent c96fe38 commit 26a4a8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Examples/Python/src/Geant4Component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ PYBIND11_MODULE(ActsPythonBindingsGeant4, mod) {
const std::vector<std::string>&
sensitiveMatches,
const std::vector<std::string>&
passiveMatches) {
passiveMatches,
bool convertMaterial) {
// Initiate the detector construction & retrieve world
ActsExamples::GdmlDetectorConstruction gdmlContruction(gdmlFileName);
const auto* world = gdmlContruction.Construct();
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26a4a8f

Please sign in to comment.