Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions inc/SimInfo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace mu2e
XYZVectorF endpos = XYZVectorF(); // end position of the SimParticle [mm, in detector coords]
MCRelationship prirel = MCRelationship(); // relationship to the event primary particles
MCRelationship trkrel = MCRelationship(); // relationship to the particle that created hits in the track
std::vector<int> ancestorSimIds; // full parent chain: [parentId, grandparentId, ..., rootId]
void reset() { *this = SimInfo(); }
};
}
Expand Down
6 changes: 6 additions & 0 deletions src/InfoMCStructHelper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,12 @@ namespace mu2e {
SimInfo siminfo;
fillSimInfo(edep.sim(), siminfo);
siminfo.index = csis.size();
// Walk the Geant4 parent chain and store all ancestor SimParticle IDs
auto currentPtr = edep.sim();
while (currentPtr->hasParent()) {
currentPtr = currentPtr->parent();
siminfo.ancestorSimIds.push_back(currentPtr->id().asInt());
}
csis.push_back(siminfo);
}
}
Expand Down