22 auto track{step->GetTrack()};
24 const auto track_id{track->GetTrackID()};
25 const auto parent{track->GetParentID()};
28 track_parents_[track_id] = parent;
31 auto process{track->GetCreatorProcess()};
32 std::string process_name{process ? process->GetProcessName() :
"Primary"};
34 if (process_name.find(
"biasWrapper") != std::string::npos) {
35 std::size_t pos_ = process_name.find_first_of(
"(") + 1;
36 process_name = process_name.substr(pos_, process_name.size() - pos_ - 1);
43 track_map.isDescendant(
54 const auto particle_name{track->GetParticleDefinition()->GetParticleName()};
57 const auto energy{step->GetPostStepPoint()->GetTotalEnergy()};
60 auto volume{track->GetVolume()};
61 auto volume_name{volume ? volume->GetName() :
"undefined"};
65 auto next_volume_ptr{track->GetNextVolume()};
66 auto next_volume{next_volume_ptr ? next_volume_ptr->GetName() :
"undefined"};
69 G4String region_name{
"undefined"};
71 auto lv{volume->GetLogicalVolume()};
73 auto region{lv->GetRegion()};
75 region_name = region->GetName();
80 std::cout <<
" Step " << track->GetCurrentStepNumber() <<
" ("
81 << track->GetParticleDefinition()->GetParticleName() <<
") {"
82 <<
" Energy: " << energy <<
" Track ID: " << track->GetTrackID()
83 <<
" Particle currently in: " << volume_name
84 <<
" Region: " << region_name <<
" Next volume: " << next_volume
85 <<
" Weight: " << track->GetWeight() <<
" Parent: " << parent
86 <<
" (" << process_name <<
") " <<
" Children:";
87 for (
auto const& child : *(step->GetSecondaryInCurrentStep())) {
88 std::cout <<
" (" << child->GetTotalEnergy()
89 <<
"): " << child->GetParticleDefinition()->GetPDGEncoding();
92 std::cout <<
" }" << std::endl;