From cd595470b4a00a5df5e192fbf8453e0d5e7b1d55 Mon Sep 17 00:00:00 2001
From: Maarten Van Veghel <maarten.vanveghel@cern.ch>
Date: Wed, 17 May 2023 17:30:53 +0200
Subject: [PATCH] fix calo hypo persistency in protop building

---
 .../RecoConf/calorimeter_reconstruction.py    | 19 +++++++++++++------
 .../python/RecoConf/protoparticles.py         |  2 ++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/Hlt/RecoConf/python/RecoConf/calorimeter_reconstruction.py b/Hlt/RecoConf/python/RecoConf/calorimeter_reconstruction.py
index 469dc17928d..004d02ea2f4 100644
--- a/Hlt/RecoConf/python/RecoConf/calorimeter_reconstruction.py
+++ b/Hlt/RecoConf/python/RecoConf/calorimeter_reconstruction.py
@@ -508,7 +508,7 @@ def make_calo(tracks,
     old_ecalClusters = old_ecal.OutputClusters
     old_ecalDigits = old_ecal.OutputDigits
 
-    old_photons = HypoConverter(
+    photon_converter = HypoConverter(
         InputHypos=photons,
         InputClusters=old_ecalClusters,
         ExtraInputs=[old_ecalDigits],
@@ -516,9 +516,11 @@ def make_calo(tracks,
             'OutputHypos': persisted_location('CaloPhotons'),
             'OutputTable': None,
         },
-    ).OutputHypos
+    )
+    old_photons_hypos = photon_converter.OutputHypos
+    old_photons_relations = photon_converter.OutputTable
 
-    old_electrons = HypoConverter(
+    electrons_converter = HypoConverter(
         InputHypos=electrons,
         InputClusters=old_ecalClusters,
         ExtraInputs=[old_ecalDigits],
@@ -526,7 +528,10 @@ def make_calo(tracks,
             'OutputHypos': persisted_location('CaloElectrons'),
             'OutputTable': None,
         },
-    ).OutputHypos
+    )
+    old_electrons_hypos = electrons_converter.OutputHypos
+    old_electrons_relations = electrons_converter.OutputTable
+
     old_ecalSplit = ClusterConverter(InputClusters=ecalSplitClusters)
     old_ecalSplitClusters = old_ecalSplit.OutputClusters
     old_ecalSplitDigits = old_ecalSplit.OutputDigits
@@ -553,8 +558,10 @@ def make_calo(tracks,
         "ecalSplitClusters": ecalSplitClusters,
         "v1_chargedpids": calopids_v1["chargedpids"],
         "v1_breminfos": calopids_v1["breminfos"],
-        "v1_photons": old_photons,
-        "v1_electrons": old_electrons,
+        "v1_photons": old_photons_hypos,
+        "v1_photons_relations": old_photons_relations,
+        "v1_electrons": old_electrons_hypos,
+        "v1_electrons_relations": old_electrons_relations,
         "v1_mergedPi0s": old_mergedPi0s,
         "v1_splitPhotons": old_splitPhotons,
         "v2_chargedpids": calopids_v3["chargedpids"],
diff --git a/Hlt/RecoConf/python/RecoConf/protoparticles.py b/Hlt/RecoConf/python/RecoConf/protoparticles.py
index 827abc1917e..a7316267606 100644
--- a/Hlt/RecoConf/python/RecoConf/protoparticles.py
+++ b/Hlt/RecoConf/python/RecoConf/protoparticles.py
@@ -137,6 +137,7 @@ def make_charged_protoparticles(tracks,
                     for tt in calo_pids["v1_chargedpids"].keys()
                     if tt in accepted_types["calo"]
                 ],
+                CaloHypo2IDTable=calo_pids["v1_electrons_relations"],
             ),
             ChargedProtoParticleAddHcalInfo(
                 name='addHcalInfo',
@@ -153,6 +154,7 @@ def make_charged_protoparticles(tracks,
                     for tt in calo_pids["v1_chargedpids"].keys()
                     if tt in accepted_types["brem"]
                 ],
+                CaloHypo2IDTable=calo_pids["v1_photons_relations"],
             ),
         ]
 
-- 
GitLab