diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXFexConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXFexConfig.py
index f53a76aec22254e21323a0dc756a9b3619b39417..8754b10dd60e042354b20f0a5b93f8678deec09e 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXFexConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXFexConfig.py
@@ -204,16 +204,6 @@ class EFBMuMuXFex_allModes (EFBMuMuXFex_1):
         self.AthenaMonTools = [ validation, online, time ]
 
 
-class EFBMuMuXFex_FTK (EFBMuMuXFex_1):
-    __slots__ = []
-    def __init__(self, name = "EFBMuMuXFex_FTK"):
-        EFBMuMuXFex_1.__init__(self, name )
-        
-        # FTK
-        self.DoFTK = True
-        self.TrackCollection = "InDetTrigTrackingxAODCnv_BeamSpot_FTK"
-        
-
 
 class EFBMuMuXFex_allModes_tightBc (EFBMuMuXFex_allModes):
     __slots__ = []
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXHypoConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXHypoConfig.py
index 8784be00206c211493bffe3d5985b6dee134f113..949f046e76ab4332153bed5ab2b3538beff97e1c 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigEFBMuMuXHypoConfig.py
@@ -90,12 +90,6 @@ class EFBMuMuXHypo_allModes (EFBMuMuXHypo_1):
         self.AcceptLb = True
         self.AcceptBc = True
         
