[Common] Fix matching to MC for daughters interacting with material #9391
+23
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Together with @mfaggin we realised that whenever a daughter particle (i.e. pion or kaon from a D0 decay) interacts with the material, the particle id changes and in particular another particle with same pdg of the original one is produced by GEANT, and it is set as daughter of the original mother. This can happen several times, due to several interactions with material.
When this happens,
getMatchedMCRec
does not match correctly the signals, since the track can be associated to the particle from material and not the original daughter:To overcome this issue, I added a functionality similar to the one added by @Luca610 for the decays into muons, with the only difference that it searches the mothers iteratively, since multiple interactions might have happen.
The effect is anyway very small (< 1%) in case global tracks are required, since often if the particle interacts with material, there are two track segments reconstructed (only one of the two having hits in the ITS IB, i.e. the one produced by decay itself) or only a track for the particle produced by the material that has no ITS IB hit most of the times.
However, if no global track requirement is applied to the daughters (which might be in case of non-HF decays) the fraction is very high (in the case of the D0, about 25% of the D0 have at least a daughter that interacted with material), so the fraction of non matched signals becomes also very high.
@vkucera could you please have a look to check if it's good for you? If it's the case, I would ask @ddobrigk to merge this so that I will include it in the HF code. Thanks!