PR: Gen Matching Fixes
This PR fixes two issues. We initially thought that when an offline object is not matched to a gen object then, genPartIdx
would be -1. This is still true but, this should not cause the crash that we saw. Because genPart[i][index] with index = -1
will just return the last element. The issue comes from events where the GenPart collection is empty. E.g. for the /DYto2L-2Jets_MLL-10to50_TuneCP5_13p6TeV_amcatnloFXFX-pythia8/Run3Summer22EENanoAODv11-126X_mcRun3_2022_realistic_postEE_v1-v1/NANOAODSIM
dataset, the tt & em channel have empty collections due to no surviving pairs. Therefore, a check is performed to ensure gen information is only added to pairs when there are surviving pairs.
Edited by Klitos Savva