Skip to content

Commit

Permalink
fix: G4 material converter (#1803)
Browse files Browse the repository at this point in the history
nucleus charge VS effective mass

somehow there is no nice solution to get the relative atomic mass in G4 so I had to go through the element class
  • Loading branch information
andiwand committed Jan 27, 2023
1 parent 78defc3 commit 8fc8c0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Plugins/Geant4/src/Geant4Converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "Acts/Surfaces/TrapezoidBounds.hpp"
#include "Acts/Utilities/Helpers.hpp"

#include <cassert>

#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4Material.hh"
Expand Down Expand Up @@ -301,12 +303,14 @@ std::shared_ptr<Acts::HomogeneousSurfaceMaterial>
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(
Expand Down

0 comments on commit 8fc8c0a

Please sign in to comment.