From 38c6bfaa6f014c3af2b1e5219c383cf36483c9c3 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Tue, 21 Nov 2023 16:05:47 -0600 Subject: [PATCH] Add index leaf to allow navigation to sub-ranked genealogy sim info. Allow matching multiple sim particles by default --- fcl/prolog.fcl | 4 +++- inc/SimInfo.hh | 1 + src/InfoMCStructHelper.cc | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fcl/prolog.fcl b/fcl/prolog.fcl index 9d072e8..cd1ca37 100644 --- a/fcl/prolog.fcl +++ b/fcl/prolog.fcl @@ -97,13 +97,15 @@ dioLLWeight : { } genCountLogger: { module_type: GenEventCountReader } -AllOpt : { fillMC : true +AllOpt : { + fillMC : true trkqual : "TrkQual" fillTrkQual : true trkpid : "TrkPID" fillTrkPID : true fillHits : true genealogyDepth : -1 + matchDepth : -1 } DeM : { input : "KK" diff --git a/inc/SimInfo.hh b/inc/SimInfo.hh index 3124be7..0615e42 100644 --- a/inc/SimInfo.hh +++ b/inc/SimInfo.hh @@ -20,6 +20,7 @@ namespace mu2e Int_t proc = -1; // process code Int_t gen = -1; // generator code Float_t time = -1.0; // Origin time of the SimParticle + Int_t index; // index into the SimInfo vector XYZVectorF mom = XYZVectorF(); // origin momentumof the SimParticle XYZVectorF pos = XYZVectorF(); // origin position of the SimParticle MCRelationship prirel = MCRelationship::none; // relationship to the event primary particles diff --git a/src/InfoMCStructHelper.cc b/src/InfoMCStructHelper.cc index e76d3a4..8159644 100644 --- a/src/InfoMCStructHelper.cc +++ b/src/InfoMCStructHelper.cc @@ -160,7 +160,8 @@ namespace mu2e { sim_info.nhits = kseedmc.simParticle(imatch)._nhits; sim_info.nactive = kseedmc.simParticle(imatch)._nactive; } - + // record the index this object will have + sim_info.index = siminfos.size(); siminfos.push_back(sim_info); if (current_sim_particle.parent().isNonnull()) { current_sim_particle_ptr = current_sim_particle.parent(); @@ -189,6 +190,7 @@ namespace mu2e { auto trkprimaryptr = kseedmc.simParticle().simParticle(_spcH); sim_info.trkrel = MCRelationship(spp, trkprimaryptr); sim_info.prirel = MCRelationship(spp, spp); + sim_info.index = siminfos.size(); siminfos.push_back(sim_info); } }