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 2,
"%1 for %2 with %3 touchable(s), edep: %4, Hit collection size: %5",
FUNCTION_NAME, GetName(),
69 std::to_string(thisStepProcessedTouchables.size()), std::to_string(depe), 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 %1: %2", GetName(), thisGTouchable->getIdentityString());
81 it->second =
new GHit(thisGTouchable, thisStep);
82 gHitsCollection->insert(it->second);
85 log->info(2,
" ❌ existing GTouchable for %1: %2", GetName(), thisGTouchable->getIdentityString());
86 it->second->addHitInfos(thisStep);
92 if (digitization_routine->shouldStopTrackAfterHit(thisStep)) {
93 thisStep->GetTrack()->SetTrackStatus(fStopAndKill);