From 6064d08f5743a4b3fea8c52b12c41dfbb60a28b4 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Thu, 31 Jan 2019 12:37:45 +0100
Subject: [PATCH] use functionality provided by the CA to move algorithms when
 merging

---
 .../TrigUpgradeTest/python/InDetConfig.py              | 10 ++--------
 .../python/HLTMenuConfig/Menu/MenuComponents.py        |  5 +++++
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
index 692959fdf3e..3311aff346e 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
@@ -441,17 +441,11 @@ def indetInViewRecoCfg( flags, viewMakerName ):
   from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco
   reco = InViewReco( viewMakerName )
   algAcc = TrigInDetConfig( flags, roisKey=reco.inputMaker().InViewRoIs )
-  # TODO fixeme using getEventAlgs CA method
-  # this awkward line will be removed one CA gets appopriate method to get all algorithms  
-  reco.addRecoAlg( algAcc._sequence.getChildren() )
   from AthenaCommon.Constants import DEBUG
   for a in algAcc._sequence.getChildren():
     a.OutputLevel=DEBUG
-    
-  from AthenaCommon.AlgSequence import AthSequencer
-  algAcc._sequence = AthSequencer('AthAlgSeq') # empty the sequence, we need a better API for that
-  reco.merge( algAcc )
-  
+
+  reco.mergeReco( algAcc )  
   return reco
 
   
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
index 39d58c7199c..5c6f65fcc60 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
@@ -528,8 +528,13 @@ class InViewReco( ComponentAccumulator ):
         self.viewMakerAlg.InputMakerInputDecisions += [ inKey ]
         self.viewMakerAlg.InputMakerOutputDecisions += [ outKey ]
 
+    def mergeReco( self, ca ):
+        """ Merged CA movnig reconstruction algorithms into the right sequence """
+        return self.merge( ca, sequenceName=self.viewsSeq.getName() )
+
     def addRecoAlg( self, alg ):
         """Reconstruction alg to be run per view"""
+        log.warning( "InViewReco.addRecoAlgo: consider using mergeReco that takes care of the CA accumulation and moving algorithms" )
         self.addEventAlgo( alg, self.viewsSeq.name() )
 
     def sequence( self ):
-- 
GitLab