24 auto track{step->GetTrack()};
26 const auto track_id{track->GetTrackID()};
27 const auto parent{track->GetParentID()};
30 track_parents_[track_id] = parent;
33 auto process{track->GetCreatorProcess()};
34 std::string process_name{process ? process->GetProcessName() :
"Primary"};
36 if (process_name.find(
"biasWrapper") != std::string::npos) {
37 std::size_t pos = process_name.find_first_of(
"(") + 1;
38 process_name = process_name.substr(pos, process_name.size() - pos - 1);
45 track_map.isDescendant(
56 const auto particle_name{track->GetParticleDefinition()->GetParticleName()};
59 const auto energy{step->GetPostStepPoint()->GetTotalEnergy()};
62 auto volume{track->GetVolume()};
63 auto volume_name{volume ? volume->GetName() :
"undefined"};
67 auto next_volume_ptr{track->GetNextVolume()};
68 auto next_volume{next_volume_ptr ? next_volume_ptr->GetName() :
"undefined"};
71 G4String region_name{
"undefined"};
73 auto lv{volume->GetLogicalVolume()};
75 auto region{lv->GetRegion()};
77 region_name = region->GetName();
82 std::cout <<
" Step " << track->GetCurrentStepNumber() <<
" ("
83 << track->GetParticleDefinition()->GetParticleName() <<
") {"
84 <<
" Energy: " << energy <<
" Track ID: " << track->GetTrackID()
85 <<
" Particle currently in: " << volume_name
86 <<
" Region: " << region_name <<
" Next volume: " << next_volume
87 <<
" Weight: " << track->GetWeight() <<
" Parent: " << parent
88 <<
" (" << process_name <<
") " <<
" Children:";
89 for (
auto const& child : *(step->GetSecondaryInCurrentStep())) {
90 std::cout <<
" (" << child->GetTotalEnergy()
91 <<
"): " << child->GetParticleDefinition()->GetPDGEncoding();
94 std::cout <<
" }" << std::endl;