From b77351dd89540b6804dc61ae398e8c46dc562b50 Mon Sep 17 00:00:00 2001 From: andiwand Date: Fri, 27 Jan 2023 11:00:39 +0100 Subject: [PATCH 1/2] fix g4 material converter --- Plugins/Geant4/src/Geant4Converters.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Plugins/Geant4/src/Geant4Converters.cpp b/Plugins/Geant4/src/Geant4Converters.cpp index ab2e26fa841..03adfe56a0a 100644 --- a/Plugins/Geant4/src/Geant4Converters.cpp +++ b/Plugins/Geant4/src/Geant4Converters.cpp @@ -31,6 +31,8 @@ #include "G4VPhysicalVolume.hh" #include "G4VSolid.hh" +#include + Acts::Transform3 Acts::Geant4AlgebraConverter::transform( const G4ThreeVector& g4Trans) { Transform3 gTransform = Transform3::Identity(); @@ -301,12 +303,14 @@ std::shared_ptr Acts::Geant4MaterialConverter::surfaceMaterial(const G4Material& g4Material, ActsScalar original, ActsScalar compressed) { + assert(g4Material.GetNumberOfElements() == 1); + ActsScalar compression = original / compressed; auto g4X0 = g4Material.GetRadlen(); auto g4L0 = g4Material.GetNuclearInterLength(); auto g4Z = g4Material.GetZ(); - auto g4A = g4Material.GetZ(); + auto g4A = (*g4Material.GetElementVector())[0]->GetN(); auto g4Rho = g4Material.GetDensity(); Material mat = Material::fromMassDensity( From 9a8774edf67eeca78b8d2f1f39db1e63fb547682 Mon Sep 17 00:00:00 2001 From: andiwand Date: Fri, 27 Jan 2023 11:06:18 +0100 Subject: [PATCH 2/2] clang format --- Plugins/Geant4/src/Geant4Converters.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Geant4/src/Geant4Converters.cpp b/Plugins/Geant4/src/Geant4Converters.cpp index 03adfe56a0a..178ddfa095a 100644 --- a/Plugins/Geant4/src/Geant4Converters.cpp +++ b/Plugins/Geant4/src/Geant4Converters.cpp @@ -22,6 +22,8 @@ #include "Acts/Surfaces/TrapezoidBounds.hpp" #include "Acts/Utilities/Helpers.hpp" +#include + #include "G4Box.hh" #include "G4LogicalVolume.hh" #include "G4Material.hh" @@ -31,8 +33,6 @@ #include "G4VPhysicalVolume.hh" #include "G4VSolid.hh" -#include - Acts::Transform3 Acts::Geant4AlgebraConverter::transform( const G4ThreeVector& g4Trans) { Transform3 gTransform = Transform3::Identity();