15 #include <G4Material.hh>
18 using namespace ActsExamples;
28 throw std::logic_error(
29 "Attempted to duplicate the SteppingAction singleton");
41 G4Material*
material = step->GetPreStepPoint()->GetMaterial();
43 if (material && material->GetName() !=
"Vacuum" &&
44 material->GetName() !=
"Air") {
47 double L0 = (material->GetNuclearInterLength() /
CLHEP::mm) *
49 double rho = (material->GetDensity() / (CLHEP::gram /
CLHEP::mm3)) *
53 const G4ElementVector* elements = material->GetElementVector();
54 const G4double* fraction = material->GetFractionVector();
55 size_t nElements = material->GetNumberOfElements();
59 Ar = material->GetA() / (CLHEP::gram / CLHEP::mole);
62 for (
size_t i = 0; i < nElements; i++) {
64 elements->at(i)->GetA() * fraction[i] / (CLHEP::gram / CLHEP::mole);
65 Z += elements->at(i)->GetZ() * fraction[i];
85 const auto& rawPos = step->GetPreStepPoint()->GetPosition();
86 const auto& rawDir = step->GetPreStepPoint()->GetMomentum();