History of MCTrack objects can be discontinuous
The issue
The way we currently follow track creation and MCParticles relies on them interacting in the sensitive volume of your detector in order to be registered (registering is done in SensitiveDetectorAction::ProcessHits()
only). Now the problem appears when we have interactions and particle creation outside a sensitive volume:
If particle A interacts with detector 1, then creates a secondary, particle B, in some support material (e.g. ASIC), which in turn creates particle C, and we only see particle C in detector 2 we have a problem: we will only see particle A and particle C within the sensors but particle B is lost. Therefore also the relation C -> B -> A is lost and C suddenly has no parent despite not originating from the world volume.
Also see https://allpix-squared-forum.web.cern.ch/t/definition-of-primaries/121 for one instance of this issue appearing.
The past
This has been discussed while implementing the MCTrack
code in 2018: !125 (merged)
Possible solutions
@kwolters made a comment here !125 (comment 1217233) about a possibility to do this through the tracking manager's secondaries information. Need to investigate.