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
9 changes: 9 additions & 0 deletions src/InfoMCStructHelper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@ namespace mu2e {
siminfo.pos = XYZVectorF(det->toDetector(sp.startPosition()));
siminfo.endpos = XYZVectorF(det->toDetector(sp.endPosition()));
siminfo.endmom = XYZVectorF(sp.endMomentum());
// Walk the Geant4 parent chain and store every ancestor's SimParticle id
// (immediate parent first, root last). Populated here so every SimInfo
// collection (trkmcsim, calomcsim, primary list) exposes the same
// ancestorSimIds branch consistently.
auto p = sp.parent();
while (p.isNonnull()) {
siminfo.ancestorSimIds.push_back(p->id().asInt());
p = p->parent();
}
}

void InfoMCStructHelper::fillVDInfo(const KalSeed& kseed, const KalSeedMC& kseedmc, std::vector<std::vector<MCStepInfo>>& all_vdinfos) {
Expand Down