From c5c1a0bd82c33e29980c138ede140c28c963ad2e Mon Sep 17 00:00:00 2001
From: James Beacham <j.beacham@cern.ch>
Date: Mon, 8 Jan 2018 19:39:51 +0000
Subject: [PATCH] Merge branch 'feature-checkDoTRTInTracklet' into '21.0'

Fix a potential bug about pixel prd tracklets

See merge request atlas/athena!7452

(cherry picked from commit c2190ce667fbef81b54596b217fa235e52c9e85c [formerly 9adf79eefa6dceb7eb25ea911496275b3b085208])

07dbe00f Fix a potential bug in tracklet reconstruction. Added a check of TRT existence
ef0b36fb Merge remote-tracking branch 'remotes/upstream/21.0' into feature-checkDoTRTInTracklet

Former-commit-id: 32b2d124e19a20704d707414094cf44de8efdb01
---
 .../share/InDetRec_jobOptions.py              | 22 +++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
index 30ca873f083..8b681d6c45d 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
@@ -691,14 +691,15 @@ else:
                                                                  TrackCollectionKeys,
                                                                  TrackCollectionTruthKeys)
 
-      include ("InDetRecExample/ConfiguredNewTrackingTRTExtension.py")
-      InDetPixelTrackingTRTExtension = ConfiguredNewTrackingTRTExtension(InDetNewTrackingCutsPixelPrdAssociation,
-                                                                 InDetKeys.ResolvedPixelPrdAssociationTracks(),
-                                                                 InDetKeys.ExtendedTracksPixelPrdAssociation(),
-                                                                 InDetKeys.ExtendedTracksMapPixelPrdAssociation(),
-                                                                 TrackCollectionKeys,
-                                                                 TrackCollectionTruthKeys,
-                                                                 False)
+      if InDetFlags.doTRTExtension() :
+        include ("InDetRecExample/ConfiguredNewTrackingTRTExtension.py")
+        InDetPixelTrackingTRTExtension = ConfiguredNewTrackingTRTExtension(InDetNewTrackingCutsPixelPrdAssociation,
+                                                                   InDetKeys.ResolvedPixelPrdAssociationTracks(),
+                                                                   InDetKeys.ExtendedTracksPixelPrdAssociation(),
+                                                                   InDetKeys.ExtendedTracksMapPixelPrdAssociation(),
+                                                                   TrackCollectionKeys,
+                                                                   TrackCollectionTruthKeys,
+                                                                   False)
 
     # ------------------------------------------------------------
     #
@@ -1063,7 +1064,10 @@ else:
       # Dummy Merger to fill additional info for PRD-associated pixel tracklets
       if InDetFlags.doTrackSegmentsPixelPrdAssociation():
        DummyCollection = []
-       DummyCollection += [ InDetKeys.ExtendedTracksPixelPrdAssociation()]
+       if InDetFlags.doTRTExtension() :
+         DummyCollection += [ InDetKeys.ExtendedTracksPixelPrdAssociation()]
+       else :
+         DummyCollection += [ InDetKeys.ResolvedPixelPrdAssociationTracks()]
        TrkTrackCollectionMerger_pix = Trk__TrackCollectionMerger(name                    = "InDetTrackCollectionMerger_pix",
                                                                  TracksLocation          = DummyCollection,
                                                                  OutputTracksLocation    = InDetKeys.PixelPrdAssociationTracks(),
-- 
GitLab