-class EFBMuMuXHypo_FTK (EFBMuMuXHypo_1):
-    __slots__ = []
-    def __init__(self, name = "EFBMuMuXHypo_FTK"):
-        EFBMuMuXHypo_1.__init__(self, name )
-
-        
 class EFBMuMuXHypo_allModes_tightBc (EFBMuMuXHypo_allModes):
     __slots__ = []
     def __init__(self, name = "EFBMuMuXHypo_allModes_tightBc"):
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassFexConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassFexConfig.py
deleted file mode 100644
index 7b395b99b5cf9da58c281627edf3e2fce6412649..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassFexConfig.py
+++ /dev/null
@@ -1,304 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from TrigBphysHypo.TrigBphysHypoConf import TrigL2TrkMassFex
-from TrigVertexFitter.TrigVertexFitterConf import TrigL2VertexFitter
-from TrigVertexFitter.TrigVertexFitterConf import TrigVertexFitter
-from TrigVertexFitter.TrigVertexFitterConf import TrigVertexingTool
-
-L2VFitTool = TrigL2VertexFitter()
-VFitTool = TrigVertexFitter()
-VertexTool = TrigVertexingTool()
-
-from __main__ import ToolSvc
-
-ToolSvc += L2VFitTool
-ToolSvc += VFitTool
-ToolSvc += VertexTool
-
-
-# basic cut
-class L2TrkMassFex_Jpsimumu (TrigL2TrkMassFex):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu"):
-        super( TrigL2TrkMassFex, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        # L2 TrkMass cuts
-        self.TrackPTthr          = 4000
-        self.dEtaTrackRoI        = 0.1
-        self.dPhiTrackRoI        = 0.1
-        self.Mass_low_cut        = 2850.
-        self.Mass_high_cut       = 3350.
-        self.doVertexFit         = True
-        self.DaughterMass        = 105.658357
-        self.TrigL2VertexFitter = L2VFitTool
-        self.TrigVertexFitter = VFitTool
-        self.TrigVertexingTool = VertexTool
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexValidationMonitoring_RoI
-        validation = TrigL2TrkMassFexValidationMonitoring_RoI()
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexOnlineMonitoring_RoI
-        online = TrigL2TrkMassFexOnlineMonitoring_RoI()
-        
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-                
-        self.AthenaMonTools = [ validation, online, time ]
-
-# pass all
-class L2TrkMassFex_Jpsimumu_passL2 (L2TrkMassFex_Jpsimumu):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_passL2"):
-        super( L2TrkMassFex_Jpsimumu_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# loose cut
-class L2TrkMassFex_Jpsimumu_loose (TrigL2TrkMassFex):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_loose"):
-        super( TrigL2TrkMassFex, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        # L2 TrkMass cuts
-        self.OppositeCharge = False
-        self.TrackPTthr          = 3500
-        self.dEtaTrackRoI        = 0.1
-        self.dPhiTrackRoI        = 0.1
-        self.Mass_low_cut        = 2600.
-        self.Mass_high_cut       = 3600.
-        self.doVertexFit         = True
-        self.DaughterMass        = 105.658357
-        self.TrigL2VertexFitter = L2VFitTool
-        self.TrigVertexFitter = VFitTool
-        self.TrigVertexingTool = VertexTool
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexValidationMonitoring_RoI
-        validation = TrigL2TrkMassFexValidationMonitoring_RoI()
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexOnlineMonitoring_RoI
-        online = TrigL2TrkMassFexOnlineMonitoring_RoI()
-        
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-                
-        self.AthenaMonTools = [ validation, online, time ]
-
-
-# pass all
-class L2TrkMassFex_Jpsimumu_loose_passL2 (L2TrkMassFex_Jpsimumu_loose):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_loose_passL2"):
-        super( L2TrkMassFex_Jpsimumu_loose_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# looser cut
-class L2TrkMassFex_Jpsimumu_looser (TrigL2TrkMassFex):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_looser"):
-        super( TrigL2TrkMassFex, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        # L2 TrkMass cuts
-        self.OppositeCharge = False
-        self.TrackPTthr          = 2000.
-        self.dEtaTrackRoI        = 0.1
-        self.dPhiTrackRoI        = 0.1
-        self.Mass_low_cut        = 2600.
-        self.Mass_high_cut       = 3600.
-        self.doVertexFit         = True
-        self.DaughterMass        = 105.658357
-        self.TrigL2VertexFitter = L2VFitTool
-        self.TrigVertexFitter = VFitTool
-        self.TrigVertexingTool = VertexTool
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexValidationMonitoring_RoI
-        validation = TrigL2TrkMassFexValidationMonitoring_RoI()
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexOnlineMonitoring_RoI
-        online = TrigL2TrkMassFexOnlineMonitoring_RoI()
-        
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-                
-        self.AthenaMonTools = [ validation, online, time ]
-
-
-# pass all
-class L2TrkMassFex_Jpsimumu_looser_passL2 (L2TrkMassFex_Jpsimumu_looser):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_looser_passL2"):
-        super( L2TrkMassFex_Jpsimumu_looser_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# basic cut
-class L2TrkMassFex_Jpsimumu_FS (TrigL2TrkMassFex):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_FS"):
-        super( TrigL2TrkMassFex, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        # L2 TrkMass cuts
-        self.TrackPTthr          = 4000
-        self.dEtaTrackRoI        = 0.1
-        self.dPhiTrackRoI        = 0.1
-        self.Mass_low_cut        = 2850.
-        self.Mass_high_cut       = 3350.
-        self.DaughterMass        = 105.658357
-        self.doVertexFit         = True
-        self.TrigL2VertexFitter = L2VFitTool
-        self.TrigVertexFitter = VFitTool
-        self.TrigVertexingTool = VertexTool
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexValidationMonitoring_FS
-        validation = TrigL2TrkMassFexValidationMonitoring_FS()
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexOnlineMonitoring_FS
-        online = TrigL2TrkMassFexOnlineMonitoring_FS()
-        
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-                
-        self.AthenaMonTools = [ validation, online, time ]
-
-
-# pass all
-class L2TrkMassFex_Jpsimumu_FS_passL2 (L2TrkMassFex_Jpsimumu_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_FS_passL2"):
-        super( L2TrkMassFex_Jpsimumu_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# FS loose cut
-class L2TrkMassFex_Jpsimumu_loose_FS (TrigL2TrkMassFex):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_loose_FS"):
-        super( TrigL2TrkMassFex, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        # L2 TrkMass cuts
-        self.OppositeCharge      = False
-        self.TrackPTthr          = 3000
-        self.dEtaTrackRoI        = 0.1
-        self.dPhiTrackRoI        = 0.1
-        self.Mass_low_cut        = 2500.
-        self.Mass_high_cut       = 4000.
-        self.DaughterMass        = 105.658357
-        self.doVertexFit         = True
-        self.TrigL2VertexFitter = L2VFitTool
-        self.TrigVertexFitter = VFitTool
-        self.TrigVertexingTool = VertexTool
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexValidationMonitoring_FS
-        validation = TrigL2TrkMassFexValidationMonitoring_FS()
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexOnlineMonitoring_FS
-        online = TrigL2TrkMassFexOnlineMonitoring_FS()
-        
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-                
-        self.AthenaMonTools = [ validation, online, time ]
-
-class L2TrkMassFex_Jpsimumu_loose_FS_passL2 (L2TrkMassFex_Jpsimumu_loose_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Jpsimumu_loose_FS_passL2"):
-        super(L2TrkMassFex_Jpsimumu_loose_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# Upsi FS basic cut
-class L2TrkMassFex_Upsimumu_FS (TrigL2TrkMassFex):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Upsimumu_FS"):
-        super( TrigL2TrkMassFex, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        # L2 TrkMass cuts
-        self.TrackPTthr          = 4000
-        self.dEtaTrackRoI        = 0.1
-        self.dPhiTrackRoI        = 0.1
-        self.Mass_low_cut        = 8000.
-        self.Mass_high_cut       = 12000.
-        self.DaughterMass        = 105.658357
-        self.doVertexFit         = True
-        self.TrigL2VertexFitter = L2VFitTool
-        self.TrigVertexFitter = VFitTool
-        self.TrigVertexingTool = VertexTool
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexValidationMonitoring_Upsi_FS
-        validation = TrigL2TrkMassFexValidationMonitoring_Upsi_FS()
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexOnlineMonitoring_Upsi_FS
-        online = TrigL2TrkMassFexOnlineMonitoring_Upsi_FS()
-        
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-                
-        self.AthenaMonTools = [ validation, online, time ]
-
-
-class L2TrkMassFex_Upsimumu_FS_passL2 (L2TrkMassFex_Upsimumu_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Upsimumu_FS_passL2"):
-        super(L2TrkMassFex_Upsimumu_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# FS loose cut
-class L2TrkMassFex_Upsimumu_loose_FS (TrigL2TrkMassFex):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Upsimumu_loose_FS"):
-        super( TrigL2TrkMassFex, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        # L2 TrkMass cuts
-        self.OppositeCharge      = False
-        self.TrackPTthr          = 3000
-        self.dEtaTrackRoI        = 0.1
-        self.dPhiTrackRoI        = 0.1
-        self.Mass_low_cut        = 8000.
-        self.Mass_high_cut       = 12000.
-        self.DaughterMass        = 105.658357
-        self.doVertexFit         = True
-        self.TrigL2VertexFitter = L2VFitTool
-        self.TrigVertexFitter = VFitTool
-        self.TrigVertexingTool = VertexTool
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexValidationMonitoring_Upsi_FS
-        validation = TrigL2TrkMassFexValidationMonitoring_Upsi_FS()
-        
-        from TrigBphysHypo.TrigL2TrkMassFexMonitoring import TrigL2TrkMassFexOnlineMonitoring_Upsi_FS
-        online = TrigL2TrkMassFexOnlineMonitoring_Upsi_FS()
-        
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-                
-        self.AthenaMonTools = [ validation, online, time ]
-
-class L2TrkMassFex_Upsimumu_loose_FS_passL2 (L2TrkMassFex_Upsimumu_loose_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassFex_Upsimumu_loose_FS_passL2"):
-        super(L2TrkMassFex_Upsimumu_loose_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassFexMonitoring.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassFexMonitoring.py
deleted file mode 100644
index f9548d2ced5a3d7a3b2eca58caa7fccf4a640df2..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassFexMonitoring.py
+++ /dev/null
@@ -1,760 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
-
-ERROR_labels = ' No_EventInfo : No_RoI : No_TrackColl : No_CombMuon : More_TrackColl : AddTrack_Fails : Unique_AddTrack_Fails : CalcInvMass_Fails : CalcMother_Fails : CalcMassPull_Fails : BphysColl_Fails '
-ERROR_number = 10
-
-ACCEPTANCE_labels = ' Input : AcceptAll : Got_RoI : Got_TrackColl : Full_TrackColl : Single_TrackColl : Full_IDTracks : Mu1_Chi2_Cut : Mu1_pT_Cut : Mu1_Chi2Pt_Cuts : Mu1_dEta_Cut : Mu1_dPhi_Cut : Mu1_dR_Cut : Mu2_Chi2_Cut : Mu2_pT_Cut : Mu2_Chi2Pt_Cuts : Opp_Charge : InvMass_Cut : AddTrack_Test : Vertexing : CalcInvMass : CalcMother : Vertex_not_NULL : : BphysColl_not_Empty : : Each_Mu1_Chi2_Cut : Each_Mu1_pT_Cut : Each_Mu1_Chi2Pt_Cuts : Each_Mu1_dEta_Cut : Each_Mu1_dPhi_Cut : Each_Mu1_dR_Cut : : Each_Mu2_Chi2_Cut : Each_Mu2_pT_Cut : Each_Mu2_Chi2Pt_Cuts : Each_Opp_Charge : Each_InvMass_Cut : Each_AddTrack_Test : Each_Vertexing : Each_CalcInvMass : Each_CalcMother : Each_Vertex_not_NULL '
-ACCEPTANCE_number = 43
-
-class TrigL2TrkMassFexValidationMonitoring_RoI(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="L2TrkMassFexValidation_RoI"):
-        super(TrigL2TrkMassFexValidationMonitoring_RoI, self).__init__(name)
-        self.defineTarget("Validation")
-        self.Histograms  = [ defineHistogram ( 'Errors', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Algorithm errors ; ; # Events / Candidates',
-                                               xbins = ERROR_number , xmin = -0.5, xmax = ERROR_number - 0.5,
-                                               labels = ERROR_labels ) ]
-        self.Histograms += [ defineHistogram ( 'Acceptance', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Reached steps - acceptance ; ; # Events / Candidates',
-                                               xbins = ACCEPTANCE_number , xmin = -0.5, xmax = ACCEPTANCE_number - 0.5,
-                                               labels = ACCEPTANCE_labels ) ]
-        self.Histograms += [ defineHistogram ( 'ROIEta, ROIPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - ROI direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'nTracks', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of ID tracks ; # Tracks ; # Events',
-                                               xbins = 101, xmin = -1.5, xmax = 99.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} - low range ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 200. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkEta, TrkPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta, TrkROIdPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Pt, Trk2Pt', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks p_{T} correlation ; p_{T#mu1} [GeV] ; p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 50, xmin = 0., xmax = 50.,
-                                               ybins = 50, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Eta, Trk2Eta', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #eta correlation ; #eta_{#mu1} ; #eta_{#mu2} ; # Candidates',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 30, ymin = -3.0, ymax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Phi, Trk2Phi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #phi correlation ; #phi_{#mu1} ; #phi_{#mu2} ; # Candidates',
-                                               xbins = 32, xmin = -3.2, xmax = 3.2,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta, Trk1Trk2dPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Candidates',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'SumPtTrk12', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1+Track2 p_{T} ; p_{T#mu1}+p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass, InvMass_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Before vs. after vertex fit invariant mass ; Fitted mass [GeV] ; Invariant mass [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 1., xmax = 6.,
-                                               ybins = 25, ymin = 1., ymax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoF', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF} ; #chi^{2}/_{NDoF} ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoFProb', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF}-probability ; prob(#chi^{2}/_{NDoF}) ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 1. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} ; p_{T} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt, SumPtTrk12_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} vs. track1+track2 p_{T} ; p_{T} [GeV] ; (p_{T#mu1}+p_{T#mu2}) [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex R-position ; R [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 10. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxZ', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex Z-position ; Z [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 500. ) ]
-        self.Histograms += [ defineHistogram ( 'nBphys', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of di-muon candidates ; # di-muons ; # Events',
-                                               xbins = 50, xmin = -0.5, xmax = 49.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TotalRunTime', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Total processing time ; t_{tot} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'VertexingTime', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit processing time ; t_{vtx} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'TotalRunTime, VertexingTime', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Total vs. vertex fit processing time ; t_{tot} [ms] ; t_{vtx} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50.,
-                                               ybins = 100, ymin = 0., ymax = 50. ) ]
-
-class TrigL2TrkMassFexOnlineMonitoring_RoI(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="L2TrkMassFexOnline_RoI"):
-        super(TrigL2TrkMassFexOnlineMonitoring_RoI, self).__init__(name)
-        self.defineTarget("Online")
-        self.Histograms  = [ defineHistogram ( 'Errors', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Algorithm errors ; ; # Events / Candidates',
-                                               xbins = ERROR_number , xmin = -0.5, xmax = ERROR_number - 0.5,
-                                               labels = ERROR_labels ) ]
-        self.Histograms += [ defineHistogram ( 'Acceptance', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Reached steps - acceptance ; ; # Events / Candidates',
-                                               xbins = ACCEPTANCE_number , xmin = -0.5, xmax = ACCEPTANCE_number - 0.5,
-                                               labels = ACCEPTANCE_labels ) ]
-        self.Histograms += [ defineHistogram ( 'ROIEta, ROIPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - ROI direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'nTracks', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of ID tracks ; # Tracks ; # Events',
-                                               xbins = 101, xmin = -1.5, xmax = 99.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} - low range ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 200. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkEta, TrkPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta, TrkROIdPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Pt, Trk2Pt', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks p_{T} correlation ; p_{T#mu1} [GeV] ; p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 50, xmin = 0., xmax = 50.,
-                                               ybins = 50, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Eta, Trk2Eta', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #eta correlation ; #eta_{#mu1} ; #eta_{#mu2} ; # Candidates',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 30, ymin = -3.0, ymax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Phi, Trk2Phi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #phi correlation ; #phi_{#mu1} ; #phi_{#mu2} ; # Candidates',
-                                               xbins = 32, xmin = -3.2, xmax = 3.2,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta, Trk1Trk2dPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Candidates',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'SumPtTrk12', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1+Track2 p_{T} ; p_{T#mu1}+p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass, InvMass_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Before vs. after vertex fit invariant mass ; Fitted mass [GeV] ; Invariant mass [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 1., xmax = 6.,
-                                               ybins = 25, ymin = 1., ymax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoF', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF} ; #chi^{2}/_{NDoF} ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoFProb', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF}-probability ; prob(#chi^{2}/_{NDoF}) ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 1. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} ; p_{T} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt, SumPtTrk12_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} vs. track1+track2 p_{T} ; p_{T} [GeV] ; (p_{T#mu1}+p_{T#mu2}) [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex R-position ; R [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 10. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxZ', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex Z-position ; Z [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 500. ) ]
-        self.Histograms += [ defineHistogram ( 'nBphys', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of di-muon candidates ; # di-muons ; # Events',
-                                               xbins = 50, xmin = -0.5, xmax = 49.5 ) ]
-#        self.Histograms += [ defineHistogram ( 'TotalRunTime', type = 'TH1F',
-#                                               title = 'L2TrkMassFex - Total processing time ; t_{tot} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-#        self.Histograms += [ defineHistogram ( 'VertexingTime', type = 'TH1F',
-#                                               title = 'L2TrkMassFex - Vertex fit processing time ; t_{vtx} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-#        self.Histograms += [ defineHistogram ( 'TotalRunTime, VertexingTime', type = 'TH2F',
-#                                               title = 'L2TrkMassFex - Total vs. vertex fit processing time ; t_{tot} [ms] ; t_{vtx} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50.,
-#                                               ybins = 100, ymin = 0., ymax = 50. ) ]
-
-class TrigL2TrkMassFexValidationMonitoring_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="L2TrkMassFexValidation_FS"):
-        super(TrigL2TrkMassFexValidationMonitoring_FS, self).__init__(name)
-        self.defineTarget("Validation")
-        self.Histograms  = [ defineHistogram ( 'Errors', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Algorithm errors ; ; # Events / Candidates',
-                                               xbins = ERROR_number , xmin = -0.5, xmax = ERROR_number - 0.5,
-                                               labels = ERROR_labels ) ]
-        self.Histograms += [ defineHistogram ( 'Acceptance', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Reached steps - acceptance ; ; # Events / Candidates',
-                                               xbins = ACCEPTANCE_number , xmin = -0.5, xmax = ACCEPTANCE_number - 0.5,
-                                               labels = ACCEPTANCE_labels ) ]
-        self.Histograms += [ defineHistogram ( 'ROIEta, ROIPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - ROI direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'nTracks', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of ID tracks ; # Tracks ; # Events',
-                                               xbins = 101, xmin = -1.5, xmax = 99.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} - low range ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 200. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkEta, TrkPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta, TrkROIdPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Pt, Trk2Pt', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks p_{T} correlation ; p_{T#mu1} [GeV] ; p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Eta, Trk2Eta', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #eta correlation ; #eta_{#mu1} ; #eta_{#mu2} ; # Candidates',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 30, ymin = -3.0, ymax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Phi, Trk2Phi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #phi correlation ; #phi_{#mu1} ; #phi_{#mu2} ; # Candidates',
-                                               xbins = 32, xmin = -3.2, xmax = 3.2,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta, Trk1Trk2dPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Candidates',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'SumPtTrk12', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1+Track2 p_{T} ; p_{T#mu1}+p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass, InvMass_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Before vs. after vertex fit invariant mass ; Fitted mass [GeV] ; Invariant mass [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 1., xmax = 6.,
-                                               ybins = 25, ymin = 1., ymax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoF', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF} ; #chi^{2}/_{NDoF} ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoFProb', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF}-probability ; prob(#chi^{2}/_{NDoF}) ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 1. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} ; p_{T} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt, SumPtTrk12_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} vs. track1+track2 p_{T} ; p_{T} [GeV] ; (p_{T#mu1}+p_{T#mu2}) [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex R-position ; R [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 10. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxZ', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex Z-position ; Z [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 500. ) ]
-        self.Histograms += [ defineHistogram ( 'nBphys', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of di-muon candidates ; # di-muons ; # Events',
-                                               xbins = 50, xmin = -0.5, xmax = 49.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TotalRunTime', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Total processing time ; t_{tot} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'VertexingTime', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit processing time ; t_{vtx} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'TotalRunTime, VertexingTime', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Total vs. vertex fit processing time ; t_{tot} [ms] ; t_{vtx} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50.,
-                                               ybins = 100, ymin = 0., ymax = 50. ) ]
-
-class TrigL2TrkMassFexOnlineMonitoring_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="L2TrkMassFexOnline_FS"):
-        super(TrigL2TrkMassFexOnlineMonitoring_FS, self).__init__(name)
-        self.defineTarget("Online")
-        self.Histograms  = [ defineHistogram ( 'Errors', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Algorithm errors ; ; # Events / Candidates',
-                                               xbins = ERROR_number , xmin = -0.5, xmax = ERROR_number - 0.5,
-                                               labels = ERROR_labels ) ]
-        self.Histograms += [ defineHistogram ( 'Acceptance', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Reached steps - acceptance ; ; # Events / Candidates',
-                                               xbins = ACCEPTANCE_number , xmin = -0.5, xmax = ACCEPTANCE_number - 0.5,
-                                               labels = ACCEPTANCE_labels ) ]
-        self.Histograms += [ defineHistogram ( 'ROIEta, ROIPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - ROI direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'nTracks', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of ID tracks ; # Tracks ; # Events',
-                                               xbins = 101, xmin = -1.5, xmax = 99.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} - low range ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 200. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkEta, TrkPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta, TrkROIdPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Pt, Trk2Pt', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks p_{T} correlation ; p_{T#mu1} [GeV] ; p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Eta, Trk2Eta', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #eta correlation ; #eta_{#mu1} ; #eta_{#mu2} ; # Candidates',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 30, ymin = -3.0, ymax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Phi, Trk2Phi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #phi correlation ; #phi_{#mu1} ; #phi_{#mu2} ; # Candidates',
-                                               xbins = 32, xmin = -3.2, xmax = 3.2,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta, Trk1Trk2dPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Candidates',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'SumPtTrk12', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1+Track2 p_{T} ; p_{T#mu1}+p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 1., xmax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass, InvMass_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Before vs. after vertex fit invariant mass ; Fitted mass [GeV] ; Invariant mass [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 1., xmax = 6.,
-                                               ybins = 25, ymin = 1., ymax = 6. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoF', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF} ; #chi^{2}/_{NDoF} ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoFProb', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF}-probability ; prob(#chi^{2}/_{NDoF}) ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 1. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} ; p_{T} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt, SumPtTrk12_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} vs. track1+track2 p_{T} ; p_{T} [GeV] ; (p_{T#mu1}+p_{T#mu2}) [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex R-position ; R [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 10. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxZ', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex Z-position ; Z [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 500. ) ]
-        self.Histograms += [ defineHistogram ( 'nBphys', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of di-muon candidates ; # di-muons ; # Events',
-                                               xbins = 50, xmin = -0.5, xmax = 49.5 ) ]
-#        self.Histograms += [ defineHistogram ( 'TotalRunTime', type = 'TH1F',
-#                                               title = 'L2TrkMassFex - Total processing time ; t_{tot} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-#        self.Histograms += [ defineHistogram ( 'VertexingTime', type = 'TH1F',
-#                                               title = 'L2TrkMassFex - Vertex fit processing time ; t_{vtx} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-#        self.Histograms += [ defineHistogram ( 'TotalRunTime, VertexingTime', type = 'TH2F',
-#                                               title = 'L2TrkMassFex - Total vs. vertex fit processing time ; t_{tot} [ms] ; t_{vtx} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50.,
-#                                               ybins = 100, ymin = 0., ymax = 50. ) ]
-
-class TrigL2TrkMassFexValidationMonitoring_Upsi_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="L2TrkMassFexValidation_Upsi_FS"):
-        super(TrigL2TrkMassFexValidationMonitoring_Upsi_FS, self).__init__(name)
-        self.defineTarget("Validation")
-        self.Histograms  = [ defineHistogram ( 'Errors', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Algorithm errors ; ; # Events / Candidates',
-                                               xbins = ERROR_number , xmin = -0.5, xmax = ERROR_number - 0.5,
-                                               labels = ERROR_labels ) ]
-        self.Histograms += [ defineHistogram ( 'Acceptance', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Reached steps - acceptance ; ; # Events / Candidates',
-                                               xbins = ACCEPTANCE_number , xmin = -0.5, xmax = ACCEPTANCE_number - 0.5,
-                                               labels = ACCEPTANCE_labels ) ]
-        self.Histograms += [ defineHistogram ( 'ROIEta, ROIPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - ROI direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'nTracks', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of ID tracks ; # Tracks ; # Events',
-                                               xbins = 101, xmin = -1.5, xmax = 99.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} - low range ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 200. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkEta, TrkPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta, TrkROIdPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 140, xmin = 1., xmax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 140, xmin = 1., xmax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Pt, Trk2Pt', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks p_{T} correlation ; p_{T#mu1} [GeV] ; p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Eta, Trk2Eta', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #eta correlation ; #eta_{#mu1} ; #eta_{#mu2} ; # Candidates',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 30, ymin = -3.0, ymax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Phi, Trk2Phi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #phi correlation ; #phi_{#mu1} ; #phi_{#mu2} ; # Candidates',
-                                               xbins = 32, xmin = -3.2, xmax = 3.2,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta, Trk1Trk2dPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Candidates',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'SumPtTrk12', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1+Track2 p_{T} ; p_{T#mu1}+p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 140, xmin = 1., xmax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass, InvMass_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Before vs. after vertex fit invariant mass ; Fitted mass [GeV] ; Invariant mass [GeV] ; # Candidates',
-                                               xbins = 28, xmin = 1., xmax = 15.,
-                                               ybins = 28, ymin = 1., ymax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoF', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF} ; #chi^{2}/_{NDoF} ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoFProb', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF}-probability ; prob(#chi^{2}/_{NDoF}) ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 1. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} ; p_{T} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt, SumPtTrk12_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} vs. track1+track2 p_{T} ; p_{T} [GeV] ; (p_{T#mu1}+p_{T#mu2}) [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex R-position ; R [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 10. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxZ', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex Z-position ; Z [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 500. ) ]
-        self.Histograms += [ defineHistogram ( 'nBphys', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of di-muon candidates ; # di-muons ; # Events',
-                                               xbins = 50, xmin = -0.5, xmax = 49.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TotalRunTime', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Total processing time ; t_{tot} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'VertexingTime', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit processing time ; t_{vtx} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'TotalRunTime, VertexingTime', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Total vs. vertex fit processing time ; t_{tot} [ms] ; t_{vtx} [ms] ; # Events',
-                                               xbins = 100, xmin = 0., xmax = 50.,
-                                               ybins = 100, ymin = 0., ymax = 50. ) ]
-
-class TrigL2TrkMassFexOnlineMonitoring_Upsi_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="L2TrkMassFexOnline_Upsi_FS"):
-        super(TrigL2TrkMassFexOnlineMonitoring_Upsi_FS, self).__init__(name)
-        self.defineTarget("Online")
-        self.Histograms  = [ defineHistogram ( 'Errors', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Algorithm errors ; ; # Events / Candidates',
-                                               xbins = ERROR_number , xmin = -0.5, xmax = ERROR_number - 0.5,
-                                               labels = ERROR_labels ) ]
-        self.Histograms += [ defineHistogram ( 'Acceptance', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Reached steps - acceptance ; ; # Events / Candidates',
-                                               xbins = ACCEPTANCE_number , xmin = -0.5, xmax = ACCEPTANCE_number - 0.5,
-                                               labels = ACCEPTANCE_labels ) ]
-        self.Histograms += [ defineHistogram ( 'ROIEta, ROIPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - ROI direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'nTracks', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of ID tracks ; # Tracks ; # Events',
-                                               xbins = 101, xmin = -1.5, xmax = 99.5 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} - low range ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkPt_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - ID tracks p_{T} ; p_{T} [GeV] ; # Tracks',
-                                               xbins = 100, xmin = 0., xmax = 200. ) ]
-        self.Histograms += [ defineHistogram ( 'TrkEta, TrkPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track direction ; #eta ; #phi ; # Events',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta, TrkROIdPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'TrkROIdR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track-ROI #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 140, xmin = 1., xmax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMassNoTrkPtCut_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - p_{T#mu2} > 2 GeV ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 140, xmin = 1., xmax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'InvMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Invariant mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Pt, Trk2Pt', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks p_{T} correlation ; p_{T#mu1} [GeV] ; p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Eta, Trk2Eta', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #eta correlation ; #eta_{#mu1} ; #eta_{#mu2} ; # Candidates',
-                                               xbins = 30, xmin = -3.0, xmax = 3.0,
-                                               ybins = 30, ymin = -3.0, ymax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Phi, Trk2Phi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Tracks #phi correlation ; #phi_{#mu1} ; #phi_{#mu2} ; # Candidates',
-                                               xbins = 32, xmin = -3.2, xmax = 3.2,
-                                               ybins = 32, ymin = -3.2, ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta, Trk1Trk2dPhi', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta#Delta#phi difference ; #Delta#eta ; #Delta#phi ; # Candidates',
-                                               xbins = 30, xmin = 0., xmax = 3.0,
-                                               ybins = 32, ymin = 0., ymax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dEta', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#eta difference ; #Delta#eta ; # Tracks',
-                                               xbins = 30, xmin = 0., xmax = 3.0 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dPhi', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #Delta#phi difference ; #Delta#phi ; # Tracks',
-                                               xbins = 32, xmin = 0., xmax = 3.2 ) ]
-        self.Histograms += [ defineHistogram ( 'Trk1Trk2dR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1-Track2 #DeltaR difference ; #DeltaR ; # Tracks',
-                                               xbins = 50, xmin = 0., xmax = 5. ) ]
-        self.Histograms += [ defineHistogram ( 'SumPtTrk12', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Track1+Track2 p_{T} ; p_{T#mu1}+p_{T#mu2} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass - low range ; Mass [GeV] ; # Candidates',
-                                               xbins = 140, xmin = 1., xmax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass_wideRange', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted mass ; Mass [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitMass, InvMass_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Before vs. after vertex fit invariant mass ; Fitted mass [GeV] ; Invariant mass [GeV] ; # Candidates',
-                                               xbins = 28, xmin = 1., xmax = 15.,
-                                               ybins = 28, ymin = 1., ymax = 15. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoF', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF} ; #chi^{2}/_{NDoF} ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 25. ) ]
-        self.Histograms += [ defineHistogram ( 'Chi2toNDoFProb', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Vertex fit #chi^{2}/_{NDoF}-probability ; prob(#chi^{2}/_{NDoF}) ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 1. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} ; p_{T} [GeV] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 100. ) ]
-        self.Histograms += [ defineHistogram ( 'FitTotalPt, SumPtTrk12_okFit', type = 'TH2F',
-                                               title = 'L2TrkMassFex - Fitted di-muon p_{T} vs. track1+track2 p_{T} ; p_{T} [GeV] ; (p_{T#mu1}+p_{T#mu2}) [GeV] ; # Candidates',
-                                               xbins = 25, xmin = 0., xmax = 50.,
-                                               ybins = 25, ymin = 0., ymax = 50. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxR', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex R-position ; R [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 10. ) ]
-        self.Histograms += [ defineHistogram ( 'FitVtxZ', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Fitted vertex Z-position ; Z [mm] ; # Candidates',
-                                               xbins = 100, xmin = 0., xmax = 500. ) ]
-        self.Histograms += [ defineHistogram ( 'nBphys', type = 'TH1F',
-                                               title = 'L2TrkMassFex - Number of di-muon candidates ; # di-muons ; # Events',
-                                               xbins = 50, xmin = -0.5, xmax = 49.5 ) ]
-#        self.Histograms += [ defineHistogram ( 'TotalRunTime', type = 'TH1F',
-#                                               title = 'L2TrkMassFex - Total processing time ; t_{tot} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-#        self.Histograms += [ defineHistogram ( 'VertexingTime', type = 'TH1F',
-#                                               title = 'L2TrkMassFex - Vertex fit processing time ; t_{vtx} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50. ) ]
-#        self.Histograms += [ defineHistogram ( 'TotalRunTime, VertexingTime', type = 'TH2F',
-#                                               title = 'L2TrkMassFex - Total vs. vertex fit processing time ; t_{tot} [ms] ; t_{vtx} [ms] ; # Events',
-#                                               xbins = 100, xmin = 0., xmax = 50.,
-#                                               ybins = 100, ymin = 0., ymax = 50. ) ]
-
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassHypoConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassHypoConfig.py
deleted file mode 100644
index b30d1a8e199c4b222785a1be7dc62beeee4d8259..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassHypoConfig.py
+++ /dev/null
@@ -1,205 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from TrigBphysHypo.TrigBphysHypoConf import TrigL2TrkMassHypo
-
-# Jpsi
-class L2TrkMassHypo_Jpsimumu (TrigL2TrkMassHypo):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu"):
-        super( TrigL2TrkMassHypo, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-        # mass cuts
-        self.AcceptAll = False
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoValidationMonitoring_RoI
-        validation = TrigL2TrkMassHypoValidationMonitoring_RoI()
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoOnlineMonitoring_RoI
-        online = TrigL2TrkMassHypoOnlineMonitoring_RoI()
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-
-        self.AthenaMonTools = [ validation, online, time ]
-
-# Jpsi passL2
-class L2TrkMassHypo_Jpsimumu_passL2 (L2TrkMassHypo_Jpsimumu):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_passL2"):
-        super( L2TrkMassHypo_Jpsimumu_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-
-# Jpsi FS
-class L2TrkMassHypo_Jpsimumu_FS (TrigL2TrkMassHypo):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_FS"):
-        super( TrigL2TrkMassHypo, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoValidationMonitoring_FS
-        validation = TrigL2TrkMassHypoValidationMonitoring_FS()
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoOnlineMonitoring_FS
-        online = TrigL2TrkMassHypoOnlineMonitoring_FS()
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-
-        self.AthenaMonTools = [ validation, online, time ]
-
-# Jpsi passL2
-class L2TrkMassHypo_Jpsimumu_FS_passL2 (L2TrkMassHypo_Jpsimumu_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_FS_passL2"):
-        super( L2TrkMassHypo_Jpsimumu_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-
-# Jpsi loose
-class L2TrkMassHypo_Jpsimumu_loose (TrigL2TrkMassHypo):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_loose"):
-        super( TrigL2TrkMassHypo, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-        # mass cuts
-        self.AcceptAll = False
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoValidationMonitoring_RoI
-        validation = TrigL2TrkMassHypoValidationMonitoring_RoI()
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoOnlineMonitoring_RoI
-        online = TrigL2TrkMassHypoOnlineMonitoring_RoI()
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-
-        self.AthenaMonTools = [ validation, online, time ]
-
-# Jpsi loose passL2
-class L2TrkMassHypo_Jpsimumu_loose_passL2 (L2TrkMassHypo_Jpsimumu_loose):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_loose_passL2"):
-        super( L2TrkMassHypo_Jpsimumu_loose_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# Jpsi loose
-class L2TrkMassHypo_Jpsimumu_looser (TrigL2TrkMassHypo):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_looser"):
-        super( TrigL2TrkMassHypo, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-        # mass cuts
-        self.AcceptAll = False
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoValidationMonitoring_RoI
-        validation = TrigL2TrkMassHypoValidationMonitoring_RoI()
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoOnlineMonitoring_RoI
-        online = TrigL2TrkMassHypoOnlineMonitoring_RoI()
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-
-        self.AthenaMonTools = [ validation, online, time ]
-
-# Jpsi loose passL2
-class L2TrkMassHypo_Jpsimumu_looser_passL2 (L2TrkMassHypo_Jpsimumu_looser):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_looser_passL2"):
-        super( L2TrkMassHypo_Jpsimumu_looser_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# Jpsi FS loose
-class L2TrkMassHypo_Jpsimumu_loose_FS (TrigL2TrkMassHypo):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_loose_FS"):
-        super( TrigL2TrkMassHypo, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoValidationMonitoring_FS
-        validation = TrigL2TrkMassHypoValidationMonitoring_FS()
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoOnlineMonitoring_FS
-        online = TrigL2TrkMassHypoOnlineMonitoring_FS()
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-
-        self.AthenaMonTools = [ validation, online, time ]
-
-
-class L2TrkMassHypo_Jpsimumu_loose_FS_passL2 (L2TrkMassHypo_Jpsimumu_loose_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Jpsimumu_loose_FS_passL2"):
-        super( L2TrkMassHypo_Jpsimumu_loose_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# Upsi FS 
-class L2TrkMassHypo_Upsimumu_FS (TrigL2TrkMassHypo):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Upsimumu_FS"):
-        super( TrigL2TrkMassHypo, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoValidationMonitoring_Upsi_FS
-        validation = TrigL2TrkMassHypoValidationMonitoring_Upsi_FS()
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoOnlineMonitoring_Upsi_FS
-        online = TrigL2TrkMassHypoOnlineMonitoring_Upsi_FS()
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-
-        self.AthenaMonTools = [ validation, online, time ]
-
-
-class L2TrkMassHypo_Upsimumu_FS_passL2 (L2TrkMassHypo_Upsimumu_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Upsimumu_FS_passL2"):
-        super( L2TrkMassHypo_Upsimumu_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
-# Upsi FS loose
-class L2TrkMassHypo_Upsimumu_loose_FS (TrigL2TrkMassHypo):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Upsimumu_loose_FS"):
-        super( TrigL2TrkMassHypo, self ).__init__( name )
-
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = False
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoValidationMonitoring_Upsi_FS
-        validation = TrigL2TrkMassHypoValidationMonitoring_Upsi_FS()
-
-        from TrigBphysHypo.TrigL2TrkMassHypoMonitoring import TrigL2TrkMassHypoOnlineMonitoring_Upsi_FS
-        online = TrigL2TrkMassHypoOnlineMonitoring_Upsi_FS()
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("Time")
-
-        self.AthenaMonTools = [ validation, online, time ]
-
-
-class L2TrkMassHypo_Upsimumu_loose_FS_passL2 (L2TrkMassHypo_Upsimumu_loose_FS):
-    __slots__ = []
-    def __init__(self, name = "L2TrkMassHypo_Upsimumu_loose_FS_passL2"):
-        super( L2TrkMassHypo_Upsimumu_loose_FS_passL2, self ).__init__( name )
-        # AcceptAll flag: if true take events regardless of cuts
-        self.AcceptAll = True
-
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassHypoMonitoring.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassHypoMonitoring.py
deleted file mode 100644
index 4c749c1e232ef5bf2e8af63214e240319ad93eeb..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigL2TrkMassHypoMonitoring.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig 
-
-class TrigL2TrkMassHypoValidationMonitoring_RoI(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigL2TrkMassHypoValidationMonitoring_RoI"):
-        super(TrigL2TrkMassHypoValidationMonitoring_RoI, self).__init__(name)
-        self.defineTarget("Validation")
-        self.Histograms += [ defineHistogram('CutCounter', type='TH1F', title="cut info",
-                                           xbins=10, xmin=-1.5, xmax=8.5) ]
-        self.Histograms += [ defineHistogram('Mass', type='TH1F', title="L2TrkMassHypo Mass_RoI; Mass[GeV]",
-                                           xbins=100, xmin=1., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('FitMass', type='TH1F', title="L2TrkMassFex FitMass; FitMass[MeV]",
-#                                           xbins=100, xmin=1000., xmax=5000.) ]
-#        self.Histograms += [ defineHistogram('Chi2', type='TH1F', title="L2TrkMassFex Chi2; Chi2",
-#                                           xbins=100, xmin=0., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('Chi2Prob', type='TH1F', title="L2TrkMassFex Chi2Prob; Chi2Prob",
-#                                           xbins=100, xmin=0., xmax=1.) ]
-        self.Histograms += [ defineHistogram('NBphys', type='TH1F', title="L2TrkMassHypo NBphys created",
-                                           xbins=50, xmin=0.0, xmax=50.0) ]
-
-class TrigL2TrkMassHypoOnlineMonitoring_RoI(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigL2TrkMassHypoOnlineMonitoring_RoI"):
-        super(TrigL2TrkMassHypoOnlineMonitoring_RoI, self).__init__(name)
-        self.defineTarget("Online")
-        self.Histograms += [ defineHistogram('CutCounter', type='TH1F', title="cut info",
-                                           xbins=10, xmin=-1.5, xmax=8.5) ]
-        self.Histograms += [ defineHistogram('Mass', type='TH1F', title="L2TrkMassHypo Mass_RoI; Mass[GeV]",
-                                           xbins=100, xmin=1., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('FitMass', type='TH1F', title="L2TrkMassFex FitMass; FitMass[MeV]",
-#                                           xbins=100, xmin=1000., xmax=5000.) ]
-#        self.Histograms += [ defineHistogram('Chi2', type='TH1F', title="L2TrkMassFex Chi2; Chi2",
-#                                           xbins=100, xmin=0., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('Chi2Prob', type='TH1F', title="L2TrkMassFex Chi2Prob; Chi2Prob",
-#                                           xbins=100, xmin=0., xmax=1.) ]
-        self.Histograms += [ defineHistogram('NBphys', type='TH1F', title="L2TrkMassHypo NBphys created",
-                                           xbins=50, xmin=0.0, xmax=50.0) ]
-
-
-class TrigL2TrkMassHypoValidationMonitoring_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigL2TrkMassHypoValidationMonitoring_FS"):
-        super(TrigL2TrkMassHypoValidationMonitoring_FS, self).__init__(name)
-        self.defineTarget("Validation")
-        self.Histograms += [ defineHistogram('CutCounter', type='TH1F', title="cut info",
-                                           xbins=10, xmin=-1.5, xmax=8.5) ]
-        self.Histograms += [ defineHistogram('Mass', type='TH1F', title="L2TrkMassHypo Mass_FS; Mass[GeV]",
-                                           xbins=100, xmin=1., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('FitMass', type='TH1F', title="L2TrkMassFex FitMass; FitMass[MeV]",
-#                                           xbins=100, xmin=1000., xmax=5000.) ]
-#        self.Histograms += [ defineHistogram('Chi2', type='TH1F', title="L2TrkMassFex Chi2; Chi2",
-#                                           xbins=100, xmin=0., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('Chi2Prob', type='TH1F', title="L2TrkMassFex Chi2Prob; Chi2Prob",
-#                                           xbins=100, xmin=0., xmax=1.) ]
-        self.Histograms += [ defineHistogram('NBphys', type='TH1F', title="L2TrkMassHypo NBphys created",
-                                           xbins=50, xmin=0.0, xmax=50.0) ]
-
-class TrigL2TrkMassHypoOnlineMonitoring_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigL2TrkMassHypoOnlineMonitoring_FS"):
-        super(TrigL2TrkMassHypoOnlineMonitoring_FS, self).__init__(name)
-        self.defineTarget("Online")
-        self.Histograms += [ defineHistogram('CutCounter', type='TH1F', title="cut info",
-                                           xbins=10, xmin=-1.5, xmax=8.5) ]
-        self.Histograms += [ defineHistogram('Mass', type='TH1F', title="L2TrkMassHypo Mass_FS; Mass[GeV]",
-                                           xbins=100, xmin=1., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('FitMass', type='TH1F', title="L2TrkMassFex FitMass; FitMass[MeV]",
-#                                           xbins=100, xmin=1000., xmax=5000.) ]
-#        self.Histograms += [ defineHistogram('Chi2', type='TH1F', title="L2TrkMassFex Chi2; Chi2",
-#                                           xbins=100, xmin=0., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('Chi2Prob', type='TH1F', title="L2TrkMassFex Chi2Prob; Chi2Prob",
-#                                           xbins=100, xmin=0., xmax=1.) ]
-        self.Histograms += [ defineHistogram('NBphys', type='TH1F', title="L2TrkMassHypo NBphys created",
-                                           xbins=50, xmin=0.0, xmax=50.0) ]
-
-class TrigL2TrkMassHypoValidationMonitoring_Upsi_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigL2TrkMassHypoValidationMonitoring_Upsi_FS"):
-        super(TrigL2TrkMassHypoValidationMonitoring_Upsi_FS, self).__init__(name)
-        self.defineTarget("Validation")
-        self.Histograms += [ defineHistogram('CutCounter', type='TH1F', title="cut info",
-                                           xbins=10, xmin=-1.5, xmax=8.5) ]
-        self.Histograms += [ defineHistogram('Mass', type='TH1F', title="L2TrkMassHypo Mass_FS; Mass[GeV]",
-                                           xbins=140, xmin=1., xmax=15.) ]
-#        self.Histograms += [ defineHistogram('FitMass', type='TH1F', title="L2TrkMassFex FitMass; FitMass[MeV]",
-#                                           xbins=100, xmin=1000., xmax=5000.) ]
-#        self.Histograms += [ defineHistogram('Chi2', type='TH1F', title="L2TrkMassFex Chi2; Chi2",
-#                                           xbins=100, xmin=0., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('Chi2Prob', type='TH1F', title="L2TrkMassFex Chi2Prob; Chi2Prob",
-#                                           xbins=100, xmin=0., xmax=1.) ]
-        self.Histograms += [ defineHistogram('NBphys', type='TH1F', title="L2TrkMassHypo NBphys created",
-                                           xbins=50, xmin=0.0, xmax=50.0) ]
-
-class TrigL2TrkMassHypoOnlineMonitoring_Upsi_FS(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigL2TrkMassHypoOnlineMonitoring_Upsi_FS"):
-        super(TrigL2TrkMassHypoOnlineMonitoring_Upsi_FS, self).__init__(name)
-        self.defineTarget("Online")
-        self.Histograms += [ defineHistogram('CutCounter', type='TH1F', title="cut info",
-                                           xbins=10, xmin=-1.5, xmax=8.5) ]
-        self.Histograms += [ defineHistogram('Mass', type='TH1F', title="L2TrkMassHypo Mass_FS; Mass[GeV]",
-                                           xbins=140, xmin=1., xmax=15.) ]
-#        self.Histograms += [ defineHistogram('FitMass', type='TH1F', title="L2TrkMassFex FitMass; FitMass[MeV]",
-#                                           xbins=100, xmin=1000., xmax=5000.) ]
-#        self.Histograms += [ defineHistogram('Chi2', type='TH1F', title="L2TrkMassFex Chi2; Chi2",
-#                                           xbins=100, xmin=0., xmax=10.) ]
-#        self.Histograms += [ defineHistogram('Chi2Prob', type='TH1F', title="L2TrkMassFex Chi2Prob; Chi2Prob",
-#                                           xbins=100, xmin=0., xmax=1.) ]
-        self.Histograms += [ defineHistogram('NBphys', type='TH1F', title="L2TrkMassHypo NBphys created",
-                                           xbins=50, xmin=0.0, xmax=50.0) ]
-
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.cxx
index 71246290460602babd506785a1698dfd4f916f52..6bc093f11960ab9be30f0d6e2fdaa5bbe3c7581a 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.cxx
@@ -5,43 +5,7 @@
 #include "BtrigUtils.h"
 
 #include <math.h>
-#include <vector>
 
-
-#include "TrigInDetEvent/TrigInDetTrack.h"
-#include "TrigInDetEvent/TrigInDetTrackFitPar.h"
-
-#include "TrigSteeringEvent/Enums.h"
-
-#include "xAODMuon/Muon.h"
-#include "xAODTracking/TrackParticle.h"
-
-#include <exception>
-
-
-//----------------------------------------------
-// pT calculation using Trk::Track.
-//----------------------------------------------
-/*
-double PtVal(const std::vector<const Trk::Track*> & tracks) {
-
-  std::vector<const Trk::Track*>::const_iterator trkItr    = tracks.begin();
-  std::vector<const Trk::Track*>::const_iterator trkItrEnd = tracks.end();
-
-  double px_sum = 0;
-  double py_sum = 0;
-
-  for ( ; trkItr!=trkItrEnd; trkItr++ ) {
-    px_sum += fabs((*trkItr)->perigeeParameters()->pT()) * cos((*trkItr)->perigeeParameters()->parameters()[Trk::phi0]);
-    py_sum += fabs((*trkItr)->perigeeParameters()->pT()) * sin((*trkItr)->perigeeParameters()->parameters()[Trk::phi0]);
-  }
-
-  double pt2 = px_sum*px_sum + py_sum*py_sum;
-
-  if ( pt2 < 0 ) return 0;
-  else          return sqrt(pt2);
-}
-*/
 //----------------------------------------------
 // pT calculation using xAOD::TrackParticle.
 //----------------------------------------------
@@ -55,8 +19,8 @@ double PtVal(const std::vector<const xAOD::TrackParticle*> & tracks) {
   double py_sum = 0;
 
   for ( ; trkItr!=trkItrEnd; trkItr++ ) {
-    px_sum += fabs((*trkItr)->pt()) * cos((*trkItr)->phi());
-    py_sum += fabs((*trkItr)->pt()) * sin((*trkItr)->phi());
+    px_sum += std::abs((*trkItr)->pt()) * cos((*trkItr)->phi());
+    py_sum += std::abs((*trkItr)->pt()) * sin((*trkItr)->phi());
   }
 
   double pt2 = px_sum*px_sum + py_sum*py_sum;
@@ -69,13 +33,13 @@ double PtVal(const std::vector<const xAOD::TrackParticle*> & tracks) {
 // L_xy calculation using Trk::Track and two vertex positions.
 //------------------------------------------------------------
 
-double LxyVal(const double px, const double py, const Amg::Vector3D Vertex0, const Amg::Vector3D Vertex1) {
+double LxyVal(const double px, const double py, const Amg::Vector3D &Vertex0, const Amg::Vector3D &Vertex1) {
 
   double rdx = Vertex1[0] - Vertex0[0];
   double rdy = Vertex1[1] - Vertex0[1];
 
-  double pt  = sqrt(px*px+py*py);
-  double rxy = sqrt(rdx*rdx+rdy*rdy);
+  double pt  = std::sqrt(px*px+py*py);
+  double rxy = std::sqrt(rdx*rdx+rdy*rdy);
 
   double cosxy = 0.;
   if ( rxy != 0. ) cosxy = (px*rdx+py*rdy)/rxy/pt;
@@ -83,151 +47,3 @@ double LxyVal(const double px, const double py, const Amg::Vector3D Vertex0, con
   return rxy*cosxy;
 }
 
-//--------------------------------------------------------------------
-// Base invariant mass calculation using px,py,pz and mass-hypothesis.
-//--------------------------------------------------------------------
-
-double InvMass(const std::vector<double> & px, const std::vector<double> & py,
-               const std::vector<double> & pz, const std::vector<double> & massHypo) {
-
-  double px_sum = 0;
-  double py_sum = 0;
-  double pz_sum = 0;
-  double e_sum  = 0;
-
-  for ( unsigned int i=0; i<massHypo.size(); i++ ) {
-    px_sum += px[i];
-    py_sum += py[i];
-    pz_sum += pz[i];
-    e_sum  += sqrt(massHypo[i]*massHypo[i] + px[i]*px[i] + py[i]*py[i] + pz[i]*pz[i]);
-  }
-
-  double m2 = e_sum*e_sum - px_sum*px_sum - py_sum*py_sum - pz_sum*pz_sum;
-
-  if ( m2 < 0 ) return 0;
-  else          return sqrt(m2);
-}
-
-
-
-//--------------------------------------------------
-// Invariant mass calculations using TrigInDetTrack.
-//--------------------------------------------------
-
-double InvMass(const std::vector<const TrigInDetTrack*> &tracks, const std::vector<double> & massHypo) {
-
-  std::vector<const TrigInDetTrack*>::const_iterator trkItr    = tracks.begin();
-  std::vector<const TrigInDetTrack*>::const_iterator trkItrEnd = tracks.end();
-
-  std::vector<double> px, py, pz;
-
-  for ( ; trkItr!=trkItrEnd; trkItr++ ) {
-    double theta = 2. * atan(exp(-1.0*((*trkItr)->param()->eta())));
-    px.push_back( fabs((*trkItr)->param()->pT()) * cos((*trkItr)->param()->phi0()) );
-    py.push_back( fabs((*trkItr)->param()->pT()) * sin((*trkItr)->param()->phi0()) );
-    pz.push_back( fabs((*trkItr)->param()->pT()) / tan(theta) );
-  }
-
-  return InvMass(px, py, pz, massHypo);
-}
-
-
-
-//--------------------------------------------------------
-// Invariant mass calculations using TrigInDetTrackFitPar.
-//--------------------------------------------------------
-
-double InvMass(const std::vector<const TrigInDetTrackFitPar*> & tracks, const std::vector<double> & massHypo) {
-
-  std::vector<const TrigInDetTrackFitPar*>::const_iterator trkItr    = tracks.begin();
-  std::vector<const TrigInDetTrackFitPar*>::const_iterator trkItrEnd = tracks.end();
-
-  std::vector<double> px, py, pz;
-
-  for ( ; trkItr!=trkItrEnd; trkItr++ ) {
-    double theta = 2. * atan(exp(-1.0*((*trkItr)->eta())));
-    px.push_back( fabs((*trkItr)->pT()) * cos((*trkItr)->phi0()) );
-    py.push_back( fabs((*trkItr)->pT()) * sin((*trkItr)->phi0()) );
-    pz.push_back( fabs((*trkItr)->pT()) / tan(theta) );
-  }
-
-  return InvMass(px, py, pz, massHypo);
-}
-
-
-
-//--------------------------------------------------------
-// Invariant mass calculations using Trk::MeasuredPerigee.
-//--------------------------------------------------------
-/*
-double InvMass(const std::vector<const Trk::TrackParameters*> & tracks, const std::vector<double> & massHypo) {
-
-  std::vector<const Trk::TrackParameters*>::const_iterator trkItr    = tracks.begin();
-  std::vector<const Trk::TrackParameters*>::const_iterator trkItrEnd = tracks.end();
-
-  std::vector<double> px, py, pz;
-
-  for ( ; trkItr!=trkItrEnd; trkItr++ ) {
-    px.push_back( (*trkItr)->momentum()[Trk::px] );
-    py.push_back( (*trkItr)->momentum()[Trk::py] );
-    pz.push_back( (*trkItr)->momentum()[Trk::pz] );
-  }
-
-  return InvMass(px, py, pz, massHypo);
-}
-*/
-//--------------------------------------------------------
-// Invariant mass calculations using Trk::Perigee.
-//--------------------------------------------------------
-
-double InvMass(const std::vector<const Trk::Perigee*> & tracks, const std::vector<double> & massHypo) {
-    auto trkItr    = tracks.begin();
-    auto trkItrEnd = tracks.end();
-
-    std::vector<double> px, py, pz;
-    
-    for ( ; trkItr!=trkItrEnd; trkItr++ ) {
-        px.push_back( (*trkItr)->momentum()[Trk::px] );
-        py.push_back( (*trkItr)->momentum()[Trk::py] );
-        pz.push_back( (*trkItr)->momentum()[Trk::pz] );
-    }
-    
-    return InvMass(px, py, pz, massHypo);
-}
-
-
-//----------------------------------------------
-// Invariant mass calculations using Trk::Track.
-//----------------------------------------------
-/*
-double InvMass(const std::vector<const Trk::Track*> & tracks, const std::vector<double> & massHypo) {
-
-  std::vector<const Trk::Track*>::const_iterator trkItr    = tracks.begin();
-  std::vector<const Trk::Track*>::const_iterator trkItrEnd = tracks.end();
-
-  std::vector<double> px, py, pz;
-
-  for ( ; trkItr!=trkItrEnd; trkItr++ ) {
-      // JW EDM
-      //    px.push_back( fabs((*trkItr)->perigeeParameters()->pT()) * ((*trkItr)->perigeeParameters()->cosPhi()) );
-      //    py.push_back( fabs((*trkItr)->perigeeParameters()->pT()) * ((*trkItr)->perigeeParameters()->sinPhi()) );
-      //    pz.push_back( fabs((*trkItr)->perigeeParameters()->pT()) * ((*trkItr)->perigeeParameters()->cotTheta()) );
-      px.push_back( fabs((*trkItr)->perigeeParameters()->pT()) * cos((*trkItr)->perigeeParameters()->parameters()[Trk::phi0]));
-      py.push_back( fabs((*trkItr)->perigeeParameters()->pT()) * sin((*trkItr)->perigeeParameters()->parameters()[Trk::phi0]));
-      pz.push_back( fabs((*trkItr)->perigeeParameters()->pT()) * 1./tan((*trkItr)->perigeeParameters()->parameters()[Trk::theta]));
-
-  }
-
-  return InvMass(px, py, pz, massHypo);
-}
-*/
-double fabsDeltaPhi(double phi1, double phi2) {
-    double dPhi=fabs(phi1 - phi2);
-    if (dPhi > M_PI) dPhi = 2.*M_PI - dPhi;
-    return dPhi;
-}
-
-double fabsDeltaEta(double eta1, double eta2) {
-    return fabs( eta1 - eta2);
-}
-
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.h
index b6f86ffc01764f14d9e3aa4a1a06c20afa56e8e8..22c4b168f4c08ee3469702ed40b8380977520836 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/BtrigUtils.h
@@ -6,30 +6,11 @@
 #define BTRIGUTILS_H
 
 #include <vector>
+#include "xAODTracking/TrackParticle.h"
+#include "GeoPrimitives/GeoPrimitives.h"  // for Vector3D
 
-#include "TrigInDetEvent/TrigInDetTrack.h"
-#include "TrigInDetEvent/TrigInDetTrackFitPar.h"
-//#include "TrigMuonEvent/TrigMuonEFInfoContainer.h"
-#include "TrigSteeringEvent/Enums.h"
-
-
-// xAOD edm
-#include "xAODMuon/MuonContainer.h"
-
-//double PtVal(const std::vector<const Trk::Track*>&);
 double PtVal(const std::vector<const xAOD::TrackParticle*>&);
 
-double LxyVal(const double, const double, const Amg::Vector3D, const Amg::Vector3D);
-
-double InvMass(const std::vector<const TrigInDetTrack*>  &    , const std::vector<double>&);
-double InvMass(const std::vector<const TrigInDetTrackFitPar*>&, const std::vector<double>&);
-double InvMass(const std::vector<const Trk::TrackParameters*>&, const std::vector<double>&);
-//double InvMass(const std::vector<const Trk::Track*>          &, const std::vector<double>&);
-double InvMass(const std::vector<const Trk::Perigee*>        &, const std::vector<double>&);
-
-// JW new methods to help simplify the algorithms
-
-double fabsDeltaPhi(double phi1, double phi2); //! absolute delta phi - correcting for 2pi
-double fabsDeltaEta(double eta1, double eta2); //! absolute delta eta
+double LxyVal(const double, const double, const Amg::Vector3D&, const Amg::Vector3D&);
 
 #endif // BTRIGUTILS_H
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/Constants.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/Constants.h
index 6dd0ecca41e76ab16a267b51b8aaf6df23492c01..475f4edba579422b55cdadefac156d2bdfb78b40 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/Constants.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/Constants.h
@@ -5,32 +5,31 @@
 #ifndef TRIGBPHYSHYPO_CONSTANTS_H
 #define TRIGBPHYSHYPO_CONSTANTS_H
 
-const double EPSILON     =      1.0E-6;
-const double PROTONMASS  =    938.272;    //MeV
-const double EMASS       =      0.511003;//MeV
-const double MUMASS      =    105.65837; //MeV
-const double PIMASS      =    139.57;    //MeV
-const double JPSIMASS    =   3096.916;   //MeV
-const double KMASS       =    493.677;   //MeV
-const double PHIMASS     =   1020.;      //MeV
-const double DSMASS      =   1968.2;     //MeV
-const double KPLUSMASS   =    493.67700; //MeV
-const double BPLUSMASS   =   5279.13;    //MeV
-const double BSMASS      =   5369.3;     //MeV
-const double KSTARMASS   =    891.66;    //MeV
-const double BDMASS      =   5279.5;     //MeV
-const double LAMBDAMASS  =   1115.683;   //MeV
-const double LAMBDABMASS =   5620.2;     //MeV
-const double BCMASS      =   6277.0;     //MeV
+constexpr double EPSILON     =      1.0E-6;
+constexpr double PROTONMASS  =    938.272;    //MeV
+constexpr double EMASS       =      0.511003;//MeV
+constexpr double MUMASS      =    105.65837; //MeV
+constexpr double PIMASS      =    139.57;    //MeV
+constexpr double JPSIMASS    =   3096.916;   //MeV
+constexpr double KMASS       =    493.677;   //MeV
+constexpr double PHIMASS     =   1020.;      //MeV
+constexpr double DSMASS      =   1968.2;     //MeV
+constexpr double KPLUSMASS   =    493.67700; //MeV
+constexpr double BPLUSMASS   =   5279.13;    //MeV
+constexpr double BSMASS      =   5369.3;     //MeV
+constexpr double KSTARMASS   =    891.66;    //MeV
+constexpr double BDMASS      =   5279.5;     //MeV
+constexpr double LAMBDAMASS  =   1115.683;   //MeV
+constexpr double LAMBDABMASS =   5620.2;     //MeV
+constexpr double BCMASS      =   6277.0;     //MeV
 
-/// list of decay constants BMuMuX
-const int di_to_muons = 0;      
-const int b_to_K = 1;           // to recognize type of decay B+/- ->K+/-      mu+ mu-
-const int bD_to_Kstar = 2; 		// to recognize type of decay Bd   ->K*(K+Pi-) mu+ mu-
-const int bS_to_Phi = 3; 		// to recognize type of decay Bs   ->Phi(K+K-) mu+ mu-
-const int lB_to_L = 4; 		    // to recognize type of decay Lb   ->L(PPi-)   mu+ mu-
-const int bC_to_PiPi = 5; 	// to recognize type of decay Bc   ->D+(K-pi+pi+) mu+ mu-
-//const int bP_to_Kstar = 5;      // to recognize type of decay B+   ->K*+       mu+ mu-
-const int di_to_electrons = 6;      
+/// list of decay constexprants BMuMuX
+constexpr int di_to_muons = 0;      
+constexpr int b_to_K = 1;           // to recognize type of decay B+/- ->K+/-      mu+ mu-
+constexpr int bD_to_Kstar = 2; 		// to recognize type of decay Bd   ->K*(K+Pi-) mu+ mu-
+constexpr int bS_to_Phi = 3; 		// to recognize type of decay Bs   ->Phi(K+K-) mu+ mu-
+constexpr int lB_to_L = 4; 		    // to recognize type of decay Lb   ->L(PPi-)   mu+ mu-
+constexpr int bC_to_PiPi = 5; 	// to recognize type of decay Bc   ->D+(K-pi+pi+) mu+ mu-
+constexpr int di_to_electrons = 6;      
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.cxx
index f4622c27d565b02aeb7b8420c2123e5f86ea88cc..1b5661332416dbe45a08c0d1436f3510d48be46e 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.cxx
@@ -17,9 +17,7 @@
 #include "TrigBphysElectronCounter.h"
 
 #include "xAODEgamma/ElectronContainer.h"
-#include "TrigTimeAlgs/TrigTimerSvc.h" 
-#include "FourMomUtils/P4Helpers.h"
-
+#include "TrigTimeAlgs/TrigTimer.h"                  // for TrigTimer
 
 // Define the bins for acceptance-monitoring histogram
 #define ACCEPT_hltExecute         0
@@ -202,7 +200,7 @@ HLT::ErrorCode TrigBphysElectronCounter::hltExecute(std::vector<std::vector<HLT:
   xAOD::TrackParticleAuxContainer outputTrackCollAuxCont;
   outputTrackColl->setStore( &outputTrackCollAuxCont );
   outputTrackColl->reserve(m_nEfElectron);
-    for( auto elec : efelectrons ){
+    for( const auto& elec : efelectrons ){
       xAOD::TrackParticle *trk1 = new xAOD::TrackParticle();
       trk1->makePrivateStore( (*elec)->trackParticle());
       outputTrackColl->push_back(trk1);
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.h
index ab36be4fd711da2bd80931db6735d7913587dd2f..eb481292c9d6ff40d9985f262e0e0eef13d99eff 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysElectronCounter.h
@@ -99,17 +99,14 @@ template<class Tin, class Tout> int TrigBphysElectronCounter::passNObjects(int n
   ElementLinkVector<Tin> inVecColl;
   outVec.clear();
   std::vector<float> pts;
-  std::vector<unsigned int> isEMs;
-  std::vector<bool> isLHAcceptTrigs;
   
   float mindR2 = mindR*mindR;
 
   bool useLumiTool=false;
-  double mu = 0.;
   double avg_mu = 0.;
   if(m_useAthElectronLHIDSelector && m_lumiBlockMuTool){
       useLumiTool=true;
-      mu = m_lumiBlockMuTool->actualInteractionsPerCrossing(); // (retrieve mu for the current BCID)
+      double mu = m_lumiBlockMuTool->actualInteractionsPerCrossing(); // (retrieve mu for the current BCID)
       avg_mu = m_lumiBlockMuTool->averageInteractionsPerCrossing();
       ATH_MSG_DEBUG("REGTEST: Retrieved Mu Value : " << mu << ", Average Mu Value   : " << avg_mu);
   }
@@ -205,7 +202,6 @@ template<class Tin, class Tout> int TrigBphysElectronCounter::passNObjects(int n
   }
 
   // now check pts cuts  
-  //std::sort(isEMs.begin(), isEMs.end(), [&pts](size_t i, size_t j) {return pts[i] > pts[j];});
   std::sort(pts.begin(), pts.end(), std::greater<float>());
 
   //== check that electrons have correct pts and isEM
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx
index 8fcabff24e5b5660bae38756b6e5a43b107cb938..b1a4a4fe510a7d3620c1644f5601c3ada713ae19 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx
@@ -29,7 +29,7 @@ TrigBphysHelperUtilsTool::TrigBphysHelperUtilsTool( const std::string& type,
 		      const std::string& name, 
 		      const IInterface* parent ) : 
   ::AthAlgTool  ( type, name, parent   )
-,  m_fitterSvc("Trk::TrkVKalVrtFitter/VertexFitterTool",this)
+,  m_fitterSvc("Trk::TrkVKalVrtFitter/VertexFitterTool",this), m_VKVFitter(nullptr)
 {
   declareInterface< TrigBphysHelperUtilsTool >(this);
   //
@@ -101,32 +101,6 @@ double TrigBphysHelperUtilsTool::deltaR(double deta, double dphi) const {
 }
 
 
-void TrigBphysHelperUtilsTool::addUnique(std::vector<const Trk::Track*>& tracks, const Trk::Track* trkIn) const {
-    // from the the original run-1 code
-    if (!trkIn) return;
-    std::vector<const Trk::Track*>::iterator tItr     = tracks.begin();
-    std::vector<const Trk::Track*>::iterator tItr_end = tracks.end();
-
-    double phi = trkIn->perigeeParameters()->parameters()[Trk::phi];
-    double eta = (*tItr)->perigeeParameters()->eta();
-    double pT  = fabs(trkIn->perigeeParameters()->pT());
-    
-    for (;tItr != tItr_end; ++tItr) {
-        if (trkIn == *tItr) continue; // don't consider if already included
-        // match on eta and phi
-        double dphi = absDeltaPhi((*tItr)->perigeeParameters()->parameters()[Trk::phi], phi);
-        double deta = absDeltaEta((*tItr)->perigeeParameters()->eta(), eta);
-        double dpt  = fabs(fabs((*tItr)->perigeeParameters()->pT()) - pT);
-        
-        if (dphi < 0.005 &&
-            deta < 0.005 &&
-            dpt  < 10.) return; // found a matching track, so return out of the function
-    } // for
-    
-    // if here then track is added to list
-    tracks.push_back(trkIn);
-}
-
 bool TrigBphysHelperUtilsTool::areUnique(const xAOD::TrackParticle* t0, const xAOD::TrackParticle* t1, double dEtaCut , double dPhiCut, double dPtCut) const {
     if (!t0 || !t1) {
         ATH_MSG_DEBUG("nullptr for inputs " << t0 << " " << t1 );
@@ -291,7 +265,6 @@ StatusCode TrigBphysHelperUtilsTool::buildDiMu(const std::vector<ElementLink<xAO
         ATH_MSG_DEBUG("Fit not allowed, Problems with TP1" );
     }
 
-    //const Trk::Vertex startingPoint(Amg::Vector3D(0.,0.,0.)); // #FIXME use beamline for starting point?
     const Amg::Vector3D startingPoint(0.,0.,0.);
     std::vector<const xAOD::TrackParticle*> trks;
     trks.push_back(*particles[0]);
@@ -313,9 +286,7 @@ StatusCode TrigBphysHelperUtilsTool::buildDiMu(const std::vector<ElementLink<xAO
         result->setFitz        (-9999);
         
     } else {
-        //std::vector<int> trkIndices(particles.size(),1);
         double invariantMass(0.), invariantMassError(0.); // #FIXME what about the input masses?
-        //if (!(m_VKVFitter->VKalGetMassError(trkIndices,invariantMass,invariantMassError).isSuccess())) {
         if (!(m_VKVFitter->VKalGetMassError(invariantMass,invariantMassError,*state).isSuccess())) {
             ATH_MSG_DEBUG("Warning from VKaVrt - cannot calculate uncertainties!");
         } // if
@@ -380,7 +351,7 @@ StatusCode TrigBphysHelperUtilsTool::vertexFit(xAOD::TrigBphys * result,
     bool doFit(true); // set false if problematic TP
     std::vector<const xAOD::TrackParticle*> trks;
     
-    for ( auto ptlEL : particles) {
+    for ( const auto& ptlEL : particles) {
         if (!ptlEL.isValid()) {
             ATH_MSG_DEBUG("Non valid TPEL" );
             doFit = false;
@@ -414,7 +385,6 @@ StatusCode TrigBphysHelperUtilsTool::vertexFit(xAOD::TrigBphys * result,
     } else {
         //std::vector<int> trkIndices(particles.size(),1);
         double invariantMass(0.), invariantMassError(0.); // #FIXME what about the input masses?
-        //if (!(m_VKVFitter->VKalGetMassError(trkIndices,invariantMass,invariantMassError).isSuccess())) {
         if (!(m_VKVFitter->VKalGetMassError(invariantMass,invariantMassError,istate).isSuccess())) {
             ATH_MSG_DEBUG("Warning from VKaVrt - cannot calculate uncertainties!");
             invariantMass = -9999.;
@@ -449,7 +419,7 @@ StatusCode TrigBphysHelperUtilsTool::vertexFit(xAOD::TrigBphys * result,
         "fity:          " << result->fity() << "\n\t  " <<
         "fitz:          " << result->fitz() << "\n\t  " );
     
-    for ( auto ptlEL : particles) {
+    for ( const auto& ptlEL : particles) {
         result->addTrackParticleLink(ptlEL);
     }
     return StatusCode::SUCCESS;
@@ -492,7 +462,6 @@ StatusCode TrigBphysHelperUtilsTool::vertexFit(xAOD::TrigBphys * result,
     } else {
         std::vector<int> trkIndices(trks.size(),1);
         double invariantMass(0.), invariantMassError(0.); // #FIXME what about the input masses?
-        //if (!(m_VKVFitter->VKalGetMassError(trkIndices,invariantMass,invariantMassError).isSuccess())) {
         if (!(m_VKVFitter->VKalGetMassError(invariantMass,invariantMassError,*state).isSuccess())) {
             ATH_MSG_DEBUG("Warning from VKaVrt - cannot calculate uncertainties!");
             invariantMass = -9999.;
@@ -541,42 +510,15 @@ double TrigBphysHelperUtilsTool::invariantMass(const xAOD::TrackParticle *p1, co
     static_assert(!std::is_base_of<xAOD::TrackParticle, xAOD::L2StandAloneMuon>::value, "Types have become ambiguous, units may be wrong" );
     assert(p1!=nullptr);
     assert(p2!=nullptr);
-    double px(0.),py(0.),pz(0.),E(0.);
-    
-
-    {
-    const auto &pv1 = p1->p4();
-    px += pv1.Px();
-    py += pv1.Py();
-    pz += pv1.Pz();
-    E  += sqrt(mi1*mi1 +
-               pv1.Px()*pv1.Px() +
-               pv1.Py()*pv1.Py() +
-               pv1.Pz()*pv1.Pz()
-          );
-    }
-    {
-    const auto &pv2 = p2->p4();
-    px += pv2.Px();
-    py += pv2.Py();
-    pz += pv2.Pz();
-    E  += sqrt(mi2*mi2 +
-               pv2.Px()*pv2.Px() +
-               pv2.Py()*pv2.Py() +
-               pv2.Pz()*pv2.Pz()
-          );
-    }
-    double m2 = E*E - px*px - py*py -pz*pz;
-    if (m2 < 0) return 0.;
-    else        return sqrt(m2);
+	const std::array<const xAOD::TrackParticle*, 2> &tracks{p1, p2};
+	const std::array<double, 2> &masses{mi1, mi2};
+    return invariantMassInternal(tracks.data(), masses.data(), 2);
 } // invariantMass
 
 
 double TrigBphysHelperUtilsTool::invariantMass(const std::vector<const xAOD::TrackParticle*>&ptls, const std::vector<double> & masses) const {
-    // 're-cast the vector in terms of the iparticle'
-    std::vector<const xAOD::IParticle*> i_ptls;
-    for ( auto tp : ptls) i_ptls.push_back(tp);
-    return invariantMassIP(i_ptls,masses);
+	assert(ptls.size() == masses.size());
+    return invariantMassInternal(ptls.data(), masses.data(), masses.size());
 }
 
 
@@ -627,15 +569,6 @@ void TrigBphysHelperUtilsTool::fillTrigObjectKinematics(xAOD::TrigBphys* bphys,
          return;
      }
      
-     //     if (ptls.size() != masses.size()) {
-     //         if ( msg().level() <= MSG::WARNING ) {
-     //             msg()  << MSG::WARNING << "Nptls != nMasses; no information will be populated." );
-     //         }
-     //         return;
-     //     } // if invalid prequesits
-     
-     
-     
      xAOD::TrackParticle::FourMom_t fourMom;
      
      for (const auto& ptl : ptls) {
@@ -707,6 +640,25 @@ void TrigBphysHelperUtilsTool::setBeamlineDisplacement(xAOD::TrigBphys* bphys,
     bphys->setTauError(BsTauError);
 } // setBeamlineDisplacement
 
+double TrigBphysHelperUtilsTool::invariantMassInternal(const xAOD::TrackParticle* const* tracks, const double* masses, size_t N)
+{
+    double px(0.),py(0.),pz(0.),E(0.);
+    for(size_t i=0; i<N; i++){
+       const auto &pv1 = tracks[i]->p4();
+       double mi1 = masses[i];
+       px += pv1.Px();
+       py += pv1.Py();
+       pz += pv1.Pz();
+       E  += sqrt(mi1*mi1 +
+               pv1.Px()*pv1.Px() +
+               pv1.Py()*pv1.Py() +
+               pv1.Pz()*pv1.Pz()
+          );
+    }
+    double m2 = E*E - px*px - py*py -pz*pz;
+    if (m2 < 0) return 0.;
+    else        return std::sqrt(m2);
+}
 
 std::unique_ptr<Trk::IVKalState>
 TrigBphysHelperUtilsTool::makeVKalState() const
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.h
index 3bb9958f82141793952187b4e96335f6b49d2dd4..8ce0f2412f18e623fd9919ffc657237a63cf7f95 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.h
@@ -77,8 +77,6 @@ class TrigBphysHelperUtilsTool: virtual public ::AthAlgTool
   /////////////////////////////////////////////////////////////////// 
   // Non-const methods: 
   /////////////////////////////////////////////////////////////////// 
-    void addUnique(std::vector<const Trk::Track*>& tracks, const Trk::Track* trkIn) const;   /// Copy of the default method in main code
-    
     void addUnique(const xAOD::Muon* muon, std::vector<const xAOD::Muon*> & output,
                    double dEtaCut = 0.005, double dPhiCut=0.005, double dPtCut =-1,
                    xAOD::Muon::TrackParticleType ptype= xAOD::Muon::InnerDetectorTrackParticle) const; ///
@@ -131,7 +129,7 @@ class TrigBphysHelperUtilsTool: virtual public ::AthAlgTool
   // Private data: 
   /////////////////////////////////////////////////////////////////// 
  private: 
-
+  static double invariantMassInternal(const xAOD::TrackParticle* const* tracks , const double*  masses , size_t N);
   /// Default constructor: 
   TrigBphysHelperUtilsTool();
 
@@ -153,22 +151,7 @@ class TrigBphysHelperUtilsTool: virtual public ::AthAlgTool
 
 template<size_t N>
 double TrigBphysHelperUtilsTool::invariantMass(const std::array<const xAOD::TrackParticle*, N> &tracks, const std::array<double, N> &masses){
-    double px(0.),py(0.),pz(0.),E(0.);
-    for(size_t i=0; i<N; i++){
-       const auto &pv1 = tracks[i]->p4();
-       double mi1 = masses[i];
-       px += pv1.Px();
-       py += pv1.Py();
-       pz += pv1.Pz();
-       E  += sqrt(mi1*mi1 +
-               pv1.Px()*pv1.Px() +
-               pv1.Py()*pv1.Py() +
-               pv1.Pz()*pv1.Pz()
-          );
-    }
-    double m2 = E*E - px*px - py*py -pz*pz;
-    if (m2 < 0) return 0.;
-    else        return std::sqrt(m2);
+   return invariantMassInternal(tracks.data(), masses.data(), N);
 }
 
 
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.cxx
index bac752349938a5a062261bb99d565541f6634ea6..566f41056a765563c57bb91a1ebf6207fad4ade9 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.cxx
@@ -15,10 +15,8 @@
  **************************************************************************/ 
  
 #include "TrigBphysMuonCounter.h"
-
+#include "TrigTimeAlgs/TrigTimer.h"                  // for TrigTimer
 #include "xAODMuon/MuonContainer.h"
-#include "TrigTimeAlgs/TrigTimerSvc.h"
-#include "FourMomUtils/P4Helpers.h"
 
 
 // Define the bins for acceptance-monitoring histogram
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.h
index 4e892a89f8a0c21a4a538bd4a19963a1f21d1d1b..727f6ab0085f46f57717863ba83d50ed6a5a93d6 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysMuonCounter.h
@@ -20,8 +20,6 @@
 
 // standard stuff
 #include <string>
-#include <map>
-#include <cmath> 
 #include <algorithm>
 
 #include "TrigInterfaces/AllTEAlgo.h"
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysTrackRoiMaker.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysTrackRoiMaker.h
index 768817fcad09cf34a7adf6f480657f0015e783ee..a8dbc49067a7d0e0c277a401adc65c99c65a16ab 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysTrackRoiMaker.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysTrackRoiMaker.h
@@ -17,9 +17,8 @@
 #include "TrigInterfaces/FexAlgo.h"
 #include <string>
 
-// edm classes
-#include "xAODBase/IParticle.h"
-#include "xAODTracking/TrackParticle.h"
+#include <vector>                     // for vector
+#include "TrigSteeringEvent/Enums.h"  // for ErrorCode
 
 // fwd declare TrigRoiDescriptor class
 class TrigRoiDescriptor;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx
index cd07c6b8f41a2ad1b7afe587a085a71114a47ee7..e180b07e4c626c32f3085e33839d28ae534edcce 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx
@@ -26,8 +26,8 @@
 
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 #include "AthenaKernel/Timeout.h"
-
-
+#include "Constants.h"                                    // for BSMASS
+#include "TrigSteeringEvent/TrigRoiDescriptor.h"     // for TrigRoiDescriptor
 // additions of xAOD objects
 #include "xAODEventInfo/EventInfo.h"
 #include <memory>
@@ -35,15 +35,12 @@
 /*----------------------------------------------------------------------------*/
 TrigEFBEEXFex::TrigEFBEEXFex(const std::string & name, ISvcLocator* pSvcLocator):
 HLT::ComboAlgo(name, pSvcLocator)
-,m_fitterSvc("Trk::TrkVKalVrtFitter/VertexFitterTool",this)
 ,m_bphysHelperTool("TrigBphysHelperUtilsTool")
 ,m_TrigBphysColl_b(NULL)
 ,m_TrigBphysColl_X(NULL)
 
 ,m_TotTimer(0)
 ,m_VtxFitTimer(0)
-,m_VKVFitter(0)
-
 // counters
 ,m_lastEvent(-1)
 ,m_lastEventPassed(-1)
@@ -56,8 +53,6 @@ HLT::ComboAlgo(name, pSvcLocator)
 ,m_lastEventPassedBd(-1)
 ,m_lastEventPassedBs(-1)
 ,m_countPassedEventsBplus(0)
-,m_countPassedEventsBs(0)
-,m_countPassedEventsBd(0)
 
 ,m_countPassedEEID(0)
 ,m_countPassedEEOS(0)
@@ -89,7 +84,6 @@ HLT::ComboAlgo(name, pSvcLocator)
 
 {
     declareProperty("TrigBphysHelperTool", m_bphysHelperTool);
-    declareProperty("VertexFitterTool", m_fitterSvc);
     
     declareProperty("bphysCollectionKey", m_bphysCollectionKey  = "EFBEEXFex" );
     declareProperty("AcceptAll",    m_acceptAll=true); // Should we just accept all events
@@ -138,10 +132,6 @@ HLT::ComboAlgo(name, pSvcLocator)
     declareProperty("MaxBsToStore", m_maxBsToStore = -1);
     
 
-    // FTK Flag
-    declareProperty("DoFTK",    m_FTK=false); // Are we using FTK??
-
-    
     // Monitoring variables
     //   General
     declareMonitoredStdContainer("Errors",     m_mon_Errors,     AutoClear);
@@ -229,7 +219,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltInitialize()
     
     ATH_MSG_DEBUG("Initialization completed successfully:" );
     ATH_MSG_DEBUG("AcceptAll          = "   << (m_acceptAll==true ? "True" : "False") );
-    ATH_MSG_DEBUG("DoFTK         = "        << (m_FTK==true ? "True" : "False") );
     ATH_MSG_DEBUG("MaxNcombinations            = " << m_maxNcombinations );
         
     ATH_MSG_DEBUG("Activated decays:" );
@@ -245,15 +234,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltInitialize()
         m_VtxFitTimer = addTimer("EFBEEXFexVtxFit");
     }
     
-    // retrieving the vertex fitting tool
-    if (m_fitterSvc.retrieve().isFailure()) {
-        ATH_MSG_ERROR("Can't find Trk::TrkVKalVrtFitter" );
-        return HLT::OK;
-    } else {
-        ATH_MSG_DEBUG("Trk::TrkVKalVrtFitter found" );
-        m_VKVFitter = dynamic_cast< Trk::TrkVKalVrtFitter* > (&(*m_fitterSvc));
-    }
-    
     // retrieving BphysHelperUtilsTool
     if (m_bphysHelperTool.retrieve().isFailure()) {
         ATH_MSG_ERROR("Can't find TrigBphysHelperUtilsTool" );
@@ -273,12 +253,8 @@ HLT::ErrorCode TrigEFBEEXFex::hltInitialize()
     m_lastEventPassedBplus=-1;
     m_lastEventPassedBd=-1;
     m_lastEventPassedBs=-1;
-    m_lastEventPassedLb=-1;
     
     m_countPassedEventsBplus=0;
-    m_countPassedEventsBs=0;
-    m_countPassedEventsBd=0;
-    m_countPassedEventsLb=0;
     
     m_countPassedEEID=0;
     m_countPassedEEOS=0;
@@ -303,9 +279,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltInitialize()
     m_countPassedPhi1020VtxChi2=0;
     m_countPassedBsVtx=0;
     m_countPassedBsVtxChi2=0;
-    
-
-    
     return HLT::OK;
 }
 
@@ -320,8 +293,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltFinalize()
     ATH_MSG_INFO("Run on events/RoIs      " << m_countTotalEvents << "/" << m_countTotalRoI );
     ATH_MSG_INFO("Passed events/RoIs      " << m_countPassedEvents << "/" << m_countPassedRoIs );
     ATH_MSG_INFO("Evts Passed B+:         " << m_countPassedEventsBplus );
-    ATH_MSG_INFO("Evts Passed Bd:         " << m_countPassedEventsBd );
-    ATH_MSG_INFO("Evts Passed Bs:         " << m_countPassedEventsBs );
     ATH_MSG_INFO(std::endl );
     ATH_MSG_INFO("PassedEEID:           " << m_countPassedEEID );
     ATH_MSG_INFO("PassedEEOS:           " << m_countPassedEEOS );
@@ -393,7 +364,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
         ATH_MSG_WARNING("Failed to get xAOD::EventInfo " );
     }else { // found the xAOD event info
         ATH_MSG_DEBUG(" Run " << evtInfo->runNumber() << " Event " << evtInfo->eventNumber() << " using algo m_lepAlgo" );
-//        IdRun   = evtInfo->runNumber();
         IdEvent = evtInfo->eventNumber();
     } // get event info
     
@@ -401,27 +371,13 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
     //Check that we got 2 input TEs
     int lep1_TE=-1;
     int lep2_TE=-1;
-    if (!m_FTK) {
-      if ( inputTE.size() != 2 ) {
-        ATH_MSG_DEBUG("Got different than 2 number of input TEs: " << inputTE.size() );
-          //m_mon_Errors.push_back(ERROR_Not_2_InputTEs);
-          //if ( timerSvc() ) m_TotTimer->stop();
-          //return HLT::BAD_JOB_SETUP;
-        lep1_TE=0;
-        lep2_TE=0;
-      }else{
-        lep1_TE=0;
-        lep2_TE=1;
-      }
-    } else {
-      if ( inputTE.size() != 3 ) {
-        ATH_MSG_ERROR("FTK mode expect 3 input TEs, got : " << inputTE.size() );
-        m_mon_Errors.push_back(ERROR_Not_2_InputTEs);
-        if ( timerSvc() ) m_TotTimer->stop();
-        return HLT::BAD_JOB_SETUP;
-      }
-      lep1_TE=1;
-      lep2_TE=2;
+    if ( inputTE.size() != 2 ) {
+      ATH_MSG_DEBUG("Got different than 2 number of input TEs: " << inputTE.size() );
+      lep1_TE=0;
+      lep2_TE=0;
+    }else{
+      lep1_TE=0;
+      lep2_TE=1;
     }
 
 
@@ -445,7 +401,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
     //Retrieve ROIs
     const TrigRoiDescriptor *roiDescriptor1(0);
     const TrigRoiDescriptor *roiDescriptor2(0);
-    const TrigRoiDescriptor *roiDescriptorTrk(0); // for FTK chain
     
     // get them from the navigation
 
@@ -471,24 +426,10 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
        return HLT::NAV_ERROR;
      }
 
-     if (m_FTK) {
-      if ( getFeature(inputTE[0], roiDescriptorTrk) != HLT::OK ) {
-        ATH_MSG_ERROR("Navigation error while getting RoI descriptor Trk" );
-        m_mon_Errors.push_back(ERROR_No_RoIs);
-        if ( timerSvc() ) m_TotTimer->stop();
-        return HLT::NAV_ERROR;
-      }
-     }
-
-
-    
-     ATH_MSG_DEBUG("Using inputTEs: "<< inputTE[lep1_TE] <<  " and "  << inputTE[lep2_TE] << " with Ids " << inputTE[lep1_TE]->getId()<< " AND "<< inputTE[lep2_TE]->getId());
+      ATH_MSG_DEBUG("Using inputTEs: "<< inputTE[lep1_TE] <<  " and "  << inputTE[lep2_TE] << " with Ids " << inputTE[lep1_TE]->getId()<< " AND "<< inputTE[lep2_TE]->getId());
      ATH_MSG_DEBUG("; RoI IDs = "   << roiDescriptor1->roiId()<< " AND   " <<roiDescriptor2->roiId());
      ATH_MSG_DEBUG(": Eta1 =    "   << roiDescriptor1->eta() << " Eta2= " <<roiDescriptor2->eta() << ", Phi1 =    "   << roiDescriptor1->phi() << " Phi2= " <<roiDescriptor2->phi());
-	 if (m_FTK) {
-	    ATH_MSG_DEBUG("Using inputTE for tracks: "<< inputTE[0] << " " << inputTE[0]->getId()
-          << "; RoI IDs = "   << roiDescriptorTrk->roiId() << ": EtaTrk =    "   << roiDescriptorTrk->eta() << ", PhiTrk =    "   << roiDescriptorTrk->phi() );
-	 }
+
         
     // Fill RoIs monitoring containers
     m_mon_RoI_RoI1Eta.push_back(roiDescriptor1->eta());
@@ -519,7 +460,7 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
 
 
     // OI : here we probably should check that electron object has passed identification at the previous step
-    for ( const auto muel : lepContainerEF1 ) {
+    for ( const auto& muel : lepContainerEF1 ) {
    
       //if ( (*muel)->lepType() != xAOD::Lep::Combined && (*muel)->lepType() != xAOD::Lep::SegmentTagged) {
       //  ATH_MSG_DEBUG("Lep from roi1 is neither Combined or SegmentTagged - reject" );
@@ -556,7 +497,7 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
     }
     ATH_MSG_DEBUG("Found LepContainer, Got LepEF (2) Feature, size = " << lepContainerEF2.size());
     
-    for ( const auto muel : lepContainerEF2 ) {
+    for ( const auto& muel : lepContainerEF2 ) {
       //if ( (*muel)->lepType() != xAOD::Electron::Combined && (*muel)->lepType() != xAOD::Electron::SegmentTagged) {
       //  ATH_MSG_DEBUG("Lep from roi2 is neither Combined or SegmentTagged - reject" );
       //  continue;
@@ -578,14 +519,14 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
     
     // build a map of the tracks and corresponding leps
     std::map<const xAOD::TrackParticle*, ElementLink<xAOD::ElectronContainer> > mapTrkToLeps;
-    for (const auto mu : lepContainerEF1) {
+    for (const auto& mu : lepContainerEF1) {
             auto idtp  = (*mu)->trackParticleLink();
             if (!idtp.isValid()) continue;
             if (!*idtp) continue;
             //if (!(*idtp)->track()) continue;
             mapTrkToLeps[(*idtp)] = mu;
     } // lepContainerEF1
-    for (const auto mu : lepContainerEF2) {
+    for (const auto& mu : lepContainerEF2) {
             auto idtp  = (*mu)->trackParticleLink();
             if (!idtp.isValid()) continue;
             if (!*idtp) continue;
@@ -596,21 +537,17 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
     if(msgLvl() <= MSG::DEBUG){
         msg() << MSG::DEBUG << "lepContainerEF1.size()= " << lepContainerEF1.size() << "lepContainerEF2.size()= " << lepContainerEF2.size() 
           << "lepTPELtracks1.size()= "  << lepTPELtracks1.size() << "lepTPELtracks2.size()= "  << lepTPELtracks2.size() << "lepTPELtracksMerged.size()= "  << lepTPELtracksMerged.size()<< endmsg;        
-        for (auto muel: lepTPELtracks1) {
+        for (const auto& muel: lepTPELtracks1) {
             msg() << MSG::DEBUG << "lepTPELtracks1: " << *muel << " " << (*muel)->pt() << " , " << (*muel)->eta() << " , " << (*muel)->phi() << " , " << (*muel)->charge() << endmsg;
         }
-        for (auto muel: lepTPELtracks2) {
+        for (const auto& muel: lepTPELtracks2) {
             msg() << MSG::DEBUG << "lepTPELtracks2: " << *muel << " " << (*muel)->pt() << " , " << (*muel)->eta() << " , " << (*muel)->phi() << " , " << (*muel)->charge() << endmsg;
         }
-        for (auto muel: lepTPELtracksMerged) {
+        for (const auto& muel: lepTPELtracksMerged) {
             msg() << MSG::DEBUG << "lepTPELtracksMerged: " << *muel << " " << (*muel)->pt() << " , " << (*muel)->eta() << " , " << (*muel)->phi() << " , " << (*muel)->charge() << endmsg;
         }
     } // if debug
     
-    //   TrigEFBphys* trigPartBEEX (NULL);
-    // FIXME - remove these 'new's
-    //m_trigBphysColl_b = new TrigEFBphysContainer();
-    //m_trigBphysColl_X = new TrigEFBphysContainer();
     
     m_TrigBphysColl_b = new xAOD::TrigBphysContainer();
     xAOD::TrigBphysAuxContainer xAODTrigBphysAuxColl_b;
@@ -774,7 +711,7 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
                 std::map<const xAOD::TrackParticle*, ElementLink<xAOD::TrackParticleContainer> > mapTrackToEL;
                 
                 int idCounter(0);
-                for (auto trk: tracksRoiI1) {
+                for (const auto& trk: tracksRoiI1) {
                     // merged_tracks.push_back(trk);
                     addUnique(merged_tracks,*trk);
                     ElIndex tmp;
@@ -785,7 +722,7 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
                     ++idCounter;
                 }
                 idCounter = 0;
-                for (auto trk: tracksRoiI2) {
+                for (const auto& trk: tracksRoiI2) {
                     // merged_tracks.push_back(trk);
                     addUnique(merged_tracks,*trk);
                     ElIndex tmp;
@@ -842,10 +779,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
                     ELlep2.resetWithKeyAndIndex(trkmuit->second.dataID(),trkmuit->second.index());
                     Found2Track = true;
                 } // if
-                  //                ELlep1.resetWithKeyAndIndex(pTp->dataID(),pTp->index());
-                  //                Found1Track = true;
-                  //                ELlep2.resetWithKeyAndIndex(mTp->dataID(),mTp->index());
-                  //                Found2Track = true;
                 
                 ATH_MSG_DEBUG("Matching summary: " << Found1Track<<Found2Track << ", Now loop over TrackParticles to find tracks " );
                 //                    xAOD::TrackParticleContainer::const_iterator trkIt =  merged_tracks.begin();
@@ -862,13 +795,8 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
                 
                 for (int itrk1=0 ; trkIt1 != lastTrkIt; itrk1++, trkIt1++)
                 {
-                    //const Trk::Track* track1 = (*trkIt1)->track();
                     const xAOD::TrackParticle* track1 = (*trkIt1);
                     
-//                    ElementLink<xAOD::TrackParticleContainer> trackEL3( mapTrackToIndex[*trkIt1].roi == 1 ? tracksRoiI1[0].dataID() : tracksRoiI2[0].dataID(), mapTrackToIndex[*trkIt1].index);
-//                    ElementLink<xAOD::IParticleContainer> ItrackEL3;
-//                    ItrackEL3.resetWithKeyAndIndex(mapTrackToIndex[*trkIt1].roi == 1 ? tracksRoiI1[0].dataID() : tracksRoiI2[0].dataID(), mapTrackToIndex[*trkIt1].index);
-                    
                     ElementLink<xAOD::TrackParticleContainer> & trackEL3 = mapTrackToIndex[*trkIt1].elLink;
                     ElementLink<xAOD::IParticleContainer> ItrackEL3;
                     ItrackEL3.resetWithKeyAndIndex(trackEL3.dataID(), trackEL3.index());
@@ -961,7 +889,6 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
                         }
                         
 			            if(m_doBd_KstarEEDecay || m_doBs_Phi1020EEDecay ) {
-                                //const Trk::Track* track2 = (*trkIt2)->track();
                                 const xAOD::TrackParticle* track2 = (*trkIt2);
 
                             // Sergey S.
@@ -1203,7 +1130,7 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
         ATH_MSG_WARNING("Failed to getFeaturesLinks trigBphys_X Collection in outputTE" );
         } else {
             if(msgLvl() <= MSG::DEBUG)
-            for ( const auto eltp: ELvecTBPh) {
+            for ( const auto& eltp: ELvecTBPh) {
               msg() << MSG::DEBUG << "  ===== TrigBphys Container ElementLinks : " 
               << " index: "  << eltp.index()
               << " sgkey: "  << eltp.dataID()
@@ -1220,7 +1147,7 @@ HLT::ErrorCode TrigEFBEEXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerE
               ElementLink<xAOD::TrigBphysContainer> secEL;
 //               secEL.resetWithKeyAndIndex(KEY,(*BPobj)->secondaryDecayLink().index());
               // match transient secondary decay ELs with those from persistified container
-              for(auto persistentSecEL : ELvecTBPh ) {
+              for(const auto& persistentSecEL : ELvecTBPh ) {
                 if(*persistentSecEL == *(*BPobj)->secondaryDecayLink())
                   secEL = persistentSecEL;
               }
@@ -1334,7 +1261,7 @@ xAOD::TrigBphys* TrigEFBEEXFex::checkBplusEEKplus(const ElementLink<xAOD::TrackP
     } // if m_doB_KEEVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         result->addTrackParticleLink(tpel);
       }
     }
@@ -1521,7 +1448,7 @@ xAOD::TrigBphys* TrigEFBEEXFex::checkBEE2X(const ElementLink<xAOD::TrackParticle
     } // do2XVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracksX) {
+      for(const auto& tpel : vec_tracksX) {
         fitVtx_X->addTrackParticleLink(tpel);
       }
     }
@@ -1547,7 +1474,7 @@ xAOD::TrigBphys* TrigEFBEEXFex::checkBEE2X(const ElementLink<xAOD::TrackParticle
     } // doBEE2XVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         fitVtx->addTrackParticleLink(tpel);
       }
     }
@@ -1558,30 +1485,6 @@ xAOD::TrigBphys* TrigEFBEEXFex::checkBEE2X(const ElementLink<xAOD::TrackParticle
 } // checkBEE2X
 
 
-
-/*----------------------------------------------------------------------------*/
-void TrigEFBEEXFex::addUnique(std::vector<const Trk::Track*>& tracks, const Trk::Track* trkIn)
-{
-    //  std::cout<<" in addUnique : trkIn pT= "<<trkIn->perigeeParameters()->pT()<<std::endl;
-    std::vector<const Trk::Track*>::iterator tItr;
-    for( tItr = tracks.begin(); tItr != tracks.end(); tItr++)
-    {
-        double dPhi=fabs((*tItr)->perigeeParameters()->parameters()[Trk::phi] -
-                         trkIn->perigeeParameters()->parameters()[Trk::phi]);
-        if (dPhi > M_PI) dPhi = 2.*M_PI - dPhi;
-        
-        if( fabs(dPhi) < 0.02 &&
-           fabs((*tItr)->perigeeParameters()->eta() -
-                trkIn->perigeeParameters()->eta()) < 0.02 ) 
-        { //std::cout<<" TrigEFBEEFex addUnique: the SAME tracks! pT= "<<
-            //trkIn->perigeeParameters()->pT()<<" and "<<
-            //(*tItr)->perigeeParameters()->pT()<<std::endl;
-            return;
-        }
-    } 
-    tracks.push_back(trkIn);       
-}
-
 /*----------------------------------------------------------------------------*/
 void TrigEFBEEXFex::addUnique(std::vector<const xAOD::TrackParticle*>& tps, const xAOD::TrackParticle* tpIn)
 {
@@ -1644,149 +1547,93 @@ bool TrigEFBEEXFex::isUnique(const  xAOD::TrackParticle* id1, const  xAOD::Track
 
 double TrigEFBEEXFex::XMass(const xAOD::TrackParticle* particle1, const xAOD::TrackParticle* particle2, int decay) { /// checking the mass
     
-    std::vector<double> massHypo;
-    massHypo.clear();
+    std::array<double, 2> massHypo;
     if(decay == di_to_electrons){
-        massHypo.push_back(EMASS);
-        massHypo.push_back(EMASS);
+        massHypo[0] = EMASS;
+        massHypo[1] = EMASS;
     }
-    if(decay == bD_to_Kstar){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(PIMASS);
+    else if(decay == bD_to_Kstar){
+        massHypo[0] = KPLUSMASS;
+        massHypo[1] = PIMASS;
+    }
+    else if(decay == bS_to_Phi){
+        massHypo[0] = KPLUSMASS;
+        massHypo[1] = KPLUSMASS;
     }
-    if(decay == bS_to_Phi){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(KPLUSMASS);
+    else if(decay == bC_to_PiPi){  
+        massHypo[0] = PIMASS;
+        massHypo[1] = PIMASS;    
     }
-    if(decay == bC_to_PiPi){  
-        massHypo.push_back(PIMASS);
-        massHypo.push_back(PIMASS);    
+    else if(decay == lB_to_L){
+        massHypo[0] = PROTONMASS;
+        massHypo[1] = PIMASS;
     }
-    if(decay == lB_to_L){
-        massHypo.push_back(PROTONMASS);
-        massHypo.push_back(PIMASS);
+    else{
+        throw std::runtime_error("unknown decay TrigEFBEEXFex::XEEMass");
     }
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
+    const std::array<const xAOD::TrackParticle*, 2> bTracks{particle1, particle2};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBEEXFex::X3Mass(const xAOD::TrackParticle* particle1, const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
-    
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static const std::array<double, 3> massHypo{KPLUSMASS, KPLUSMASS, PIMASS};
+    const std::array<const xAOD::TrackParticle*, 3> bTracks{particle1, particle2, particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBEEXFex::XKPiPiMass(const xAOD::TrackParticle* particle1, const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
-    
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static const std::array<double, 3> massHypo{ KPLUSMASS, PIMASS, PIMASS};
+    const std::array<const xAOD::TrackParticle*, 3> bTracks{ particle1, particle2, particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBEEXFex::KEEMass( const xAOD::TrackParticle* lep1, const xAOD::TrackParticle* lep2, const xAOD::TrackParticle* kaon) {
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(EMASS);
-    massHypo.push_back(EMASS);
-    massHypo.push_back(KPLUSMASS);  //K
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(lep1);
-    bTracks.push_back(lep2);
-    bTracks.push_back(kaon);
+    static const std::array<double, 3> massHypo{ EMASS, EMASS, KPLUSMASS};
+    const std::array<const xAOD::TrackParticle*, 3> bTracks{lep1, lep2, kaon};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
 }
 
 double TrigEFBEEXFex::XEEMass(const xAOD::TrackParticle* lep1, const xAOD::TrackParticle* lep2, const xAOD::TrackParticle* particle1,
                                   const xAOD::TrackParticle* particle2, int decay){
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(EMASS);
-    massHypo.push_back(EMASS);
+    std::array<double, 4> massHypo;
+    massHypo[0] = EMASS;
+    massHypo[1] = EMASS;
     if(decay == bD_to_Kstar){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(PIMASS);
+        massHypo[2] = KPLUSMASS;
+        massHypo[3] = PIMASS;
     }
-    if(decay == bS_to_Phi){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(KPLUSMASS);
+    else if(decay == bS_to_Phi){
+        massHypo[2] = KPLUSMASS;
+        massHypo[3] = KPLUSMASS;
     }
-    if(decay == bC_to_PiPi){  
-        massHypo.push_back(PIMASS);
-        massHypo.push_back(PIMASS);    
+    else if(decay == bC_to_PiPi){
+        massHypo[2] = PIMASS;
+        massHypo[3] = PIMASS;
     }
-    if(decay == lB_to_L){
-        massHypo.push_back(PROTONMASS);
-        massHypo.push_back(PIMASS);
+    else if(decay == lB_to_L){
+        massHypo[2] = PROTONMASS;
+        massHypo[3] = PIMASS;
+    }else{
+        throw std::runtime_error("unknown decay TrigEFBEEXFex::XEEMass");
     }
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(lep1);
-    bTracks.push_back(lep2);
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
+    std::array<const xAOD::TrackParticle*, 4> bTracks{ lep1, lep2, particle1, particle2 };
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
 }
 
 double TrigEFBEEXFex::X3EEMass(const xAOD::TrackParticle* lep1, const xAOD::TrackParticle* lep2, const xAOD::TrackParticle* particle1,
                                    const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(EMASS);
-    massHypo.push_back(EMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(lep1);
-    bTracks.push_back(lep2);
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static constexpr std::array<double, 5> massHypo{ EMASS, EMASS, KPLUSMASS, KPLUSMASS, PIMASS};
+    const std::array<const xAOD::TrackParticle*, 5> bTracks{lep1, lep2, particle1, particle2, particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBEEXFex::XKPiPiEEMass(const xAOD::TrackParticle* lep1, const xAOD::TrackParticle* lep2, const xAOD::TrackParticle* particle1,
                                    const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(EMASS);
-    massHypo.push_back(EMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(lep1);
-    bTracks.push_back(lep2);
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static constexpr std::array<double, 5> massHypo{EMASS, EMASS, KPLUSMASS, PIMASS, PIMASS};
+    const std::array<const xAOD::TrackParticle*, 5> bTracks{ lep1, lep2, particle1, particle2, particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
-    
 }
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.h
index 9fde079ee80583e01c42a9a0efbf9f74155fb279..d093122e281cdf551dce1998949016086b6bc3cd 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.h
@@ -24,11 +24,7 @@
 #include <string>
 // trigger includes
 #include "TrigInterfaces/ComboAlgo.h"
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
 
-#include "Constants.h"
-#include "BtrigUtils.h"
 #include "TrigBphysHelperUtilsTool.h"
 
 #include "xAODEventInfo/EventInfo.h"
@@ -53,8 +49,6 @@ class TrigEFBEEXFex: public HLT::ComboAlgo  {
     
   private:
     
-    ToolHandle < Trk::IVertexFitter  >       m_fitterSvc;
-    
     ToolHandle <TrigBphysHelperUtilsTool> m_bphysHelperTool;
     
     // container inputs names
@@ -99,11 +93,6 @@ class TrigEFBEEXFex: public HLT::ComboAlgo  {
     float m_bSVtxChi2Cut;
     int m_maxBsToStore;
     
-
-    
-    // FTK Flag
-    bool m_FTK;
-
     // Monitoring variables and containers
     //   General
     std::vector<int>   m_mon_Errors;
@@ -179,10 +168,6 @@ class TrigEFBEEXFex: public HLT::ComboAlgo  {
     // to set Accept-All mode: should be done with force-accept when possible
     bool m_acceptAll;
 
-
-    // TrigEFBphysContainer* m_trigBphysColl_b;
-    // TrigEFBphysContainer* m_trigBphysColl_X;
-
     xAOD::TrigBphysContainer * m_TrigBphysColl_b;
     xAOD::TrigBphysContainer * m_TrigBphysColl_X;
     
@@ -190,8 +175,6 @@ class TrigEFBEEXFex: public HLT::ComboAlgo  {
     TrigTimer* m_TotTimer;
     TrigTimer* m_VtxFitTimer;
     
-    Trk::TrkVKalVrtFitter* m_VKVFitter;       
-    
     //Counters
     int m_lastEvent;
     int m_lastEventPassed;
@@ -203,11 +186,7 @@ class TrigEFBEEXFex: public HLT::ComboAlgo  {
     int m_lastEventPassedBplus;
     int m_lastEventPassedBd;
     int m_lastEventPassedBs;
-    int m_lastEventPassedLb;
     unsigned int m_countPassedEventsBplus;
-    unsigned int m_countPassedEventsBs;
-    unsigned int m_countPassedEventsBd;
-    unsigned int m_countPassedEventsLb;
     
     unsigned int m_countPassedEEID;
     unsigned int m_countPassedEEOS;
@@ -238,7 +217,6 @@ class TrigEFBEEXFex: public HLT::ComboAlgo  {
     
 
     
-    void addUnique(std::vector<const Trk::Track*>&, const Trk::Track*);
     void addUnique(std::vector<const xAOD::TrackParticle*>&, const xAOD::TrackParticle*);
     void addUnique(std::vector<ElementLink<xAOD::TrackParticleContainer> >&, const ElementLink<xAOD::TrackParticleContainer>&);
     bool isUnique(const  xAOD::TrackParticle* id1, const  xAOD::TrackParticle* id2) const;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.cxx
index f0190d1a12f4f73a30345f86837f0de8c9566625..ba3b44411cc3e39be7b3ba4141746a329cf116da 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.cxx
@@ -13,16 +13,12 @@
  **************************************************************************/ 
  
 #include "TrigEFBMuMuFex.h"
-#include "BtrigUtils.h"
 #include "TrigBphysHelperUtilsTool.h"
 
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 
-#include <iostream>
-//class ISvcLocator;
 
 // additions of xAOD objects
-#include "xAODEventInfo/EventInfo.h"
 #include "xAODMuon/MuonContainer.h"
 #include "xAODTracking/TrackParticle.h"
 #include "xAODTracking/TrackParticleContainer.h"
@@ -32,11 +28,7 @@
 
 TrigEFBMuMuFex::TrigEFBMuMuFex(const std::string & name, ISvcLocator* pSvcLocator):
 HLT::ComboAlgo(name, pSvcLocator)
-//  m_fitterSvc("Trk::TrkVKalVrtFitter/VertexFitterTool",this),
 ,m_bphysHelperTool("TrigBphysHelperUtilsTool")
-//m_trigBphysColl(NULL),
-//m_xAODTrigBphysColl(NULL),
-//m_xAODTrigBphysAuxColl(NULL)
 ,m_BmmHypTot(0),m_BmmHypVtx(0)
 ,m_expectNumberOfInputTE(2)
 ,m_massMuon(105.6583715)
@@ -80,7 +72,6 @@ HLT::ComboAlgo(name, pSvcLocator)
     declareProperty("LowerMassCut", m_lowerMassCut=2000.0);
     declareProperty("UpperMassCut", m_upperMassCut=10000.0);
     declareProperty("ApplyUpperMassCut", m_ApplyupperMassCut=true);
-    //declareProperty("VertexFitterTool", m_fitterSvc);
     declareProperty("MuonAlgo"    , m_muonAlgo="TrigMuSuperEF");
     declareProperty("ExtrapolatedTrackParticleContName", m_SAMuonLabel="MuonEFInfo_ExtrapTrackParticles");
     declareProperty("noId"        , m_noId              = false);
@@ -335,7 +326,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
             // loop over the vector of muon containers
             msg() << MSG::DEBUG << "MuonContainer, Got MuonEF " << ic << " Feature, size = " << muelv.size() << endmsg;
             int i(0);
-            for ( const auto muel: muelv) {
+            for ( const auto& muel: muelv) {
                 msg() << MSG::DEBUG << "ELLink: " << i++
                     << " index: "  << muel.index()
                     << " sgkey: "  << muel.dataID()
@@ -363,7 +354,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
         for ( const auto& tpelv : vec_elv_tps) {
             msg() << MSG::DEBUG <<  "SATrackParticleContainer, Got MUSA " << ic << " Feature, size = " << tpelv.size() << endmsg;
             int i(0);
-            for ( const auto tpel: tpelv) {
+            for ( const auto& tpel: tpelv) {
                 msg() << MSG::DEBUG << "ELLink: " << i++
                     << " index: "  << tpel.index()
                     << " sgkey: "  << tpel.dataID()
@@ -378,7 +369,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
     
     // for each of the two roi's make muons selection (not roi2 has m_noID complexity)
     std::vector<const xAOD::Muon*> muons0, muons1, muonsAll;
-    for (const auto muel: vec_elv_muons[0]){
+    for (const auto& muel: vec_elv_muons[0]){
         if ( (*muel)->muonType() != xAOD::Muon::Combined && (*muel)->muonType() != xAOD::Muon::SegmentTagged) {
             ATH_MSG_DEBUG("Muon from roi1 is neither Combined or SegmentTagged - reject" );
             continue;
@@ -388,7 +379,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
         m_bphysHelperTool->addUnique(*muel, muonsAll,0.005,0.005,10, m_muonParticleType);
     } // roi1
     if(vec_elv_muons.size() > 1) {
-      for (const auto muel: vec_elv_muons[1]){
+      for (const auto& muel: vec_elv_muons[1]){
           // special case if noId set
           if (m_noId) {
               // no check needed for the noID
@@ -437,7 +428,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
                 xAOD::TrigBphys * bphys = m_resultsHolder.back();
                 ElementLink<xAOD::IParticleContainer> ptl1EL,ptl2EL;
                 bool foundMu0(false), foundMu1(false);
-                for ( const auto muel: vec_elv_muons[0] ) {
+                for ( const auto& muel: vec_elv_muons[0] ) {
                     if ( *muel == mu0) {
                         ptl1EL.resetWithKeyAndIndex(muel.dataID(),muel.index());
                         foundMu0 = true;
@@ -449,7 +440,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
                     if (foundMu0 && foundMu1) break; // found both links
                 }
                 if(vec_elv_muons.size() > 1) {
-                  for ( const auto muel: vec_elv_muons[1] ) {
+                  for ( const auto& muel: vec_elv_muons[1] ) {
                       if ( *muel == mu0) {
                           ptl1EL.resetWithKeyAndIndex(muel.dataID(),muel.index());
                           foundMu0 = true;
@@ -490,7 +481,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
                 xAOD::TrigBphys * bphys = m_resultsHolder.back();
                 ElementLink<xAOD::IParticleContainer> ptl1EL,ptl2EL;
                 bool foundMu0(false), foundMu1(false);
-                for ( const auto muel: vec_elv_muons[0] ) {
+                for ( const auto& muel: vec_elv_muons[0] ) {
                     if ( *muel == mu0) {
                         ptl1EL.resetWithKeyAndIndex(muel.dataID(),muel.index());
                         foundMu0 = true;
@@ -502,7 +493,7 @@ HLT::ErrorCode TrigEFBMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
                     if (foundMu0 && foundMu1) break; // found both links
                 }
                 if(vec_elv_muons.size() > 1) {
-                  for ( const auto muel: vec_elv_muons[1] ) {
+                  for ( const auto& muel: vec_elv_muons[1] ) {
                       if ( *muel == mu0) {
                           ptl1EL.resetWithKeyAndIndex(muel.dataID(),muel.index());
                           foundMu0 = true;
@@ -584,10 +575,8 @@ void TrigEFBMuMuFex::buildCombination(const xAOD::Muon *mu0, const xAOD::Muon *m
     const xAOD::TrackParticle* tp1 = mu1->trackParticle(m_noId ? xAOD::Muon::MuonSpectrometerTrackParticle : m_muonParticleType);
     if (!tp0) return;
     if (!tp1) return;
-    const Trk::Track * trk0 = tp0->track();
-    const Trk::Track * trk1 = tp1->track();
-    if (trk1 && (trk1 == trk0)) {
-        ATH_MSG_DEBUG("Same Trk::Track pointers" );
+    if (tp0 == tp1) {
+        ATH_MSG_DEBUG("Same xAOD::TrackParticle  pointers" );
         return;
     } // if tracks the same
 
@@ -597,8 +586,8 @@ void TrigEFBMuMuFex::buildCombination(const xAOD::Muon *mu0, const xAOD::Muon *m
     } // track uniqueness
     m_mon_Acceptance.push_back( ACCEPT_MuMu_Unique );
     // opposite charge requirement
-    ATH_MSG_VERBOSE("Charges combination: " << mu0 << ": " << mu0->charge() << " " << tp0->qOverP() << " " << (trk0 ? trk0->perigeeParameters()->charge() : -99)
-        << " , " << mu1 << ": " << mu1->charge() << " " << tp1->qOverP() << " " << (trk1 ? trk1->perigeeParameters()->charge() : -99));
+    ATH_MSG_VERBOSE("Charges combination: " << mu0 << ": " << mu0->charge() << " " << tp0->qOverP() << " " <<  tp0->charge()
+        << " , " << mu1 << ": " << mu1->charge() << " " << tp1->qOverP() << " " << tp1->charge());
     
     if (m_oppositeCharge && (tp0->charge() * tp1->charge() > 0)) {
         ATH_MSG_DEBUG("Reject permutation due to opposite charge requirement: " << mu0->charge() << "  " << mu1->charge() );
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.h
index f27dbd8252d336a016e221c96b862faa838059d6..394e87a74198454d05637d3d73459a2f15973468 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuFex.h
@@ -21,13 +21,10 @@
 
 // standard stuff
 #include <string>
-#include <map>
-#include <cmath> 
 // general athena stuff
 //// trigger includes
 #include "TrigInterfaces/ComboAlgo.h"
 #include "xAODMuon/Muon.h"
-#include "AthLinks/ElementLink.h"
 
 // forward includes
 class TrigBphysHelperUtilsTool;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.cxx
index 54fe1e0ba407ca3341b356726ee2817e9efb216d..76bdfc96cee05d0546b4369b35493fcc0e7ebd32 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.cxx
@@ -18,23 +18,17 @@
  **
  **************************************************************************/
 
-//#include "TrigMuonEvent/CombinedMuonFeature.h"
-
 #include "TrigEFBMuMuHypo.h"
 
 #include <math.h>
 #include "xAODTrigger/TrigPassBits.h"
-#include "TrigNavigation/Navigation.h"
 
 
 // additions of xAOD objects
 #include "xAODEventInfo/EventInfo.h"
 #include "xAODTracking/TrackParticle.h"
-#include "xAODMuon/Muon.h"
-#include "xAODMuon/MuonContainer.h"
 #include "xAODTrigBphys/TrigBphys.h"
 #include "xAODTrigBphys/TrigBphysContainer.h"
-//#include "xAODTrigBphys/TrigBphysAuxContainer.h"
 
 class ISvcLocator;
 
@@ -149,12 +143,8 @@ HLT::ErrorCode TrigEFBMuMuHypo::hltExecute(const HLT::TriggerElement* outputTE,
   ATH_MSG_DEBUG("AcceptAll is set to : " << (m_acceptAll ? "True, taking all events " : "False, applying selection" ));
 
   //  create vector for TrigEFBphys particles
-    // const TrigEFBphysContainer* trigBphysColl = 0;
     const xAOD::TrigBphysContainer* trigBphysColl(0);
     
-//  const TrigEFBContainer* trigBphysColl = 0;
-//  const VxContainer* VertexColl;
-
   HLT::ErrorCode status = getFeature(outputTE, trigBphysColl, "EFBMuMuFex");
 
   if ( status != HLT::OK ) {
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.h
index ce88e25bb429f6e57d9166bbb2f7d3f05eb301a9..f8c69638592de7738bf2ac38f0ed505577df90c6 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuHypo.h
@@ -25,7 +25,6 @@
 #include "TrigInterfaces/HypoAlgo.h"
 
 #include "BeamSpotConditionsData/BeamSpotData.h"
-#include "Constants.h"
 
 class TrigEFBMuMuHypo: public HLT::HypoAlgo  {
   
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx
index 26b31d7a149ed650cc3c8311380422a72b45ca60..afd2b59da5e88cc9ef43893cfdaab35975b33f41 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx
@@ -320,10 +320,6 @@ HLT::ComboAlgo(name, pSvcLocator)
     declareProperty("BcD0VtxChi2Cut", m_bCD0VtxChi2Cut = 120.);           // default = 120.0
     declareProperty("MaxBcD0ToStore", m_maxBcD0ToStore = -1);
 
-    // FTK Flag
-    declareProperty("DoFTK",    m_FTK=false); // Are we using FTK??
-
-    
     // Monitoring variables
     //   General
     declareMonitoredStdContainer("Errors",     m_mon_Errors,     AutoClear);
@@ -510,7 +506,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltInitialize()
    
     ATH_MSG_DEBUG("Initialization completed successfully:" );
     ATH_MSG_DEBUG("AcceptAll          = "   << (m_acceptAll==true ? "True" : "False") );
-    ATH_MSG_DEBUG("DoFTK         = "        << (m_FTK==true ? "True" : "False") );
     ATH_MSG_DEBUG("MaxNcombinations            = " << m_maxNcombinations );
     ATH_MSG_DEBUG("Activated decays:" );
     ATH_MSG_DEBUG("    B+ -> mu mu K+ : " << (m_doB_KMuMuDecay==true ? "True" : "False") );
@@ -778,28 +773,15 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
     //Check that we got 2 input TEs
     int mu1_TE=-1;
     int mu2_TE=-1;
-    if (!m_FTK) {
-      if ( inputTE.size() != 2 ) {
-        ATH_MSG_DEBUG("Got different than 2 number of input TEs: " << inputTE.size() );
-          //m_mon_Errors.push_back(ERROR_Not_2_InputTEs);
-          //if ( timerSvc() ) m_TotTimer->stop();
-          //return HLT::BAD_JOB_SETUP;
-        mu1_TE=0;
-        mu2_TE=0;
-      }else{
-        mu1_TE=0;
-        mu2_TE=1;
-      }
-    } else {
-      if ( inputTE.size() != 3 ) {
-        ATH_MSG_ERROR("FTK mode expect 3 input TEs, got : " << inputTE.size() );
-        m_mon_Errors.push_back(ERROR_Not_2_InputTEs);
-        if ( timerSvc() ) m_TotTimer->stop();
-        return HLT::BAD_JOB_SETUP;
-      }
-      mu1_TE=1;
-      mu2_TE=2;
+    if ( inputTE.size() != 2 ) {
+      ATH_MSG_DEBUG("Got different than 2 number of input TEs: " << inputTE.size() );
+      mu1_TE=0;
+      mu2_TE=0;
+    }else{
+      mu1_TE=0;
+      mu2_TE=1;
     }
+    
 
 
     if(IdEvent!=m_lastEvent) {
@@ -824,7 +806,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
     //Retrieve ROIs
     const TrigRoiDescriptor *roiDescriptor1(0);
     const TrigRoiDescriptor *roiDescriptor2(0);
-    const TrigRoiDescriptor *roiDescriptorTrk(0); // for FTK chain
     
     // get them from the navigation
 
@@ -850,22 +831,10 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
        return HLT::NAV_ERROR;
      }
 
-     if (m_FTK) {
-      if ( getFeature(inputTE[0], roiDescriptorTrk) != HLT::OK ) {
-        ATH_MSG_ERROR("Navigation error while getting RoI descriptor Trk" );
-        m_mon_Errors.push_back(ERROR_No_RoIs);
-        if ( timerSvc() ) m_TotTimer->stop();
-        return HLT::NAV_ERROR;
-      }
-     }
 
     ATH_MSG_DEBUG("Using inputTEs: "<< inputTE[mu1_TE] <<  " and "  << inputTE[mu2_TE] << " with Ids " << inputTE[mu1_TE]->getId()<< " AND "<< inputTE[mu2_TE]->getId()
         << "; RoI IDs = "   << roiDescriptor1->roiId()<< " AND   " <<roiDescriptor2->roiId() << ": Eta1 =    "   << roiDescriptor1->eta() << " Eta2= " <<roiDescriptor2->eta()
         << ", Phi1 =    "   << roiDescriptor1->phi() << " Phi2= " <<roiDescriptor2->phi() );
-	if (m_FTK) {
-	  ATH_MSG_DEBUG("Using inputTE for tracks: "<< inputTE[0] << " " << inputTE[0]->getId()
-        << "; RoI IDs = "   << roiDescriptorTrk->roiId() << ": EtaTrk =    "   << roiDescriptorTrk->eta() << ", PhiTrk =    "   << roiDescriptorTrk->phi());
-	}
     
     // Fill RoIs monitoring containers
     m_mon_RoI_RoI1Eta.push_back(roiDescriptor1->eta());
@@ -879,8 +848,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
     m_mon_RoI_dPhiRoI.push_back( fabs(tmp_RoI_dPhiRoI) );
     
     // Retrieve muons
-    //std::vector<const Trk::Track*> muidIDtracks1;
-    //std::vector<const Trk::Track*> muidIDtracks2;
     //JW
     std::vector<ElementLink<xAOD::TrackParticleContainer> > muonTPELtracks1;
     std::vector<ElementLink<xAOD::TrackParticleContainer> > muonTPELtracks2;
@@ -903,7 +870,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
     }
     ATH_MSG_DEBUG("Found MuonContainer, Got MuonEF (1) Feature, size = " << muonContainerEF1.size());
     
-    for ( const auto muel : muonContainerEF1 ) {
+    for ( const auto& muel : muonContainerEF1 ) {
       if ( (*muel)->muonType() != xAOD::Muon::Combined && (*muel)->muonType() != xAOD::Muon::SegmentTagged) {
         ATH_MSG_DEBUG("Muon from roi1 is neither Combined or SegmentTagged - reject" );
         continue;
@@ -917,12 +884,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
           ATH_MSG_DEBUG("No innerdetector muon1 TrackParticle found" );
           continue;
       }
-        //const Trk::Track* indetTrack = idtp->track();
-        //if ( !indetTrack ) {
-        //  ATH_MSG_DEBUG("No id muon1 id Trk::Track found" );
-        //  continue;
-        //}
-        //addUnique(muidIDtracks1, indetTrack);
         addUnique(muonTPELtracks1,idtpEl);
         addUnique(muonTPELtracksMerged,idtpEl);
         
@@ -944,7 +905,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
     }
     ATH_MSG_DEBUG("Found MuonContainer, Got MuonEF (2) Feature, size = " << muonContainerEF2.size());
     
-    for ( const auto muel : muonContainerEF2 ) {
+    for ( const auto& muel : muonContainerEF2 ) {
       if ( (*muel)->muonType() != xAOD::Muon::Combined && (*muel)->muonType() != xAOD::Muon::SegmentTagged) {
         ATH_MSG_DEBUG("Muon from roi2 is neither Combined or SegmentTagged - reject" );
         continue;
@@ -958,12 +919,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
           ATH_MSG_DEBUG("No innerdetector muon2 TrackParticle found" );
           continue;
       }
-        //      const Trk::Track* indetTrack = idtp->track();
-        //      if ( !indetTrack ) {
-        //          ATH_MSG_DEBUG("No id muon2 id Trk::Track found" );
-        //          continue;
-        //      }
-        //addUnique(muidIDtracks2, indetTrack);
         addUnique(muonTPELtracks2,idtpEl);
         addUnique(muonTPELtracksMerged,idtpEl);
         ATH_MSG_DEBUG("Comb muon 1 pt/eta/phi " << idtp->pt() << " / " << idtp->eta() << " / " << idtp->phi());
@@ -973,7 +928,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
     // build a map of the tracks and corresponding muons
     std::map<const xAOD::TrackParticle*, ElementLink<xAOD::MuonContainer> > mapTrkToMuons;
     //for (auto& muCont: muonContainerEF1) {
-        for (const auto mu : muonContainerEF1) {
+        for (const auto& mu : muonContainerEF1) {
             auto idtp  = (*mu)->inDetTrackParticleLink();
             if (!idtp.isValid()) continue;
             if (!*idtp) continue;
@@ -982,7 +937,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
         } // muCont
     //} // muonContainerEF1
     //for (auto& muCont: muonContainerEF2) {
-        for (const auto mu : muonContainerEF2) {
+        for (const auto& mu : muonContainerEF2) {
             auto idtp  = (*mu)->inDetTrackParticleLink();
             if (!idtp.isValid()) continue;
             if (!*idtp) continue;
@@ -995,23 +950,17 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
         msg() << MSG::DEBUG << "muonContainerEF1.size()= " << muonContainerEF1.size()<< " muonContainerEF2.size()= " << muonContainerEF2.size() 
           << " uonTPELtracks1.size()= "  << muonTPELtracks1.size() << " muonTPELtracks2.size()= "  << muonTPELtracks2.size() << " muonTPELtracksMerged.size()= "  << muonTPELtracksMerged.size() <<endmsg;
         
-        for (auto muel: muonTPELtracks1) {
+        for (const auto& muel: muonTPELtracks1) {
             msg() << MSG::DEBUG << "muonTPELtracks1: " << *muel << " " << (*muel)->pt() << " , " << (*muel)->eta() << " , " << (*muel)->phi() << " , " << (*muel)->charge() << endmsg;
         }
-        for (auto muel: muonTPELtracks2) {
+        for (const auto& muel: muonTPELtracks2) {
             msg() << MSG::DEBUG << "muonTPELtracks2: " << *muel << " " << (*muel)->pt() << " , " << (*muel)->eta() << " , " << (*muel)->phi() << " , " << (*muel)->charge() << endmsg;
         }
-        for (auto muel: muonTPELtracksMerged) {
+        for (const auto& muel: muonTPELtracksMerged) {
             msg() << MSG::DEBUG << "muonTPELtracksMerged: " << *muel << " " << (*muel)->pt() << " , " << (*muel)->eta() << " , " << (*muel)->phi() << " , " << (*muel)->charge() << endmsg;
         }
     } // if debug
     
-    
-    //   TrigEFBphys* trigPartBMuMuX (NULL);
-    // FIXME - remove these 'new's
-    //m_trigBphysColl_b = new TrigEFBphysContainer();
-    //m_trigBphysColl_X = new TrigEFBphysContainer();
-    
     m_TrigBphysColl_b = new xAOD::TrigBphysContainer();
     xAOD::TrigBphysAuxContainer xAODTrigBphysAuxColl_b;
     m_TrigBphysColl_b->setStore(&xAODTrigBphysAuxColl_b);
@@ -1038,17 +987,10 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
     } else {
         
         // Loop over muons
-        //std::vector<ElementLink<xAOD::TrackParticleContainer> >::iterator pElItr=muonTPELtracks1.begin();
-        //std::vector<ElementLink<xAOD::TrackParticleContainer> >::iterator mElItr=muonTPELtracks2.begin();
-        std::vector<ElementLink<xAOD::TrackParticleContainer> >::iterator pElItr=muonTPELtracksMerged.begin();
-        std::vector<ElementLink<xAOD::TrackParticleContainer> >::iterator mElItr=muonTPELtracksMerged.begin();
-
-        //        for(pElItr=muonTPELtracks1.begin(); pElItr != muonTPELtracks1.end(); pElItr++) {
-        //            for(mElItr=muonTPELtracks2.begin(); mElItr != muonTPELtracks2.end(); mElItr++) {
         const Amg::Vector3D beamspot = m_bphysHelperTool->getBeamSpot(Gaudi::Hive::currentContext());
 
-        for(pElItr=muonTPELtracksMerged.begin(); pElItr != muonTPELtracksMerged.end(); ++pElItr) {
-            for(mElItr=pElItr+1; mElItr != muonTPELtracksMerged.end(); ++mElItr) {
+        for(auto pElItr=muonTPELtracksMerged.begin(); pElItr != muonTPELtracksMerged.end(); ++pElItr) {
+            for(auto mElItr=pElItr+1; mElItr != muonTPELtracksMerged.end(); ++mElItr) {
                 auto pTp = **pElItr;
                 auto mTp = **mElItr;
                 ATH_MSG_DEBUG("Try to build muon pair from mu1 " << *(*pElItr) << ", mu2 " << *(*mElItr) );
@@ -1193,7 +1135,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
                 std::map<const xAOD::TrackParticle*, ElementLink<xAOD::TrackParticleContainer> > mapTrackToEL;
                 
                 int idCounter(0);
-                for (auto trk: tracksRoiI1) {
+                for (const auto& trk: tracksRoiI1) {
                     // merged_tracks.push_back(trk);
                     addUnique(merged_tracks,*trk);
                     ElIndex tmp;
@@ -1204,7 +1146,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
                     ++idCounter;
                 }
                 idCounter = 0;
-                for (auto trk: tracksRoiI2) {
+                for (const auto& trk: tracksRoiI2) {
                     // merged_tracks.push_back(trk);
                     addUnique(merged_tracks,*trk);
                     ElIndex tmp;
@@ -1284,7 +1226,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
                 
                 for (int itrk1=0 ; trkIt1 != lastTrkIt; itrk1++, trkIt1++)
                 {
-                    //const Trk::Track* track1 = (*trkIt1)->track();
                     const xAOD::TrackParticle* track1 = (*trkIt1);
                     
 //                    ElementLink<xAOD::TrackParticleContainer> trackEL3( mapTrackToIndex[*trkIt1].roi == 1 ? tracksRoiI1[0].dataID() : tracksRoiI2[0].dataID(), mapTrackToIndex[*trkIt1].index);
@@ -1381,7 +1322,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
                         }
                         
 			if(m_doBd_KstarMuMuDecay || m_doBs_Phi1020MuMuDecay || m_doLb_LambdaMuMuDecay || m_doBc_DsMuMuDecay || m_doBc_DplusMuMuDecay || m_doBc_DstarMuMuDecay || m_doBc_D0MuMuDecay) {
-                                //const Trk::Track* track2 = (*trkIt2)->track();
                                 const xAOD::TrackParticle* track2 = (*trkIt2);
 
                             // Sergey S.
@@ -1747,7 +1687,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
 
                                         for (int itrk3=0 ; trkIt3 != lastTrkIt; itrk3++, trkIt3++)
                                         {
-                                            //const Trk::Track* track3 = (*trkIt3)->track();
                                             const xAOD::TrackParticle* track3 = *trkIt3;
 
                                             // looping over all tracks, so expect to same tracks, but should skip those combinations
@@ -1888,7 +1827,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
 
                                             for (int itrk3=0 ; trkIt3 != lastTrkIt; itrk3++, trkIt3++)
                                             {
-                                                //const Trk::Track* track3 = (*trkIt3)->track();
                                                 const xAOD::TrackParticle* track3 = *trkIt3;
 
                                                 // looping over all tracks, so expect to same tracks, but should skip those combinations
@@ -2040,7 +1978,6 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
 
                                             for (int itrk3=0 ; trkIt3 != lastTrkIt; itrk3++, trkIt3++)
                                             {
-                                                //const Trk::Track* track3 = (*trkIt3)->track();
                                                 const xAOD::TrackParticle* track3 = *trkIt3;
 
                                                 // looping over all tracks, so expect to same tracks, but should skip those combinations
@@ -2286,7 +2223,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
         ATH_MSG_WARNING( "Failed to getFeaturesLinks trigBphys_X Collection in outputTE" );
         } else {
             if(msgLvl() <= MSG::DEBUG){
-              for ( const auto eltp: ELvecTBPh) {
+              for ( const auto& eltp: ELvecTBPh) {
                 msg() << MSG::DEBUG << "  ===== TrigBphys Container ElementLinks : " 
                   << " index: "  << eltp.index()
                   << " sgkey: "  << eltp.dataID()
@@ -2304,7 +2241,7 @@ HLT::ErrorCode TrigEFBMuMuXFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigge
               ElementLink<xAOD::TrigBphysContainer> secEL;
 //               secEL.resetWithKeyAndIndex(KEY,(*BPobj)->secondaryDecayLink().index());
               // match transient secondary decay ELs with those from persistified container
-              for(auto persistentSecEL : ELvecTBPh ) {
+              for(const auto& persistentSecEL : ELvecTBPh ) {
                 if(*persistentSecEL == *(*BPobj)->secondaryDecayLink())
                   secEL = persistentSecEL;
               }
@@ -2422,7 +2359,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBplusMuMuKplus(const ElementLink<xAOD::Tr
     } // if m_doB_KMuMuVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         result->addTrackParticleLink(tpel);
       }
     }
@@ -2521,7 +2458,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDs(const ElementLink<xAOD::TrackPar
     } // m_doDs_Vertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracksX) {
+      for(const auto& tpel : vec_tracksX) {
         fitVtx_X->addTrackParticleLink(tpel);
       }
     }
@@ -2644,7 +2581,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDs(const ElementLink<xAOD::TrackPar
               m_mon_BcMuMuDs_Chi2_Bc.push_back(chi2XMuMu);
               
               // manually attach the track links to fitVtx
-              for(auto tpel : vec_tracks) {
+              for(const auto& tpel : vec_tracks) {
                 fitVtx->addTrackParticleLink(tpel);
               }
               
@@ -2687,7 +2624,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDs(const ElementLink<xAOD::TrackPar
     } //m_doBc_DsMuMuVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         fitVtx->addTrackParticleLink(tpel);
       }
     }
@@ -2786,7 +2723,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDplus(const ElementLink<xAOD::Track
     } // m_doDplus_Vertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracksX) {
+      for(const auto& tpel : vec_tracksX) {
         fitVtx_X->addTrackParticleLink(tpel);
       }
     }
@@ -2912,7 +2849,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDplus(const ElementLink<xAOD::Track
               m_mon_BcMuMuDplus_Chi2_Bc.push_back(chi2XMuMu);
               
               // manually attach the track links to fitVtx
-              for(auto tpel : vec_tracks) {
+              for(const auto& tpel : vec_tracks) {
                 fitVtx->addTrackParticleLink(tpel);
               }
               
@@ -2955,7 +2892,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDplus(const ElementLink<xAOD::Track
     } //m_doBc_DplusMuMuVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         fitVtx->addTrackParticleLink(tpel);
       }
     }
@@ -2982,7 +2919,6 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDstar(const ElementLink<xAOD::Track
     xAOD::TrigBphys * fitVtx(nullptr);
     
     std::vector<double> massHypoD0 = {KPLUSMASS,PIMASS};
-    std::vector<double> massHypoX = {KPLUSMASS,PIMASS,PIMASS};
     std::vector<double> massHypo  = {MUMASS,MUMASS,KPLUSMASS,PIMASS,PIMASS};
     float massX;
     float massXMuMu;
@@ -3025,12 +2961,10 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDstar(const ElementLink<xAOD::Track
                        xAOD::TrigBphys::BCDSTMUMU, massXMuMu, xAOD::TrigBphys::EF);
 
     std::vector<ElementLink<xAOD::TrackParticleContainer> > vec_tracksD0;
-    std::vector<ElementLink<xAOD::TrackParticleContainer> > vec_tracksX;
     std::vector<ElementLink<xAOD::TrackParticleContainer> > vec_tracks;
     
     if ( ((*eltrack1)->charge())*((*eltrack3)->charge()) < 0 ) {
       vec_tracksD0 = {eltrack1,eltrack2};
-      vec_tracksX = {eltrack1,eltrack2,eltrack3};
       vec_tracks  = {elmu1,elmu2,eltrack1,eltrack2,eltrack3};
     
       m_mon_BcMuMuDstar_Pt_K.push_back ((*eltrack1)->pt()*0.001);
@@ -3041,7 +2975,6 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDstar(const ElementLink<xAOD::Track
       m_mon_BcMuMuDstar_Phi_pi.push_back((*eltrack2)->phi());
     } else {
       vec_tracksD0 = {eltrack2,eltrack1};
-      vec_tracksX = {eltrack2,eltrack1,eltrack3};
       vec_tracks  = {elmu1,elmu2,eltrack2,eltrack1,eltrack3};
     
       m_mon_BcMuMuDstar_Pt_K.push_back ((*eltrack2)->pt()*0.001);
@@ -3087,7 +3020,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDstar(const ElementLink<xAOD::Track
     } // m_doDplus_Vertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracksD0) {
+      for(const auto& tpel : vec_tracksD0) {
         fitVtx_X->addTrackParticleLink(tpel);
       }
     }
@@ -3227,7 +3160,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDstar(const ElementLink<xAOD::Track
               m_mon_BcMuMuDstar_Chi2_Bc.push_back(chi2XMuMu);
               
               // manually attach the track links to fitVtx
-              for(auto tpel : vec_tracks) {
+              for(const auto& tpel : vec_tracks) {
                 fitVtx->addTrackParticleLink(tpel);
               }
               
@@ -3268,7 +3201,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuDstar(const ElementLink<xAOD::Track
     } //m_doBc_DstarMuMuVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         fitVtx->addTrackParticleLink(tpel);
       }
     }
@@ -3385,7 +3318,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuD0(const ElementLink<xAOD::TrackPar
     } // m_doDplus_Vertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracksX) {
+      for(const auto& tpel : vec_tracksX) {
         fitVtx_X->addTrackParticleLink(tpel);
       }
     }
@@ -3513,7 +3446,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuD0(const ElementLink<xAOD::TrackPar
               m_mon_BcMuMuD0_Chi2_Bc.push_back(chi2XMuMu);
               
               // manually attach the track links to fitVtx
-              for(auto tpel : vec_tracks) {
+              for(const auto& tpel : vec_tracks) {
                 fitVtx->addTrackParticleLink(tpel);
               }
               
@@ -3554,7 +3487,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBcMuMuD0(const ElementLink<xAOD::TrackPar
     } //m_doBc_D0MuMuVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         fitVtx->addTrackParticleLink(tpel);
       }
     }
@@ -3651,7 +3584,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkLbMuMuLambda(const ElementLink<xAOD::Trac
     } // m_doDplus_Vertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracksX) {
+      for(const auto& tpel : vec_tracksX) {
         fitVtx_X->addTrackParticleLink(tpel);
       }
     }
@@ -3796,7 +3729,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkLbMuMuLambda(const ElementLink<xAOD::Trac
               m_mon_LbMuMuLambda_FinMass_Lb.push_back(massXMuMu/1000.);
               
               // manually attach the track links to fitVtx
-              for(auto tpel : vec_tracks) {
+              for(const auto& tpel : vec_tracks) {
                 fitVtx->addTrackParticleLink(tpel);
               }
               
@@ -3839,7 +3772,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkLbMuMuLambda(const ElementLink<xAOD::Trac
     } //m_doLb_LambdaMuMuVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         fitVtx->addTrackParticleLink(tpel);
       }
     }
@@ -4064,7 +3997,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBMuMu2X(const ElementLink<xAOD::TrackPart
     } // do2XVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracksX) {
+      for(const auto& tpel : vec_tracksX) {
         fitVtx_X->addTrackParticleLink(tpel);
       }
     }
@@ -4090,7 +4023,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBMuMu2X(const ElementLink<xAOD::TrackPart
     } // doBMuMu2XVertexing
     else {
       // if vertexting is not done - just attach trackParticle links
-      for(auto tpel : vec_tracks) {
+      for(const auto& tpel : vec_tracks) {
         fitVtx->addTrackParticleLink(tpel);
       }
     }
@@ -4102,29 +4035,6 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBMuMu2X(const ElementLink<xAOD::TrackPart
 
 
 
-/*----------------------------------------------------------------------------*/
-void TrigEFBMuMuXFex::addUnique(std::vector<const Trk::Track*>& tracks, const Trk::Track* trkIn)
-{
-    //  std::cout<<" in addUnique : trkIn pT= "<<trkIn->perigeeParameters()->pT()<<std::endl;
-    std::vector<const Trk::Track*>::iterator tItr;
-    for( tItr = tracks.begin(); tItr != tracks.end(); tItr++)
-    {
-        double dPhi=fabs((*tItr)->perigeeParameters()->parameters()[Trk::phi] -
-                         trkIn->perigeeParameters()->parameters()[Trk::phi]);
-        if (dPhi > M_PI) dPhi = 2.*M_PI - dPhi;
-        
-        if( fabs(dPhi) < 0.02 &&
-           fabs((*tItr)->perigeeParameters()->eta() -
-                trkIn->perigeeParameters()->eta()) < 0.02 ) 
-        { //std::cout<<" TrigEFBMuMuFex addUnique: the SAME tracks! pT= "<<
-            //trkIn->perigeeParameters()->pT()<<" and "<<
-            //(*tItr)->perigeeParameters()->pT()<<std::endl;
-            return;
-        }
-    } 
-    tracks.push_back(trkIn);       
-}
-
 /*----------------------------------------------------------------------------*/
 void TrigEFBMuMuXFex::addUnique(std::vector<const xAOD::TrackParticle*>& tps, const xAOD::TrackParticle* tpIn)
 {
@@ -4192,149 +4102,94 @@ bool TrigEFBMuMuXFex::isUnique(const  xAOD::TrackParticle* id1, const  xAOD::Tra
 
 double TrigEFBMuMuXFex::XMass(const xAOD::TrackParticle* particle1, const xAOD::TrackParticle* particle2, int decay) { /// checking the mass
     
-    std::vector<double> massHypo;
-    massHypo.clear();
+    std::array<double, 2> massHypo;
     if(decay == di_to_muons){
-        massHypo.push_back(MUMASS);
-        massHypo.push_back(MUMASS);
-    }
-    if(decay == bD_to_Kstar){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(PIMASS);
+        massHypo[0] = (MUMASS);
+        massHypo[1] = (MUMASS);
     }
-    if(decay == bS_to_Phi){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(KPLUSMASS);
+    else if(decay == bD_to_Kstar){
+        massHypo[0] = (KPLUSMASS);
+        massHypo[1] = (PIMASS);
     }
-    if(decay == bC_to_PiPi){  
-        massHypo.push_back(PIMASS);
-        massHypo.push_back(PIMASS);    
+    else if(decay == bS_to_Phi){
+        massHypo[0] = (KPLUSMASS);
+        massHypo[1] = (KPLUSMASS);
     }
-    if(decay == lB_to_L){
-        massHypo.push_back(PROTONMASS);
-        massHypo.push_back(PIMASS);
+    else if(decay == bC_to_PiPi){  
+        massHypo[0] = (PIMASS);
+        massHypo[1] = (PIMASS);    
     }
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
+    else if(decay == lB_to_L){
+        massHypo[0] = (PROTONMASS);
+        massHypo[1] = (PIMASS);
+    }else{
+		throw std::runtime_error("unknown decay TrigEFBMuMuXFex::XMass");
+	}
+    std::array<const xAOD::TrackParticle*, 2> bTracks{particle1, particle2};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBMuMuXFex::X3Mass(const xAOD::TrackParticle* particle1, const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
-    
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static constexpr std::array<double, 3> massHypo{KPLUSMASS, KPLUSMASS, PIMASS};
+    const std::array<const xAOD::TrackParticle*, 3> bTracks{ particle1, particle2, particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBMuMuXFex::XKPiPiMass(const xAOD::TrackParticle* particle1, const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
     
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static constexpr std::array<double, 3> massHypo{KPLUSMASS, PIMASS, PIMASS};
+	const std::array<const xAOD::TrackParticle*, 3> bTracks{particle1,particle2,particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBMuMuXFex::KMuMuMass( const xAOD::TrackParticle* mu1, const xAOD::TrackParticle* mu2, const xAOD::TrackParticle* kaon) {
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(MUMASS);
-    massHypo.push_back(MUMASS);
-    massHypo.push_back(KPLUSMASS);  //K
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(mu1);
-    bTracks.push_back(mu2);
-    bTracks.push_back(kaon);
+    static constexpr std::array<double, 3> massHypo{MUMASS, MUMASS, KPLUSMASS};  //K
+    const std::array<const xAOD::TrackParticle*, 3> bTracks{mu1, mu2, kaon};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
 }
 
 double TrigEFBMuMuXFex::XMuMuMass(const xAOD::TrackParticle* mu1, const xAOD::TrackParticle* mu2, const xAOD::TrackParticle* particle1,
                                   const xAOD::TrackParticle* particle2, int decay){
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(MUMASS);
-    massHypo.push_back(MUMASS);
+    std::array<double, 4> massHypo;
+    massHypo[0] = MUMASS;
+    massHypo[1] = MUMASS;
     if(decay == bD_to_Kstar){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(PIMASS);
-    }
-    if(decay == bS_to_Phi){
-        massHypo.push_back(KPLUSMASS);
-        massHypo.push_back(KPLUSMASS);
+        massHypo[2] = KPLUSMASS;
+        massHypo[3] = PIMASS;
     }
-    if(decay == bC_to_PiPi){  
-        massHypo.push_back(PIMASS);
-        massHypo.push_back(PIMASS);    
+    else if(decay == bS_to_Phi){
+        massHypo[2] = KPLUSMASS;
+        massHypo[3] = KPLUSMASS;
     }
-    if(decay == lB_to_L){
-        massHypo.push_back(PROTONMASS);
-        massHypo.push_back(PIMASS);
+    else if(decay == bC_to_PiPi){  
+        massHypo[2] = PIMASS;
+        massHypo[3] = PIMASS;    
     }
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(mu1);
-    bTracks.push_back(mu2);
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
+    else if(decay == lB_to_L){
+        massHypo[2] = PROTONMASS;
+        massHypo[3] = PIMASS;
+    }else{
+		throw std::runtime_error("unknown decay TrigEFBMuMuXFex::XMuMuMass");
+	}
+    const std::array<const xAOD::TrackParticle*, 4> bTracks{mu1,mu2,particle1,particle2};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
 }
 
 double TrigEFBMuMuXFex::X3MuMuMass(const xAOD::TrackParticle* mu1, const xAOD::TrackParticle* mu2, const xAOD::TrackParticle* particle1,
                                    const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(MUMASS);
-    massHypo.push_back(MUMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(mu1);
-    bTracks.push_back(mu2);
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static constexpr std::array<double, 5> massHypo{MUMASS, MUMASS, KPLUSMASS, KPLUSMASS, PIMASS};
+    const std::array<const xAOD::TrackParticle*, 5> bTracks{mu1,mu2,particle1,particle2,particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
 
 double TrigEFBMuMuXFex::XKPiPiMuMuMass(const xAOD::TrackParticle* mu1, const xAOD::TrackParticle* mu2, const xAOD::TrackParticle* particle1,
                                    const xAOD::TrackParticle* particle2, const xAOD::TrackParticle* particle3 ) {
-    std::vector<double> massHypo;
-    massHypo.clear();
-    massHypo.push_back(MUMASS);
-    massHypo.push_back(MUMASS);
-    massHypo.push_back(KPLUSMASS);
-    massHypo.push_back(PIMASS);
-    massHypo.push_back(PIMASS);
-    std::vector<const xAOD::TrackParticle*> bTracks;
-    bTracks.clear();
-    bTracks.push_back(mu1);
-    bTracks.push_back(mu2);
-    bTracks.push_back(particle1);
-    bTracks.push_back(particle2);
-    bTracks.push_back(particle3);
+    static constexpr std::array<double, 5> massHypo{MUMASS, MUMASS, KPLUSMASS, PIMASS, PIMASS};
+    const std::array<const xAOD::TrackParticle*, 5> bTracks{mu1,mu2,particle1,particle2,particle3};
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
 }
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.h
index 37fefad3c983b49926b00583d68c7567a911b55f..13a7e317b6aa86ae94484da287d92558a13a8e7c 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.h
@@ -202,9 +202,6 @@ class TrigEFBMuMuXFex: public HLT::ComboAlgo  {
     float m_bCD0VtxChi2Cut;
     int m_maxBcD0ToStore;
     
-    // FTK Flag
-    bool m_FTK;
-
     // Monitoring variables and containers
     //   General
     std::vector<int>   m_mon_Errors;
@@ -379,10 +376,6 @@ class TrigEFBMuMuXFex: public HLT::ComboAlgo  {
     // to set Accept-All mode: should be done with force-accept when possible
     bool m_acceptAll;
 
-
-    // TrigEFBphysContainer* m_trigBphysColl_b;
-    // TrigEFBphysContainer* m_trigBphysColl_X;
-
     xAOD::TrigBphysContainer * m_TrigBphysColl_b;
     xAOD::TrigBphysContainer * m_TrigBphysColl_X;
     
@@ -493,7 +486,6 @@ class TrigEFBMuMuXFex: public HLT::ComboAlgo  {
     unsigned int m_countPassedBcD0Lxy;
     int m_countBcD0ToStore;
     
-    void addUnique(std::vector<const Trk::Track*>&, const Trk::Track*);
     void addUnique(std::vector<const xAOD::TrackParticle*>&, const xAOD::TrackParticle*);
     void addUnique(std::vector<ElementLink<xAOD::TrackParticleContainer> >&, const ElementLink<xAOD::TrackParticleContainer>&);
 //   double invariantMass(const TrigMuonEF* , const TrigMuonEF* );
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.cxx
index 9bc75c8d0905cfe37ba4c414dd28459368e447a5..2799601e2a71ab49288561bdf06b5542e27a77c6 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.cxx
@@ -29,9 +29,9 @@
 
 // additions of xAOD objects
 #include "xAODEventInfo/EventInfo.h"
-
-//#include "TrigVKalFitter/TrigVKalFitter.h"
-//#include "TrigVKalFitter/VKalVrtAtlas.h"
+#include "xAODTrigBphys/TrigBphys.h"
+#include "xAODTrigBphys/TrigBphysContainer.h"
+#include "xAODTrigBphys/TrigBphysAuxContainer.h"
 
 class ISvcLocator;
 
@@ -216,7 +216,6 @@ HLT::ErrorCode TrigEFBMuMuXHypo::hltExecute(const HLT::TriggerElement* outputTE,
   
   
   // create vector for TrigEFBphys particles
-    //  const TrigEFBphysContainer* trigBphysColl = 0;
     const xAOD::TrigBphysContainer * xAODTrigBphysColl(0);
     
   // get vector of TrigEFBphys particles from outputTE
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.h
index d083329d9419ba779b9b6620ef58425191711af5..dbaf6e240db5a21a54caa257015bf67e88fe816f 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXHypo.h
@@ -26,14 +26,6 @@
 #include <string>
 // general athena stuff
 #include "TrigInterfaces/HypoAlgo.h"
-#include "TrigInDetEvent/TrigVertexCollection.h"
-
-#include "Constants.h"
-
-#include "xAODTrigBphys/TrigBphys.h"
-#include "xAODTrigBphys/TrigBphysContainer.h"
-#include "xAODTrigBphys/TrigBphysAuxContainer.h"
-
 
 class TrigEFBMuMuXHypo: public HLT::HypoAlgo  {
   
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.cxx
index 4cc889324b06e87bffc999a5db30467673dad2ac..9aaa4601d8cd83dae5ce3852d284b489f3799765 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.cxx
@@ -17,8 +17,7 @@
 
 #include "xAODTracking/TrackParticle.h"
 #include "xAODMuon/MuonContainer.h"
-#include "TrigTimeAlgs/TrigTimerSvc.h"
-
+#include "TrigTimeAlgs/TrigTimer.h"                  // for TrigTimer
 
 TrigEFMultiMuFex::TrigEFMultiMuFex(const std::string & name, ISvcLocator* pSvcLocator):
   HLT::ComboAlgo(name, pSvcLocator)
@@ -260,7 +259,7 @@ void TrigEFMultiMuFex::processTriMuon(HLT::TEConstVec& inputTE, xAOD::TrigBphysC
             // loop over the vector of muon containers
             msg() << MSG::DEBUG << "MuonContainer, Got MuonEF " << ic << " Feature, size = " << muelv.size() << endmsg;
             int i(0);
-            for ( const auto muel: muelv) {
+            for ( const auto& muel: muelv) {
                 msg() << MSG::DEBUG << "ELLink: " << i++
                     << " index: "  << muel.index()
                     << " sgkey: "  << muel.dataID()
@@ -290,7 +289,7 @@ void TrigEFMultiMuFex::processTriMuon(HLT::TEConstVec& inputTE, xAOD::TrigBphysC
     std::vector<const xAOD::Muon*> uniqueMuons;
     // add all the unique muons into a single container
     for ( const auto& muelv : vec_elv_muons) {
-        for ( const auto muel : muelv ) {
+        for ( const auto& muel : muelv ) {
             m_bphysHelperTool->addUnique( *muel, uniqueMuons, 0.005,0.005,10,xAOD::Muon::InnerDetectorTrackParticle);
         } // loop over muonEL in each roi
     } // loop over rois
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.h
index 220b51e18664a848890e4f03c52f4f76f713c6a0..c782afaccee0ce9c1eccec8059e590917b22cbdd 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuFex.h
@@ -21,8 +21,6 @@
 
 // standard stuff
 #include <string>
-#include <map>
-#include <cmath> 
 
 #include "TrigInterfaces/ComboAlgo.h"
 #include "xAODMuon/Muon.h"
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.cxx
index 32866c609f2f62b6d28f4ad8e92df290d3c8ab59..39ec9f87ceee10d48b2b3695a2b55cccd45c1ab0 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.cxx
@@ -15,18 +15,13 @@
  **
  **************************************************************************/
 
-//#include "TrigMuonEvent/CombinedMuonFeature.h"
-
 #include "TrigEFMultiMuHypo.h"
 
-#include <math.h>
 #include "xAODTrigger/TrigPassBits.h"
 
 
 // additions of xAOD objects
 #include "xAODEventInfo/EventInfo.h"
-#include "xAODMuon/Muon.h"
-#include "xAODTracking/TrackParticle.h"
 
 #include "xAODTrigBphys/TrigBphys.h"
 #include "xAODTrigBphys/TrigBphysContainer.h"
@@ -141,12 +136,8 @@ HLT::ErrorCode TrigEFMultiMuHypo::hltExecute(const HLT::TriggerElement* outputTE
   ATH_MSG_DEBUG("AcceptAll is set to : " << (m_acceptAll ? "True, taking all events " : "False, applying selection" ));
 
   //  create vector for TrigEFBphys particles
-    //const TrigEFBphysContainer* trigBphysColl = 0;
     const xAOD::TrigBphysContainer* trigBphysColl = 0;
 
-//  const TrigEFBContainer* trigBphysColl = 0;
-//  const VxContainer* VertexColl;
-
   HLT::ErrorCode status = getFeature(outputTE, trigBphysColl, m_bphysCollectionKey );
 
   if ( status != HLT::OK ) {
@@ -176,7 +167,6 @@ HLT::ErrorCode TrigEFMultiMuHypo::hltExecute(const HLT::TriggerElement* outputTE
   std::unique_ptr<xAOD::TrigPassBits> xBits = xAOD::makeTrigPassBits<xAOD::TrigBphysContainer>(trigBphysColl);
 
   // now loop over Bphys particles to see if one passes cuts
-    //    for (TrigEFBphysContainer::const_iterator bphysIter = trigBphysColl->begin(); bphysIter !=  trigBphysColl->end(); ++bphysIter) {
     for (xAOD::TrigBphysContainer::const_iterator bphysIter = trigBphysColl->begin(); bphysIter !=  trigBphysColl->end(); ++bphysIter) {
         
         if ((*bphysIter)->particleType() == xAOD::TrigBphys::MULTIMU ) {
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.h
index 423b7cdc43640ac798cd531feb103b5baabdbff3..afa7bd675390b6a3d4a5bb6326527f21e3caf589 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFMultiMuHypo.h
@@ -24,8 +24,6 @@
 // general athena stuff
 #include "TrigInterfaces/HypoAlgo.h"
 
-#include "Constants.h"
-
 
 class TrigEFMultiMuHypo: public HLT::HypoAlgo  {
   
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.cxx
index b93443bbb91902d00bceb50ea11e12f4811938ce..10e6bd6c1351e6c89c3729fa0d2d7a5e89859da8 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.cxx
@@ -10,23 +10,19 @@
 // ********************************************************************
 
 #include "TrigEFTrkMassFex.h"
-#include "BtrigUtils.h"
 #include "TrigBphysHelperUtilsTool.h"
 
 #include "xAODTrigBphys/TrigBphysAuxContainer.h"
 // additions of xAOD objects
-#include "xAODEventInfo/EventInfo.h"
 #include "xAODMuon/MuonContainer.h"
 
-#include <algorithm>
 #include <math.h>
 
-#include "TrigTimeAlgs/TrigTimerSvc.h"
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
-
+#include "CLHEP/Units/SystemOfUnits.h"
 
 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
-
+#include "TrigTimeAlgs/TrigTimer.h"                  // for TrigTimer
 
 class ISvcLocator;
 
@@ -44,7 +40,6 @@ HLT::FexAlgo(name, pSvcLocator)
     // Read cuts
     declareProperty( "AcceptAll", m_acceptAll  = false );
     declareProperty( "OppositeCharge", m_oppositeCharge  = true );
-    declareProperty("m_matchL1", m_matchL1 = false);
     declareProperty("MuonPTthr", m_muonPtthr=4.);
     declareProperty("TrackPTthr", m_trackPtthr=1.4);
     declareProperty("dEtaTrackRoI", m_dEta_cut=0.1);
@@ -127,10 +122,6 @@ HLT::ErrorCode TrigEFTrkMassFex::hltInitialize()
         ATH_MSG_DEBUG("TrigBphysHelperUtilsTool found" );
     }
     
-    if (m_matchL1) {
-        ATH_MSG_DEBUG("matchL1 not yet re-implemented." );
-        return HLT::BAD_JOB_SETUP;
-    }
     
     ATH_MSG_INFO("AcceptAll            = "<< (m_acceptAll==true ? "True" : "False") );
     ATH_MSG_INFO("Apply opposite sign cut = " << (m_oppositeCharge==true ? "True" : "False") );
@@ -302,7 +293,7 @@ HLT::ErrorCode TrigEFTrkMassFex::hltExecute(const HLT::TriggerElement*  inputTE
     }
     if(msgLvl() <= MSG::DEBUG) { // print debug
         msg() << MSG::DEBUG << "Found MuonContainer, Got MuonEF size = " << elvmuon.size() << endmsg;
-        for ( const auto muel: elvmuon) {
+        for ( const auto& muel: elvmuon) {
             msg() << MSG::DEBUG << "ELLink: "
                 << " index: "  << muel.index()
                 << " sgkey: "  << muel.dataID()
@@ -311,7 +302,7 @@ HLT::ErrorCode TrigEFTrkMassFex::hltExecute(const HLT::TriggerElement*  inputTE
                 << " ptr: "    << (muel.isValid() ? *muel : nullptr)
                 << endmsg;
         }
-        for ( const auto muel: elvmuon) {
+        for ( const auto& muel: elvmuon) {
             if (!muel.isValid()) continue;
             msg() << MSG::DEBUG << "Muon:   "
                 << " pt: " <<  (*muel)->pt()
@@ -352,7 +343,7 @@ HLT::ErrorCode TrigEFTrkMassFex::hltExecute(const HLT::TriggerElement*  inputTE
 
     if(msgLvl() <= MSG::DEBUG) { // print debug
         msg() << MSG::DEBUG << "Found TrackParticleContainer, size: " << elvtps.size() << endmsg;
-        for ( const auto eltp: elvtps) {
+        for ( const auto& eltp: elvtps) {
             msg() << MSG::DEBUG << "ELLink: "
                 << " index: "  << eltp.index()
                 << " sgkey: "  << eltp.dataID()
@@ -393,7 +384,7 @@ HLT::ErrorCode TrigEFTrkMassFex::hltExecute(const HLT::TriggerElement*  inputTE
     //#FIXME - remember to implement the scenario of (tracks matched to roi + tracks)
     std::vector<ElementLink<xAOD::MuonContainer> > muons;
     std::vector<ElementLink<xAOD::TrackParticleContainer> > tracks;
-    for (auto muel: elvmuon) {
+    for (const auto& muel: elvmuon) {
         if (!muel.isValid()) continue;
         const xAOD::TrackParticle * mutrk = (*muel)->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
         if (!mutrk) continue;
@@ -436,7 +427,7 @@ HLT::ErrorCode TrigEFTrkMassFex::hltExecute(const HLT::TriggerElement*  inputTE
         
         muons.push_back(muel);
     } // optimize? addUnique?
-    for (auto trkel: elvtps)  {
+    for (const auto& trkel: elvtps)  {
         const xAOD::TrackParticle * trk = *trkel;
         if (!trk) continue;
         if (trk->definingParametersCovMatrixVec().size() == 0) {
@@ -528,7 +519,7 @@ void TrigEFTrkMassFex::buildMuTrkPairs(const TrigRoiDescriptor * roi,
         return;
     }
 
-    for (auto muel: muons) {
+    for (const auto& muel: muons) {
         if (!muel.isValid()) continue;
         const xAOD::Muon * muon = *muel;
         if (!muon) continue;
@@ -536,7 +527,7 @@ void TrigEFTrkMassFex::buildMuTrkPairs(const TrigRoiDescriptor * roi,
         const ElementLink<xAOD::TrackParticleContainer> & mutrkel = muon->trackParticleLink(xAOD::Muon::InnerDetectorTrackParticle);
         if (!mutrk) continue;
         
-        for (auto trkel: tracks) {
+        for (const auto& trkel: tracks) {
             if (!trkel.isValid()) continue;
             const xAOD::TrackParticle * trk = *trkel;
             if (!trk) continue;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.h
index 4e74d78a8a0e1713ff29bad746a1d4cfd7c7847e..4deff4ef0b2181410f9f21ffa60711264e5a1ae1 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassFex.h
@@ -58,7 +58,6 @@ class TrigEFTrkMassFex: public HLT::FexAlgo {
     // container inputs names
     std::string m_input_trackCollectionKey; //! list of tracks to search for second leg
 
-    float        m_matchL1;
     float        m_trackPtthr;
     float        m_muonPtthr;
     float        m_dEta_cut;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.cxx
index 9e1cbed9a0bc64dea88c9fdd4ac816c5ec0bef08..b69f2ff3dc04b8fd6a24c42312d867f02a0dc793 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.cxx
@@ -23,8 +23,6 @@
 #include "TrigEFTrkMassHypo.h"
 
 
-#include <math.h>
-//#include "TrigSteeringEvent/TrigPassBits.h"
 #include "xAODTrigger/TrigPassBits.h"
 
 // additions of xAOD objects
@@ -118,7 +116,6 @@ HLT::ErrorCode TrigEFTrkMassHypo::hltExecute(const HLT::TriggerElement* outputTE
   // for now pass all events - JK changed to false 9/2/10
   pass=false;
 //  create vector for TrigEFBphys particles
-    //const TrigEFBphysContainer* trigBphysColl = 0;
     const xAOD::TrigBphysContainer * xAODTrigBphysColl(0);
     
   HLT::ErrorCode status = getFeature(outputTE, xAODTrigBphysColl, "EFTrackMass");
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.h
index e659b78e51922e8ed8849639cd512303c275508d..198ba8c12b83859af5b232ed21d34a142e3c6935 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFTrkMassHypo.h
@@ -7,7 +7,6 @@
 #define TRIGEFTRKMASSHYPO_H
 
 #include "TrigInterfaces/HypoAlgo.h"
-#include "Constants.h"
 
 class TriggerElement;
 
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.cxx
index 84c4d7aac4d65549b23e3b3946aa202cff217168..91e67cfed12d86ef3a00e439064a3b35edb1dbce 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.cxx
@@ -23,12 +23,12 @@
 
 #include "TrigInDetToolInterfaces/ITrigVertexingTool.h"
 #include "TrigInDetEvent/TrigL2Vertex.h"
-
+#include "TrigInDetEvent/TrigVertex.h"                    // for TrigVertex
+#include "xAODTrigBphys/TrigBphysAuxContainer.h"          // for TrigBphysAu...
+#include "xAODTrigBphys/TrigBphysContainer.h"             // for TrigBphysCo...
 #include "Constants.h"
-#include "BtrigUtils.h"
 
 // additions of xAOD objects
-#include "xAODEventInfo/EventInfo.h"
 #include "xAODTracking/TrackParticle.h"
 #include "xAODTracking/TrackParticleContainer.h"
 #include "xAODTrigMuon/L2StandAloneMuon.h"
@@ -132,20 +132,13 @@ m_massMuon(105.6583715)
     //  declareMonitoredStdContainer("InvMass_stand"          , m_mon_InvMass_stand           , AutoClear);
     //  declareMonitoredStdContainer("InvMass_stand_wideRange", m_mon_InvMass_stand_wideRange , AutoClear);
     
-    // Initialize the collections
-    //  m_trigBphysColl = NULL;
-    m_VertexColl    = NULL;
 }
 
 /*------------------------------*/
 TrigL2BMuMuFex::~TrigL2BMuMuFex()
 /*------------------------------*/
 {
-    // TODO: Delete the collections ?
-    //delete m_trigBphysColl;
-    //delete m_VertexColl;
 }
-
 /*-------------------------------------------*/
 HLT::ErrorCode TrigL2BMuMuFex::hltInitialize()
 /*-------------------------------------------*/
@@ -859,7 +852,7 @@ HLT::ErrorCode TrigL2BMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
         } else {
             ATH_MSG_DEBUG("Comb muon container: " << muonContainerComb1.size() );
         }
-        for (auto el: muonContainerComb1) {
+        for (const auto& el: muonContainerComb1) {
             ATH_MSG_DEBUG("Comb muon container: " << el.dataID() << " " << el.index() );
         }
         if (HLT::OK != getFeaturesLinks<xAOD::L2CombinedMuonContainer,xAOD::L2CombinedMuonContainer>(inputTE[1],muonContainerComb2,m_combinedMuonKey)) {
@@ -867,7 +860,7 @@ HLT::ErrorCode TrigL2BMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
         } else {
             ATH_MSG_DEBUG("Comb muon container: " << muonContainerComb2.size() );
         }
-        for (auto el: muonContainerComb2) {
+        for (const auto& el: muonContainerComb2) {
             ATH_MSG_DEBUG("Comb muon container: " << el.dataID() << " " << el.index() );
         }
         ElementLink<xAOD::IParticleContainer> ptl1EL = remap_container(muonXEL[0],muonContainerComb1);
@@ -996,11 +989,7 @@ HLT::ErrorCode TrigL2BMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
             ATH_MSG_DEBUG("REGTEST: Chi2 vtx fit = " << p_mumuV->chi2() );
             ATH_MSG_DEBUG("SigmaX =  SigmaY =  SigmaZ = " << sqrt(p_mumuV->cov()[0]) << " " << sqrt(p_mumuV->cov()[2]) << " " << sqrt(p_mumuV->cov()[5]) );
             
-            m_VertexColl = new TrigVertexCollection();
-            m_VertexColl->push_back(p_mumuV);
-            
             // JK 28/4/08 changes for ElementLinks
-            ElementLink<TrigVertexCollection> BMuMuVertexEL(*m_VertexColl,0);
             // trigPartBmumu->pVertex(p_mumuV);
             // 14-05-08 trigPartBmumu->pVertex(BMuMuVertexEL);
             
@@ -1051,7 +1040,6 @@ HLT::ErrorCode TrigL2BMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
     pass = true;
     if ( vtxpass ) {
         m_countPassedVtxFit++;
-        delete m_VertexColl;
     }
     if ( mumuIDpass ) m_countPassedmumuPairs++;
     m_countPassedRoIs++;
@@ -1059,7 +1047,6 @@ HLT::ErrorCode TrigL2BMuMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass
         m_countPassedEvents++;
         m_lastEventPassed = IdEvent;
     }
-    m_VertexColl = 0;
     
     if ( timerSvc() ) {
         m_BmmHypTot->stop();
@@ -1139,7 +1126,7 @@ ElementLink<xAOD::TrackParticleContainer> TrigL2BMuMuFex::remap_container(const
     if (!oldElink.isValid()) return oldElink;
     const auto tp  = *oldElink;
 
-    for (auto elink : newContainer) {
+    for (const auto& elink : newContainer) {
         if (!elink.isValid()) continue;
         const auto el  = *elink;
 
@@ -1176,7 +1163,7 @@ ElementLink<xAOD::IParticleContainer> TrigL2BMuMuFex::remap_container(const Elem
     if (!oldElink.isValid()) return iptlELold;
     const auto tp  = *oldElink;
     
-    for (auto elink : newContainer) {
+    for (const auto& elink : newContainer) {
         if (!elink.isValid()) continue;
         const auto el  = *elink;
         
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.h
index 82b5ec43b369dae8f550d1b2e2202609ed1beef9..d42c15955dffd4b7c97965d792255225cd337e88 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuFex.h
@@ -17,8 +17,6 @@
 
 #include "TrigInterfaces/ComboAlgo.h"
 
-#include "TrigInDetEvent/TrigVertexCollection.h"
-#include "TrigInDetToolInterfaces/ITrigVertexFitter.h"
 #include "TrigInDetToolInterfaces/ITrigL2VertexFitter.h"
 
 //#include "TrigParticle/TrigL2BphysContainer.h"
@@ -29,10 +27,6 @@
 
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 
-class TriggerElement;
-//class CombinedMuonFeature;
-
-class ITrigVertexFitter;
 class ITrigL2VertexFitter;
 class ITrigVertexingTool;
 
@@ -53,11 +47,6 @@ class TrigL2BMuMuFex: public HLT::ComboAlgo {
   private:
     ToolHandle <TrigBphysHelperUtilsTool> m_bphysHelperTool;
 
-    // Invariant mass helper calculators (TODO: move to InvMass.cxx tool-box)
-    //    double invariantMass(const CombinedMuonFeature* mu1, const CombinedMuonFeature* mu2);
-    //    double invariantMass(const CombinedMuonFeature* mu1, const MuonFeature* mu2);
-
-    //bool isUnique(const  TrigInDetTrack* id1, const  TrigInDetTrack* id2);
     bool isUnique(const  xAOD::TrackParticle* id1, const  xAOD::TrackParticle* id2) const;
     ElementLink<xAOD::TrackParticleContainer> remap_container(const ElementLink<xAOD::TrackParticleContainer> & oldElink,const ElementLinkVector<xAOD::TrackParticleContainer> &newContainer) const;
     //    ElementLink<xAOD::IParticleContainer> remap_container(const ElementLink<xAOD::IParticleContainer> & oldElink,const ElementLinkVector<xAOD::IParticleContainer> &newContainer) const;
@@ -105,8 +94,6 @@ class TrigL2BMuMuFex: public HLT::ComboAlgo {
     unsigned int m_countPassedVtxFit;
 
     // Output collections
-    //TrigL2BphysContainer* m_trigBphysColl;
-    TrigVertexCollection* m_VertexColl;
 
     std::vector<xAOD::TrigBphys*> m_resultHolder; /// Hold results between accept and execute
     
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.cxx
index d1c0281157e57ad6f6ec866f2dc19e43ca4a22d2..3e0924144c6d1f8b11454769783f95f3c5973444 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.cxx
@@ -20,9 +20,7 @@
 
 #include "TrigL2BMuMuHypo.h"
 
-#include <math.h>
 #include "xAODTrigger/TrigPassBits.h"
-#include "TrigNavigation/Navigation.h"
 
 #include "TrigBphysHelperUtilsTool.h"
 #include "xAODTrigBphys/TrigBphys.h"
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.h
index 4c5ba40fd230424c4f69cd9a2e8261511077fbc7..4f7d363085eaab034193e892e734e8e3e1e63907 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuHypo.h
@@ -24,13 +24,6 @@
 // general athena stuff
 #include "TrigInterfaces/HypoAlgo.h"
 
-//#include "TrigTimeAlgs/TrigTimerSvc.h"
-//#include "TrigInDetEvent/TrigVertexCollection.h"
-//#include "TrigParticle/TrigL2Bphys.h"
-//#include "TrigParticle/TrigL2BphysContainer.h"
-
-#include "Constants.h"
-
 class TrigBphysHelperUtilsTool;
 
 
@@ -72,9 +65,6 @@ class TrigL2BMuMuHypo: public HLT::HypoAlgo  {
   unsigned int m_countPassedBsMass;
   unsigned int m_countPassedChi2Cut;
 
-    //  TrigL2BphysContainer* m_trigBphysColl;
-    //  TrigVertexCollection* m_VertexColl;
-
   /* monitored variables */
   int m_mon_cutCounter;
   std::vector<float> m_mon_MuMumass;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.cxx
index ad614f39898ab5397d7f854509d9e001726c2133..a08a88b5ce86746bd7af01be737f55e371f8b00e 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.cxx
@@ -34,7 +34,6 @@
 
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 
-#include "TrigInDetEvent/TrigInDetTrackCollection.h"
 
 #include "TrigInDetToolInterfaces/ITrigL2VertexFitter.h" 
 #include "TrigInDetEvent/TrigL2Vertex.h"                         
@@ -42,7 +41,7 @@
 // additions of xAOD objects
 #include "xAODEventInfo/EventInfo.h"
 #include "TrigBphysHelperUtilsTool.h"
-
+#include "TrigInDetEvent/TrigVertex.h"
 
 #include <math.h>
 
@@ -401,7 +400,6 @@ TrigL2BMuMuXFex::TrigL2BMuMuXFex(const std::string & name, ISvcLocator* pSvcLoca
 ////////////////////////////// Declaration of output collections ///////////////////////////////////////////
   m_trigBphysColl_b = NULL;
   m_trigBphysColl_bxAOD = NULL;
-  m_VertexColl = NULL;
   // temporary
   m_trigBphysColl_kStarxAOD = NULL;
   m_trigBphysColl_phixAOD = NULL;
@@ -414,7 +412,6 @@ TrigL2BMuMuXFex::TrigL2BMuMuXFex(const std::string & name, ISvcLocator* pSvcLoca
 /*----------------------------------------*/
 TrigL2BMuMuXFex::~TrigL2BMuMuXFex()                                            
 { 
-  if(m_VertexColl!=NULL) delete m_VertexColl;
 //  if(m_trigBphysColl_kSplus) delete m_trigBphysColl_kSplus;
  
 }
@@ -541,14 +538,7 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltInitialize()
   }
 ///////////////////////////// end of add timers ////////////////////////////////
   
-// /////////////////////////////// choose tracking algo ///////////////////////////
-//   std::string inDetAlgo = m_inDetAlgo;
-// 
-//   if(inDetAlgo=="IDSCAN")        m_inDetAlgoId = TrigInDetTrack::IDSCANID;
-//   else if(inDetAlgo=="SITRACK")  m_inDetAlgoId = TrigInDetTrack::SITRACKID;
-//   else                           m_inDetAlgoId = TrigInDetTrack::IDSCANID;
-// ///////////////////////////// end of choose tracking algo //////////////////////
-  
+ 
   return HLT::OK;
 
 } ///////// end of HLT - Errorcode - TrigL2BMuMuXFex - hltInitialize////////////
@@ -815,7 +805,7 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
     
     if ( !pCombinedMuonFeature1->idTrack()) {
         ATH_MSG_DEBUG("Muon candidate1: no id track!");
-        auto idlink = pCombinedMuonFeature1->idTrackLink();
+        const auto& idlink = pCombinedMuonFeature1->idTrackLink();
         ATH_MSG_DEBUG("Muon elementlink has "<< idlink.dataID() << " " << idlink.index() << " " << idlink.isValid() );
         if(timerSvc()) {
             m_TotTimer->stop();
@@ -829,7 +819,7 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
     
     if ( !pCombinedMuonFeature2->idTrack()) {
         ATH_MSG_DEBUG("Muon candidate2: no id track!");
-        auto idlink = pCombinedMuonFeature2->idTrackLink();
+        const auto& idlink = pCombinedMuonFeature2->idTrackLink();
         ATH_MSG_DEBUG("Muon elementlink has "<< idlink.dataID() << " " << idlink.index() << " " << idlink.isValid() );
         if(timerSvc()) {
             m_TotTimer->stop();
@@ -860,38 +850,7 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
   /////////////////////////// loop over TE's////////////////////////////////////
   //////////////////////////////////////////////////////////////////////////////    
 
-    /*
-  std::vector<const TrigInDetTrackCollection*> vectorOfTrackCollections1;
-  std::vector<const TrigInDetTrackCollection*> vectorOfTrackCollections2;
-  //std::vector<const TrackCollection*> vectorOfTrackCollections1;
-  //std::vector<const TrackCollection*> vectorOfTrackCollections2;
-
-  std::vector<const HLT::TriggerElement*>::const_iterator iTE = inputTEs.begin();
-  ////////////////////////////// other particle candidates //////////////////////////////  
-  status = getFeatures(*iTE, vectorOfTrackCollections1);
-  //status = getFeatures(*iTE, vectorOfTrackCollections1,"TrigFastTrackFinder_TrigInDetTrack_Muon");
-  //status = getFeatures(*iTE, vectorOfTrackCollections1);
-    if (status!=HLT::OK) { ATH_MSG_ERROR("XX1: ");return HLT::NAV_ERROR;}
-    std::vector<const TrigInDetTrackCollection*> vectorOfTrackCollections1a;
-    std::vector<const TrackCollection*> vectorOfTrackCollections1b;
-    std::vector<const TrackCollection*> vectorOfTrackCollections1c;
-    status = getFeatures(*iTE, vectorOfTrackCollections1a,"TrigFastTrackFinder_TrigInDetTrack_Muon");
-    if (status!=HLT::OK) { ATH_MSG_ERROR("XX1a: ");return HLT::NAV_ERROR;}
-    status = getFeatures(*iTE, vectorOfTrackCollections1b);
-    if (status!=HLT::OK) { ATH_MSG_ERROR("XX1b: ");return HLT::NAV_ERROR;}
-    status = getFeatures(*iTE, vectorOfTrackCollections1c,"TrigFastTrackFinder_Muon");
-    if (status!=HLT::OK) { ATH_MSG_ERROR("XX1c: ");return HLT::NAV_ERROR;}
-    ATH_MSG_INFO(" found: "
-    << vectorOfTrackCollections1.size() << " "
-    << vectorOfTrackCollections1a.size() << " "
-    << vectorOfTrackCollections1b.size() << " "
-    << vectorOfTrackCollections1c.size() << " ");
-    
-    for (auto x: vectorOfTrackCollections1 ) { if (!x) continue; ATH_MSG_INFO(" 1 : " << x->size());}
-    for (auto x: vectorOfTrackCollections1a) { if (!x) continue; ATH_MSG_INFO(" 1a: " << x->size());}
-    for (auto x: vectorOfTrackCollections1b) { if (!x) continue; ATH_MSG_INFO(" 1b: " << x->size());}
-    for (auto x: vectorOfTrackCollections1c) { if (!x) continue; ATH_MSG_INFO(" 1c: " << x->size());}
-    */
+
     std::vector<const xAOD::TrackParticleContainer*> vectorOfTrackCollections1;
     std::vector<const xAOD::TrackParticleContainer*> vectorOfTrackCollections2;
     std::vector<const HLT::TriggerElement*>::const_iterator iTE = inputTEs.begin();
@@ -913,7 +872,6 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
     }
     m_mon_Acceptance.push_back( ACCEPT_First_TrackColl );
     ++iTE; // next trigger element, no more or less than two, checked by acceptInputs!!
-    //status = getFeatures(*iTE, vectorOfTrackCollections2,"TrigFastTrackFinder_TrigInDetTrack_Muon");
     status = getFeatures(*iTE, vectorOfTrackCollections2);
     //status = getFeatures(*iTE, vectorOfTrackCollections2);
     //status = getFeatures( *iTE, vectorOfTrackCollections);
@@ -1075,24 +1033,15 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
   ////////////////////////// end of muons part ///////////////////////////////
 
   //////////////////// merge of vectorOfTrackCollections /////////////////////
-//    std::vector<const TrigInDetTrackCollection*> vectorOfTrackCollections= merge_no_dupl(vectorOfTrackCollections1, vectorOfTrackCollections2);
     std::vector<const xAOD::TrackParticleContainer*> vectorOfTrackCollections= merge_no_dupl(vectorOfTrackCollections1, vectorOfTrackCollections2);
     ///////////////////////////////////////////////////////////////////////////////
     ////////////////////////// output trigger element /////////////////////////////  
     //  create vector for TrigL2Bphys particles
-    //    m_trigBphysColl_b = new TrigL2BphysContainer();
-    //    m_VertexColl = new TrigVertexCollection();
-    //    //temporary
-    //    m_trigBphysColl_kStar = new TrigL2BphysContainer();
-    //    m_trigBphysColl_phi = new TrigL2BphysContainer();
-    //    m_trigBphysColl_lambda = new TrigL2BphysContainer();
-    //    m_trigBphysColl_ds = new TrigL2BphysContainer();
-    //    //m_trigBphysColl_kSplus = new TrigL2BphysContainer();
+
     
     m_trigBphysColl_bxAOD = new xAOD::TrigBphysContainer();
     xAOD::TrigBphysAuxContainer trigBphysAuxColl_bxAOD;
     m_trigBphysColl_bxAOD->setStore(&trigBphysAuxColl_bxAOD);
-    m_VertexColl          = new TrigVertexCollection();
     //temporary
     m_trigBphysColl_kStarxAOD  = new xAOD::TrigBphysContainer();
     xAOD::TrigBphysAuxContainer trigBphysAuxColl_kStarxAOD;
@@ -1214,7 +1163,6 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
           nTriedCombinations++;
         } //end of B->KMuMu decay
 
-        if(iTrack2 != lastiTrack2) {
           // Protection
           if(nTriedCombinations > m_maxNcombinations) {
             ATH_MSG_DEBUG("Too many track combinations: ");
@@ -1299,7 +1247,6 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
                                  << *iTrack3 << " = " << (*iTrack3)->charge());
             }
           } // end of loop over iTrack3 (internal)                      
-        }
       }   // end of loop over iTrack2 (external)             
     } //////////////// end of loop over InDetTrackCollections //////////////////    
  
@@ -1349,8 +1296,6 @@ HLT::ErrorCode TrigL2BMuMuXFex::hltExecute(HLT::TEConstVec& inputTEs, HLT::Trigg
     delete m_trigBphysColl_dsxAOD;
   }
   m_trigBphysColl_bxAOD=NULL;
-  delete m_VertexColl;
-  m_VertexColl=NULL;
   // try add other collections to delete them!!
 //   delete m_trigBphysColl_lambda;
   m_trigBphysColl_lambdaxAOD = NULL;
@@ -1385,20 +1330,15 @@ void TrigL2BMuMuXFex::checkBMuMuK(const xAOD::L2CombinedMuon* mu1, const xAOD::L
         trigPartBmumuKplus->initialise(0., 0., 0., xAOD::TrigBphys::BKMUMU, kMuMumass,xAOD::TrigBphys::L2);
         ATH_MSG_DEBUG(" Create B+ Bphys particle with roIId - more RoIs => 0" << trigPartBmumuKplus->roiId() << " mass " << kMuMumass
             << " phi, eta - more RoIs => 0" << trigPartBmumuKplus->phi() << " " << trigPartBmumuKplus->eta() << " vertex type " << trigPartBmumuKplus->particleType());
-        ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuKplus;
-        ElementLink<xAOD::TrackParticleContainer> track1EL = mu1->idTrackLink();
-        ElementLink<xAOD::TrackParticleContainer> track2EL = mu2->idTrackLink();
+        const ElementLink<xAOD::TrackParticleContainer>& track1EL = mu1->idTrackLink();
+        const ElementLink<xAOD::TrackParticleContainer>& track2EL = mu2->idTrackLink();
         ElementLink<xAOD::TrackParticleContainer> track3EL(*trkCollection, iTrk3);
 
         ATH_MSG_VERBOSE("Just check track links... ");
         ATH_MSG_VERBOSE("Muon 1 pT " << (*track1EL)->pt() << " eta: " << (*track1EL)->eta() << " phi: " << (*track1EL)->phi());
         ATH_MSG_VERBOSE("Muon 2 pT " << (*track2EL)->pt() << " eta: " << (*track2EL)->eta() << " phi: " << (*track2EL)->phi());
         ATH_MSG_VERBOSE("Track 1 pT " << (*track3EL)->pt() << " eta: " << (*track3EL)->eta() << " phi: " << (*track3EL)->phi());
-        
-        trackVectorBmumuKplus.push_back(track1EL); // temp
-        trackVectorBmumuKplus.push_back(track2EL); // temp
-        trackVectorBmumuKplus.push_back(track3EL); // temp
-        
+
         trigPartBmumuKplus->addTrackParticleLink(track1EL);
         trigPartBmumuKplus->addTrackParticleLink(track2EL);
         trigPartBmumuKplus->addTrackParticleLink(track3EL);
@@ -1514,7 +1454,6 @@ void TrigL2BMuMuXFex::checkBMuMuK(const xAOD::L2CombinedMuon* mu1, const xAOD::L
                         <<", ndof = " <<baplusVtx->ndof());
                         
                         // perferct -> Bphys particle was stored in Collection
-                        m_VertexColl->push_back(mother_BplusVtx);
                         m_trigBphysColl_bxAOD->push_back(trigPartBmumuKplus);
                         ATH_MSG_DEBUG(" Added B vertex to vertex collection");
                         
@@ -1532,7 +1471,6 @@ void TrigL2BMuMuXFex::checkBMuMuK(const xAOD::L2CombinedMuon* mu1, const xAOD::L
                     }else{
                         ATH_MSG_DEBUG(" B rejected by mass or chi2 cuts after vertex fit!" << ", chi2= " << baplusVtx->chi2());  
                     
-                    vertex = false;
                     delete mother_BplusVtx;
                     delete trigPartBmumuKplus;
                     }
@@ -1594,18 +1532,14 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
         << " phi, eta - more RoIs => " << trigPartBmumuKstar->phi() << " " << trigPartBmumuKstar->eta() << " vertex type " << trigPartBmumuKstar->particleType());
         
         // Store links to the tracks forming bphys particle
-        ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuKstar;
+
         ElementLink<xAOD::TrackParticleContainer> track3EL(*trkCollection, iTrk3);
         ElementLink<xAOD::TrackParticleContainer> track4EL(*trkCollection, iTrk4);
-        //         ElementLink<TrigInDetTrackCollection> track3EL(*(*iTrackCollection), itrk);
-        //         ElementLink<TrigInDetTrackCollection> track4EL(*(*iTrackCollection), jtrk);
         
         ATH_MSG_VERBOSE("Just check track links... ");
         ATH_MSG_VERBOSE("Track 1 pT " << (*track3EL)->pt() << " eta: " << (*track3EL)->eta() << " phi: " << (*track3EL)->phi());
         ATH_MSG_VERBOSE("Track 2 pT " << (*track4EL)->pt() << " eta: " << (*track4EL)->eta() << " phi: " << (*track4EL)->phi());
-        trackVectorBmumuKstar.push_back(track3EL); // temp
-        trackVectorBmumuKstar.push_back(track4EL); // temp
-        
+
         trigPartBmumuKstar->addTrackParticleLink(track3EL);
         trigPartBmumuKstar->addTrackParticleLink(track4EL);
         // end of initial addon
@@ -1702,11 +1636,6 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
                         << ", chi2= " << kaStarVtx->chi2() <<", ndof = " <<kaStarVtx->ndof());
                         goodKstar = true;
                         
-                        // GREAT -> store daughter particle info
-                        m_VertexColl->push_back(mother_KstarVtx);
-                        ATH_MSG_DEBUG(" Added Kstar vertex to vertex collection");
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> KstarVertexEL(*m_VertexColl,index);
                         
                         // monitoring
                         m_mon_BdMuMuKs_VtxMassBd_Ks.push_back((kaStarVtx->mass())*0.001);
@@ -1726,12 +1655,9 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
                         ATH_MSG_DEBUG(" B0 rejected by mass or chi2 cuts after vertex fit!" << ", chi2= " << kaStarVtx->chi2());
                         if(timerSvc()) m_VtxFitTimer->pause();
                         //continue; // for performance test not continue
-                        vertex = false;
                         delete mother_KstarVtx;
                     }
                 } // end of successful fit condition "mother"
-                //int index = m_VertexColl->size()-1;
-                //ElementLink<TrigVertexCollection> BplusVertexEL(*m_VertexColl,index);
                 delete kaStarVtx;
             } // end of successful fit condition initial vertex
             if(timerSvc()) m_VtxFitTimer->pause();
@@ -1837,7 +1763,6 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
                             << ", chi2= " << baDVtx->chi2() <<", ndof = " <<baDVtx->ndof());
                             
                             // PERFECT -> Bphys particle was stored in collection
-                            m_VertexColl->push_back(mother_BdVtx);
                             m_trigBphysColl_bxAOD->push_back(trigPartBmumuBd);
                             ATH_MSG_DEBUG(" Added Bd vertex to vertex collection");
                             
@@ -1865,8 +1790,6 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
                         }
                     } // end of successful fit condition "mother"
                     if (vertex){
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> BdVertexEL(*m_VertexColl,index);
                     } else {
                         delete mother_BdVtx;
                     }
@@ -1881,9 +1804,9 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
             if ((xMuMuMass > m_lowerBd_KstarMuMuMassCutVtxOff && xMuMuMass < m_upperBd_KstarMuMuMassCutVtxOff)) {
                 
                 // Store links to the tracks forming bphys particle
-                ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuBd;
-                ElementLink<xAOD::TrackParticleContainer> track1ELBd = mu1->idTrackLink();
-                ElementLink<xAOD::TrackParticleContainer> track2ELBd = mu2->idTrackLink();
+
+                const ElementLink<xAOD::TrackParticleContainer>& track1ELBd = mu1->idTrackLink();
+                const ElementLink<xAOD::TrackParticleContainer>& track2ELBd = mu2->idTrackLink();
                 ElementLink<xAOD::TrackParticleContainer> track3ELBd(*trkCollection, iTrk3);
                 ElementLink<xAOD::TrackParticleContainer> track4ELBd(*trkCollection, iTrk4);
                 
@@ -1893,15 +1816,8 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
                 ATH_MSG_VERBOSE("Track 1 pT " << (*track3ELBd)->pt() << " eta: " << (*track3ELBd)->eta() << " phi: " << (*track3ELBd)->phi());
                 ATH_MSG_VERBOSE("Track 2 pT " << (*track4ELBd)->pt() << " eta: " << (*track4ELBd)->eta() << " phi: " << (*track4ELBd)->phi());
 
-                trackVectorBmumuBd.push_back(track1ELBd); // temp
-                trackVectorBmumuBd.push_back(track2ELBd); // temp
-                trackVectorBmumuBd.push_back(track3ELBd); // temp
-                trackVectorBmumuBd.push_back(track4ELBd); // temp
-                
-                
-                //                 if(m_doKstar_KaonPionVertexFit){
                 ElementLink<xAOD::TrigBphysContainer> trigPartBdEL(*m_trigBphysColl_kStarxAOD,KstarIndex);
-                //TrigL2Bphys* trigPartBmumuBd = new TrigL2Bphys(0.0, 0.0, 0.0, TrigL2Bphys::BDKSTMUMU, xMuMuMass, trigPartBdEL);
+
                 xAOD::TrigBphys * trigPartBmumuBd = new xAOD::TrigBphys();
                 trigPartBmumuBd->makePrivateStore();
                 trigPartBmumuBd->initialise(0.0, 0.0, 0.0, xAOD::TrigBphys::BDKSTMUMU, xMuMuMass,trigPartBdEL, xAOD::TrigBphys::L2);
@@ -1911,15 +1827,7 @@ void TrigL2BMuMuXFex::checkBdMuMuKstar(const xAOD::L2CombinedMuon* mu1, const xA
                 trigPartBmumuBd->addTrackParticleLink(track3ELBd);
                 trigPartBmumuBd->addTrackParticleLink(track4ELBd);
                 m_trigBphysColl_bxAOD->push_back(trigPartBmumuBd);
-                //                 }else{
-                //                     ElementLink<TrigL2BphysContainer> trigPartBdEL(*m_trigBphysColl_kStar,KstarIndex);
-                //                     TrigL2Bphys* trigPartBmumuBd = new TrigL2Bphys(0., 0., 0., TrigL2Bphys::BDKSTMUMU, xMuMuMass, trigPartBdEL);
-                //                     trigPartBmumuBd->addTrack(track1ELBd);
-                //                     trigPartBmumuBd->addTrack(track2ELBd);
-                //                     trigPartBmumuBd->addTrack(track3ELBd);
-                //                     trigPartBmumuBd->addTrack(track4ELBd);
-                //                     m_trigBphysColl_b->push_back(trigPartBmumuBd);
-                //                 }
+
                 
                 ATH_MSG_DEBUG(" Kstar's Pion and Kaon Candidates accepted with K* mass: " << xMass << "MeV" << " and with Bd mass : " << xMuMuMass << "MeV"
                     << " kaon particle with pt: "<< trk3->pt() << " pion charged particle with pt: "<< trk4->pt());
@@ -1967,7 +1875,7 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
         << " phi, eta - more RoIs => " << trigPartBmumuPhi->phi() << " " << trigPartBmumuPhi->eta() << " vertex type " << trigPartBmumuPhi->particleType());
 
         // Store links to the tracks forming bphys particle
-        ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuPhi;
+
         ElementLink<xAOD::TrackParticleContainer> track3EL(*trkCollection, iTrk3);
         ElementLink<xAOD::TrackParticleContainer> track4EL(*trkCollection, iTrk4);
         
@@ -1975,9 +1883,6 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
         ATH_MSG_VERBOSE("Track 1 pT " << (*track3EL)->pt() << " eta: " << (*track3EL)->eta() << " phi: " << (*track3EL)->phi());
         ATH_MSG_VERBOSE("Track 2 pT " << (*track4EL)->pt() << " eta: " << (*track4EL)->eta() << " phi: " << (*track4EL)->phi());
 
-        trackVectorBmumuPhi.push_back(track3EL); // temp
-        trackVectorBmumuPhi.push_back(track4EL); // temp
-        
         trigPartBmumuPhi->addTrackParticleLink(track3EL);
         trigPartBmumuPhi->addTrackParticleLink(track4EL);
         // end of initial addon
@@ -2090,10 +1995,7 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
                         
                         goodPhi = true;
                         // GREAT -> store daughter particle info
-                        m_VertexColl->push_back(mother_PhiVtx);
                         ATH_MSG_DEBUG(" Added Phi vertex to vertex collection");
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> PhiVertexEL(*m_VertexColl,index);
                         
                         // monitoring
                         m_mon_BsMuMuPhi_VtxMassBs_Phi.push_back((phia1020Vtx->mass())*0.001);
@@ -2119,12 +2021,9 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
                         ATH_MSG_DEBUG(" Phi rejected by mass or chi2 cuts after vertex fit!" << ", chi2= " << phia1020Vtx->chi2());
                         if(timerSvc()) m_VtxFitTimer->pause();
                         //continue; // for performance test not continue
-                        vertex = false;
                         delete mother_PhiVtx;
                     }
                 } // end of successful fit condition "mother"
-                //int index = m_VertexColl->size()-1;
-                //ElementLink<TrigVertexCollection> BplusVertexEL(*m_VertexColl,index);
                 delete phia1020Vtx;
             } // end of successful fit condition initial vertex
             if(timerSvc()) m_VtxFitTimer->pause();
@@ -2233,7 +2132,6 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
                                 << ", chi2= " << baSVtx->chi2()
                                 <<", ndof = " <<baSVtx->ndof());
                             // PERFECT -> Bphys particle was stored in collection
-                            m_VertexColl->push_back(mother_BsVtx);
                             m_trigBphysColl_bxAOD->push_back(trigPartBmumuBs);
                             ATH_MSG_DEBUG(" Added Bs vertex to vertex collection");
                             // monitoring of successfuly stored particles
@@ -2266,8 +2164,6 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
                         }
                     } // end of successful fit condition "mother"
                     if(vertex) {
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> BsVertexEL(*m_VertexColl,index);
                     } else {
                         delete mother_BsVtx;
                     }
@@ -2282,9 +2178,8 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
             if ((xMuMuMass > m_lowerBs_Phi1020MuMuMassCutVtxOff && xMuMuMass < m_upperBs_Phi1020MuMuMassCutVtxOff)) {
                 
                 // Store links to the tracks forming bphys particle
-                ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuBs;
-                ElementLink<xAOD::TrackParticleContainer> track1ELBs = mu1->idTrackLink();
-                ElementLink<xAOD::TrackParticleContainer> track2ELBs = mu2->idTrackLink();
+                const ElementLink<xAOD::TrackParticleContainer>& track1ELBs = mu1->idTrackLink();
+                const ElementLink<xAOD::TrackParticleContainer>& track2ELBs = mu2->idTrackLink();
                 ElementLink<xAOD::TrackParticleContainer> track3ELBs(*trkCollection, iTrk3);
                 ElementLink<xAOD::TrackParticleContainer> track4ELBs(*trkCollection, iTrk4);
                 
@@ -2294,15 +2189,8 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
                 ATH_MSG_VERBOSE("Track 1 pT " << (*track3ELBs)->pt() << " eta: " << (*track3ELBs)->eta() << " phi: " << (*track3ELBs)->phi());
                 ATH_MSG_VERBOSE("Track 2 pT " << (*track4ELBs)->pt() << " eta: " << (*track4ELBs)->eta() << " phi: " << (*track4ELBs)->phi());
 
-                trackVectorBmumuBs.push_back(track1ELBs); // temp
-                trackVectorBmumuBs.push_back(track2ELBs); // temp
-                trackVectorBmumuBs.push_back(track3ELBs); // temp
-                trackVectorBmumuBs.push_back(track4ELBs); // temp
-                
-                
-                //         if(m_doPhi1020_KaonKaonVertexFit){
-                //                ElementLink<TrigL2BphysContainer> trigPartBsEL(*m_trigBphysColl_phi,PhiIndex);
-                //TrigL2Bphys* trigPartBmumuBs = new TrigL2Bphys(0.0, 0.0, 0.0, TrigL2Bphys::BSPHIMUMU, xMuMuMass, trigPartBsEL);
+
+
                 ElementLink<xAOD::TrigBphysContainer> trigPartBsEL(*m_trigBphysColl_phixAOD,PhiIndex);
                 xAOD::TrigBphys *trigPartBmumuBs = new xAOD::TrigBphys();
                 trigPartBmumuBs->makePrivateStore();
@@ -2313,18 +2201,7 @@ void TrigL2BMuMuXFex::checkBsMuMuPhi(const xAOD::L2CombinedMuon* mu1, const xAOD
                 trigPartBmumuBs->addTrackParticleLink(track3ELBs); 
                 trigPartBmumuBs->addTrackParticleLink(track4ELBs); 
                 m_trigBphysColl_bxAOD->push_back(trigPartBmumuBs);
-                //         }else{
-                // //           m_trigBphysColl_phi->push_back(trigPartBmumuPhi);
-                // //           int PhiIndex = m_trigBphysColl_phi->size() - 1;
-                // //           ElementLink<TrigL2BphysContainer> trigPartBsEL(*m_trigBphysColl_phi,PhiIndex);
-                //           
-                //           TrigL2Bphys* trigPartBmumuBs = new TrigL2Bphys(0., 0., 0., TrigL2Bphys::BSPHIMUMU, xMuMuMass/*, trigPartBsEL*/);
-                //           trigPartBmumuBs->addTrackParticleLink(track1ELBs); 
-                //             trigPartBmumuBs->addTrackParticleLink(track2ELBs); 
-                //             trigPartBmumuBs->addTrackParticleLink(track3ELBs); 
-                //             trigPartBmumuBs->addTrackParticleLink(track4ELBs); 
-                //           m_trigBphysColl_b->push_back(trigPartBmumuBs);
-                //         }
+
                 m_mon_BsMuMuPhi_n++;
                 if(trk3->pt() * trk3->charge() > 0) {
                     ATH_MSG_DEBUG(" Phi's Kplus and Kminus Candidates accepted with Phi mass: " << xMass << "MeV"  
@@ -2387,7 +2264,7 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
             << " phi, eta - more RoIs => " << trigPartBmumuL->phi() << " " << trigPartBmumuL->eta() << " vertex type " << trigPartBmumuL->particleType());
         
         // Store links to the tracks forming bphys particle
-        ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuL;
+
         ElementLink<xAOD::TrackParticleContainer> track3EL(*trkCollection, iTrk3);
         ElementLink<xAOD::TrackParticleContainer> track4EL(*trkCollection, iTrk4);
         
@@ -2395,9 +2272,6 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
         ATH_MSG_VERBOSE("Track 1 pT " << (*track3EL)->pt() << " eta: " << (*track3EL)->eta() << " phi: " << (*track3EL)->phi());
         ATH_MSG_VERBOSE("Track 2 pT " << (*track4EL)->pt() << " eta: " << (*track4EL)->eta() << " phi: " << (*track4EL)->phi());
         
-        trackVectorBmumuL.push_back(track3EL); // temp
-        trackVectorBmumuL.push_back(track4EL); // temp
-        
         trigPartBmumuL->addTrackParticleLink(track3EL);
         trigPartBmumuL->addTrackParticleLink(track4EL);
         // end of initial addon
@@ -2496,10 +2370,6 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
                             <<", ndof = " <<lambdaaVtx->ndof());
                         goodL = true;
                         // GREAT -> store daughter particle info
-                        m_VertexColl->push_back(mother_LVtx);
-                        ATH_MSG_DEBUG(" Added L vertex to vertex collection");
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> LVertexEL(*m_VertexColl,index);
                         
                         // monitoring
                         m_mon_LbMuMuL_VtxMassLb_L.push_back((lambdaaVtx->mass())*0.001);
@@ -2523,8 +2393,6 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
                         delete mother_LVtx;
                     }
                 } // end of successful fit condition "mother"
-                //int index = m_VertexColl->size()-1;
-                //ElementLink<TrigVertexCollection> BplusVertexEL(*m_VertexColl,index);
                 delete lambdaaVtx;
             } // end of successful fit condition initial vertex
             if(timerSvc()) m_VtxFitTimer->pause();
@@ -2635,7 +2503,6 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
                                 <<", ndof = " <<laBVtx->ndof());
                             
                             // PERFECT -> Bphys particle was stored in collection
-                            m_VertexColl->push_back(mother_LbVtx);
                             m_trigBphysColl_bxAOD->push_back(trigPartBmumuLb);
                             ATH_MSG_DEBUG(" Added Lb vertex to vertex collection");
                             
@@ -2663,8 +2530,6 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
                         }
                     } // end of successful fit condition "mother"
                     if(vertex) {
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> LbVertexEL(*m_VertexColl,index);
                     } else {
                         delete mother_LbVtx;
                     }
@@ -2680,9 +2545,8 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
             if ((xMuMuMass > m_lowerLb_LambdaMuMuMassCutVtxOff && xMuMuMass < m_upperLb_LambdaMuMuMassCutVtxOff)) {
                 
                 // Store links to the tracks forming bphys particle
-                ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuLb;
-                ElementLink<xAOD::TrackParticleContainer> track1ELLb = mu1->idTrackLink();
-                ElementLink<xAOD::TrackParticleContainer> track2ELLb = mu2->idTrackLink();
+                const ElementLink<xAOD::TrackParticleContainer>& track1ELLb = mu1->idTrackLink();
+                const ElementLink<xAOD::TrackParticleContainer>& track2ELLb = mu2->idTrackLink();
                 ElementLink<xAOD::TrackParticleContainer> track3ELLb(*trkCollection, iTrk3);
                 ElementLink<xAOD::TrackParticleContainer> track4ELLb(*trkCollection, iTrk4);
                 
@@ -2691,16 +2555,8 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
                 ATH_MSG_VERBOSE("Muon 2 pT " << (*track2ELLb)->pt() << " eta: " << (*track2ELLb)->eta() << " phi: " << (*track2ELLb)->phi());
                 ATH_MSG_VERBOSE("Track 1 pT " << (*track3ELLb)->pt() << " eta: " << (*track3ELLb)->eta() << " phi: " << (*track3ELLb)->phi());
                 ATH_MSG_VERBOSE("Track 2 pT " << (*track4ELLb)->pt() << " eta: " << (*track4ELLb)->eta() << " phi: " << (*track4ELLb)->phi());
-                
-                trackVectorBmumuLb.push_back(track1ELLb); // temp
-                trackVectorBmumuLb.push_back(track2ELLb); // temp
-                trackVectorBmumuLb.push_back(track3ELLb); // temp
-                trackVectorBmumuLb.push_back(track4ELLb); // temp
-                
-                
-                //         if(m_doLambda_ProtonPionVertexFit){
+
                 ElementLink<xAOD::TrigBphysContainer> trigPartLbEL(*m_trigBphysColl_lambdaxAOD,LIndex);
-                //TrigL2Bphys* trigPartBmumuLb = new TrigL2Bphys(0.0, 0.0, 0.0, TrigL2Bphys::LBLMUMU, xMuMuMass, trigPartLbEL);
                 xAOD::TrigBphys* trigPartBmumuLb = new xAOD::TrigBphys();
                 trigPartBmumuLb->makePrivateStore();
                 trigPartBmumuLb->initialise(0.0, 0.0, 0.0, xAOD::TrigBphys::LBLMUMU, xMuMuMass, trigPartLbEL,xAOD::TrigBphys::L2);
@@ -2710,18 +2566,6 @@ void TrigL2BMuMuXFex::checkLbMuMuLambda(const xAOD::L2CombinedMuon* mu1, const x
                 trigPartBmumuLb->addTrackParticleLink(track3ELLb);
                 trigPartBmumuLb->addTrackParticleLink(track4ELLb);
                 m_trigBphysColl_bxAOD->push_back(trigPartBmumuLb);
-                //         }else{
-                // //           m_trigBphysColl_lambda->push_back(trigPartBmumuL);
-                // //           int LIndex = m_trigBphysColl_lambda->size() - 1;
-                // //           ElementLink<xAOD::TrigBphysContainer> trigPartLbEL(*m_trigBphysColl_lambda,LIndex);
-                //           
-                //           TrigL2Bphys* trigPartBmumuLb = new TrigL2Bphys(0., 0., 0., TrigL2Bphys::LBLMUMU, xMuMuMass/*, trigPartLbEL*/);
-                //           trigPartBmumuLb->addTrack(track1ELLb); 
-                //           trigPartBmumuLb->addTrack(track2ELLb); 
-                //           trigPartBmumuLb->addTrack(track3ELLb); 
-                //           trigPartBmumuLb->addTrack(track4ELLb); 
-                //           m_trigBphysColl_b->push_back(trigPartBmumuLb);
-                //         }
                 
                 ATH_MSG_DEBUG(" Lambda's Proton and Pion Candidates accepted with L mass: " << xMass << "MeV"  
                     << " and with LambdaB mass : " << xMuMuMass << "MeV" << " proton particle with pt: "<< trk3->pt() << " pion particle with pt: "<< trk4->pt());
@@ -2773,7 +2617,7 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
             << " phi, eta - more RoIs => " << trigPartBmumuDs->phi() << " " << trigPartBmumuDs->eta() << " vertex type " << trigPartBmumuDs->particleType());
         
         // Store links to the tracks forming bphys particle
-        ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuDs;
+
         ElementLink<xAOD::TrackParticleContainer> track3EL(*trkCollection, iTrk3); //kaon
         ElementLink<xAOD::TrackParticleContainer> track4EL(*trkCollection, iTrk4); //kaon
         ElementLink<xAOD::TrackParticleContainer> track5EL(*trkCollection, iTrk5); //pion
@@ -2783,9 +2627,6 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
         ATH_MSG_VERBOSE("Track 2 pT " << (*track4EL)->pt() << " eta: " << (*track4EL)->eta() << " phi: " << (*track4EL)->phi());
         ATH_MSG_VERBOSE("Track 3 pT " << (*track5EL)->pt() << " eta: " << (*track5EL)->eta() << " phi: " << (*track5EL)->phi());
 
-        trackVectorBmumuDs.push_back(track3EL); // temp
-        trackVectorBmumuDs.push_back(track4EL); // temp
-        trackVectorBmumuDs.push_back(track5EL); // temp
         
         trigPartBmumuDs->addTrackParticleLink(track3EL);
         trigPartBmumuDs->addTrackParticleLink(track4EL);
@@ -2898,10 +2739,7 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
                         
                         goodDs = true;
                         // GREAT -> store daughter particle info
-                        m_VertexColl->push_back(mother_DsVtx);
                         ATH_MSG_DEBUG(" Added Ds vertex to vertex collection");
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> DsVertexEL(*m_VertexColl,index);
                         
                         // monitoring
                         m_mon_BcMuMuDs_VtxMassBc_Ds.push_back((DsVtx->mass())*0.001);
@@ -2939,8 +2777,6 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
                         delete mother_DsVtx;
                     }
                 } // end of successful fit condition "mother"
-                //int index = m_VertexColl->size()-1;
-                //ElementLink<TrigVertexCollection> BplusVertexEL(*m_VertexColl,index);
                 delete DsVtx;
             } // end of successful fit condition initial vertex
             if(timerSvc()) m_VtxFitTimer->pause();
@@ -2995,8 +2831,7 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
                     //continue;
                     vertex = false;
                 }
-                //ElementLink<TrigL2BphysContainer> trigPartBcEL(*m_trigBphysColl_ds,DsIndex);
-                //TrigL2Bphys* trigPartBmumuBc = new TrigL2Bphys(0.0, 0.0, 0.0, TrigL2Bphys::BCDSMUMU, xMuMuMass, trigPartBcEL);
+
                 ElementLink<xAOD::TrigBphysContainer> trigPartBcEL(*m_trigBphysColl_dsxAOD,DsIndex);
                 xAOD::TrigBphys* trigPartBmumuBc = new xAOD::TrigBphys();
                 trigPartBmumuBc->makePrivateStore();
@@ -3057,7 +2892,6 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
                                 <<", ndof = " <<BcVtx->ndof());
                             
                             // PERFECT -> Bphys particle was stored in collection
-                            m_VertexColl->push_back(mother_BcVtx);
                             m_trigBphysColl_bxAOD->push_back(trigPartBmumuBc);
                             ATH_MSG_DEBUG(" Added Bc vertex to vertex collection");
                             // monitoring of successfuly stored particles
@@ -3095,8 +2929,6 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
                         }
                     } // end of successful fit condition "mother"
                     if(vertex) {
-                        int index = m_VertexColl->size()-1;
-                        ElementLink<TrigVertexCollection> BsVertexEL(*m_VertexColl,index);
                     } else {
                         delete mother_BcVtx;
                     }
@@ -3111,9 +2943,9 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
             if ((xMuMuMass > m_lowerBc_DsMuMuMassCutVtxOff && xMuMuMass < m_upperBc_DsMuMuMassCutVtxOff)) {
                 
                 // Store links to the tracks forming bphys particle
-                ElementLinkVector<xAOD::TrackParticleContainer> trackVectorBmumuBc;
-                ElementLink<xAOD::TrackParticleContainer> track1ELBc = mu1->idTrackLink();
-                ElementLink<xAOD::TrackParticleContainer> track2ELBc = mu2->idTrackLink();
+
+                const ElementLink<xAOD::TrackParticleContainer>& track1ELBc = mu1->idTrackLink();
+                const ElementLink<xAOD::TrackParticleContainer>& track2ELBc = mu2->idTrackLink();
                 ElementLink<xAOD::TrackParticleContainer> track3ELBc(*trkCollection, iTrk3);
                 ElementLink<xAOD::TrackParticleContainer> track4ELBc(*trkCollection, iTrk4);
                 ElementLink<xAOD::TrackParticleContainer> track5ELBc(*trkCollection, iTrk5);
@@ -3124,17 +2956,7 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
                 ATH_MSG_VERBOSE("Track 1 pT " << (*track3ELBc)->pt() << " eta: " << (*track3ELBc)->eta() << " phi: " << (*track3ELBc)->phi());
                 ATH_MSG_VERBOSE("Track 2 pT " << (*track4ELBc)->pt() << " eta: " << (*track4ELBc)->eta() << " phi: " << (*track4ELBc)->phi());
                 ATH_MSG_VERBOSE("Track 3 pT " << (*track5ELBc)->pt() << " eta: " << (*track5ELBc)->eta() << " phi: " << (*track5ELBc)->phi());
-                
-                trackVectorBmumuBc.push_back(track1ELBc); // temp
-                trackVectorBmumuBc.push_back(track2ELBc); // temp
-                trackVectorBmumuBc.push_back(track3ELBc); // temp
-                trackVectorBmumuBc.push_back(track4ELBc); // temp
-                trackVectorBmumuBc.push_back(track5ELBc); // temp
-                
-                
-                //         if(m_doPhi1020_KaonKaonVertexFit){
-                //ElementLink<TrigL2BphysContainer> trigPartBcEL(*m_trigBphysColl_ds,DsIndex);
-                //TrigL2Bphys* trigPartBmumuBc = new TrigL2Bphys(0.0, 0.0, 0.0, TrigL2Bphys::BCDSMUMU, xMuMuMass, trigPartBcEL);
+
                 ElementLink<xAOD::TrigBphysContainer> trigPartBcEL(*m_trigBphysColl_dsxAOD,DsIndex);
                 xAOD::TrigBphys* trigPartBmumuBc = new xAOD::TrigBphys();
                 trigPartBmumuBc->makePrivateStore();
@@ -3146,18 +2968,7 @@ void TrigL2BMuMuXFex::checkBcMuMuDs(const xAOD::L2CombinedMuon* mu1, const xAOD:
                 trigPartBmumuBc->addTrackParticleLink(track4ELBc);
                 trigPartBmumuBc->addTrackParticleLink(track5ELBc);
                 m_trigBphysColl_bxAOD->push_back(trigPartBmumuBc);
-                //         }else{
-                // //           m_trigBphysColl_phi->push_back(trigPartBmumuPhi);
-                // //           int PhiIndex = m_trigBphysColl_phi->size() - 1;
-                // //           ElementLink<TrigL2BphysContainer> trigPartBsEL(*m_trigBphysColl_phi,PhiIndex);
-                //           
-                //           TrigL2Bphys* trigPartBmumuBs = new TrigL2Bphys(0., 0., 0., TrigL2Bphys::BSPHIMUMU, xMuMuMass/*, trigPartBsEL*/);
-                //           trigPartBmumuBs->addTrack(track1ELBs); 
-                //             trigPartBmumuBs->addTrack(track2ELBs); 
-                //             trigPartBmumuBs->addTrack(track3ELBs); 
-                //             trigPartBmumuBs->addTrack(track4ELBs); 
-                //           m_trigBphysColl_b->push_back(trigPartBmumuBs);
-                //         }
+
                 m_mon_BcMuMuDs_n++;
                 if(trk3->pt()*trk3->charge() > 0) {
                     ATH_MSG_DEBUG(" Ds's Kplus, Kminus and pion Candidates accepted with Ds mass: " << xMass << "MeV"  
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.h
index d21a9b46fc994707e7f3d17be2ab48d1de9b4e16..ecd33b40a907cb04eb09a77fe5f9f571b55006e7 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2BMuMuXFex.h
@@ -26,16 +26,10 @@
 #include "BtrigUtils.h"
 
 
-#include "TrigInDetEvent/TrigInDetTrackFitPar.h"
-#include "TrigInDetEvent/TrigInDetTrackCollection.h"
-//#include "TrigMuonEvent/TrigCombDiMuonContainer.h"
-
 #include "TrigInDetToolInterfaces/ITrigVertexingTool.h"
 
 #include "TrigInDetToolInterfaces/ITrigL2VertexFitter.h"                         
 
-#include "TrigInDetEvent/TrigVertexCollection.h"
-
 #include "xAODTrigBphys/TrigBphysContainer.h"
 #include "xAODTrigBphys/TrigBphysAuxContainer.h"
 #include "xAODTrigBphys/TrigBphys.h"
@@ -43,8 +37,6 @@
 #include "xAODTrigMuon/L2CombinedMuon.h"
 #include "xAODTrigMuon/L2CombinedMuonContainer.h"
 
-typedef std::vector<const TrigInDetTrack*> TTrackPair;
-
 class TrigBphysHelperUtilsTool;
 
 /// addon, not needed 
@@ -67,20 +59,6 @@ class TrigL2BMuMuXFex: public HLT::ComboAlgo
   private:
     ToolHandle <TrigBphysHelperUtilsTool> m_bphysHelperTool;
 
-//    double KMuMuMass(const TrigInDetTrack* mu1, const TrigInDetTrack* mu2, const TrigInDetTrack* kaon);
-//    double XMass(const TrigInDetTrack* particle1, const TrigInDetTrack* particle2, int decay);                
-//    double XMuMuMass(const TrigInDetTrack* mu1, const TrigInDetTrack* mu2, 
-//                     const TrigInDetTrack* particle1, const TrigInDetTrack* particle2, int decay);
-//    double X3Mass(const TrigInDetTrack* particle1, const TrigInDetTrack* particle2, const TrigInDetTrack* particle3);                
-//    double X3MuMuMass(const TrigInDetTrack* mu1, const TrigInDetTrack* mu2, 
-//                     const TrigInDetTrack* particle1, const TrigInDetTrack* particle2, const TrigInDetTrack* particle3);
-//    
-    //    void checkBMuMuK(const CombinedMuonFeature* mu1, const CombinedMuonFeature* mu2, const TrigInDetTrack* trk3, const TrigInDetTrackCollection* trkCollection, int iTrk3);
-    //    void checkBdMuMuKstar(const CombinedMuonFeature* mu1, const CombinedMuonFeature* mu2, const TrigInDetTrack* trk3, const TrigInDetTrack* trk4, const TrigInDetTrackCollection* trkCollection, int iTrk3, int iTrk4);
-    //    void checkBsMuMuPhi(const CombinedMuonFeature* mu1, const CombinedMuonFeature* mu2, const TrigInDetTrack* trk3, const TrigInDetTrack* trk4, const TrigInDetTrackCollection* trkCollection, int iTrk3, int iTrk4);
-    //    void checkLbMuMuLambda(const CombinedMuonFeature* mu1, const CombinedMuonFeature* mu2, const TrigInDetTrack* trk3, const TrigInDetTrack* trk4, const TrigInDetTrackCollection* trkCollection, int iTrk3, int iTrk4);
-    //    void checkBcMuMuDs(const CombinedMuonFeature* mu1, const CombinedMuonFeature* mu2, const TrigInDetTrack* trk3, const TrigInDetTrack* trk4, const TrigInDetTrack* trk5, const TrigInDetTrackCollection* trkCollection, int iTrk3, int iTrk4, double xPhiMass, int iTrk5);
- 
     
     void checkBMuMuK(const xAOD::L2CombinedMuon* mu1, const xAOD::L2CombinedMuon* mu2, const xAOD::TrackParticle* trk3,
                      const xAOD::TrackParticleContainer* trkCollection, int iTrk3);
@@ -233,13 +211,6 @@ class TrigL2BMuMuXFex: public HLT::ComboAlgo
     TrigL2BphysContainer* m_trigBphysColl_b;
     xAOD::TrigBphysContainer* m_trigBphysColl_bxAOD; // revert back to non-aod naming once complete
     
-    TrigVertexCollection* m_VertexColl;
-    // temporary
-//    TrigL2BphysContainer* m_trigBphysColl_kStar;   
-//    TrigL2BphysContainer* m_trigBphysColl_phi;   
-//    TrigL2BphysContainer* m_trigBphysColl_lambda;   
-//    TrigL2BphysContainer* m_trigBphysColl_ds;
-
     xAOD::TrigBphysContainer* m_trigBphysColl_kStarxAOD;
     xAOD::TrigBphysContainer* m_trigBphysColl_phixAOD;
     xAOD::TrigBphysContainer* m_trigBphysColl_lambdaxAOD;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.cxx
index 12f80ddaa6a9b3fb1cf4d7d3ad38168b4063bfc0..8d53edd535d778fd15b507937101fc984a8aed99 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.cxx
@@ -14,10 +14,6 @@
 
 #include "TrigL2MultiMuFex.h"
 
-#include "TrigInDetEvent/TrigInDetTrackCollection.h"
-#include "TrigInDetEvent/TrigInDetTrackFitPar.h"
-
-
 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
 
 #include "TrigInDetToolInterfaces/ITrigVertexingTool.h"
@@ -107,16 +103,12 @@ TrigL2MultiMuFex::TrigL2MultiMuFex(const std::string & name, ISvcLocator* pSvcLo
 
   // Initialize the collections
   m_trigBphysColl = NULL;
-  //m_VertexColl    = NULL;
 }
 
 /*------------------------------*/
 TrigL2MultiMuFex::~TrigL2MultiMuFex()
 /*------------------------------*/
 {
-  // TODO: Delete the collections ?
-  //delete m_trigBphysColl;
-  //delete m_VertexColl;
 }
 
 /*-------------------------------------------*/
@@ -235,19 +227,7 @@ HLT::ErrorCode TrigL2MultiMuFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pa
   // Processing timers
   if ( timerSvc() ) m_BmmHypTot->start();
 
-    // Retrieve event info
-    //    int IdRun   = 0;
-    //    int IdEvent = 0;
-    //    // event info
-    //    uint32_t runNumber(0), evtNumber(0), lbBlock(0);
-    //    if (m_bphysHelperTool->getRunEvtLb( runNumber, evtNumber, lbBlock).isFailure()) {
-    //        ATH_MSG_ERROR("Error retriving EventInfo" );
-    //    }
-    //    IdRun = runNumber;
-    //    IdEvent = evtNumber;
-
-
-    
+  
   // Check consistency of the number of input Trigger Elements
   if (m_checkNinputTE && inputTE.size() != m_NInputMuon ) {
     ATH_MSG_ERROR("Got wrong number of input TEs, expect " << m_NInputMuon << " got " << inputTE.size() );
@@ -272,7 +252,6 @@ HLT::ErrorCode TrigL2MultiMuFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigg
 {
     ATH_MSG_DEBUG(" In hltExecute " );
 
-    //  m_trigBphysColl = new TrigL2BphysContainer();
     m_trigBphysColl = new xAOD::TrigBphysContainer;
     xAOD::TrigBphysAuxContainer xAODTrigBphysAuxColl;
     m_trigBphysColl->setStore(&xAODTrigBphysAuxColl);
@@ -317,10 +296,6 @@ void TrigL2MultiMuFex::processTriMuon(HLT::TEConstVec& inputTE)
       const HLT::TriggerElement* te2 = inputTE[1];
       const HLT::TriggerElement* te3 = inputTE[2];
 
-    //      const CombinedMuonFeature *muon1;
-    //      const CombinedMuonFeature *muon2;
-    //      const CombinedMuonFeature *muon3;
-
     
     //if(getFeature(te1,muon1)!= HLT::OK) {
     if(getFeaturesLinks<xAOD::L2CombinedMuonContainer,xAOD::L2CombinedMuonContainer>(te1,l2combinedMuonEL[0]) != HLT::OK
@@ -445,19 +420,6 @@ void TrigL2MultiMuFex::processTriMuon(HLT::TEConstVec& inputTE)
       m_mon_MutrkPhi.push_back( (*ELidtrack2)->phi0() );
       m_mon_MutrkPhi.push_back( (*ELidtrack3)->phi0() );
 
-    // simple lambda to help print out information, without tedious typing
-    /*
-    auto dumpinfo = [this] (const xAOD::L2CombinedMuon* muon) {
-        this->msg() << "pt=" << muon->pt()*muon->charge() << " trkAddr=" << muon->idTrack() << " Trk:Track=" << muon->idTrack()->track()
-    };
-    if (msgLvl() <= MSG::DEBUG ) {
-        ATH_MSG_DEBUG("1st CombinedMuonFeature " << dumpinfo(muon1) );
-        ATH_MSG_DEBUG("2st CombinedMuonFeature " << dumpinfo(muon2) );
-        ATH_MSG_DEBUG("3st CombinedMuonFeature " << dumpinfo(muon3) );
-    } // if debug
-    */
- 
-
     if (m_NMassMuon ==2) {   // check mass of opposite sign muon pairs
         
         m_passInvMass=false;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.h
index 52128dc642a23e8a686cdaebe73c8f529db437bb..8fe510b81e0dbd196fb69b02f3145af3bb9b21d6 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuFex.h
@@ -17,12 +17,9 @@
 
 #include "TrigInterfaces/ComboAlgo.h"
 
-#include "TrigInDetEvent/TrigVertexCollection.h"
 #include "TrigInDetToolInterfaces/ITrigVertexFitter.h"
 #include "TrigInDetToolInterfaces/ITrigL2VertexFitter.h"
 
-//#include "TrigParticle/TrigL2BphysContainer.h"
-
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 
 #include "Constants.h"
@@ -109,7 +106,6 @@ class TrigL2MultiMuFex: public HLT::ComboAlgo {
 
     // Output collections
     xAOD::TrigBphysContainer* m_trigBphysColl;
-    //TrigVertexCollection* m_VertexColl;
 
     // Monitored variables
     std::vector<int>   m_mon_Errors;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuHypo.h
index 91fcf53621f22bb39ee20d15020d4c6e2c3abde5..7edefeee3cfbbc44688d73a5a27e3ff121c9a35c 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2MultiMuHypo.h
@@ -23,12 +23,6 @@
 #include <string>
 #include "TrigInterfaces/HypoAlgo.h"
 
-////#include "TrigTimeAlgs/TrigTimerSvc.h"
-//#include "TrigInDetEvent/TrigVertexCollection.h"
-//#include "TrigParticle/TrigL2Bphys.h"
-//#include "TrigParticle/TrigL2BphysContainer.h"
-//
-
 class TrigBphysHelperUtilsTool;
 
 
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassFex.cxx
deleted file mode 100644
index d88335918518db2285b863e767ec09565d8df3b3..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassFex.cxx
+++ /dev/null
@@ -1,943 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// *******************************************************************
-//
-// NAME:     TrigL2TrkMassFex.cxx
-// PACKAGE:  Trigger/TrigHypothesis/TrigBphysHypo
-// AUTHOR:   Julie Kirk
-//
-// *******************************************************************
-
-#include <math.h>
-
-#include "TrigL2TrkMassFex.h"
-
-
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-
-#include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
-
-#include "TrigInDetToolInterfaces/ITrigVertexingTool.h"
-#include "TrigInDetEvent/TrigL2Vertex.h"
-
-#include "Constants.h"
-#include "BtrigUtils.h"
-
-// additions of xAOD objects
-#include "TrigBphysHelperUtilsTool.h"
-#include "xAODTracking/TrackParticle.h"
-#include "xAODTracking/TrackParticleContainer.h"
-#include "xAODTrigMuon/L2StandAloneMuon.h"
-#include "xAODTrigMuon/L2StandAloneMuonContainer.h"
-#include "xAODTrigMuon/L2CombinedMuon.h"
-#include "xAODTrigMuon/L2CombinedMuonContainer.h"
-
-using namespace std;
-
-/*------------------------------------------------------------------------------------*/
-TrigL2TrkMassFex::TrigL2TrkMassFex(const std::string & name, ISvcLocator* pSvcLocator):
-  HLT::FexAlgo(name, pSvcLocator),
-  m_bphysHelperTool("TrigBphysHelperUtilsTool"),
-  m_vertFitter("TrigVertexFitter",this),
-  m_L2vertFitter("TrigL2VertexFitter",this),
-  m_vertexingTool("TrigVertexingTool",this),
-  m_TotTimer(0),
-  m_VtxFitTimer(0)
-/*------------------------------------------------------------------------------------*/
-{
-    
-  // Read properties - boolean switches
-  declareProperty("AcceptAll"     , m_acceptAll      = false);
-  declareProperty("OppositeCharge", m_oppositeCharge = true );
-  declareProperty("doVertexFit"   , m_doVertexFit    = true );
-
-    // Input list of tracks for second leg
-    declareProperty("TrackCollection",m_input_trackCollectionKey="InDetTrigTrackingxAODCnv_Bphysics_FTF");
-    
-  // Read properties - cuts
-  declareProperty("MatchL1"     , m_matchL1    = false );
-  declareProperty("MuonPTthr"   , m_muonPtthr    = 4000 );
-  declareProperty("TrackPTthr"   , m_trackPtthr    = 1400 );
-  declareProperty("dEtaTrackRoI" , m_dEta_cut      = 0.1);
-  declareProperty("dPhiTrackRoI" , m_dPhi_cut      = 0.1);
-  declareProperty("DaughterMass" , m_daughterMass  = 0. );
-  declareProperty("Mass_low_cut" , m_mass_low_cut  = 0. );
-  declareProperty("Mass_high_cut", m_mass_high_cut = 0. );
-
-  // Read properties - vertexing tools
-  declareProperty("TrigVertexFitter"  , m_vertFitter);
-  declareProperty("TrigL2VertexFitter", m_L2vertFitter);
-  declareProperty("TrigVertexingTool" , m_vertexingTool, "TrigVertexingTool");
-
-  // Variables for monitoring histograms
-  declareMonitoredStdContainer("Errors"                     , m_mon_Errors                        , AutoClear);
-  declareMonitoredStdContainer("Acceptance"                 , m_mon_Acceptance                    , AutoClear);
-  declareMonitoredStdContainer("ROIEta"                     , m_mon_ROIEta                        , AutoClear);
-  declareMonitoredStdContainer("ROIPhi"                     , m_mon_ROIPhi                        , AutoClear);
-  declareMonitoredVariable(    "nTracks"                    , m_mon_nTracks );
-  declareMonitoredStdContainer("TrkPt"                      , m_mon_TrkPt                         , AutoClear);
-  declareMonitoredStdContainer("TrkPt_wideRange"            , m_mon_TrkPt_wideRange               , AutoClear);
-  declareMonitoredStdContainer("TrkEta"                     , m_mon_TrkEta                        , AutoClear);
-  declareMonitoredStdContainer("TrkPhi"                     , m_mon_TrkPhi                        , AutoClear);
-  declareMonitoredStdContainer("TrkROIdEta"                 , m_mon_TrkROIdEta                    , AutoClear);
-  declareMonitoredStdContainer("TrkROIdPhi"                 , m_mon_TrkROIdPhi                    , AutoClear);
-  declareMonitoredStdContainer("TrkROIdR"                   , m_mon_TrkROIdR                      , AutoClear);
-  declareMonitoredStdContainer("InvMassNoTrkPtCut"          , m_mon_InvMassNoTrkPtCut             , AutoClear);
-  declareMonitoredStdContainer("InvMassNoTrkPtCut_wideRange", m_mon_InvMassNoTrkPtCut_wideRange   , AutoClear);
-  declareMonitoredStdContainer("InvMass"                    , m_mon_InvMass                       , AutoClear);
-  declareMonitoredStdContainer("InvMass_wideRange"          , m_mon_InvMass_wideRange             , AutoClear);
-  declareMonitoredStdContainer("Trk1Pt"                     , m_mon_Trk1Pt                        , AutoClear);
-  declareMonitoredStdContainer("Trk2Pt"                     , m_mon_Trk2Pt                        , AutoClear);
-  declareMonitoredStdContainer("Trk1Eta"                    , m_mon_Trk1Eta                       , AutoClear);
-  declareMonitoredStdContainer("Trk2Eta"                    , m_mon_Trk2Eta                       , AutoClear);
-  declareMonitoredStdContainer("Trk1Phi"                    , m_mon_Trk1Phi                       , AutoClear);
-  declareMonitoredStdContainer("Trk2Phi"                    , m_mon_Trk2Phi                       , AutoClear);
-  declareMonitoredStdContainer("Trk1Trk2dEta"               , m_mon_Trk1Trk2dEta                  , AutoClear);
-  declareMonitoredStdContainer("Trk1Trk2dPhi"               , m_mon_Trk1Trk2dPhi                  , AutoClear);
-  declareMonitoredStdContainer("Trk1Trk2dR"                 , m_mon_Trk1Trk2dR                    , AutoClear);
-  declareMonitoredStdContainer("SumPtTrk12"                 , m_mon_SumPtTrk12                    , AutoClear);
-  declareMonitoredStdContainer("FitMass"                    , m_mon_FitMass                       , AutoClear);
-  declareMonitoredStdContainer("FitMass_wideRange"          , m_mon_FitMass                       , AutoClear);
-  declareMonitoredStdContainer("InvMass_okFit"              , m_mon_InvMass_okFit                 , AutoClear);
-  declareMonitoredStdContainer("Chi2toNDoF"                 , m_mon_Chi2toNDoF                    , AutoClear);
-  declareMonitoredStdContainer("Chi2toNDoFProb"             , m_mon_Chi2toNDoFProb                , AutoClear);
-  declareMonitoredStdContainer("FitTotalPt"                 , m_mon_FitTotalPt                    , AutoClear);
-  declareMonitoredStdContainer("SumPtTrk12_okFit"           , m_mon_SumPtTrk12_okFit              , AutoClear);
-  declareMonitoredStdContainer("FitVtxR"                    , m_mon_FitVtxR                       , AutoClear);
-  declareMonitoredStdContainer("FitVtxZ"                    , m_mon_FitVtxZ                       , AutoClear);
-  declareMonitoredVariable(    "nBphys"                     , m_mon_nBphys );
-  declareMonitoredVariable(    "TotalRunTime"               , m_mon_TotalRunTime );
-  declareMonitoredVariable(    "VertexingTime"              , m_mon_VertexingTime );
-
-  // Zero the counters
-  m_lastEvent           = 999;
-  m_lastEventPassed     = 999;
-  m_countTotalEvents    = 0;
-  m_countTotalRoI       = 0;
-  m_countPassedEvents   = 0;
-  m_countPassedRoIs     = 0;
-  m_countPassedRoIMatch = 0;
-  m_countPassedMass     = 0;
-
-  // Initialize the collections
-  m_trigBphysColl = NULL;
-  m_VertexColl    = NULL;
-}
-
-/*----------------------------------*/
-TrigL2TrkMassFex::~TrigL2TrkMassFex()
-/*----------------------------------*/
-{
-  // Delete the collections
-  delete m_trigBphysColl;
-  delete m_VertexColl;
-}
-
-/*---------------------------------------------*/
-HLT::ErrorCode TrigL2TrkMassFex::hltInitialize()
-/*---------------------------------------------*/
-{
-
-  // Print out properties, cuts
-  ATH_MSG_INFO("AcceptAll               = " << (m_acceptAll==true ? "True" : "False") );
-  ATH_MSG_INFO("Apply opposite sign cut = " << (m_oppositeCharge==true ? "True" : "False") );
-  ATH_MSG_INFO("Muon pT cut        : " << m_muonPtthr << " GeV" );
-  ATH_MSG_INFO("Track pT cut        : " << m_trackPtthr << " GeV" );
-  ATH_MSG_INFO("Track-RoI match cuts: dEta < " << m_dEta_cut << " dPhi < " << m_dPhi_cut );
-  ATH_MSG_INFO("Mass cuts           : " << m_mass_low_cut << " to " << m_mass_high_cut << " GeV" );
-  ATH_MSG_INFO("Daughter mass       : " << m_daughterMass << " GeV" );
-
-  ATH_MSG_INFO("Initialization completed successfully");
-
-  // Retrieve the vertexing tools
-  StatusCode sc = m_vertFitter.retrieve();
-  if ( sc.isFailure() ) {
-    ATH_MSG_FATAL("Unable to locate TrigVertexFitter tool" );
-    return HLT::BAD_JOB_SETUP;
-  } else {
-    ATH_MSG_INFO("TrigVertexFitter retrieved" );
-  }
-
-  sc = m_L2vertFitter.retrieve();
-  if ( sc.isFailure() ) {
-    ATH_MSG_FATAL("Unable to locate TrigL2VertexFitter tool" );
-    return HLT::BAD_JOB_SETUP;
-  }
-  else {
-    ATH_MSG_INFO("TrigL2VertexFitter retrieved" );
-  }
-
-  sc = m_vertexingTool.retrieve();
-  if ( sc.isFailure() ) {
-    ATH_MSG_FATAL("Unable to locate TrigVertexingTool tool" );
-    return HLT::BAD_JOB_SETUP;
-  } else {
-    ATH_MSG_INFO("TrigVertexingTool retrieved" );
-  }
-    if (m_bphysHelperTool.retrieve().isFailure()) {
-        ATH_MSG_ERROR("Can't find TrigBphysHelperUtilsTool" );
-        return HLT::BAD_JOB_SETUP;
-    } else {
-        ATH_MSG_DEBUG("TrigBphysHelperUtilsTool found" );
-    }
-
-  // Add the timers
-  if ( timerSvc() ) {
-    m_TotTimer    = addTimer("L2TrkMassTot");
-    m_VtxFitTimer = addTimer("L2TrkMassVFit");
-  }
-
-  return HLT::OK;
-}
-
-
-/*-------------------------------------------*/
-HLT::ErrorCode TrigL2TrkMassFex::hltFinalize()
-/*-------------------------------------------*/
-{
-
-  ATH_MSG_INFO("in finalize()" );
-  ATH_MSG_INFO("Run on events/RoIs " << m_countTotalEvents << "/" << m_countTotalRoI );
-  ATH_MSG_INFO("Passed events/RoIs " << m_countPassedEvents << "/" << m_countPassedRoIs );
-  ATH_MSG_INFO("Passed RoI match " << m_countPassedRoIMatch );
-  ATH_MSG_INFO("Passed mass cuts " << m_countPassedMass );
-
-  return HLT::OK;
-}
-
-// Define the bins for error-monitoring histogram  (//#define ERROR_Empty_TrackColl        3)
-#define ERROR_No_EventInfo           0
-#define ERROR_No_RoI                 1
-#define ERROR_No_TrackColl           2
-#define ERROR_No_CombMuon            3
-#define ERROR_More_TrackColl         4
-#define ERROR_AddTrack_Fails         5
-#define ERROR_Unique_AddTrack_Fails  6
-#define ERROR_CalcInvMass_Fails      7
-#define ERROR_CalcMother_Fails       8
-#define ERROR_CalcMassPull_Fails     9
-#define ERROR_BphysColl_Fails        10
-
-// Define the bins for acceptance-monitoring histogram
-#define ACCEPT_Input                 0
-#define ACCEPT_AcceptAll             1
-#define ACCEPT_Got_RoI               2
-#define ACCEPT_Got_TrackColl         3
-#define ACCEPT_Full_TrackColl        4
-#define ACCEPT_Single_TrackColl      5
-#define ACCEPT_Full_IDTracks         6
-#define ACCEPT_Mu1_Chi2_Cut          7
-#define ACCEPT_Mu1_pT_Cut            8
-#define ACCEPT_Mu1_Chi2Pt_Cuts       9
-#define ACCEPT_Mu1_dEta_Cut         10
-#define ACCEPT_Mu1_dPhi_Cut         11
-#define ACCEPT_Mu1_dR_Cut           12
-#define ACCEPT_Mu2_Chi2_Cut         13
-#define ACCEPT_Mu2_pT_Cut           14
-#define ACCEPT_Mu2_Chi2Pt_Cuts      15
-#define ACCEPT_Opp_Charge           16
-#define ACCEPT_InvMass_Cut          17
-#define ACCEPT_AddTrack_Test        18
-#define ACCEPT_Vertexing            19
-#define ACCEPT_CalcInvMass          20
-#define ACCEPT_CalcMother           21
-#define ACCEPT_Vertex_not_NULL      22
-// Separator                        23
-#define ACCEPT_BphysColl_not_Empty  24
-// Separator                        25
-#define ACCEPT_Each_Mu1_Chi2_Cut    26
-#define ACCEPT_Each_Mu1_pT_Cut      27
-#define ACCEPT_Each_Mu1_Chi2Pt_Cuts 28
-#define ACCEPT_Each_Mu1_dEta_Cut    29
-#define ACCEPT_Each_Mu1_dPhi_Cut    30
-#define ACCEPT_Each_Mu1_dR_Cut      31
-// Separator                        32
-#define ACCEPT_Each_Mu2_Chi2_Cut    33
-#define ACCEPT_Each_Mu2_pT_Cut      34
-#define ACCEPT_Each_Mu2_Chi2Pt_Cuts 35
-#define ACCEPT_Each_Opp_Charge      36
-#define ACCEPT_Each_InvMass_Cut     37
-#define ACCEPT_Each_AddTrack_Test   38
-#define ACCEPT_Each_Vertexing       39
-#define ACCEPT_Each_CalcInvMass     40
-#define ACCEPT_Each_CalcMother      41
-#define ACCEPT_Each_Vertex_not_NULL 42
-
-// /*-----------------------------------------------------------------------------------------*/
-// HLT::ErrorCode TrigL2TrkMassFex::acceptInput(const HLT::TriggerElement* inputTE, bool& pass)
-// /*-----------------------------------------------------------------------------------------*/
-// {
-// }
-
-/*---------------------------------------------------------------------------------------------------*/
-HLT::ErrorCode TrigL2TrkMassFex::hltExecute(const HLT::TriggerElement*, HLT::TriggerElement* outputTE)
-/*---------------------------------------------------------------------------------------------------*/
-{
-
-  // Global flags
-  bool result         = false;
-  bool PassedRoIMatch = false;
-  bool PassedMass     = false;
-
-  // Processing timers
-  if ( timerSvc() ) m_TotTimer->start();
-
-  // Initialize the monitoring variables
-  m_mon_nBphys        = 0;
-  m_mon_TotalRunTime  = 0;
-  m_mon_VertexingTime = 0;
-
-  ATH_MSG_DEBUG(" In B tag and probe FEX acceptInput" );
-  m_mon_Acceptance.push_back( ACCEPT_Input );
-
-    // Retrieve event info
-    int IdRun   = 0;
-    int IdEvent = 0;
-    // event info
-    uint32_t runNumber(0), evtNumber(0), lbBlock(0);
-    if (m_bphysHelperTool->getRunEvtLb( runNumber, evtNumber, lbBlock).isFailure()) {
-        ATH_MSG_ERROR("Error retriving EventInfo" );
-    }
-    IdRun = runNumber;
-    IdEvent = evtNumber;
-
-  // Accept-All mode: temporary patch; should be done with force-accept
-  if (m_acceptAll) {
-    ATH_MSG_DEBUG("AcceptAll property is set: taking all events" );
-    // pass = true;
-    m_mon_Acceptance.push_back( ACCEPT_AcceptAll );
-  }
-  else {
-    ATH_MSG_DEBUG("AcceptAll property not set: applying selection" );
-    // pass = false;
-  }
-
-  // Get RoI descriptor
-  const TrigRoiDescriptor* roiDescriptor = 0;
-  if (getFeature(outputTE, roiDescriptor, "initialRoI") != HLT::OK) roiDescriptor = 0;
-
-  if ( !roiDescriptor ) {
-    ATH_MSG_WARNING("No RoI for this Trigger Element! " );
-    if ( timerSvc() ) {
-      m_TotTimer->stop();
-      m_mon_TotalRunTime = m_TotTimer->elapsed();
-    }
-    m_mon_Errors.push_back( ERROR_No_RoI );
-    return HLT::NAV_ERROR;
-  }
-  m_mon_Acceptance.push_back( ACCEPT_Got_RoI );
-
-  // Print RoI debugging information
-    ATH_MSG_DEBUG("Using TE(" << outputTE << ")->getId(): " << outputTE->getId() << "; RoI ID = " << roiDescriptor->roiId()
-          << ": Eta = "    << roiDescriptor->eta() << ", Phi = "    << roiDescriptor->phi() );
-
-  // RoI monitoring
-  m_mon_ROIEta.push_back( roiDescriptor->eta() );
-  m_mon_ROIPhi.push_back( roiDescriptor->phi() );
-
-  // Create vector for TrigL2Bphys particles
-    //  delete m_trigBphysColl;
-    //  delete m_VertexColl;
-    m_trigBphysColl = new xAOD::TrigBphysContainer();
-    xAOD::TrigBphysAuxContainer trigBphysAuxColl;
-    m_trigBphysColl->setStore(&trigBphysAuxColl);
-    m_VertexColl    = new TrigVertexCollection();
-
-
-  ///////////////// Get vector of tracks /////////////////
-
-  std::vector<const xAOD::TrackParticleContainer*> vectorOfTrackCollections;
-
-  HLT::ErrorCode status = getFeatures(outputTE, vectorOfTrackCollections,m_input_trackCollectionKey);
-
-  // Were the track-collections read out ?
-  if ( status != HLT::OK ) {
-    ATH_MSG_DEBUG(" Failed to get InDetTrackCollections, exiting " );
-    if ( timerSvc() ) {
-      m_TotTimer->stop();
-      m_mon_TotalRunTime = m_TotTimer->elapsed();
-    }
-    m_mon_Errors.push_back( ERROR_No_TrackColl );
-    return HLT::OK;
-  }
-  m_mon_Acceptance.push_back( ACCEPT_Got_TrackColl );
-
-  // Is there at least one collection ?
-  if (vectorOfTrackCollections.size() == 0) {
-    if ( timerSvc() ) {
-      m_TotTimer->stop();
-      m_mon_TotalRunTime = m_TotTimer->elapsed();
-    }
-//    m_mon_Errors.push_back( ERROR_Empty_TrackColl );
-    return HLT::OK;
-  }
-  m_mon_Acceptance.push_back( ACCEPT_Full_TrackColl );
-
-  // Is there only one collection ?
-  if (vectorOfTrackCollections.size() != 1) {
-    ATH_MSG_DEBUG(" Got " << vectorOfTrackCollections.size() << " InDetTrackCollections, expected one unless this is FullScan" );
-    if ( timerSvc() ) {
-      m_TotTimer->stop();
-      m_mon_TotalRunTime = m_TotTimer->elapsed();
-    }
-    //    m_mon_Errors.push_back( ERROR_More_TrackColl );
-    //return HLT::OK;
-  }
-
-  m_mon_Acceptance.push_back( ACCEPT_Single_TrackColl );
-
-  std::vector<const xAOD::TrackParticleContainer*>::iterator pTrackColl    = vectorOfTrackCollections.begin();
-  std::vector<const xAOD::TrackParticleContainer*>::iterator lastTrackColl = vectorOfTrackCollections.end();
-
-  // JK If more than 1 track collection then this is FullScan instance. Find collection with most tarcks
-  if (vectorOfTrackCollections.size() > 1) {
-    std::vector<const xAOD::TrackParticleContainer*>::iterator findMaxTrackColl    = vectorOfTrackCollections.begin();
-    unsigned int Ntracks=0;
-    for (;findMaxTrackColl != lastTrackColl; ++ findMaxTrackColl) {
-      ATH_MSG_DEBUG("  InDetTrackCollections size, " << (*findMaxTrackColl)->size() );
-      if ((*findMaxTrackColl)->size() > Ntracks) {
-          ATH_MSG_DEBUG(" Largest collection so far, assume it is FullScan " );
-          Ntracks= (*findMaxTrackColl)->size();
-          pTrackColl= findMaxTrackColl;
-      }
-    }
-  }
-
-  ////////////////////////////////////////////////////////
-
-  // Check if we are still in the same event
-  if ( IdEvent != (int) m_lastEvent ) {
-    m_countTotalEvents++;
-    m_lastEvent = IdEvent;
-  }
-  m_countTotalRoI++;
-
-  // Get the number of tracks
-  ATH_MSG_DEBUG(" Got InDetTrackCollections with " << (*pTrackColl)->size() << " tracks" );
-
-  // Number of tracks monitoring
-  if ( (*pTrackColl)->size() > 0 ) m_mon_Acceptance.push_back( ACCEPT_Full_IDTracks );
-  m_mon_nTracks = (*pTrackColl)->size();
-
-  // Boolean flags indicating what stages were already reached (for monitoring purposes)
-  std::vector<bool> flag_stages( 43, false );
-
-  // Prepare the vertexing timer
-  if ( timerSvc() ) {
-    m_VtxFitTimer->start();
-    m_VtxFitTimer->pause(); // resume it only for the vertexing periods
-  }
-
-
-  ///////////////// Get muons /////////////////
-    //  const CombinedMuonFeature *muon;
-    const xAOD::L2CombinedMuon *muon(nullptr);
-    //ElementLink<xAOD::L2CombinedMuonContainer> muonEL;
-    typedef  ElementLinkVector<xAOD::L2CombinedMuonContainer>  ELVMuons;
-    ELVMuons muonEL;
-
-  if (!m_matchL1) {
-      //HLT::ErrorCode status = getFeature(outputTE, muon);
-      //HLT::ErrorCode status = getFeatureLink<xAOD::L2CombinedMuonContainer,xAOD::L2CombinedMuonContainer>(outputTE,muonEL);
-      HLT::ErrorCode status = getFeaturesLinks<xAOD::L2CombinedMuonContainer,xAOD::L2CombinedMuonContainer>(outputTE,muonEL);
-
-   if ( status != HLT::OK || !muonEL.size()) {
-     ATH_MSG_DEBUG(" Failed to get CombinedMuonFeature, exiting " );
-     m_mon_Errors.push_back( ERROR_No_CombMuon );
-       return HLT::OK;
-   }
-      if (muonEL.size() > 1) {
-          ATH_MSG_WARNING("Unexpected number of containers for comb feature: " );
-      }
-      if (!muonEL[0].isValid()) {
-          ATH_MSG_WARNING("Invalid comb muon: " );
-          m_mon_Errors.push_back( ERROR_No_CombMuon );
-          return HLT::OK;
-      }
-
-      muon = *(muonEL.at(0));
-      
-   ATH_MSG_DEBUG(" Got CombinedMuonFeature addr=" << muon << " pt=" << muon->charge() *muon->charge() 
-           << " trkAddr=" << muon->idTrack() << " trackParamAddr=" << muon->idTrack()->track());
-  }
-
-
-
-  //////////// Loop over track collections ///////////////
-
-  for ( ; pTrackColl != lastTrackColl;  pTrackColl++ ) {
-
-    // Monitor the tracks that failed to be added into the vertexing procedure
-    std::vector<bool> addTrackFails ( (*pTrackColl)->size(), false );
-
-    // loop over tracks and look for match to RoI
-    xAOD::TrackParticleContainer::const_iterator track1     = (*pTrackColl)->begin();
-    xAOD::TrackParticleContainer::const_iterator lastTrack1 = (*pTrackColl)->end();
-
-    ///////////// Find RoI matching track ////////////////
-
-    for (int itrk = 0; track1 != lastTrack1; ++itrk, track1++) {
-        ATH_MSG_DEBUG("track1 : " << itrk << " pT = "   << (*track1)->pt()
-              << " phi = "  << (*track1)->phi() << " eta = "  << (*track1)->eta() << " chi2 = " << (*track1)->chiSquared() );
-
-      // Tracks monitoring
-      m_mon_TrkPt_wideRange.push_back( fabs((*track1)->pt()) / CLHEP::GeV );
-      m_mon_TrkPt .push_back( fabs((*track1)->pt()) / CLHEP::GeV );
-      m_mon_TrkEta.push_back( (*track1)->eta() );
-      m_mon_TrkPhi.push_back( (*track1)->phi() );
-
-      // Get the pT and chi2 of the tracks
-      float trackPt   = fabs( (*track1)->pt() );
-      float trackChi2 = (*track1)->chiSquared();
-
-      // Check pT and chi2 (monitoring only)
-      if ( trackChi2 <= 1e7 ) {
-        if ( !flag_stages[ ACCEPT_Mu1_Chi2_Cut ] ) {
-          m_mon_Acceptance.push_back( ACCEPT_Mu1_Chi2_Cut );
-          flag_stages[ ACCEPT_Mu1_Chi2_Cut ] = true;
-        }
-        m_mon_Acceptance.push_back( ACCEPT_Each_Mu1_Chi2_Cut );
-      }
-
-      //JK 4/5/11 changed this to use muonPtthr i.e. different pT cuts for muon and tarck
-      if ( trackPt >= m_muonPtthr ) {
-        if ( !flag_stages[ ACCEPT_Mu1_pT_Cut ] ){
-          m_mon_Acceptance.push_back( ACCEPT_Mu1_pT_Cut );
-          flag_stages[ ACCEPT_Mu1_pT_Cut ] = true;
-        }
-        m_mon_Acceptance.push_back( ACCEPT_Each_Mu1_pT_Cut );
-      }
-
-      // Check pT and chi2
-      if ( trackPt < m_muonPtthr || trackChi2 > 1e7 ) continue;
-
-      // Check pT+chi2 (monitoring only)
-      if ( !flag_stages[ ACCEPT_Mu1_Chi2Pt_Cuts ] ) {
-        m_mon_Acceptance.push_back( ACCEPT_Mu1_Chi2Pt_Cuts );
-        flag_stages[ ACCEPT_Mu1_Chi2Pt_Cuts ] = true;
-      }
-      m_mon_Acceptance.push_back( ACCEPT_Each_Mu1_Chi2Pt_Cuts );
-
-      // Match to RoI
-      // JK 25/7/11 Add option to match to l2 muon
-      double deta;
-      double dphi;
-      if (m_matchL1) {
-        deta = (*track1)->eta()  - roiDescriptor->eta();
-        dphi = (*track1)->phi() - roiDescriptor->phi();
-      } else {
-        deta = (*track1)->eta()  - muon->idTrack()->eta();
-        dphi = (*track1)->phi() - muon->idTrack()->phi();
-      }
-      double absdphi = fabs(dphi);
-      if ( 2.* M_PI - absdphi < absdphi ) {
-        if ( dphi > 0 ) {
-          dphi = dphi - 2.* M_PI;
-        } else {
-          dphi = 2* M_PI - absdphi;
-        }
-      }
-
-      // Monitoring of the RoI matching
-      m_mon_TrkROIdEta.push_back( fabs(deta) );
-      m_mon_TrkROIdPhi.push_back( fabs(dphi) );
-      m_mon_TrkROIdR  .push_back( sqrt(dphi*dphi+deta*deta) );
-
-      // Check the deta and dphi cuts (monitoring only)
-      if ( fabs(deta) < m_dEta_cut ) {
-        if ( !flag_stages[ ACCEPT_Mu1_dEta_Cut ] ) {
-          m_mon_Acceptance.push_back( ACCEPT_Mu1_dEta_Cut );
-          flag_stages[ ACCEPT_Mu1_dEta_Cut ] = true;
-        }
-        m_mon_Acceptance.push_back( ACCEPT_Each_Mu1_dEta_Cut );
-      }
-      if ( fabs(dphi) < m_dPhi_cut ) {
-        if ( !flag_stages[ ACCEPT_Mu1_dPhi_Cut ] ) {
-          m_mon_Acceptance.push_back( ACCEPT_Mu1_dPhi_Cut );
-          flag_stages[ ACCEPT_Mu1_dPhi_Cut ] = true;
-        }
-        m_mon_Acceptance.push_back( ACCEPT_Each_Mu1_dPhi_Cut );
-      }
-
-      // Check the deta and dphi cuts for RoI matching of the track
-      if ( fabs(deta) < m_dEta_cut && fabs(dphi) < m_dPhi_cut ) {
-
-        // Check deta+dphi cuts (monitoring only)
-        if ( !flag_stages[ ACCEPT_Mu1_dR_Cut ] ) {
-          m_mon_Acceptance.push_back( ACCEPT_Mu1_dR_Cut );
-          flag_stages[ ACCEPT_Mu1_dR_Cut ] = true;
-        }
-        m_mon_Acceptance.push_back( ACCEPT_Each_Mu1_dR_Cut );
-
-        PassedRoIMatch = true;
-
-        // Match to RoI found
-        ATH_MSG_DEBUG("Track matched RoI, now search other tracks for good mass " );
-
-        xAOD::TrackParticleContainer::const_iterator track2     = (*pTrackColl)->begin();
-        xAOD::TrackParticleContainer::const_iterator lastTrack2 = (*pTrackColl)->end();
-
-        ///////////// Find the second muon ///////////////
-
-        for ( int jtrk = 0; track2 != lastTrack2; ++jtrk, track2++ ) {
-
-          // Skip identical track
-          if ( itrk == jtrk ) continue;
-
-          ATH_MSG_DEBUG("track2 : " << jtrk << " pT = "   << (*track2)->pt() << " phi = "  << (*track2)->phi()
-                  << " eta = "  << (*track2)->eta() << " chi2 = " << (*track2)->chiSquared() );
-
-          // Get the pT and chi2 of the tracks
-          float track2Pt   = fabs( (*track2)->pt() );
-          float track2Chi2 = (*track2)->chiSquared();
-
-          // Check pT and chi2 (monitoring only)
-          if ( track2Chi2 <= 1e7 ) {
-            if ( !flag_stages[ ACCEPT_Mu2_Chi2_Cut ] ) {
-              m_mon_Acceptance.push_back( ACCEPT_Mu2_Chi2_Cut );
-              flag_stages[ ACCEPT_Mu2_Chi2_Cut ] = true;
-            }
-            m_mon_Acceptance.push_back( ACCEPT_Each_Mu2_Chi2_Cut );
-          }
-          if ( track2Pt >= m_trackPtthr ) {
-            if ( !flag_stages[ ACCEPT_Mu2_pT_Cut ] ) {
-              m_mon_Acceptance.push_back( ACCEPT_Mu2_pT_Cut );
-              flag_stages[ ACCEPT_Mu2_pT_Cut ] = true;
-            }
-            m_mon_Acceptance.push_back( ACCEPT_Each_Mu2_pT_Cut );
-          }
-
-          // Prepare the di-muon pair
-            //          std::vector<const TrigInDetTrackFitPar*> inputtrks;
-            std::vector<const xAOD::TrackParticle*> inputtrks;
-          std::vector<double> massHypo ;
-          inputtrks.push_back( (*track1) );
-          inputtrks.push_back( (*track2) );
-          massHypo.push_back( m_daughterMass );
-          massHypo.push_back( m_daughterMass );
-
-          // Calculate the invariant mass (hardcoded pT cut 2 GeV for monitoring purposes)
-          double Mass = 0;
-          if ( track2Chi2 <= 1e7 ) {
-            if ( track2Pt > 2000. ) {
-                // Mass = InvMass(inputtrks, massHypo);
-                Mass = m_bphysHelperTool->invariantMass(inputtrks,massHypo);
-              m_mon_InvMassNoTrkPtCut.push_back( Mass / CLHEP::GeV );
-              m_mon_InvMassNoTrkPtCut_wideRange.push_back( Mass / CLHEP::GeV );
-            } else if ( track2Pt >= m_trackPtthr ) {
-                //Mass = InvMass(inputtrks, massHypo);
-                Mass = m_bphysHelperTool->invariantMass(inputtrks,massHypo);
-            }
-          }
-
-          // Check pT and chi2
-          if ( track2Pt < m_trackPtthr || track2Chi2 > 1e7 ) continue;
-
-          // Check pT+chi2 (monitoring only)
-          if ( !flag_stages[ ACCEPT_Mu2_Chi2Pt_Cuts ] ) {
-            m_mon_Acceptance.push_back( ACCEPT_Mu2_Chi2Pt_Cuts );
-            flag_stages[ ACCEPT_Mu2_Chi2Pt_Cuts ] = true;
-          }
-          m_mon_Acceptance.push_back( ACCEPT_Each_Mu2_Chi2Pt_Cuts );
-
-          ///////// Check the di-muon properties /////////
-
-          // Check opposite charge
-          if ( m_oppositeCharge ) {
-            if (( (*track1)->charge() > 0. && (*track2)->charge() > 0. ) ||
-                ( (*track1)->charge() < 0. && (*track2)->charge() < 0. )) continue;
-            ATH_MSG_VERBOSE("Tracks " << itrk << " and " << jtrk << " are opposite sign, make mass cuts " );
-          } else {
-            ATH_MSG_VERBOSE("opposite sign cuts not applied, make mass cuts " );
-          }
-
-          // Check opposite charge (monitoring only)
-          if ( !flag_stages[ ACCEPT_Opp_Charge ] ) {
-            m_mon_Acceptance.push_back( ACCEPT_Opp_Charge );
-            flag_stages[ ACCEPT_Opp_Charge ] = true;
-          }
-          m_mon_Acceptance.push_back( ACCEPT_Each_Opp_Charge );
-
-          // Check the invariant mass cut
-          ATH_MSG_DEBUG(" mass =  " << Mass );
-          m_mon_InvMass.push_back( Mass / CLHEP::GeV );
-          m_mon_InvMass_wideRange.push_back( Mass / CLHEP::GeV );
-          if (Mass < m_mass_low_cut || Mass > m_mass_high_cut) continue;
-
-          // Check the invariant mass cut (monitoring only)
-          if ( !flag_stages[ ACCEPT_InvMass_Cut ] ) {
-            m_mon_Acceptance.push_back( ACCEPT_InvMass_Cut );
-            flag_stages[ ACCEPT_InvMass_Cut ] = true;
-          }
-          m_mon_Acceptance.push_back( ACCEPT_Each_InvMass_Cut );
-
-          PassedMass = true;
-
-          // Monitoring of the di-muon track pairs
-          m_mon_Trk1Pt .push_back( fabs((*track1)->pt()) / CLHEP::GeV );
-          m_mon_Trk2Pt .push_back( fabs((*track2)->pt()) / CLHEP::GeV );
-          m_mon_Trk1Eta.push_back( (*track1)->eta() );
-          m_mon_Trk2Eta.push_back( (*track2)->eta() );
-          m_mon_Trk1Phi.push_back( (*track1)->phi() );
-          m_mon_Trk2Phi.push_back( (*track2)->phi() );
-          m_mon_SumPtTrk12.push_back ( (fabs((*track1)->pt()) + fabs((*track2)->pt())) / CLHEP::GeV );
-
-          // Monitoring of the opening between the two tracks
-          double dTrkEta = (*track1)->eta()  - (*track2)->eta();
-          double dTrkPhi = (*track1)->phi() - (*track2)->phi();
-          double absdTrkPhi = fabs( dTrkPhi );
-          if ( 2.* M_PI - absdTrkPhi < absdTrkPhi ) {
-            if ( dTrkPhi > 0 ) {
-              dTrkPhi = dTrkPhi - 2.* M_PI;
-            } else {
-              dTrkPhi = 2* M_PI - absdTrkPhi;
-            }
-          }
-          m_mon_Trk1Trk2dEta.push_back( fabs(dTrkEta) );
-          m_mon_Trk1Trk2dPhi.push_back( fabs(dTrkPhi) );
-          m_mon_Trk1Trk2dR  .push_back( sqrt(dTrkPhi*dTrkPhi+dTrkEta*dTrkEta) );
-
-          // Found pair with good mass , now make L2Bphys object
-            //          TrigL2Bphys* trigL2Bphys = new TrigL2Bphys((*pTrackColl)->RoI_ID(),
-            //                                                     roiDescriptor->eta(),
-            //                                                     roiDescriptor->phi(),
-            //                                                     TrigL2Bphys::JPSIMUMU,
-            //                                                     Mass);
-            xAOD::TrigBphys* trigL2Bphys = new xAOD::TrigBphys();
-            m_trigBphysColl->push_back(trigL2Bphys);
-            trigL2Bphys->initialise(0,//(*pTrackColl)->RoI_ID(), #FIXME JW
-                                    roiDescriptor->eta(),
-                                    roiDescriptor->phi(),
-                                    xAOD::TrigBphys::JPSIMUMU,
-                                    Mass,
-                                    xAOD::TrigBphys::L2);
-
-            ATH_MSG_DEBUG("Create Bphys particle with roIId " << trigL2Bphys->roiId() << " mass " << Mass
-                  << " phi, eta " << trigL2Bphys->phi() << " " << trigL2Bphys->eta() << " vertex type " << trigL2Bphys->particleType() );
-
-          // Store links to the two tracks forming the di-muon
-            ElementLink<xAOD::TrackParticleContainer> track1EL(*(*pTrackColl),itrk);
-          ElementLink<xAOD::TrackParticleContainer> track2EL(*(*pTrackColl),jtrk);
-          trigL2Bphys->addTrackParticleLink(track1EL);
-          trigL2Bphys->addTrackParticleLink(track2EL);
-
-          // Set result here if mass cut is passed. Currently no vertex requirement. Need to determine what is needed.
-          result = true;
-
-          ///////////// Now do vertexing /////////////////
-
-          if ( m_doVertexFit ) {
-
-            // Vertexing time processing
-            if ( timerSvc() ) m_VtxFitTimer->resume();
-
-            // Create the vertexer
-            TrigL2Vertex* pL2V     = new TrigL2Vertex();
-            TrigVertex*   p_vertex = NULL;
-
-            // Add tracks to the vertexer
-            bool addTracks = true;
-            StatusCode sc = m_vertexingTool->addTrack( (*track1)->track(), pL2V, Trk::muon );
-            if ( sc.isFailure() ) {
-              ATH_MSG_DEBUG("Failed to add track 1 to vertexingTool pT, chi2 " << (*track1)->pt() << " " << (*track1)->chiSquared() );
-              addTracks = false;
-              // Monitoring only
-              m_mon_Errors.push_back( ERROR_AddTrack_Fails );
-              if ( !addTrackFails[itrk] ) {
-                addTrackFails[itrk] = true;
-                m_mon_Errors.push_back( ERROR_Unique_AddTrack_Fails );
-              }
-            }
-            sc = m_vertexingTool->addTrack( (*track2)->track(), pL2V, Trk::muon );
-            if ( sc.isFailure() ) {
-              ATH_MSG_DEBUG("Failed to add track 2 to vertexingTool pT, chi2 " << (*track2)->pt() << " " << (*track2)->chiSquared() );
-              addTracks = false;
-              // Monitoring only
-              m_mon_Errors.push_back( ERROR_AddTrack_Fails );
-              if ( !addTrackFails[jtrk] ) {
-                addTrackFails[jtrk] = true;
-                m_mon_Errors.push_back( ERROR_Unique_AddTrack_Fails );
-              }
-            }
-
-            //bool vtx_created = false;
-
-            if ( addTracks ) {
-
-              // Passed Add-tracks test (monitoring only)
-              if ( !flag_stages[ ACCEPT_AddTrack_Test ] ) {
-                m_mon_Acceptance.push_back( ACCEPT_AddTrack_Test );
-                flag_stages[ ACCEPT_AddTrack_Test ] = true;
-              }
-              m_mon_Acceptance.push_back( ACCEPT_Each_AddTrack_Test );
-
-              // DO THE VERTEX-FIT
-              sc = m_L2vertFitter->fit(pL2V);
-
-              // Check the result
-              if ( sc.isFailure() ) {
-                ATH_MSG_DEBUG("TrigL2VertexFitter failed" );
-              } else {
-                // Passed vertexing (monitoring only)
-                if ( !flag_stages[ ACCEPT_Vertexing ] ) {
-                  m_mon_Acceptance.push_back( ACCEPT_Vertexing );
-                  flag_stages[ ACCEPT_Vertexing ] = true;
-                }
-                m_mon_Acceptance.push_back( ACCEPT_Each_Vertexing );
-                // Calculate invariant mass
-                sc = m_vertexingTool->calculateInvariantMass(pL2V);
-                if ( sc.isSuccess() ) {
-                  // Calc. Inv. Mass succeeded (monitoring only)
-                  if ( !flag_stages[ ACCEPT_CalcInvMass ] ) {
-                    m_mon_Acceptance.push_back( ACCEPT_CalcInvMass );
-                    flag_stages[ ACCEPT_CalcInvMass ] = true;
-                  }
-                  m_mon_Acceptance.push_back( ACCEPT_Each_CalcInvMass );
-                  // Create mother particle
-                  sc = m_vertexingTool->createMotherParticle(pL2V);
-                  if ( sc.isSuccess() ) {
-                    // Creating mother particle succeeded (monitoring only)
-                    if ( !flag_stages[ ACCEPT_CalcMother ] ) {
-                      m_mon_Acceptance.push_back( ACCEPT_CalcMother );
-                      flag_stages[ ACCEPT_CalcMother ] = true;
-                    }
-                    m_mon_Acceptance.push_back( ACCEPT_Each_CalcMother );
-                    //vtx_created = true;
-                    ATH_MSG_VERBOSE("Mother particle created: pT " << pL2V->getMotherTrack()->pT() );
-                  } else {
-                    m_mon_Errors.push_back( ERROR_CalcMother_Fails );
-                  }
-                  p_vertex = m_vertexingTool->createTrigVertex(pL2V);
-                } else {
-                  m_mon_Errors.push_back( ERROR_CalcInvMass_Fails );
-                }
-              }
-            } // end of if (addTracks)
-            delete pL2V;
-
-            // Test whether the vertex-fit was successful
-            if ( p_vertex == NULL ) {
-                ATH_MSG_DEBUG(" vertex fit failed for tracks  " << itrk << " and " << jtrk );
-            } else {
-
-              // Monitoring of p_vertex != NULL
-              if ( !flag_stages[ ACCEPT_Vertex_not_NULL ] ) {
-                m_mon_Acceptance.push_back( ACCEPT_Vertex_not_NULL );
-                flag_stages[ ACCEPT_Vertex_not_NULL ] = true;
-              }
-              m_mon_Acceptance.push_back( ACCEPT_Each_Vertex_not_NULL );
-
-              // Some debugging information
-              ATH_MSG_VERBOSE( "vertex fit successful: x= y= z=" << p_vertex->x() << " " << p_vertex->y() << " " << p_vertex->z() );
-              ATH_MSG_DEBUG("vertex fit mass = " << p_vertex->mass() << " chi2 " << p_vertex->chi2() << " ndof " << p_vertex->ndof() );
-              if (p_vertex->massVariance() != 0) {
-                ATH_MSG_VERBOSE("Mass pull = " << (p_vertex->mass()-JPSIMASS)/p_vertex->massVariance() );
-              } else {
-                ATH_MSG_VERBOSE("Phi mass variance is zero, can't calculate the pull" );
-                m_mon_Errors.push_back( ERROR_CalcMassPull_Fails );
-              }
-
-              double chi2prob = 1.0 - Genfun::CumulativeChiSquare(p_vertex->ndof())(p_vertex->chi2());
-
-              ATH_MSG_VERBOSE( "Chi2 probability of the fit = " << chi2prob );
-              ATH_MSG_VERBOSE("SigmaX =  SigmaY =  SigmaZ = " << sqrt(p_vertex->cov()[0]) << " " << sqrt(p_vertex->cov()[2]) << " " << sqrt(p_vertex->cov()[5]) );
-
-              // Add vertex results to L2Bphys
-              trigL2Bphys->setFitmass( p_vertex->mass() );
-              trigL2Bphys->setFitchi2( p_vertex->chi2() );
-              trigL2Bphys->setFitndof( p_vertex->ndof() );
-              trigL2Bphys->setFitx( p_vertex->x() );
-              trigL2Bphys->setFity( p_vertex->y() );
-              trigL2Bphys->setFitz( p_vertex->z() );
-
-              m_VertexColl->push_back(p_vertex);
-              ATH_MSG_VERBOSE("added vertex to vertex collection" );
-
-              // Monitoring of the fit results
-              m_mon_FitMass_wideRange.push_back( p_vertex->mass() / CLHEP::GeV );
-              m_mon_FitMass          .push_back( p_vertex->mass() / CLHEP::GeV );
-              m_mon_InvMass_okFit    .push_back( Mass / CLHEP::GeV );
-              m_mon_Chi2toNDoF       .push_back( p_vertex->chi2() / p_vertex->ndof() );
-              m_mon_Chi2toNDoFProb   .push_back( chi2prob );
-              if ( p_vertex->getMotherTrack() != NULL ) {
-                m_mon_FitTotalPt.push_back( p_vertex->getMotherTrack()->pT() / CLHEP::GeV );
-                m_mon_SumPtTrk12_okFit.push_back( (fabs((*track1)->pt()) + fabs((*track2)->pt())) / CLHEP::GeV );
-              }
-              m_mon_FitVtxR.push_back( sqrt(p_vertex->x()*p_vertex->x() + p_vertex->y()*p_vertex->y()) / CLHEP::mm );
-              m_mon_FitVtxZ.push_back( p_vertex->z() / CLHEP::mm );
-
-            } // end if vertex fit successful
-
-            // Pause the vertexing time monitoring
-            if ( timerSvc() ) m_VtxFitTimer->pause();
-
-          } // end if do vertex fit
-
-          // Store L2Bphys to the output collection
-          ATH_MSG_DEBUG("Store L2Bphys and move onto next track" );
-          // moved to next to creation point m_trigBphysColl->push_back(trigL2Bphys);
-
-        } // end loop over track 2, looking for track pair with good mass
-      } // if pass cut on deta, dphi match to RoI
-    } // end loop over track1 looking for RoI match
-  } // end loop over track collections
-
-  // Check the size of the bphys-objects collection
-  if ( m_trigBphysColl->size() > 0 ) m_mon_Acceptance.push_back( ACCEPT_BphysColl_not_Empty );
-  m_mon_nBphys = m_trigBphysColl->size();
-
-  // Update various counters
-  if ( PassedRoIMatch ) m_countPassedRoIMatch++;
-  if ( PassedMass     ) m_countPassedMass++;
-  if ( result ) {
-    m_countPassedRoIs++;
-    if (IdEvent!= (int) m_lastEventPassed) {
-      m_countPassedEvents++;
-      m_lastEventPassed=IdEvent;
-    }
-  }
-
-  // Some debugging information
-  ATH_MSG_DEBUG(" vertex collection size : " << m_VertexColl->size() << " m_VertexColl " << m_VertexColl );
-  ATH_MSG_DEBUG("Bphys collection size : " << m_trigBphysColl->size() << " m_trigBphysColl " << m_trigBphysColl );
-
-  // Reach this point successfully
-  ATH_MSG_DEBUG("Run: " << IdRun << " Event: " << IdEvent << "  result is " << result );
-
-  // if (!m_acceptAll) pass = result;
-
-  // Stop the processing timers
-  if ( timerSvc() ) {
-    m_TotTimer   ->stop();
-    m_VtxFitTimer->resume();
-    m_VtxFitTimer->stop();
-    // Fill the monitoring variables
-    m_mon_TotalRunTime  = m_TotTimer   ->elapsed();
-    m_mon_VertexingTime = m_VtxFitTimer->elapsed();
-  }
-
-  ATH_MSG_DEBUG("m_VertexColl " << m_VertexColl << "    m_trigBphysColl " << m_trigBphysColl );
-
-  delete m_VertexColl;
-  m_VertexColl = 0;
-
-  // Attach the resulting bphys-objects to the output trigger element
-  if ( /*( m_trigBphysColl != 0 ) &&*/ ( m_trigBphysColl->size() > 0 ) ) {
-    ATH_MSG_DEBUG("REGTEST: Store Bphys Collection size: " << m_trigBphysColl->size() );
-    HLT::ErrorCode sc = attachFeature(outputTE, m_trigBphysColl, "L2TrackMass" );
-    if ( sc != HLT::OK ) {
-      ATH_MSG_WARNING("Failed to store trigBphys Collection" );
-      m_mon_Errors.push_back( ERROR_BphysColl_Fails );
-      return sc;
-    }
-  } else {
-    ATH_MSG_DEBUG("REGTEST: no bphys collection to store " );
-    delete m_trigBphysColl;
-  }
-  m_trigBphysColl = nullptr;
-
-  return HLT::OK;
-}
-
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassFex.h
deleted file mode 100644
index 5af2c10de9660865c5c9746fd3a00a976a5c1ef3..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassFex.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// *******************************************************************
-//
-// NAME:     TrigL2TrkMassFex.h
-// PACKAGE:  Trigger/TrigHypothesis/TrigBphysHypo
-// AUTHOR:   Julie Kirk
-//
-// *******************************************************************
-
-#ifndef TRIG_TrigL2TrkMassFex_H
-#define TRIG_TrigL2TrkMassFex_H
-
-#include <string>
-
-#include "TrigInterfaces/FexAlgo.h"
-
-#include "TrigInDetEvent/TrigVertexCollection.h"
-#include "TrigInDetToolInterfaces/ITrigVertexFitter.h"
-#include "TrigInDetToolInterfaces/ITrigL2VertexFitter.h"
-
-#include "xAODTrigBphys/TrigBphysContainer.h"
-#include "xAODTrigBphys/TrigBphysAuxContainer.h"
-#include "xAODTrigBphys/TrigBphys.h"
-
-#include "TrigTimeAlgs/TrigTimerSvc.h"
-
-class TriggerElement;
-
-class ITrigVertexFitter;
-class ITrigL2VertexFitter;
-class ITrigVertexingTool;
-
-class TrigBphysHelperUtilsTool;
-
-
-class TrigL2TrkMassFex: public HLT::FexAlgo {
-
-  public:
-
-    TrigL2TrkMassFex(const std::string & name, ISvcLocator* pSvcLocator);
-    ~TrigL2TrkMassFex();
-
-    HLT::ErrorCode hltInitialize();
-    HLT::ErrorCode hltFinalize();
-    HLT::ErrorCode hltExecute(const HLT::TriggerElement* inputTE, HLT::TriggerElement* outputTE);
-    // HLT::ErrorCode acceptInput(const HLT::TriggerElement* inputTE, bool& pass );
-
-  private:
-    ToolHandle <TrigBphysHelperUtilsTool> m_bphysHelperTool;
-
-    // container inputs names
-    std::string m_input_trackCollectionKey; //! list of tracks to search for second leg
-    
-    // Configurable properties - cuts
-    float m_matchL1;
-    float m_trackPtthr;
-    float m_muonPtthr;
-    float m_dEta_cut;
-    float m_dPhi_cut;
-    float m_daughterMass;
-    float m_mass_low_cut;
-    float m_mass_high_cut;
-
-    // Configurable properties - boolean switches
-    bool  m_doVertexFit;
-    bool  m_acceptAll;
-    bool  m_oppositeCharge;
-
-    // Configurable properties - vertexing tools
-    ToolHandle<ITrigVertexFitter>   m_vertFitter;
-    ToolHandle<ITrigL2VertexFitter> m_L2vertFitter;
-    ToolHandle<ITrigVertexingTool>  m_vertexingTool;
-
-    // Timers
-    TrigTimer* m_TotTimer;
-    TrigTimer* m_VtxFitTimer;
-
-    // Counters
-    unsigned int m_lastEvent;
-    unsigned int m_lastEventPassed;
-    unsigned int m_countTotalEvents;
-    unsigned int m_countTotalRoI;
-    unsigned int m_countPassedEvents;
-    unsigned int m_countPassedRoIs;
-    unsigned int m_countPassedRoIMatch;
-    unsigned int m_countPassedMass;
-
-    // Output collections
-    xAOD::TrigBphysContainer* m_trigBphysColl;
-    TrigVertexCollection* m_VertexColl;
-
-    // Monitored variables
-    std::vector<int>   m_mon_Errors;
-    std::vector<int>   m_mon_Acceptance;
-    std::vector<float> m_mon_ROIEta;
-    std::vector<float> m_mon_ROIPhi;
-    int                m_mon_nTracks;
-    std::vector<float> m_mon_TrkPt;
-    std::vector<float> m_mon_TrkPt_wideRange;
-    std::vector<float> m_mon_TrkEta;
-    std::vector<float> m_mon_TrkPhi;
-    std::vector<float> m_mon_TrkROIdEta;
-    std::vector<float> m_mon_TrkROIdPhi;
-    std::vector<float> m_mon_TrkROIdR;
-    std::vector<float> m_mon_InvMassNoTrkPtCut;
-    std::vector<float> m_mon_InvMassNoTrkPtCut_wideRange;
-    std::vector<float> m_mon_InvMass;
-    std::vector<float> m_mon_InvMass_wideRange;
-    std::vector<float> m_mon_Trk1Pt;
-    std::vector<float> m_mon_Trk2Pt;
-    std::vector<float> m_mon_Trk1Eta;
-    std::vector<float> m_mon_Trk2Eta;
-    std::vector<float> m_mon_Trk1Phi;
-    std::vector<float> m_mon_Trk2Phi;
-    std::vector<float> m_mon_Trk1Trk2dEta;
-    std::vector<float> m_mon_Trk1Trk2dPhi;
-    std::vector<float> m_mon_Trk1Trk2dR;
-    std::vector<float> m_mon_SumPtTrk12;
-    std::vector<float> m_mon_FitMass;
-    std::vector<float> m_mon_FitMass_wideRange;
-    std::vector<float> m_mon_InvMass_okFit;
-    std::vector<float> m_mon_Chi2toNDoF;
-    std::vector<float> m_mon_Chi2toNDoFProb;
-    std::vector<float> m_mon_FitTotalPt;
-    std::vector<float> m_mon_SumPtTrk12_okFit;
-    std::vector<float> m_mon_FitVtxR;
-    std::vector<float> m_mon_FitVtxZ;
-    int                m_mon_nBphys;
-    float              m_mon_TotalRunTime;
-    float              m_mon_VertexingTime;
-
-};
-
-#endif
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassHypo.cxx
deleted file mode 100644
index 36bf04da1f22e3e978503898b7933474af031d4e..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassHypo.cxx
+++ /dev/null
@@ -1,176 +0,0 @@
-// -*- C++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**************************************************************************
- **
- **   File: Trigger/TrigHypothesis/TrigBPhysHypo/TrigL2TrkMassHypo.cxx
- **
- **   Description: L2 hypothesis algorithms for tag and probe (tracks with mass cut)
- **                Create TrigL2Bphys
- **
- **   Author: J.Kirk
- **
- **   Created:   14.10.2007
- **   Modified:
- **
- **************************************************************************/
-
-#include "TrigL2TrkMassHypo.h"
-#include <math.h>
-#include "xAODTrigger/TrigPassBits.h"
-#include "TrigNavigation/Navigation.h"
-
-// additions of xAOD objects
-#include "TrigBphysHelperUtilsTool.h"
-#include "xAODTrigBphys/TrigBphysContainer.h"
-#include "CLHEP/Units/SystemOfUnits.h"
-
-class ISvcLocator;
-
-TrigL2TrkMassHypo::TrigL2TrkMassHypo(const std::string & name, ISvcLocator* pSvcLocator):
-  HLT::HypoAlgo(name, pSvcLocator)
-,m_bphysHelperTool("TrigBphysHelperUtilsTool")
-,m_lastEvent(-1)
-,m_lastEventPassed(-1)
-,m_countTotalEvents(0)
-,m_countTotalRoI(0)
-,m_countPassedEvents(0)
-,m_countPassedRoIs(0)
-{
-
-  // Read cuts
-  declareProperty("AcceptAll",    m_acceptAll=true);
-
-  declareMonitoredVariable(    "CutCounter",  m_mon_cutCounter);
-  declareMonitoredVariable(    "NBphys",      m_mon_NBphys);
-  declareMonitoredStdContainer("Mass",        m_mon_Mass,        AutoClear);
-  //declareMonitoredStdContainer("FitMass",     m_mon_FitMass,     AutoClear);
-  //declareMonitoredStdContainer("Chi2",        m_mon_Chi2,        AutoClear);
-  //declareMonitoredStdContainer("Chi2Prob",    m_mon_Chi2Prob,    AutoClear);
-
-}
-
-TrigL2TrkMassHypo::~TrigL2TrkMassHypo()
-{ }
-
-HLT::ErrorCode TrigL2TrkMassHypo::hltInitialize()
-{
-  ATH_MSG_DEBUG("AcceptAll            = " << (m_acceptAll==true ? "True" : "False") );
-
-  m_lastEvent = -1;
-  m_lastEventPassed = -1;
-  m_countTotalEvents =0;
-  m_countTotalRoI =0;
-  m_countPassedEvents =0;
-  m_countPassedRoIs =0;
-    
-    if (m_bphysHelperTool.retrieve().isFailure()) {
-        ATH_MSG_ERROR("Can't find TrigBphysHelperUtilsTool" );
-        return HLT::BAD_JOB_SETUP;
-    } else {
-        if (msgLvl() <= MSG::DEBUG) ATH_MSG_DEBUG("TrigBphysHelperUtilsTool found" );
-    }
-
-  return HLT::OK;
-}
-
-HLT::ErrorCode TrigL2TrkMassHypo::hltFinalize()
-{
-  ATH_MSG_INFO("in finalize()" );
-  ATH_MSG_INFO("|----------------------- SUMMARY FROM TrigL2TrkMassHypo -------------|" );
-  ATH_MSG_INFO("Run on events/2xRoIs " << m_countTotalEvents << "/" << m_countTotalRoI );
-  ATH_MSG_INFO("Passed events/2xRoIs " << m_countPassedEvents << "/" << m_countPassedRoIs );
-
-  return HLT::OK;
-}
-
-//-------------------------------------------------------------------------------------
-HLT::ErrorCode TrigL2TrkMassHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass)
-{
-
-  bool result = false;
-  m_mon_cutCounter = -1;
-
-    // Retrieve event info
-    //    int IdRun   = 0;
-    int IdEvent = 0;
-    // event info
-    uint32_t runNumber(0), evtNumber(0), lbBlock(0);
-    if (m_bphysHelperTool->getRunEvtLb( runNumber, evtNumber, lbBlock).isFailure()) {
-        ATH_MSG_ERROR("Error retriving EventInfo" );
-    }
-    //    IdRun = runNumber;
-    IdEvent = evtNumber;
-
-    if (IdEvent != m_lastEvent) {
-    m_countTotalEvents++;
-    m_lastEvent=IdEvent;
-  }
-  m_countTotalRoI++;
-
-
-  // Accept-All mode: temporary patch; should be done with force-accept
-  if (m_acceptAll) {
-    pass = true;
-    //return HLT::OK;
-  }
-  ATH_MSG_DEBUG("AcceptAll is set to : " << (m_acceptAll ? "True, taking all events " : "False, applying selection" ));
-
-//  create vector for TrigL2Bphys particles
-    const xAOD::TrigBphysContainer* trigBphysColl = 0;
-
-  HLT::ErrorCode status = getFeature(outputTE, trigBphysColl, "L2TrackMass");
-
-  if ( status != HLT::OK ) {
-    ATH_MSG_WARNING("Failed to get TrigBphysics collection" );
-    return HLT::OK;
-  }
-
-  ATH_MSG_DEBUG(" Retrieved Bphys collection  trigBphysColl = " << trigBphysColl );
-  // if no Bphys particles were found, just leave TrigBphysColl and leave
-  if ( trigBphysColl == 0 ) {
-    ATH_MSG_DEBUG("No Bphys particles to analyse, leaving!" );
-
-    m_mon_NBphys=0;
-    return HLT::OK;
-  }
-  m_mon_cutCounter = 0;  // this is to separate bad input TE and true behaviour of the first cut
-
-  m_mon_NBphys=trigBphysColl->size();
-
-  ATH_MSG_DEBUG("Got TrigBphys collection with " << trigBphysColl->size() << " TrigBphys particles " );
-
-  //TrigPassBits *bits = HLT::makeTrigPassBits(trigBphysColl);
-  std::unique_ptr<xAOD::TrigPassBits> xBits = xAOD::makeTrigPassBits<xAOD::TrigBphysContainer>(trigBphysColl);
-
-  // now loop over Bphys particles to see if one passes hypo cuts- not ready, just monitoring
-  xAOD::TrigBphysContainer::const_iterator bphysIter = trigBphysColl->begin();
-  for ( ; bphysIter != trigBphysColl->end(); ++bphysIter) {
-    m_mon_Mass.push_back(((*bphysIter)->mass()) / CLHEP::GeV);   // conversion to GeV
-    //HLT::markPassing(bits, *bphysIter, trigBphysColl);
-    xBits->markPassing((*bphysIter),trigBphysColl,true);
-  }
-
-  result=true;
-
-  if (result) {
-    m_countPassedRoIs++;
-    if (IdEvent!= m_lastEventPassed) {
-      m_countPassedEvents++;
-      m_lastEventPassed=IdEvent;
-    }
-    pass=true;
-  }
-
-  // store result
-  //if ( attachBits(outputTE, bits) != HLT::OK ) {
-  //  ATH_MSG_ERROR("Problem attaching TrigPassBits! " );
-  //}
-  if(attachFeature(outputTE, xBits.release(),"passbits") != HLT::OK)
-      ATH_MSG_ERROR("Could not store TrigPassBits! ");
-
-  return HLT::OK;
-}
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassHypo.h
deleted file mode 100644
index bde77bb7ed012cdb836830fd4a3e04450e6e8fbc..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigL2TrkMassHypo.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-#ifndef TRIGL2TRKMASSHYPO_H
-#define TRIGL2TRKMASSHYPO_H
-
-#include "TrigInterfaces/HypoAlgo.h"
-#include "Constants.h"
-
-class TriggerElement;
-class TrigBphysHelperUtilsTool;
-
-class TrigL2TrkMassHypo: public HLT::HypoAlgo
-{
-
-public:
-    TrigL2TrkMassHypo(const std::string& name, ISvcLocator* pSvcLocator);
-    ~TrigL2TrkMassHypo();
-
-    HLT::ErrorCode hltInitialize();
-    HLT::ErrorCode hltFinalize();
-    HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass);
-	
-    bool execHLTAlgorithm(TriggerElement* );
-
-private:
-    ToolHandle <TrigBphysHelperUtilsTool> m_bphysHelperTool;
-
-    BooleanProperty m_acceptAll;
-    int m_lastEvent;
-    int m_lastEventPassed;
-    unsigned int m_countTotalEvents;
-    unsigned int m_countTotalRoI;
-    unsigned int m_countPassedEvents;
-    unsigned int m_countPassedRoIs;
-    void handle(const Incident &); 
-
-    /* monitored variables */
-    int m_mon_cutCounter;
-    int m_mon_NBphys;
-    std::vector<float> m_mon_Mass;
-    //std::vector<float> m_mon_FitMass;
-    //std::vector<float> m_mon_Chi2;
-    //std::vector<float> m_mon_Chi2Prob;
-
-};
-
-#endif 
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
index 271aedb7a98cc0838fd4793631f4a3d229ef9547..87237ada82ea6805d35f63e241cca1a3d6ece6d1 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
@@ -352,7 +352,7 @@ StatusCode TrigMultiTrkComboHypo::executeEF(const EventContext& context) const {
 
     for (const xAOD::Muon* muon : *muonsHandle) {
       if (!muon->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) continue;
-      const ElementLink<xAOD::TrackParticleContainer> trackEL = muon->inDetTrackParticleLink();
+      const ElementLink<xAOD::TrackParticleContainer>& trackEL = muon->inDetTrackParticleLink();
       CHECK( trackEL.isValid() );
       tracksFromView.emplace_back(trackEL);
     }
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.cxx
index 9c58b38e8c85897dbba635a7825a3f6ae9ff3f70..8e62f011bfa067ff1e89c62c4f144f743b172ea1 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.cxx
@@ -489,7 +489,7 @@ HLT::ErrorCode TrigMultiTrkFex::hltExecute(std::vector<std::vector<HLT::TriggerE
       if( m_nTrkQ >= 0 ){
 	int charge = 0;
 	//for(const auto& trk : thisIterationTracks)
- 	for(ElementLink<xAOD::TrackParticleContainer> trk : thisIterationTracks) 
+ 	for(const ElementLink<xAOD::TrackParticleContainer>& trk : thisIterationTracks) 
 	  charge += ( (*trk)->charge() > 0 ) ? 1 : -1 ;
 	if( abs(charge) != m_nTrkQ ){
 	  ATH_MSG_DEBUG(" |Charge| = "<< abs(charge) << " required "<<m_nTrkQ << " thus fail" );
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.h
index 41aa829e87e425a08c55fa1d49c0c270c37c7199..c8ab104cdc03db073ee327ff347aea4135071a41 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkFex.h
@@ -19,12 +19,9 @@
 
 // standard stuff
 #include <string>
-#include <map>
-#include <cmath> 
 #include <algorithm>
 
 #include "TrigInterfaces/AllTEAlgo.h"
-#include "xAODTrigBphys/TrigBphysContainer.h"
 
 class TrigBphysHelperUtilsTool;
 class TrigTimer;
@@ -67,9 +64,6 @@ class TrigMultiTrkFex: public HLT::AllTEAlgo  {
 		   float mindR) ;
 
 
-  //void processTriMuon(HLT::TEConstVec& inputTE, xAOD::TrigBphysContainer & outputContainer);
-  // void buildDiMu (const std::vector<const xAOD::Muon*> &muons, xAOD::TrigBphysContainer & outputContainer);
-  //void buildTriMu(const std::vector<const xAOD::Muon*> &muons, xAOD::TrigBphysContainer & outputContainer);
     
     ToolHandle <TrigBphysHelperUtilsTool> m_bphysHelperTool;
     
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/components/TrigBphysHypo_entries.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/components/TrigBphysHypo_entries.cxx
index 7f303c13b493eee4cee2c1d8e596f2e969ac0dbc..547a29ede789c37fe153162490da1221eac3edaa 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/components/TrigBphysHypo_entries.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/components/TrigBphysHypo_entries.cxx
@@ -16,8 +16,6 @@
 //#include "TrigBphysHypo/TrigL2DsPhiPiFex.h"
 //#include "../TrigL2DiMuXHypo.h"
 //#include "../TrigL2DiMuXFex.h"
-#include "../TrigL2TrkMassFex.h"
-#include "../TrigL2TrkMassHypo.h"
 #include "../TrigEFTrkMassHypo.h"
 #include "../TrigMultiTrkFex.h"
 #include "../TrigBphysMuonCounter.h"
@@ -53,8 +51,7 @@ DECLARE_COMPONENT( TrigEFMultiMuHypo )
 //DECLARE_COMPONENT( TrigL2DiMuHypo )
 //DECLARE_COMPONENT( TrigL2DsPhiPiHypo )
 //DECLARE_COMPONENT( TrigL2DsPhiPiFex )
-DECLARE_COMPONENT( TrigL2TrkMassFex )
-DECLARE_COMPONENT( TrigL2TrkMassHypo )
+
 DECLARE_COMPONENT( TrigEFTrkMassHypo )
 //DECLARE_COMPONENT( TrigL2LooseMuonHypo )