Issue with background category and probably missing relations

My analysis production had FatalGaudiErrors in a few LFNs, see lhcb-datapkg/AnalysisProductions#1313 (closed) .

Investigating on those problematic LFNs, DaVinci fails at event 3096, and the following error message appears :

    Found 4 FATAL message(s)
        * 1 instances of "BackgroundCategory:: Exception throw: Something went wrong in the MCParticle tree, please report the bug. StatusCode=FAILURE"
        * 1 instances of "Event failed in Node FunTupleBase_Particles/Rho_Tuple_Displaced"
        * 1 instances of "Event 3063 on slot 0 failed!"
        * 1 instances of "*** Too many consecutive failures 1, stopping now ***"
    Found 3 ERROR message(s)
        * 1 instances of ": MCTruthAndBkgCat_functor_Displaced.DaVinciSmartAssociator.BackgroundCategory:: Something went wrong in the MCParticle tree, please report the bug."
        * 1 instances of "Maximum number of errors ( 'ErrorMax':1) reached."
        * 1 instances of "Application Manager Terminated with error code 3"

Using this particular option, the AP test is not longer stopped, and it runs over all the events :

ApplicationMgr                         INFO Application Manager Finalized successfully
ApplicationMgr                         INFO Application Manager Terminated successfully
Summary of log messages:
    Found 204 ERROR message(s)
        * 204 instances of "CaloFuture2MCTool::addCluster -- no longer available"
    Found 92 WARNING message(s)
        * 22 instances of "BackgroundCategory:: The Cat found a common MC mother but it has no daughters!You may be trying to process an input file which does notcontain the necessary information, returning Undefined. StatusCode=FAILURE"
        * 22 instances of "BackgroundCategory:: Common MC mother has empty daughters array, returning Undefined StatusCode=FAILURE"
        * 12 instances of "CaloFuture2MCTool:: The WARNING message is suppressed : 'No Hypo2MC link at '/Event/HLT2/Rec/Calo/Photons' '"
        * 12 instances of "CaloFuture2MCTool:: The WARNING message is suppressed : ' ... try using Hypo->Cluster reference  '"
        * 12 instances of "CaloFuture2MCTool:: The WARNING message is suppressed : ' ... CaloFutureCluster  will be re-processed (require full DST)'"
        * 12 instances of "CaloFuture2MCTool:: The WARNING message is suppressed : ' ... assume an identical reconstruction version  '"

In this output file, the background category of the \pi^0 in the \pi^0 \to e^+e^-\gamma decay is now always 60 with the new neutral association (right plot). For the first test (redo_neutral_assoc = False), an output file including the events before the problematic event is created. The background categories of the \pi^0 look reasonable.

ISSUE also in mattermost: https://mattermost.web.cern.ch/lhcb/pl/q4brfao3d7rtib4zutshct9gmc .