DUNE / ND_CAFMaker

Code for making CAFs from ND inputs (whether 2x2+MINERvA prototype or full ND simulation)
Apache License 2.0
1 stars 11 forks source link

TruthMatcher matches secondary trajectories in MLNDLArRecoBranchFiller #33

Closed noeroy closed 10 months ago

noeroy commented 10 months ago

In MLNDLArRecoBranchFiller.cxx, line 515, srTruePart = &truthMatch->GetTrueParticle(sr, srTrueInt, srPartCmp, true, false); doesn't find the True primary associated to the trajectory, so a secondary trajectory is created instead of doing the matching.

This seems to be due to the track_id variable in MLReco h5 file that links to a unique ID of the trajectory and not the initial Genie ID (this is called traj_id in that wiki contrary to local_traj_id that should correspond to the initial Genie ID). This ID is not unique per Edepsim file, as several Genie files are merged per Edepsim fiile and each of them have independent trajectory ID.

I think we would either need a map linking the unique ID to the original Genie trajectory IDs, a way to pass through the Genie ID inside MLReco or a way to rebuild this unique ID in the NDCafMaker.

Note: In MINERvA Reco we do not have access to that unique ID, we internally work with one unique id that we build ourselves that is not used in the truth Matching of the CAFMaking afterwards.

chenel commented 10 months ago

After some discussion with François, we came to the conclusion that the only real viable path forward is to make

a way to pass through the Genie ID inside MLReco

This is not super hard, but will require some more plumbing...

chenel commented 10 months ago

This seems to do the trick. If @noeroy can confirm, we'll merge and consider this fixed.