Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gemc/gsd/gsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ class GSensitiveDetector : public GBase<GSensitiveDetector>, public G4VSensitive
std::string vname = thisStep->GetPreStepPoint()->GetTouchable()->GetVolume()->GetName();

auto it = gTouchableMap.find(vname);
if (it != gTouchableMap.end()) { return it->second; }
// Return a per-step copy: ProcessHits and processTouchable mutate trackId, pid and the
// time-cell index, so the registry entry must stay pristine across steps and events.
if (it != gTouchableMap.end()) { return std::make_shared<GTouchable>(*it->second); }
// If not found, log an error. The calling code assumes a valid pointer.
log->error(ERR_DYNAMICPLUGINNOTFOUND, "GTouchable for volume " + vname + " not found in gTouchableMap");
}
Expand Down