Provide a way to associate MCParticles between generator and G4 steps
Feature would greatly facilitate selection of MC truth of interesting particles which are distinguishable at the generator step, but the distinction is lost at G4 step. E.g. in ProtoDUNE we use two process names in the generator of beam particles: "primary" and "primaryBackground"; process name is changed for these particles to "primary" by G4 step, in http://nusoft.fnal.gov/larsoft/doxsvn/html/ParticleListAction_8cxx_source.html (around line 148), and finding the interesting particles become complicated (comparison of momenta etc).
For ProtoDUNE purposes it would be enough to propagate the process name from the generator, but Gianluca says it may break users codes.
More generic solution suggested by Gianluca would be to add a data product allowing for an association of particles at both ends. I believe that with a helper class it can be implemented in such a way that user is accessing product(s) created by G4 only and does not need to know what are the genrators.
Another option could be to encode the information in MCParticle.
#4 Updated by Jason Stock about 3 years ago
So, I would have two things to contribute immediately.
First, I think that G4's assumption that the process name for all primaries should be "primary" is a bad one. It has always bothered me that we stomp on the process name.
Second, unfortunately there are multiple spots in the code the expect the process name of all "primaries" to be "primary". It would not be trivial to change.
Now let me ask a couple questions.
First, if I understand correctly, what you need is a way to say PreG4 MCParticle X is the same as PostG4 MCParticle Y, right?
Second. I am in the middle of a redesign of the backtracker, and as the first step I have factored out all functions that deal only with generation and g4 results in to a new service called the ParticleInventory (available as feature/JStock_ParticleInventory). Could some of those relationships do what you are asking about?
#7 Updated by Gianluca Petrillo almost 3 years ago
I have chosen the approach of saving the index of the primary particle in the metadata of the
The underlying information is lost in the translation from
simb::MCTruth into Geant4.
Feature request #18716 is open to relay the missing information.
#9 Updated by Jason Stock over 2 years ago
I am pinging this ticket to ask about what information we may want functionality we may want to add to the ParticleInventory to utilize this new information Gianluca is adding to the MCParticle/MCTruth Association. I plan on doing some code maintenance soon (Mostly adding/updating documentation), and could add a couple new functions if helpful.