53 double depe = thisStep->GetTotalEnergyDeposit();
55 if (digitization_routine->decisionToSkipHit(depe, thisStep)) {
return true; }
58 if (gHitsCollection ==
nullptr) {
log->error(
ERR_NOCOLLECTION,
"No hit collection found"); }
62 std::vector<std::shared_ptr<GTouchable>> thisStepProcessedTouchables =
63 digitization_routine->processTouchable(getGTouchable(thisStep), thisStep);
65 auto hcsize = gHitsCollection->GetSize();
68 " with ", std::to_string(thisStepProcessedTouchables.size()),
" touchable(s), edep: ",
69 std::to_string(depe),
", Hit collection size: ", hcsize);
71 for (
auto thisGTouchable : thisStepProcessedTouchables) {
73 thisGTouchable->assignTrackId(thisStep->GetTrack()->GetTrackID());
74 thisGTouchable->assignPId(thisStep->GetTrack()->GetDefinition()->GetPDGEncoding());
78 auto [it, isNewCell] = hitsByCellKey.try_emplace(thisGTouchable->cellKey(),
nullptr);
80 log->info(2,
" ✅ new GTouchable for ", GetName(),
": ", thisGTouchable->getIdentityString());
81 it->second =
new GHit(thisGTouchable, thisStep);
82 gHitsCollection->insert(it->second);
85 log->info(2,
" ❌ existing GTouchable for ", GetName(),
": ", thisGTouchable->getIdentityString());
86 it->second->addHitInfos(thisStep);
92 if (digitization_routine->shouldStopTrackAfterHit(thisStep)) {
93 thisStep->GetTrack()->SetTrackStatus(fStopAndKill);