diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.py b/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.py
index 7c6850264293893b7094c10069213800b075e57b..cd8048ce610f03a644fc4993851e6536adf40a93 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.py
@@ -46,7 +46,7 @@ DetDescrVersion = "ATLAS-R2-2016-01-00-01"
 #--------------------------------------------------------------
 # Input options
 #--------------------------------------------------------------
-svcMgr.DoubleEventSelector.PrimaryInputCollections = [ "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v1/RDO.merged-pileup-MT.100events.pool.root" ]
+svcMgr.DoubleEventSelector.PrimaryInputCollections = [ "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/RDO.merged-pileup-MT.unittest.pool.root" ]
 svcMgr.DoubleEventSelector.SecondaryaryInputCollections = [ "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000765.pool.root.1" ]
 svcMgr.DoubleEventSelector.OutputLevel = DEBUG
 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.ref
index 4919106c2a2a366cadc1881c722f5a10a63f21ba..1a669f329ba1aff313d6ca11f42d424e28f8e181 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTest.ref
@@ -1,14 +1,14 @@
-Thu Apr  4 17:04:54 CEST 2019
+Thu Apr 18 18:48:07 CEST 2019
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [AthenaExternals-22.0.1] [x86_64-slc6-gcc8-opt] [2.0.26/d4d5e51] -- built on [2019-04-01T2109]
+Py:Athena            INFO using release [WorkDir-22.0.2] [x86_64-slc6-gcc8-opt] [master-DES-ReadWrite-Handle/ef4bb18542] -- built on [2019-04-18T1721]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "AthenaPoolTest/DoubleEventSelectorOverlayTest.py"
-Py:ConfigurableDb    INFO Read module info for 5470 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5471 configurables from 8 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-Py:ConfiguredFactory    INFO imported 131 confDb modules in 0.76 seconds
+Py:ConfiguredFactory    INFO imported 132 confDb modules in 1.08 seconds
 Py:Athena            INFO including file "AthenaPoolTest/NoStats_jobOptions.py"
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 [?1034hApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -16,7 +16,7 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on f9pc23.ijs.si on Thu Apr  4 17:05:07 2019
+                                          running on f9pc23.ijs.si on Thu Apr 18 18:48:21 2019
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -41,63 +41,64 @@ DoubleEventSele...   INFO Initializing DoubleEventSelector - package version Eve
 DoubleEventSele...  DEBUG Service base class initialized successfully
 DoubleEventSele...   INFO reinitialization...
 DoubleEventSele...   INFO EventSelection with query 
-DoubleEventSele...  DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v1/RDO.merged-pileup-MT.100events.pool.root" from the collection list.
+DoubleEventSele...  DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/RDO.merged-pileup-MT.unittest.pool.root" from the collection list.
 DoubleEventSele...   INFO EventSelection with query 
 DoubleEventSele...  DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000765.pool.root.1" from the collection list.
 ApplicationMgr       INFO Application Manager Initialized successfully
-DoubleEventSele...  DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v1/RDO.merged-pileup-MT.100events.pool.root" from the collection list.
+DoubleEventSele...  DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/RDO.merged-pileup-MT.unittest.pool.root" from the collection list.
 DoubleEventSele...  DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000765.pool.root.1" from the collection list.
 ApplicationMgr       INFO Application Manager Started successfully
 DoubleEventSele...  DEBUG guid != m_primaryGuid
 DoubleEventSele...  DEBUG guid != m_secondaryGuid
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000000].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000000].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000000].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000000].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000000].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000000]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000000].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000000]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000000]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -122,54 +123,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000001].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000001].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000001].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000001].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000001].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000001]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000001].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000001]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000001]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -194,54 +196,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000002].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000002].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000002].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000002].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000002].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000002]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000002].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000002]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000002]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -266,54 +269,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000003].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000003].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000003].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000003].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000003].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000003]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000003].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000003]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000003]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -338,54 +342,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000004].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000004].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000004].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000004].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000004].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000004]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000004].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000004]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000004]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -410,54 +415,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000005].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000005].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000005].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000005].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000005].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000005]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000005].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000005]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000005]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -482,54 +488,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000006].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000006].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000006].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000006].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000006].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000006]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000006].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000006]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000006]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -554,54 +561,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000007].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000007].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000007].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000007].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000007].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000007]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000007].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000007]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000007]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -626,54 +634,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000008].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000008].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000008].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000008].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000008].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000008]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000008].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000008]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000008]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -698,54 +707,55 @@ AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503,
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSele...  DEBUG Try recording AttributeList
+DoubleEventSele...  DEBUG Try recording AttributeLists
 DoubleEventSele...  DEBUG Get AttributeList from the collection
 DoubleEventSele...  DEBUG AttributeList size 12
-DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000009].
-DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000009].
-DoubleEventSele...  DEBUG Try appending to AttributeList
+DoubleEventSele...  DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000009].
+DoubleEventSele...  DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSele...  DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000009].
 DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000009].
-DoubleEventSele...  DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000009]
+DoubleEventSele...  DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000009].
+DoubleEventSele...  DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000009]
 AthenaPoolAddre...  DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000009]
 AthenaPoolAddre...  DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddre...  DEBUG The current Event contains: 37 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddre...  DEBUG The current Event contains: 38 objects
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddre...  DEBUG The current Event contains: 24 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTestMT.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTestMT.ref
index fb6f5d44703ed2d353fe5ac04798fea882da328b..9b2b3769805648345b096ffbea1ebcf75cff7bb0 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTestMT.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/DoubleEventSelectorOverlayTestMT.ref
@@ -1,16 +1,16 @@
-Fri Apr  5 18:07:09 CEST 2019
+Thu Apr 18 18:48:06 CEST 2019
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [AthenaExternals-22.0.1] [x86_64-slc6-gcc8-opt] [2.0.26/d4d5e51] -- built on [2019-04-01T2109]
+Py:Athena            INFO using release [WorkDir-22.0.2] [x86_64-slc6-gcc8-opt] [master-DES-ReadWrite-Handle/ef4bb18542] -- built on [2019-04-18T1721]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [4] concurrent threads and [4] concurrent events
 Py:AlgScheduler      INFO setting up AvalancheSchedulerSvc/AvalancheSchedulerSvc with 4 threads
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "AthenaPoolTest/DoubleEventSelectorOverlayTest.py"
-Py:ConfigurableDb    INFO Read module info for 5470 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5471 configurables from 8 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-Py:ConfiguredFactory    INFO imported 131 confDb modules in 0.27 seconds
+Py:ConfiguredFactory    INFO imported 132 confDb modules in 1.08 seconds
 Py:Athena            INFO including file "AthenaPoolTest/NoStats_jobOptions.py"
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 [?1034hApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -19,7 +19,7 @@ MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on f9pc23.ijs.si on Fri Apr  5 18:07:20 2019
+                                          running on f9pc23.ijs.si on Thu Apr 18 18:48:21 2019
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 ApplicationMgr                                     INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -53,63 +53,64 @@ DoubleEventSelector                         0      INFO Initializing DoubleEvent
 DoubleEventSelector                         0     DEBUG Service base class initialized successfully
 DoubleEventSelector                         0      INFO reinitialization...
 DoubleEventSelector                         0      INFO EventSelection with query 
-DoubleEventSelector                         0     DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v1/RDO.merged-pileup-MT.100events.pool.root" from the collection list.
+DoubleEventSelector                         0     DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/RDO.merged-pileup-MT.unittest.pool.root" from the collection list.
 DoubleEventSelector                         0      INFO EventSelection with query 
 DoubleEventSelector                         0     DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000765.pool.root.1" from the collection list.
 ApplicationMgr                              0      INFO Application Manager Initialized successfully
-DoubleEventSelector                         0     DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v1/RDO.merged-pileup-MT.100events.pool.root" from the collection list.
+DoubleEventSelector                         0     DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/RDO.merged-pileup-MT.unittest.pool.root" from the collection list.
 DoubleEventSelector                         0     DEBUG Try item: "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000765.pool.root.1" from the collection list.
 ApplicationMgr                              0      INFO Application Manager Started successfully
 DoubleEventSelector                     0   0     DEBUG guid != m_primaryGuid
 DoubleEventSelector                     0   0     DEBUG guid != m_secondaryGuid
-DoubleEventSelector                     0   0     DEBUG Try recording AttributeList
+DoubleEventSelector                     0   0     DEBUG Try recording AttributeLists
 DoubleEventSelector                     0   0     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     0   0     DEBUG AttributeList size 12
-DoubleEventSelector                     0   0     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000000].
-DoubleEventSelector                     0   0     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000000].
-DoubleEventSelector                     0   0     DEBUG Try appending to AttributeList
+DoubleEventSelector                     0   0     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000000].
+DoubleEventSelector                     0   0     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     0   0     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000000].
 DoubleEventSelector                     0   0     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000000].
-DoubleEventSelector                     0   0     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000000]
+DoubleEventSelector                     0   0     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000000].
+DoubleEventSelector                     0   0     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000000]
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000000]
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     0   0     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   0   0     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   0   0     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   0   0     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -134,59 +135,60 @@ AthenaPoolAddressProviderSvcSecondary   0   0     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   0   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   0   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   0   0     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     0   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     0   0     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 1
+DoubleEventSelector                     0   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     0   0     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 1
 DoubleEventSelector                     0   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     0   0     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 1
+DoubleEventSelector                     0   0     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 1
 DoubleEventSelector                     0   0     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 1
-DoubleEventSelector                     1   1     DEBUG Try recording AttributeList
+DoubleEventSelector                     1   1     DEBUG Try recording AttributeLists
 DoubleEventSelector                     1   1     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     1   1     DEBUG AttributeList size 12
-DoubleEventSelector                     1   1     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000001].
-DoubleEventSelector                     1   1     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000001].
-DoubleEventSelector                     1   1     DEBUG Try appending to AttributeList
+DoubleEventSelector                     1   1     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000001].
+DoubleEventSelector                     1   1     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     1   1     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000001].
 DoubleEventSelector                     1   1     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000001].
-DoubleEventSelector                     1   1     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000001]
+DoubleEventSelector                     1   1     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000001].
+DoubleEventSelector                     1   1     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000001]
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000001]
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     1   1     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   1   1     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   1   1     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   1   1     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -211,60 +213,61 @@ AthenaPoolAddressProviderSvcSecondary   1   1     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   1   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   1   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   1   1     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     1   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     1   1     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 2
+DoubleEventSelector                     1   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     1   1     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 2
 DoubleEventSelector                     1   1     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 1
 DoubleEventSelector                     1   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     1   1     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 2
+DoubleEventSelector                     1   1     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 2
 DoubleEventSelector                     1   1     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 2
-DoubleEventSelector                     2   2     DEBUG Try recording AttributeList
+DoubleEventSelector                     2   2     DEBUG Try recording AttributeLists
 DoubleEventSelector                     2   2     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     2   2     DEBUG AttributeList size 12
-DoubleEventSelector                     2   2     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000002].
-DoubleEventSelector                     2   2     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000002].
-DoubleEventSelector                     2   2     DEBUG Try appending to AttributeList
+DoubleEventSelector                     2   2     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000002].
+DoubleEventSelector                     2   2     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     2   2     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000002].
 DoubleEventSelector                     2   2     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000002].
-DoubleEventSelector                     2   2     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000002]
+DoubleEventSelector                     2   2     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000002].
+DoubleEventSelector                     2   2     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000002]
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000002]
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     2   2     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   2   2     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   2   2     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   2   2     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -289,60 +292,61 @@ AthenaPoolAddressProviderSvcSecondary   2   2     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   2   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   2   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   2   2     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     2   2     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     2   2     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                     2   2     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     2   2     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                     2   2     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 2
 DoubleEventSelector                     2   2     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     2   2     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                     2   2     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                     2   2     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                     3   3     DEBUG Try recording AttributeList
+DoubleEventSelector                     3   3     DEBUG Try recording AttributeLists
 DoubleEventSelector                     3   3     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     3   3     DEBUG AttributeList size 12
-DoubleEventSelector                     3   3     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000003].
-DoubleEventSelector                     3   3     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000003].
-DoubleEventSelector                     3   3     DEBUG Try appending to AttributeList
+DoubleEventSelector                     3   3     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000003].
+DoubleEventSelector                     3   3     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     3   3     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000003].
 DoubleEventSelector                     3   3     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000003].
-DoubleEventSelector                     3   3     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000003]
+DoubleEventSelector                     3   3     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000003].
+DoubleEventSelector                     3   3     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000003]
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000003]
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     3   3     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   3   3     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   3   3     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   3   3     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -367,66 +371,67 @@ AthenaPoolAddressProviderSvcSecondary   3   3     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   3   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   3   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   3   3     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     3   3     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     3   3     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     3   3     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     3   3     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     3   3     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                     3   3     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     3   3     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     3   3     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     3   3     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                     4   0     DEBUG Try recording AttributeList
+DoubleEventSelector                     4   0     DEBUG Try recording AttributeLists
 DoubleEventSelector                     4   0     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     4   0     DEBUG AttributeList size 12
-DoubleEventSelector                     4   0     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000004].
-DoubleEventSelector                     4   0     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000004].
-DoubleEventSelector                     4   0     DEBUG Try appending to AttributeList
+DoubleEventSelector                     4   0     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000004].
+DoubleEventSelector                     4   0     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     4   0     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000004].
 DoubleEventSelector                     4   0     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000004].
-DoubleEventSelector                     4   0     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000004]
+DoubleEventSelector                     4   0     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000004].
+DoubleEventSelector                     4   0     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000004]
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000004]
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     4   0     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   4   0     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   4   0     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   4   0     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -451,66 +456,67 @@ AthenaPoolAddressProviderSvcSecondary   4   0     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   4   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   4   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   4   0     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     4   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     4   0     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     4   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     4   0     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     4   0     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                     4   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     4   0     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     4   0     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     4   0     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                     5   1     DEBUG Try recording AttributeList
+DoubleEventSelector                     5   1     DEBUG Try recording AttributeLists
 DoubleEventSelector                     5   1     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     5   1     DEBUG AttributeList size 12
-DoubleEventSelector                     5   1     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000005].
-DoubleEventSelector                     5   1     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000005].
-DoubleEventSelector                     5   1     DEBUG Try appending to AttributeList
+DoubleEventSelector                     5   1     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000005].
+DoubleEventSelector                     5   1     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     5   1     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000005].
 DoubleEventSelector                     5   1     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000005].
-DoubleEventSelector                     5   1     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000005]
+DoubleEventSelector                     5   1     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000005].
+DoubleEventSelector                     5   1     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000005]
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000005]
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     5   1     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   5   1     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   5   1     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   5   1     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -535,66 +541,67 @@ AthenaPoolAddressProviderSvcSecondary   5   1     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   5   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   5   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   5   1     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     5   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     5   1     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     5   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     5   1     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     5   1     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                     5   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     5   1     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     5   1     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     5   1     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                     6   2     DEBUG Try recording AttributeList
+DoubleEventSelector                     6   2     DEBUG Try recording AttributeLists
 DoubleEventSelector                     6   2     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     6   2     DEBUG AttributeList size 12
-DoubleEventSelector                     6   2     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000006].
-DoubleEventSelector                     6   2     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000006].
-DoubleEventSelector                     6   2     DEBUG Try appending to AttributeList
+DoubleEventSelector                     6   2     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000006].
+DoubleEventSelector                     6   2     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     6   2     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000006].
 DoubleEventSelector                     6   2     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000006].
-DoubleEventSelector                     6   2     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000006]
+DoubleEventSelector                     6   2     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000006].
+DoubleEventSelector                     6   2     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000006]
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000006]
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     6   2     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   6   2     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   6   2     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   6   2     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -619,66 +626,67 @@ AthenaPoolAddressProviderSvcSecondary   6   2     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   6   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   6   2     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   6   2     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     6   2     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     6   2     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     6   2     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     6   2     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     6   2     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                     6   2     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     6   2     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     6   2     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     6   2     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                     7   3     DEBUG Try recording AttributeList
+DoubleEventSelector                     7   3     DEBUG Try recording AttributeLists
 DoubleEventSelector                     7   3     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     7   3     DEBUG AttributeList size 12
-DoubleEventSelector                     7   3     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000007].
-DoubleEventSelector                     7   3     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000007].
-DoubleEventSelector                     7   3     DEBUG Try appending to AttributeList
+DoubleEventSelector                     7   3     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000007].
+DoubleEventSelector                     7   3     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     7   3     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000007].
 DoubleEventSelector                     7   3     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000007].
-DoubleEventSelector                     7   3     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000007]
+DoubleEventSelector                     7   3     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000007].
+DoubleEventSelector                     7   3     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000007]
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000007]
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     7   3     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   7   3     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   7   3     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   7   3     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -703,66 +711,67 @@ AthenaPoolAddressProviderSvcSecondary   7   3     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   7   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   7   3     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   7   3     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     7   3     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     7   3     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     7   3     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     7   3     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     7   3     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                     7   3     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     7   3     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     7   3     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     7   3     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                     8   0     DEBUG Try recording AttributeList
+DoubleEventSelector                     8   0     DEBUG Try recording AttributeLists
 DoubleEventSelector                     8   0     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     8   0     DEBUG AttributeList size 12
-DoubleEventSelector                     8   0     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000008].
-DoubleEventSelector                     8   0     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000008].
-DoubleEventSelector                     8   0     DEBUG Try appending to AttributeList
+DoubleEventSelector                     8   0     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000008].
+DoubleEventSelector                     8   0     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     8   0     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000008].
 DoubleEventSelector                     8   0     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000008].
-DoubleEventSelector                     8   0     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000008]
+DoubleEventSelector                     8   0     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000008].
+DoubleEventSelector                     8   0     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000008]
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000008]
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     8   0     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   8   0     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   8   0     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   8   0     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -787,66 +796,67 @@ AthenaPoolAddressProviderSvcSecondary   8   0     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   8   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   8   0     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   8   0     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     8   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     8   0     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     8   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     8   0     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     8   0     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                     8   0     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     8   0     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     8   0     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     8   0     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                     9   1     DEBUG Try recording AttributeList
+DoubleEventSelector                     9   1     DEBUG Try recording AttributeLists
 DoubleEventSelector                     9   1     DEBUG Get AttributeList from the collection
 DoubleEventSelector                     9   1     DEBUG AttributeList size 12
-DoubleEventSelector                     9   1     DEBUG record AthenaAttribute, name = Token = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000009].
-DoubleEventSelector                     9   1     DEBUG record AthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000009].
-DoubleEventSelector                     9   1     DEBUG Try appending to AttributeList
+DoubleEventSelector                     9   1     DEBUG record AthenaAttribute, name = Token = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000009].
+DoubleEventSelector                     9   1     DEBUG Append secondary attribute list properties to the primary one with a suffix: secondary
 DoubleEventSelector                     9   1     DEBUG record AthenaAttribute, name = Token_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000009].
 DoubleEventSelector                     9   1     DEBUG record AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000009].
-DoubleEventSelector                     9   1     DEBUG found PrimaryAthenaAttribute, name = eventRef = [DB=108E29D8-3D38-474D-9E9A-D1FA34A36CB4][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000028-0000000000000009]
+DoubleEventSelector                     9   1     DEBUG record AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000009].
+DoubleEventSelector                     9   1     DEBUG found AthenaAttribute, name = eventRef = [DB=8BCD9728-EB56-6042-AFDF-61C0C379D70E][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=0000000000000029-0000000000000009]
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG found AthenaAttribute, name = eventRef_secondary = [DB=9553B87B-1832-3346-A65E-916E6C1DEAB5][CNT=POOLContainer(DataHeader)][CLID=D82968A1-CF91-4320-B2DD-E0F739CBC7E6][TECH=00000202][OID=000000000000001B-0000000000000009]
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG Created dataHeader SecondaryEventSelector
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG The current Event contains: 37 objects
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2540, name = PixelRDOs
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG The current Event contains: 38 objects
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2540, name = Bkg_PixelRDOs
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2541, name = Bkg_SCT_RDOs
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2542, name = TRT_RDOs
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2542, name = Bkg_TRT_RDOs
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_BCM_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_PixelSDO_Map
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_SCT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = PixelSDO_Map
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = TRT_SDO_Map
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2590, name = BCM_RDOs
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2543, name = Bkg_TRT_SDO_Map
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2590, name = Bkg_BCM_RDOs
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2711, name = Bkg_LArDigitContainer_MC
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1EM
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2771, name = Bkg_LArTTL1HAD
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = MuRcvDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = TileDigitsCnt
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2927, name = MuRcvRawChCnt
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1Cnt
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = TileTTL1MBTS
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2934, name = TileL2Cnt
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2954, name = TileMuRcvCnt
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4183, name = CSCRDO
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4186, name = TGCRDO
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4187, name = MDTCSM
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4190, name = RPCPAD
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_MuRcvDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2925, name = Bkg_TileDigitsCnt
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1Cnt
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2933, name = Bkg_TileTTL1MBTS
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2934, name = Bkg_TileL2Cnt
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 2954, name = Bkg_TileMuRcvCnt
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4183, name = Bkg_CSCRDO
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4186, name = Bkg_TGCRDO
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4187, name = Bkg_MDTCSM
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 4190, name = Bkg_RPCPAD
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 133273, name = Bkg_TruthEvent
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 38853911, name = Bkg_EventInfoAux.
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = MDT_SDO
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = RPC_SDO
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = TGC_SDO
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_MDT_SDO
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_RPC_SDO
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 41658935, name = Bkg_TGC_SDO
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 45903698, name = Bkg_EventInfo
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_EVNTtoHITS_timings
 AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 76321643, name = Bkg_HITStoRDO_timings
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = CSC_SDO
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = InTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = OutOfTimeAntiKt4TruthJets
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = InTimeAntiKt4TruthJetsAux.
-AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1095642046, name = Bkg_CSC_SDO
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = Bkg_MuonEntryLayer
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_InTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1244316195, name = Bkg_OutOfTimeAntiKt4TruthJets
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1272974287, name = PileUpEventInfoAux.
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_InTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1294631886, name = Bkg_OutOfTimeAntiKt4TruthJetsAux.
+AthenaPoolAddressProviderSvcPrimary     9   1     DEBUG loadAddresses: DataObject address, clid = 1320594112, name = PileUpEventInfo
 AthenaPoolAddressProviderSvcSecondary   9   1     DEBUG The current Event contains: 24 objects
 AthenaPoolAddressProviderSvcSecondary   9   1     DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddressProviderSvcSecondary   9   1     DEBUG loadAddresses: DataObject address, clid = 2545, name = BCMHits
@@ -871,35 +881,35 @@ AthenaPoolAddressProviderSvcSecondary   9   1     DEBUG loadAddresses: DataObjec
 AthenaPoolAddressProviderSvcSecondary   9   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonEntryLayer
 AthenaPoolAddressProviderSvcSecondary   9   1     DEBUG loadAddresses: DataObject address, clid = 1235574503, name = MuonExitLayer
 AthenaPoolAddressProviderSvcSecondary   9   1     DEBUG loadAddresses: DataObject address, clid = 1312841250, name = LArCalibrationHitDeadMaterial
-DoubleEventSelector                     9   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                     9   1     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     9   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                     9   1     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     9   1     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                     9   1     DEBUG **  MN Incident handler BeginProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                     9   1     DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 4
+DoubleEventSelector                     9   1     DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 4
 DoubleEventSelector                     9   1     DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 4
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 3
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 3
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 2
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 2
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 3
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 2
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 2
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 2
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 1
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 1
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 2
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 1
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 1
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 1
-DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=108E29D8-3D38-474D-9E9A-D1FA34A36CB4
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 0
+DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=8BCD9728-EB56-6042-AFDF-61C0C379D70E
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 0
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 1
 DoubleEventSelector                               DEBUG **  MN Incident handler EndProcessing Event source ID=9553B87B-1832-3346-A65E-916E6C1DEAB5
-DoubleEventSelector                               DEBUG SourceID: 108E29D8-3D38-474D-9E9A-D1FA34A36CB4 active events: 0
+DoubleEventSelector                               DEBUG SourceID: 8BCD9728-EB56-6042-AFDF-61C0C379D70E active events: 0
 DoubleEventSelector                               DEBUG SourceID: 9553B87B-1832-3346-A65E-916E6C1DEAB5 active events: 0
 Stream1                                            INFO Records written: 11
 ApplicationMgr                                     INFO Application Manager Stopped successfully
diff --git a/Calorimeter/CaloCnv/CaloIdCnv/CMakeLists.txt b/Calorimeter/CaloCnv/CaloIdCnv/CMakeLists.txt
index e481d1c23ad8e626a320bcd17bdca0cd3909a23c..6fa74fd3844b2ed02ab00c70d874d6c3233666e9 100644
--- a/Calorimeter/CaloCnv/CaloIdCnv/CMakeLists.txt
+++ b/Calorimeter/CaloCnv/CaloIdCnv/CMakeLists.txt
@@ -9,7 +9,6 @@ atlas_subdir( CaloIdCnv )
 atlas_depends_on_subdirs( PUBLIC
                           Calorimeter/CaloIdentifier
                           Control/AthenaKernel
-                          Control/SGTools
                           DetectorDescription/DetDescrCnvSvc
                           PRIVATE
                           Control/StoreGate
@@ -20,7 +19,7 @@ atlas_depends_on_subdirs( PUBLIC
 # Component(s) in the package:
 atlas_add_component( CaloIdCnv
                      src/*.cxx
-                     LINK_LIBRARIES CaloIdentifier AthenaKernel SGTools DetDescrCnvSvcLib StoreGateLib SGtests IdDictDetDescr Identifier GaudiKernel )
+                     LINK_LIBRARIES CaloIdentifier AthenaKernel DetDescrCnvSvcLib StoreGateLib SGtests IdDictDetDescr Identifier GaudiKernel )
 
 # Install files from the package:
 atlas_install_headers( CaloIdCnv )
diff --git a/Calorimeter/CaloCnv/CaloIdCnv/CaloIdCnv/CaloIDHelper_IDDetDescrCnv.icc b/Calorimeter/CaloCnv/CaloIdCnv/CaloIdCnv/CaloIDHelper_IDDetDescrCnv.icc
index 19334fd4759a55a2d585ff0337a2ac3c0faf4179..881b8a3b0ce5dd5afac433c9dc623765dbd4b844 100644
--- a/Calorimeter/CaloCnv/CaloIdCnv/CaloIdCnv/CaloIDHelper_IDDetDescrCnv.icc
+++ b/Calorimeter/CaloCnv/CaloIdCnv/CaloIdCnv/CaloIDHelper_IDDetDescrCnv.icc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -11,7 +11,7 @@
  */
 
 
-#include "SGTools/StorableConversions.h"
+#include "AthenaKernel/StorableConversions.h"
 #include "AthenaKernel/errorcheck.h"
 
 
diff --git a/Calorimeter/CaloCnv/CaloIdCnv/src/CaloIDHelper_IDDetDescrCnv.cxx b/Calorimeter/CaloCnv/CaloIdCnv/src/CaloIDHelper_IDDetDescrCnv.cxx
index c3e9aa190618a6c0b7c0e0fa9e0e8e1b2f69e3fb..4e83551ecb5e4b559e57a64d788d21337448c2c0 100644
--- a/Calorimeter/CaloCnv/CaloIdCnv/src/CaloIDHelper_IDDetDescrCnv.cxx
+++ b/Calorimeter/CaloCnv/CaloIdCnv/src/CaloIDHelper_IDDetDescrCnv.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -15,7 +15,7 @@
 #include "IdDictDetDescr/IdDictManager.h"
 #include "DetDescrCnvSvc/DetDescrAddress.h"
 #include "StoreGate/StoreGateSvc.h"
-#include "SGTools/ClassID_traits.h"
+#include "AthenaKernel/ClassID_traits.h"
 #include "Identifier/IdHelper.h"
 #include "AthenaKernel/IClassIDSvc.h"
 #include "AthenaKernel/errorcheck.h"
diff --git a/Control/AthLinks/AthLinks/DataLink.h b/Control/AthLinks/AthLinks/DataLink.h
index 0501e852194d35386726de57bc0d8155ef3cce78..31bbd15ffe9a8d497420dca13c7557e4f68019d6 100644
--- a/Control/AthLinks/AthLinks/DataLink.h
+++ b/Control/AthLinks/AthLinks/DataLink.h
@@ -1,7 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id: DataLink.h 783590 2016-11-11 00:38:09Z ssnyder $
@@ -18,7 +18,7 @@
 
 
 #include "AthLinks/DataLinkBase.h"
-#include "SGTools/ClassID_traits.h"
+#include "AthenaKernel/ClassID_traits.h"
 #include "AthenaKernel/DefaultKey.h"
 #include "GaudiKernel/EventContext.h"
 class IProxyDict;
diff --git a/Control/AthLinks/AthLinks/DataLink.icc b/Control/AthLinks/AthLinks/DataLink.icc
index ae1fc6f582f66370fc2ba182029505a723153400..e843394062902b92a65ce7d0ee1835791cc9e141 100644
--- a/Control/AthLinks/AthLinks/DataLink.icc
+++ b/Control/AthLinks/AthLinks/DataLink.icc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id: DataLink.icc 783590 2016-11-11 00:38:09Z ssnyder $
@@ -12,7 +12,7 @@
 
 
 #include "AthLinks/exceptions.h"
-#include "SGTools/StorableConversions.h"
+#include "AthenaKernel/StorableConversions.h"
 #include "SGTools/DataProxy.h"
 #include "AthenaKernel/ExtendedEventContext.h"
 
diff --git a/Control/AthLinks/AthLinks/exceptions.h b/Control/AthLinks/AthLinks/exceptions.h
index e907c16e096479d59307aeea5dd3dda2eb5070a2..1b17a0b0119349ed079410dc42065022c545e4e0 100644
--- a/Control/AthLinks/AthLinks/exceptions.h
+++ b/Control/AthLinks/AthLinks/exceptions.h
@@ -1,7 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -18,7 +18,6 @@
 
 
 #include "AthenaKernel/sgkey_t.h"
-#include "CxxUtils/noreturn.h"
 #include "GaudiKernel/ClassID.h"
 #include <stdexcept>
 
@@ -97,9 +96,10 @@ public:
  * @param key String key of the link.
  * @param sgkey Hashed key of the link.
  */
-ATH_NORETURN(void throwExcInvalidLink (CLID clid,
-                                       const std::string& key,
-                                       SG::sgkey_t sgkey));
+[[noreturn]]
+void throwExcInvalidLink (CLID clid,
+                          const std::string& key,
+                          SG::sgkey_t sgkey);
 
 
 /**
@@ -127,7 +127,8 @@ public:
  * @param index Index in the link.
  * @param size Size of the referenced container.
  */
-ATH_NORETURN(void throwExcBadForwardLink (size_t index, size_t size));
+[[noreturn]]
+void throwExcBadForwardLink (size_t index, size_t size);
 
 
 /**
@@ -153,7 +154,8 @@ public:
  * @brief Throw a SG::ExcElementNotFound exception.
  * @param where The operation being attempted.
  */
-ATH_NORETURN(void throwExcElementNotFound (const char* where));
+[[noreturn]]
+void throwExcElementNotFound (const char* where);
 
 
 /// Backwards compatibility.
@@ -182,7 +184,8 @@ public:
  * @brief Throw a SG::ExcInvalidIndex exception.
  * @param where The operation being attempted.
  */
-ATH_NORETURN(void throwExcInvalidIndex (const char* where));
+[[noreturn]]
+void throwExcInvalidIndex (const char* where);
 
 
 /**
@@ -208,7 +211,8 @@ public:
  * @brief Throw a SG::ExcIndexNotFound exception.
  * @param where The operation being attempted.
  */
-ATH_NORETURN(void throwExcIndexNotFound (const char* where));
+[[noreturn]]
+void throwExcIndexNotFound (const char* where);
 
 
 /**
@@ -234,7 +238,8 @@ public:
 /**
  * @brief Throw a SG::IncomparableEL exception.
  */
-ATH_NORETURN(void throwExcIncomparableEL());
+[[noreturn]]
+void throwExcIncomparableEL();
 
 
 /**
@@ -256,7 +261,8 @@ public:
 /**
  * @brief Throw a SG::ExcBadToTransient exception.
  */
-ATH_NORETURN(void throwExcBadToTransient());
+[[noreturn]]
+void throwExcBadToTransient();
 
 
 } // namespace SG
diff --git a/Control/AthLinks/test/DataLink_test.cxx b/Control/AthLinks/test/DataLink_test.cxx
index 37b4530bf1e0139cebdb15aed329599b79fea508..b148e00c248041e36db35be75e64ac265797b459 100644
--- a/Control/AthLinks/test/DataLink_test.cxx
+++ b/Control/AthLinks/test/DataLink_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -13,7 +13,7 @@
 #undef NDEBUG
 #include "AthLinks/DataLink.h"
 #include "SGTools/CurrentEventStore.h"
-#include "SGTools/StorableConversions.h"
+#include "AthenaKernel/StorableConversions.h"
 #include "SGTools/DataProxy.h"
 #include "SGTools/TransientAddress.h"
 #include "AthenaKernel/ClassID_traits.h"
diff --git a/Control/AthenaCommon/python/AthOptionsParser.py b/Control/AthenaCommon/python/AthOptionsParser.py
index b994c0e7a579cc31e7f086ca9a1df4b6eec45ebf..5b998c9249e15ecbde7bbfc8568c87725ac5f639 100644
--- a/Control/AthenaCommon/python/AthOptionsParser.py
+++ b/Control/AthenaCommon/python/AthOptionsParser.py
@@ -26,7 +26,7 @@ _userlongopts = [
     "batch", "interactive", "no-display", "debug=", "command=", "help",
     "loglevel=", "showincludes", "trace=", "check-properties",
     "version",
-    "leak-check=", "leak-check-execute", "delete-check=", "heapmon",
+    "leak-check=", "leak-check-execute", "delete-check=",
     "perfmon", "pmon=", "repeat-evts=", "profile-python=",
     "enable-ers-hdlr=",
     "keep-configuration","drop-configuration", "drop-and-reload", "config-only=",
@@ -69,7 +69,6 @@ Accepted command line options:
                                            This disables the use of tcmalloc.
      --delete-check=<stage>           ...  perform double delete checking.
                                            This disables the use of tcmalloc.
-     --heapmon                        ...  enable heap fragmentation profiling tool, HeapMon 
      --profile-python=<file>.pkl|txt  ...  profile python code, dump in <file>.pkl|txt
  -c, --command                        ...  one-liner, runs before any scripts
  -h, --help                           ...  print this help message
@@ -152,7 +151,6 @@ def parse(chk_tcmalloc=True):
     opts.config_dump_file = None # not used by default
     opts.do_leak_chk = False     # default is not to do any leak checking
     opts.memchk_mode = ''        # no mode selected by default 
-    opts.do_heap_mon = False     # default is not to do any heap monitoring
     opts.profile_python = None   # set to file name to collect and dump python profile
     opts.nprocs = 0              # enable AthenaMP if >= 1 or == -1
     opts.threads = 0             # enable AthenaMT if >= 1
@@ -305,9 +303,6 @@ def parse(chk_tcmalloc=True):
             else:
                 print ("disabling Hephaestus leak check as it is incompatible with tcmalloc")
 
-        elif opt in ("--heapmon",):
-            opts.do_heap_mon = True
-            
         elif opt in ("--profile-python",):
             pos = arg.rfind('.')
             if pos < 0 or (arg[pos+1:] != "txt" and arg[pos+1:] != "pkl"):
diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index 25913c3b9a927df06f8e60e988f82830040dcadd..56a53af0b5101177f39e8b3796850e6f6b2d4d48 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -1,10 +1,22 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+from __future__ import print_function
+
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 from AthenaCommon.SystemOfUnits import TeV
 from AthenaConfiguration.AutoConfigFlags import GetFileMD
+import imp
+
 
+def _addFlagsCategory (acf, name, generator, modName = None):
+    if modName is not None:
+        try:
+            imp.find_module(modName)
+        except ImportError:
+            return None
+    return acf.addFlagsCategory (name, generator)
 
+        
 def _createCfgFlags():
 
     acf=AthConfigFlags()
@@ -15,6 +27,13 @@ def _createCfgFlags():
     acf.addFlag('Input.RunNumber', lambda prevFlags : list(GetFileMD(prevFlags.Input.Files).get("RunNumber",None))) # former global.RunNumber
     acf.addFlag('Input.ProjectName', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("Project","data17_13TeV") ) # former global.ProjectName
 
+    def _inputCollections(inputFile):
+        rawCollections = GetFileMD(inputFile).get("SGKeys").split()
+        collections = filter(lambda col: not col.endswith('Aux.'), rawCollections)
+        return collections
+
+    acf.addFlag('Input.Collections', lambda prevFlags : _inputCollections(prevFlags.Input.Files) )
+
     acf.addFlag('Concurrency.NumProcs', 0)
     acf.addFlag('Concurrency.NumThreads', 0)
     acf.addFlag('Concurrency.NumConcurrentEvents', 0)
@@ -62,7 +81,7 @@ def _createCfgFlags():
     def __simulation():
         from G4AtlasApps.SimConfigFlags import createSimConfigFlags
         return createSimConfigFlags()
-    acf.addFlagsCategory( "Sim", __simulation )
+    _addFlagsCategory (acf, "Sim", __simulation, 'G4AtlasApps' )
 
 #Geo Model Flags:
     acf.addFlag('GeoModel.Layout', 'atlas') # replaces global.GeoLayout
@@ -82,7 +101,7 @@ def _createCfgFlags():
     def __lar():
         from LArConfiguration.LArConfigFlags import createLArConfigFlags
         return createLArConfigFlags()
-    acf.addFlagsCategory( "LAr", __lar ) 
+    _addFlagsCategory(acf, "LAr", __lar, 'LArConfiguration' ) 
 
 #CaloNoise Flags
     acf.addFlag("Calo.Noise.fixedLumiForNoise",-1)
@@ -102,24 +121,24 @@ def _createCfgFlags():
     def __trigger():
         from TriggerJobOpts.TriggerConfigFlags import createTriggerFlags
         return createTriggerFlags()
-    acf.addFlagsCategory( "Trigger", __trigger )
+    _addFlagsCategory(acf, "Trigger", __trigger, 'TriggerJobOpts' )
 
     def __muon():
         from MuonConfig.MuonConfigFlags import createMuonConfigFlags
         return createMuonConfigFlags()
-    acf.addFlagsCategory( "Muon", __muon )
+    _addFlagsCategory(acf, "Muon", __muon, 'MuonConfig' )
 
     def __egamma():
         from egammaConfig.egammaConfigFlags import createEgammaConfigFlags
         return createEgammaConfigFlags()
-    acf.addFlagsCategory( "Egamma", __egamma )
+    _addFlagsCategory(acf, "Egamma", __egamma, 'egammaConfig' )
 
     def __dq():
         from AthenaMonitoring.DQConfigFlags import createDQConfigFlags, createComplexDQConfigFlags
         dqf = createDQConfigFlags()
         dqf.join( createComplexDQConfigFlags() )
         return dqf
-    acf.addFlagsCategory("DQ", __dq )
+    _addFlagsCategory(acf, "DQ", __dq, 'AthenaMonitoring' )
 
     return acf
 
diff --git a/Control/AthenaConfiguration/python/ArgsToFlags.py b/Control/AthenaConfiguration/python/ArgsToFlags.py
index d74d2b0627f386bb6aaec7fb6d4e0a94938e55ed..acb53ac8c8f3f0e99241326837f398d3a28c9bff 100644
--- a/Control/AthenaConfiguration/python/ArgsToFlags.py
+++ b/Control/AthenaConfiguration/python/ArgsToFlags.py
@@ -1,4 +1,4 @@
-
+from __future__ import print_function
 
 def argsToFlags(configFlags=None, listOfArgs=None):
 
diff --git a/Control/AthenaConfiguration/python/AthConfigFlags.py b/Control/AthenaConfiguration/python/AthConfigFlags.py
index ae65814bee15a9d1dfdbd7a100402d2345496149..be04c2cc5fdb38eb1346e815b7fd6553b87c4744 100644
--- a/Control/AthenaConfiguration/python/AthConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AthConfigFlags.py
@@ -1,5 +1,8 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+from __future__ import print_function
+import six
+
 from copy import deepcopy
 from AthenaCommon.Logging import logging
 class CfgFlag(object):
@@ -58,10 +61,17 @@ class FlagAddress(object):
         return self._flags._set( merged, value )
 
     def __cmp__(self, other):
-        raise RuntimeError( "No such a flag: "+ self._name+". Likely the name is incomplete " )
+        raise RuntimeError( "No such flag: "+ self._name+".  The name is likely incomplete." )
+    __eq__ = __cmp__
+    __ne__ = __cmp__
+    __lt__ = __cmp__
+    __le__ = __cmp__
+    __gt__ = __cmp__
+    __ge__ = __cmp__
+
 
     def __nonzero__(self):
-        raise RuntimeError( "No such a flag: "+ self._name+". Likely the name is incomplete " )
+        raise RuntimeError( "No such flag: "+ self._name+".  The name is likely incomplete." )
         
 
 
@@ -108,7 +118,8 @@ class AthConfigFlags(object):
             self.dump()
 
     def loadAllDynamicFlags(self):
-        for prefix in self._dynaflags.keys():
+        # Need to convert to a list since _loadDynaFlags may change the dict.
+        for prefix in list(self._dynaflags.keys()):
             self._loadDynaFlags( prefix )
 
     def hasFlag(self, name):        
@@ -211,7 +222,7 @@ class AthConfigFlags(object):
     def join(self,other):
         if (self._locked):
             raise RuntimeError("Attempt to join with and already-locked container")
-        for (name,flag) in other._flagdict.iteritems():
+        for (name,flag) in six.iteritems(other._flagdict):
             if name in self._flagdict:
                 raise KeyError("Duplicated flag name: %s" % name)
             self._flagdict[name]=flag
@@ -226,7 +237,7 @@ class AthConfigFlags(object):
             return
         print("Flag categories that can be loaded dynamically")
         print("%-15.15s : %30s : %s" % ("Category","Generator name", "Defined in" ))
-        for name,gen in sorted(self._dynaflags.iteritems()):
+        for name,gen in sorted(six.iteritems(self._dynaflags)):
             print("%-15.15s : %30s : %s" %
                   (name, gen.func_name, '/'.join(gen.func_code.co_filename.split('/')[-2:])))
 
diff --git a/Control/AthenaConfiguration/python/AutoConfigFlags.py b/Control/AthenaConfiguration/python/AutoConfigFlags.py
index a2af75d18ec3f7ae5fafd6f6779a04468c4b36f7..7d8d5ddca8b998e9cb99da8ae576ad86cd8f708b 100644
--- a/Control/AthenaConfiguration/python/AutoConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AutoConfigFlags.py
@@ -1,5 +1,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+from __future__ import print_function
+
 from AthenaCommon.Logging import log
 from FilePeeker.FilePeeker import PeekFiles
 
diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index 715dd4841f8f004e80491fd23b020f54734a2d53..82cc0bf79b50a2da62bf727bf265ce723465048e 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -1,5 +1,6 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+from __future__ import print_function
 from AthenaCommon.Logging import logging
 from AthenaCommon.Configurable import Configurable,ConfigurableService,ConfigurableAlgorithm,ConfigurableAlgTool
 from AthenaCommon.CFElements import isSequence,findSubSequence,findAlgorithm,flatSequencers,findOwningSequence,\
@@ -8,10 +9,11 @@ from AthenaCommon.AlgSequence import AthSequencer
 
 import GaudiKernel.GaudiHandles as GaudiHandles
 
-from Deduplication import deduplicate, deduplicateComponent, DeduplicationFailed
+from AthenaConfiguration.Deduplication import deduplicate, deduplicateComponent, DeduplicationFailed
 
 import ast
 import collections
+import six
 
 from UnifyProperties import unifySet
 
@@ -48,13 +50,13 @@ class ComponentAccumulator(object):
             len(self._publicTools)+len(self._outputPerStream)+len(self._theAppProps) == 0
 
     def __del__(self):
-        if not self._wasMerged and not self.empty():
-            raise RuntimeError("ComponentAccumulator was not merged!")
-            #log = logging.getLogger("ComponentAccumulator")
-            #log.error("The ComponentAccumulator listed below was never merged!")
+         if not getattr(self,'_wasMerged',True) and not self.empty():
+             raise RuntimeError("ComponentAccumulator was not merged!")
+             #log = logging.getLogger("ComponentAccumulator")
+             #log.error("The ComponentAccumulator listed below was never merged!")
 
-        if self._privateTools is not None:
-            raise RuntimeError("Deleting a ComponentAccumulator with and dangling private tool(s)")
+         if getattr(self,'_privateTools',None) is not None:
+             raise RuntimeError("Deleting a ComponentAccumulator with and dangling private tool(s)")
         #pass
 
 
@@ -65,7 +67,7 @@ class ComponentAccumulator(object):
         self._msg.info( "Event Algorithm Sequences" )
 
         def printProperties(c, nestLevel = 0):
-            for propname, propval in c.getValuedProperties().iteritems():
+            for propname, propval in six.iteritems(c.getValuedProperties()):
                 # Ignore empty lists
                 if propval==[]:
                     continue
@@ -456,7 +458,7 @@ class ComponentAccumulator(object):
                 self._outputPerStream[k]=other._outputPerStream[k]
 
         #Merge AppMgr properties:
-        for (k,v) in other._theAppProps.iteritems():
+        for (k,v) in six.iteritems(other._theAppProps):
             self.setAppProperty(k,v)  #Will warn about overrides
             pass
         other._wasMerged=True
@@ -487,13 +489,13 @@ class ComponentAccumulator(object):
         for c in self._conditionsAlgs:
             deduplicate(c,condseq)
 
-        for seqName, algoList in flatSequencers( self._sequence ).iteritems():
+        for seqName, algoList in six.iteritems(flatSequencers( self._sequence )):
             seq=AthSequencer(seqName)
             for alg in algoList:
                 seq+=alg
 
 
-        for (k,v) in self._theAppProps.iteritems():
+        for (k,v) in six.iteritems(self._theAppProps):
             if k not in [ 'CreateSvc', 'ExtSvc']:
                 setattr(theApp,k,v)
 
@@ -527,7 +529,7 @@ class ComponentAccumulator(object):
                     self._jocat[name] = {}
                 self._jocat[name][k]=str(v)
 
-        #print "All Children:",confElem.getAllChildren()
+        #print ("All Children:",confElem.getAllChildren())
         for ch in confElem.getAllChildren():
             self.appendConfigurable(ch)
         return
@@ -549,7 +551,7 @@ class ComponentAccumulator(object):
             else:
                 bsfilename = "./"+localbs[0]
 
-            bsfile=open(bsfilename)
+            bsfile=open(bsfilename,'rb')
             self._jocat=pickle.load(bsfile)
             self._jocfg=pickle.load(bsfile)
             self._pycomps=pickle.load(bsfile)
@@ -595,7 +597,7 @@ class ComponentAccumulator(object):
                                                         'JobOptionsSvc/JobOptionsSvc']"
 
             #Code seems to be wrong here
-            for seqName, algoList in flatSequencers( self._sequence, algsCollection=self._algorithms ).iteritems():
+            for seqName, algoList in six.iteritems(flatSequencers( self._sequence, algsCollection=self._algorithms )):
                 self._jocat[seqName] = {}
                 for alg in algoList:
                   self._jocat[alg.name()] = {}
@@ -603,13 +605,13 @@ class ComponentAccumulator(object):
                 self._jocat[self._sequence.getName()][k]=str(v)
 
         #EventAlgorithms
-        for seqName, algoList  in flatSequencers( self._sequence, algsCollection=self._algorithms ).iteritems():
+        for seqName, algoList  in six.iteritems(flatSequencers( self._sequence, algsCollection=self._algorithms )):
             evtalgseq=[]
             for alg in algoList:
                 self.appendConfigurable( alg )
                 evtalgseq.append( alg.getFullName() )
 
-        for seqName, algoList  in flatSequencers( self._sequence, algsCollection=self._algorithms ).iteritems():
+        for seqName, algoList  in six.iteritems(flatSequencers( self._sequence, algsCollection=self._algorithms )):
             # part of the sequence may come from the bootstrap, we need to retain the content, that is done here
             for prop in self._jocat[seqName]:
                 if prop == "Members":
@@ -627,7 +629,7 @@ class ComponentAccumulator(object):
 
         #Public Tools:
         for pt in self._publicTools:
-            #print "Appending public Tool",pt.getFullName(),pt.getJobOptName()
+            #print ("Appending public Tool",pt.getFullName(),pt.getJobOptName())
             self.appendConfigurable(pt)
 
 
@@ -650,7 +652,7 @@ class ComponentAccumulator(object):
         self._jocfg["ApplicationMgr"]["EvtMax"]=nEvents
 
 
-        for (k,v) in self._theAppProps.iteritems():
+        for (k,v) in six.iteritems(self._theAppProps):
             if k not in [ 'CreateSvc', 'ExtSvc']:
                 self._jocfg["ApplicationMgr"][k]=v
 
@@ -675,7 +677,7 @@ class ComponentAccumulator(object):
         bsh=BootstrapHelper()
         app=bsh.createApplicationMgr()
 
-        for (k,v) in self._theAppProps.iteritems():
+        for (k,v) in six.iteritems(self._theAppProps):
             app.setProperty(k,str(v))
 
         #Assemble createSvc property:
@@ -686,16 +688,16 @@ class ComponentAccumulator(object):
             if svc.getJobOptName() in _servicesToCreate:
                 svcToCreate+=[svc.getFullName(),]
 
-        #print self._services
-        #print extSvc
-        #print svcToCreate
+        #print (self._services)
+        #print (extSvc)
+        #print (svcToCreate)
         app.setProperty("ExtSvc",str(extSvc))
         app.setProperty("CreateSvc",str(svcToCreate))
 
         app.configure()
 
         msp=app.getService("MessageSvc")
-        bsh.setProperty(msp,"OutputLevel",str(OutputLevel))
+        bsh.setProperty(msp,b"OutputLevel",str(OutputLevel).encode())
         #Feed the jobO service with the remaining options
         jos=app.getService("JobOptionsSvc")
 
@@ -711,7 +713,7 @@ class ComponentAccumulator(object):
                 else:
                     if not isSequence(comp) and k!="Members": #This property his handled separatly
                         self._msg.debug("Adding "+name+"."+k+" = "+str(v))
-                        bsh.addPropertyToCatalogue(jos,name,k,str(v))
+                        bsh.addPropertyToCatalogue(jos,name.encode(),k.encode(),str(v).encode())
                     pass
                 pass
             for ch in comp.getAllChildren():
@@ -724,9 +726,9 @@ class ComponentAccumulator(object):
             pass
 
         #Add tree of algorithm sequences:
-        for seqName, algoList in flatSequencers( self._sequence, algsCollection=self._algorithms ).iteritems():
+        for seqName, algoList in six.iteritems(flatSequencers( self._sequence, algsCollection=self._algorithms )):
             self._msg.debug("Members of %s : %s" % (seqName,str([alg.getFullName() for alg in algoList])))
-            bsh.addPropertyToCatalogue(jos,seqName,"Members",str( [alg.getFullName() for alg in algoList]))
+            bsh.addPropertyToCatalogue(jos,seqName.encode(),b"Members",str( [alg.getFullName() for alg in algoList]).encode())
             for alg in algoList:
                 addCompToJos(alg)
                 pass
diff --git a/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py b/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
index 1b7d5d88910f3431cd06f395756b3e2798d77dd5..778d9a26db647f927e1621ef6a5b8908a7d8ee90 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
@@ -2,6 +2,7 @@
 
 # self test of ComponentAccumulator
 
+from __future__ import print_function
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
 from AthenaConfiguration.Deduplication import DeduplicationFailed
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
@@ -74,11 +75,13 @@ class TestComponentAccumulator( unittest.TestCase ):
         accNA1=AlgsConf4(dummyCfgFlags)
         acc.merge(accNA1[0])
         acc.addEventAlgo(accNA1[1:],"sub2Sequence1" )
-        acc.store(open("testFile.pkl", "w"))
+        outf = open("testFile.pkl", "wb")
+        acc.store(outf)
+        outf.close()
         self.acc = acc
 
 
-    def test_algorihmsAreAdded( self ):
+    def test_algorithmsAreAdded( self ):
         self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo1", 1).name(), "Algo1", "Algorithm not added to a top sequence" )
         self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo2", 1).name(),  "Algo2", "Algorithm not added to a top sequence" )
         self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo3", 1).name(), "Algo3", "Algorithm not added to a top sequence" )
@@ -97,9 +100,9 @@ class TestComponentAccumulator( unittest.TestCase ):
 
     def test_readBackConfiguration( self ):
         import pickle
-        with open( "testFile.pkl" ) as f:
-            s = pickle.load( f )
-            self.assertIsNotNone( s, "The pickle has no content")
+        f = open('testFile.pkl', 'rb')
+        s = pickle.load( f )
+        self.assertIsNotNone( s, "The pickle has no content")
 
     def test_foreach_component( self ):
         from AthenaCommon.Logging import logging
@@ -131,9 +134,11 @@ class TestHLTCF( unittest.TestCase ):
         acc.addSequence( parOR("hltStep_2"), parentName="hltSteps" )
         acc.moveSequence( "L2CaloEgammaSeq", "hltStep_2" )
 
-        acc.store(open("testFile2.pkl", "w"))
+        fout = open("testFile2.pkl", "wb")
+        acc.store(fout)
+        fout.close()
         import pickle
-        f = open("testFile2.pkl")
+        f = open("testFile2.pkl", 'rb')
         s = pickle.load(f)
         f.close()
         self.assertNotEqual( s['hltSteps']['Members'], '[]', "Empty set of members in hltSteps, Sequences recording order metters" )
@@ -170,10 +175,12 @@ class MultipleParentsInSequences( unittest.TestCase ):
         self.assertIs( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), findAlgorithm( accTop.getSequence( "seq2" ), "recoAlg" ), "Algorithms are cloned" )
         self.assertIs( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), recoAlg, "Clone of the original inserted in sequence" )
 
-        accTop.store( open("dummy.pkl", "w") )
+        fout = open("dummy.pkl", "wb")
+        accTop.store( fout )
+        fout.close()
         import pickle
         # check if the recording did not harm the sequences
-        with open("dummy.pkl") as f:
+        with open("dummy.pkl", 'rb') as f:
             s = pickle.load( f )
             self.assertEqual( s['seq1']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq1 " + s['seq1']["Members"])
             self.assertEqual( s['seq2']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq2 " + s['seq2']["Members"])
@@ -357,7 +364,7 @@ class TestDeduplication( unittest.TestCase ):
                                         SomeTools=[dummyTool("tool1",BList=["lt1","lt2"]),],
                                     )
                        )
-    
+
         self.assertEqual(len(result3._services),1) #Verify that we have only one service
 
 
@@ -368,10 +375,10 @@ class TestDeduplication( unittest.TestCase ):
                                         SomeTools=[dummyTool("tool1",BList=["lt1","lt2"]),],
                                     )
                        )
-        
+      
         self.assertEqual(len(result3._services),2)
-        
-        
+      
+      
         #Add the same service again, with a sightly differently configured private tool:
         result3.addService(dummyService(AString="bla",
                                         AList=["l1","l3"],
diff --git a/Control/AthenaConfiguration/python/Deduplication.py b/Control/AthenaConfiguration/python/Deduplication.py
index 5a69d6a57c99c288fd3c26ad1bf38626cd67cd51..318a6f64b664553a2422a90333e0acf99fb0b35e 100644
--- a/Control/AthenaConfiguration/python/Deduplication.py
+++ b/Control/AthenaConfiguration/python/Deduplication.py
@@ -1,5 +1,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+from __future__ import print_function
+
 
 #Functions used by the ComponentAccumulator to de-duplicate componentes defined multiple times
 from GaudiKernel.GaudiHandles import GaudiHandleArray, PublicToolHandle, PublicToolHandleArray, ServiceHandle, ServiceHandleArray, PrivateToolHandle
@@ -7,7 +9,7 @@ from AthenaCommon.Configurable import ConfigurableAlgTool
 import collections
 from AthenaCommon.Logging import logging
 
-from UnifyProperties import unifyProperty 
+from AthenaConfiguration.UnifyProperties import unifyProperty 
 
 _msg=logging.getLogger('ComponentAccumulator') #'Deduplication' would the better name but breaks tons of unit-test log comparison
 
@@ -46,7 +48,7 @@ def deduplicate(newComp,compList):
 
 def deduplicateComponent(newComp,comp):
     #print "Checking ", comp, comp.getType(), comp.getJobOptName()
-    allProps=frozenset(comp.getValuedProperties().keys()+newComp.getValuedProperties().keys())
+    allProps=frozenset(list(comp.getValuedProperties().keys())+list(newComp.getValuedProperties().keys()))
     for prop in allProps:
         if not prop.startswith('_'):
             try:
diff --git a/Control/AthenaConfiguration/python/DetectorConfigFlags.py b/Control/AthenaConfiguration/python/DetectorConfigFlags.py
index 2359b121385fc2d151939597aa2832aa314cb758..5a0fc8decc83ff27c373c632d294fa6a6bc8ed5f 100644
--- a/Control/AthenaConfiguration/python/DetectorConfigFlags.py
+++ b/Control/AthenaConfiguration/python/DetectorConfigFlags.py
@@ -1,5 +1,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+from __future__ import print_function
+
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 
 # This module is based upon Control/AthenaCommon/python/DetFlags.py
@@ -130,4 +132,4 @@ def createDetectorConfigFlags():
                                                              prevFlags.Detector.OverlaysTGC or prevFlags.Detector.OverlayMM))
     dcf.addFlag('Detector.Overlay',      lambda prevFlags : (prevFlags.Detector.OverlayID or prevFlags.Detector.OverlayCalo or
                                                              prevFlags.Detector.OverlayMuon))
-    return dcf
\ No newline at end of file
+    return dcf
diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index e5411a40fed80d42bd276badf6656016c495db7c..609d298997ee3f262f50be88fb677dc16717a948 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaCommon.AlgSequence import AthSequencer
 
diff --git a/Control/AthenaConfiguration/python/PropSetterProxy.py b/Control/AthenaConfiguration/python/PropSetterProxy.py
index 97f3abd993878576a531b99209651ff465ab72ab..b9ada84e8e314d3ed9dfd11afe995794130e994c 100644
--- a/Control/AthenaConfiguration/python/PropSetterProxy.py
+++ b/Control/AthenaConfiguration/python/PropSetterProxy.py
@@ -1,8 +1,10 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+from __future__ import print_function
 from AthenaCommon.Logging import logging
 from AthenaCommon.CFElements import isSequence
 from AthenaCommon.Configurable import ConfigurableAlgTool
 from GaudiKernel.GaudiHandles import PrivateToolHandle, PrivateToolHandleArray
+import six
 
 msg = logging.getLogger('PropSetterProxy')
 
@@ -24,7 +26,7 @@ class PropSetterProxy(object):
 
        
        import fnmatch
-       for component_path, component in PropSetterProxy.__compPaths.iteritems():
+       for component_path, component in six.iteritems(PropSetterProxy.__compPaths):
            if fnmatch.fnmatch( component_path, self.__path ):
                if name in component.getProperties():
                    try:
@@ -36,7 +38,7 @@ class PropSetterProxy(object):
                                     name, str(value), component_path, self.__path, str(ex) )
                        pass
                else:
-                   msg.warning( "No such a property: %s in component %s, tried to set it because it matched %s",
+                   msg.warning( "No such property: %s in component %s, tried to set it because it matched %s",
                                 name, component_path, self.__path )
 
 
@@ -58,7 +60,7 @@ class PropSetterProxy(object):
            def __nestAlg(startpath, comp): # it actually dives inside the algorithms and (sub) tools               
                if comp.getName() == "":
                    return
-               for name, value in comp.getProperties().iteritems():
+               for name, value in six.iteritems(comp.getProperties()):
                    if isinstance( value, ConfigurableAlgTool ) or isinstance( value, PrivateToolHandle ):
                        __add( startpath+"/"+name+"/"+value.getFullName(), value )
                        __nestAlg( startpath+"/"+name+"/"+value.getName(), value )
diff --git a/Control/AthenaConfiguration/python/TestDefaults.py b/Control/AthenaConfiguration/python/TestDefaults.py
index 420e737b651694591dcf0b6873dcd8e4d44b5705..dc9611b3bb3b1fc65282e59ed202f6779ef9c4cd 100644
--- a/Control/AthenaConfiguration/python/TestDefaults.py
+++ b/Control/AthenaConfiguration/python/TestDefaults.py
@@ -1,5 +1,7 @@
 #Files for use in configuration unit tests
 
+from __future__ import print_function
+
 class defaultTestFiles(object):
     import os
     d = os.environ.get ("ATLAS_REFERENCE_DATA",
diff --git a/Control/AthenaConfiguration/python/TestDriveDummies.py b/Control/AthenaConfiguration/python/TestDriveDummies.py
index 2aea3e2650661b57a5ca387dab7a23b88c996c96..e5b5dbc91fdb99d3766bbcac18587eb03fa7084b 100644
--- a/Control/AthenaConfiguration/python/TestDriveDummies.py
+++ b/Control/AthenaConfiguration/python/TestDriveDummies.py
@@ -1,4 +1,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from __future__ import print_function
+
 from GaudiKernel.GaudiHandles import  ServiceHandle, PrivateToolHandleArray,PrivateToolHandle, PublicToolHandleArray, PublicToolHandle
 from AthenaCommon.Configurable import Configurable,ConfigurableService, ConfigurableAlgTool
 
diff --git a/Control/AthenaConfiguration/python/UnifyProperties.py b/Control/AthenaConfiguration/python/UnifyProperties.py
index 3f29f3250ba907791c1918932f96ac0d8eebccc1..3eb008254c05298770491491bf9dadb42dbd80f6 100644
--- a/Control/AthenaConfiguration/python/UnifyProperties.py
+++ b/Control/AthenaConfiguration/python/UnifyProperties.py
@@ -3,6 +3,8 @@
 # A collection of methods to unify/merge list-properties
 # ToDo: Define the merging-method when defining the property
 
+from __future__ import print_function
+
 from AthenaCommon.Logging import logging
 
 log=logging.getLogger('ComponentAccumulator')
diff --git a/Control/AthenaConfiguration/python/testAllConfigFlags.py b/Control/AthenaConfiguration/python/testAllConfigFlags.py
index d89f80a242d74573750c83c8d83ed0eb91126b86..57b91cc1c774c0c1b7b024aebf4bbeaedd73b4e8 100644
--- a/Control/AthenaConfiguration/python/testAllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/testAllConfigFlags.py
@@ -1,20 +1,21 @@
+from __future__ import print_function
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 acf=AthConfigFlags()
-acf.addFlag("flag1",1)
-acf.addFlag("flag2",2)
-acf.addFlag("flag3", lambda prev: prev.get("flag2")*2 )
-acf.addFlag("flag7", lambda prev: prev.get("flag1")+27)
+acf.addFlag("x.flag1",1)
+acf.addFlag("x.flag2",2)
+acf.addFlag("x.flag3", lambda prev: prev.x.flag2*2 )
+acf.addFlag("x.flag7", lambda prev: prev.x.flag1+27)
 
-print(acf.flag1)
-print(acf.flag3)
+print(acf.x.flag1)
+print(acf.x.flag3)
 
 #acf.addFlag("flag4", lambda prev: prev.get("flag5")*2 )
 #acf.addFlag("flag5", lambda prev: prev.get("flag4")*2 )
-#print acf.get("flag4") -> Circular dependency!  
+#print (acf.get("flag4") -> Circular dependency!  )
 
 
 acf.addFlag("domain1.flag1","bla")
-acf.addFlag("domain1.flag2",lambda prev: prev.get("domain1.flag1")*2)
+acf.addFlag("domain1.flag2",lambda prev: prev.domain1.flag1*2)
 acf.addFlag("domain2.flag1","geh")
 acf.addFlag("domain2.flag2","xyz")
 #acf.addFlag("domain2.flagxxx","will fail")
diff --git a/Control/AthenaConfiguration/python/testAllConfigFlags_EVNT.py b/Control/AthenaConfiguration/python/testAllConfigFlags_EVNT.py
index 7b3ed9855904136de845a0fa8004732986f289bf..00fbbe0d7dd525a72cefa71b027630772dfc5f4d 100755
--- a/Control/AthenaConfiguration/python/testAllConfigFlags_EVNT.py
+++ b/Control/AthenaConfiguration/python/testAllConfigFlags_EVNT.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+from __future__ import print_function
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 ConfigFlags.Input.Files = defaultTestFiles.EVNT
diff --git a/Control/AthenaConfiguration/python/testAllConfigFlags_HITS.py b/Control/AthenaConfiguration/python/testAllConfigFlags_HITS.py
index 02766886a1a4bc29a896821b0b8ff3528005d191..92842b3dcbec852a42da14730defc7e15236b609 100755
--- a/Control/AthenaConfiguration/python/testAllConfigFlags_HITS.py
+++ b/Control/AthenaConfiguration/python/testAllConfigFlags_HITS.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+from __future__ import print_function
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 ConfigFlags.Input.Files = defaultTestFiles.HITS
diff --git a/Control/AthenaConfiguration/python/testAllConfigFlags_RDO.py b/Control/AthenaConfiguration/python/testAllConfigFlags_RDO.py
index 8fb0a432b35a348896cd14675435a0aff5704fdb..9401e4d52ff09dadc01caad86cc9723dba28c596 100755
--- a/Control/AthenaConfiguration/python/testAllConfigFlags_RDO.py
+++ b/Control/AthenaConfiguration/python/testAllConfigFlags_RDO.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+from __future__ import print_function
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 ConfigFlags.Input.Files = defaultTestFiles.RDO
diff --git a/Control/AthenaConfiguration/python/testEmpty.py b/Control/AthenaConfiguration/python/testEmpty.py
index 2e509f78ce34aa56bd64048aa79be54d88afe571..ee1333a692298a80d98c6a1937cea4f38a904225 100644
--- a/Control/AthenaConfiguration/python/testEmpty.py
+++ b/Control/AthenaConfiguration/python/testEmpty.py
@@ -1,4 +1,5 @@
 #Generate CA pickle files from athena and CA
+from __future__ import print_function
 from AthenaCommon.Configurable import Configurable
 Configurable.configurableRun3Behavior=1
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py
index f0d0a5e5c3733007eba2d017a1a20558eb425deb..e2fbb1c9909d307bf14a5237a5026d9b986d2038 100755
--- a/Control/AthenaConfiguration/share/confTool.py
+++ b/Control/AthenaConfiguration/share/confTool.py
@@ -1,8 +1,10 @@
 #!/usr/bin/env python
 
 #
-#  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
+
+from __future__ import print_function
 import pickle
 import pprint
 import json
@@ -23,14 +25,14 @@ args = parser.parse_args()
 def __loadSingleFile( fname ):    
     conf = []
     if fname.endswith( ".pkl" ):
-        input_file = file( fname )
+        input_file = open( fname, 'rb' )
         conf = []
         while True:
             try:
                 conf.append( pickle.load( input_file ) )
             except EOFError:
                 break
-        print "... Read", len(conf), "items from python pickle file: ", fname
+        print ("... Read", len(conf), "items from python pickle file: ", fname)
 
     if fname.endswith( ".json" ):
 
@@ -44,20 +46,20 @@ def __loadSingleFile( fname ):
             return element
 
         conf = json.load( file( args.file[0] ), object_hook=__keepPlainStrings )
-        print "... Read", len(conf), "items from JSON file: ", fname
+        print ("... Read", len(conf), "items from JSON file: ", fname)
     return conf
 
 def __print( fname ):
     conf = __loadSingleFile( fname )
-    print "... ", fname, "content"
+    print ("... ", fname, "content")
     for n,c in enumerate(conf):
-        print "Item", n, "*"*80
+        print ("Item", n, "*"*80)
         pprint.pprint(dict(c))
-    print "... EOF", fname
+    print ("... EOF", fname)
 
 def __printComps( fname ):
     conf = __loadSingleFile( fname )
-    print "... ", fname, "content"
+    print ("... ", fname, "content")
     def __printdict( d ):
         for name, k in dict( d ).iteritems():
             if name in "Histograms":
@@ -68,20 +70,20 @@ def __printComps( fname ):
             elif isinstance(k, str) and '/' in k:
                 if not '[' in k: # not an array
                     if  k.count('/')  == 1:
-                        print k
+                        print (k)
                 else: # handle arrays
                     actualType = ast.literal_eval(k)
                     if isinstance( actualType, list ):
                         for el in actualType:
                             if el.count('/')  == 1 : # ==1 eliminates COOL folders
-                                print el
+                                print (el)
 
     for n,c in enumerate(conf):
         __printdict( c )
             
 
 
-    print "... EOF", fname
+    print ("... EOF", fname)
 
 
 def __diff():
@@ -92,13 +94,13 @@ def __diff():
 
     confs = [ __merge( __loadSingleFile( f )) for f in args.file ] 
     
-    allkeys = set( confs[0].keys() + confs[1].keys())
+    allkeys = set( list(confs[0].keys()) + list(confs[1].keys()))
 
     for comp in allkeys:
         if comp not in confs[0]:
-            print "... component %-54s" % comp, "absent in", args.file[0]
+            print ("... component %-54s" % comp, "absent in", args.file[0])
         elif comp not in confs[1]:
-            print "... component %-54s" % comp, "absent in", args.file[1]
+            print ("... component %-54s" % comp, "absent in", args.file[1])
         elif confs[0][comp] != confs[1][comp]:
             same = False
             if comp == "JobOptionsSvc":
@@ -109,13 +111,13 @@ def __diff():
                     if confs[0][comp][conf] != confs[1][comp][conf]:
                         break
             if not same:
-                print "... component %-54s" % comp, "present in both files but with different settings"
-                print "... in file: ", args.file[0]
+                print ("... component %-54s" % comp, "present in both files but with different settings")
+                print ("... in file: ", args.file[0])
                 pprint.pprint( confs[0][comp])
-                print "... in file: ", args.file[1]
+                print ("... in file: ", args.file[1])
                 pprint.pprint( confs[1][comp])
         else:
-            print "... component %-54s" % comp, "identical"
+            print ("... component %-54s" % comp, "identical")
 
 
 if args.prComps:
@@ -129,7 +131,7 @@ if args.pr:
 
 if args.toJSON:
     if len( args.file ) != 1:
-        print "ERROR, can convert single file at a time, got: ", args.file
+        print ("ERROR, can convert single file at a time, got: ", args.file)
         sys.exit( -1 )
     conf = __loadSingleFile( args.file[0] )
     oFile = open( args.toJSON, "w" )
@@ -139,6 +141,6 @@ if args.toJSON:
 
 if args.diff:
     if len( args.file ) != 2:
-        print "ERROR, can only diff two files at a time, got: ", args.file
+        print ("ERROR, can only diff two files at a time, got: ", args.file)
         sys.exit( -1 )
     __diff()
diff --git a/Control/AthenaExamples/AthExJobOptions/CMakeLists.txt b/Control/AthenaExamples/AthExJobOptions/CMakeLists.txt
index 5a363fe594650852975bfb73d0f877be5b348737..3df4a94557f343f8c0d5d948cd85eb504fc76284 100644
--- a/Control/AthenaExamples/AthExJobOptions/CMakeLists.txt
+++ b/Control/AthenaExamples/AthExJobOptions/CMakeLists.txt
@@ -36,7 +36,7 @@ function (athexjoboptions_run_test testName)
   atlas_add_test( ${testName}
                   SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/athexjoboptions_${testName}.sh
                   EXTRA_PATTERNS "AutoRetrieveTools"
-                  PROPERTIES TIMEOUT 300
+                  PROPERTIES TIMEOUT 600
                    )
   if( ARG_DEPENDS )
     set_tests_properties( AthExJobOptions_${testName}_ctest
diff --git a/Control/AthenaMonitoring/src/AthMonitorAlgorithm.cxx b/Control/AthenaMonitoring/src/AthMonitorAlgorithm.cxx
index e09d63f66ec4c68e7ec34fd805e56760e3252e6e..b5a56da433be27d6b037dae1a5a3267e9bfc11ee 100644
--- a/Control/AthenaMonitoring/src/AthMonitorAlgorithm.cxx
+++ b/Control/AthenaMonitoring/src/AthMonitorAlgorithm.cxx
@@ -167,16 +167,20 @@ AthMonitorAlgorithm::DataType_t AthMonitorAlgorithm::dataTypeStringToEnum( const
 
 ToolHandle<GenericMonitoringTool> AthMonitorAlgorithm::getGroup( const std::string& name ) const {
     // get the pointer to the tool, and check that it exists
-    const ToolHandle<GenericMonitoringTool> toolHandle = *(m_tools[name]);
+    const ToolHandle<GenericMonitoringTool>* toolPtr = m_tools[name];
+    if ( !toolPtr ) {
+        ATH_MSG_FATAL("The tool "<<name<<" could not be found in the monitoring algorithm's tool array. \n"<<
+            "This probably reflects a difference between your python configuration and c++ filling code."<<endmsg);
+    }
+    const ToolHandle<GenericMonitoringTool> toolHandle = *toolPtr;
     if ( toolHandle.empty() ) {
-        ATH_MSG_FATAL("The tool "<<name<<" could not be found in the monitoring algorithm's tool array."<<endmsg);
+        ATH_MSG_FATAL("The tool "<<name<<" could not be found because of an empty tool handle."<<endmsg);
     }
     // return the tool handle
     return toolHandle;
 }
 
 
-
 const ToolHandle<Trig::ITrigDecisionTool>& AthMonitorAlgorithm::getTrigDecisionTool() {
     return m_trigDecTool;
 }
diff --git a/Control/AthenaServices/src/AthDictLoaderSvc.cxx b/Control/AthenaServices/src/AthDictLoaderSvc.cxx
index 3ece5237f8b08679cb4804a7e42d16db75afd068..88f3fb83f150055360b1ddaeb7986935d68cc7ef 100644
--- a/Control/AthenaServices/src/AthDictLoaderSvc.cxx
+++ b/Control/AthenaServices/src/AthDictLoaderSvc.cxx
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // AthDictLoaderSvc.cxx 
@@ -17,7 +17,7 @@
 // FrameWork includes
 #include "GaudiKernel/Property.h"
 #include "GaudiKernel/System.h"
-#include "SGTools/BaseInfo.h"
+#include "AthenaKernel/BaseInfo.h"
 
 
 /////////////////////////////////////////////////////////////////// 
diff --git a/Control/AthenaServices/src/AthenaEventLoopMgr.cxx b/Control/AthenaServices/src/AthenaEventLoopMgr.cxx
index 7f1413536877d84eb076c1ec661aaa95e114c509..71251bb604b8eb0b4fffcee904d419be7278cae6 100644
--- a/Control/AthenaServices/src/AthenaEventLoopMgr.cxx
+++ b/Control/AthenaServices/src/AthenaEventLoopMgr.cxx
@@ -49,7 +49,6 @@
 #include "AthenaEventLoopMgr.h"
 #include "PersistentDataModel/AthenaAttributeList.h"
 
-#include "CxxUtils/make_unique.h"
 
 //=========================================================================
 // Standard Constructor
@@ -667,7 +666,7 @@ StatusCode AthenaEventLoopMgr::executeEvent(void* /*par*/)
             }
         }
     
-        pEventPtr = CxxUtils::make_unique<EventInfo>
+        pEventPtr = std::make_unique<EventInfo>
           (new EventID(runNumber, eventNumber, eventTime, eventTimeNS, lumiBlock, bunchId), (EventType*)nullptr);
         pEvent = pEventPtr.get();
 
@@ -705,7 +704,7 @@ StatusCode AthenaEventLoopMgr::executeEvent(void* /*par*/)
 	  return StatusCode::FAILURE;
 	}
 	// Record the old-style object for those clients that still need it
-	pEventPtr = CxxUtils::make_unique<EventInfo>(new EventID(eventIDFromxAOD(xAODEvent)), new EventType(eventTypeFromxAOD(xAODEvent)));
+	pEventPtr = std::make_unique<EventInfo>(new EventID(eventIDFromxAOD(xAODEvent)), new EventType(eventTypeFromxAOD(xAODEvent)));
 	pEvent = pEventPtr.get();
 	eventID=*(pEvent->event_ID());
 	StatusCode sc = eventStore()->record(std::move(pEventPtr),"");
@@ -719,7 +718,7 @@ StatusCode AthenaEventLoopMgr::executeEvent(void* /*par*/)
   else 
   {
     // With no iterator it's up to us to create an EventInfo
-    pEventPtr = CxxUtils::make_unique<EventInfo>
+    pEventPtr = std::make_unique<EventInfo>
       (new EventID(1,m_nevt), new EventType());
     pEvent = pEventPtr.get();
     pEventPtr->event_ID()->set_lumi_block( m_nevt );
diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx
index f0667db1e094ce76dba91a1d9028c8842f0588ac..8aaeca7807862086426f0e91591f87fb24c4309a 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.cxx
+++ b/Control/AthenaServices/src/AthenaOutputStream.cxx
@@ -20,14 +20,13 @@
 #include "AthenaKernel/IAthenaOutputTool.h"
 #include "AthenaKernel/IAthenaOutputStreamTool.h"
 #include "AthenaKernel/IItemListSvc.h"
-#include "CxxUtils/make_unique.h"
 
 #include "StoreGate/StoreGateSvc.h"
 #include "SGTools/DataProxy.h"
 #include "SGTools/TransientAddress.h"
 #include "SGTools/ProxyMap.h"
 #include "SGTools/SGIFolder.h"
-#include "SGTools/CLIDRegistry.h"
+#include "AthenaKernel/CLIDRegistry.h"
 
 #include "AthContainersInterfaces/IAuxStore.h"
 #include "AthContainersInterfaces/IAuxStoreIO.h"
@@ -661,7 +660,7 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item)
                      ptr = dbb->object();
                    }
                    auto altbucket =
-                     CxxUtils::make_unique<AltDataBucket>
+                     std::make_unique<AltDataBucket>
                        (ptr, item.id(),
                         *CLIDRegistry::CLIDToTypeinfo (item.id()),
                         *itemProxy);
diff --git a/Control/AthenaServices/src/AthenaOutputStreamTool.h b/Control/AthenaServices/src/AthenaOutputStreamTool.h
index ecccb549704e204a1ba60190982ee7583bc054ec..4206e8eb45e7417cb12c56dd374e51463478add6 100644
--- a/Control/AthenaServices/src/AthenaOutputStreamTool.h
+++ b/Control/AthenaServices/src/AthenaOutputStreamTool.h
@@ -70,7 +70,7 @@ public:
 
    /// Stream out a vector of objects
    ///   Must convert to DataObject, e.g.
-   ///   #include "SGTools/StorableConversions.h"
+   ///   #include "AthenaKernel/StorableConversions.h"
    ///     T* obj = xxx;
    ///     DataObject* dataObject = SG::asStorable(obj);
    typedef std::vector<DataObject*> DataObjectVec;
diff --git a/Control/AthenaServices/src/MixingEventSelector.cxx b/Control/AthenaServices/src/MixingEventSelector.cxx
index bb8871af28b69d6ea00a9906d6316fac07a6a7d8..e009192398c2b9b0ac49865332899014fd1004ef 100644
--- a/Control/AthenaServices/src/MixingEventSelector.cxx
+++ b/Control/AthenaServices/src/MixingEventSelector.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MixingEventSelector.h"
@@ -9,8 +9,8 @@
 #include "EventInfo/EventID.h"
 #include "EventInfo/EventType.h"
 #include "EventInfo/TriggerInfo.h"
-#include "SGTools/ClassID_traits.h"
-#include "SGTools/StorableConversions.h"
+#include "AthenaKernel/ClassID_traits.h"
+#include "AthenaKernel/StorableConversions.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "SGTools/DataProxy.h"
 #include "AthenaKernel/getMessageSvc.h"
diff --git a/Control/AthenaServices/test/AthenaEventLoopMgr_test.cxx b/Control/AthenaServices/test/AthenaEventLoopMgr_test.cxx
index a74e9d2d3866b39d2ca46889797aaa9374d2a164..c212f922819a213977fa74707e05f506da08c4a8 100644
--- a/Control/AthenaServices/test/AthenaEventLoopMgr_test.cxx
+++ b/Control/AthenaServices/test/AthenaEventLoopMgr_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -20,11 +20,10 @@
 #include "AthenaKernel/errorcheck.h"
 #include "EventInfo/EventInfo.h"
 #include "EventInfo/EventID.h"
-#include "SGTools/ClassID_traits.h"
+#include "AthenaKernel/ClassID_traits.h"
 #include "AthenaKernel/ICollectionSize.h"
 #include "AthenaKernel/IEventSeek.h"
 #include "AthenaKernel/IEvtSelectorSeek.h"
-#include "CxxUtils/make_unique.h"
 #include "GaudiKernel/ISvcLocator.h"
 #include "GaudiKernel/Service.h"
 #include "GaudiKernel/IEvtSelector.h"
@@ -158,7 +157,7 @@ public:
 
 TestContext::TestContext()
   : m_object(&m_ei),
-    m_addr (CxxUtils::make_unique<TestAddress> (&m_object)),
+    m_addr (std::make_unique<TestAddress> (&m_object)),
     m_event_num (0)
 {
   m_object.addRef();
diff --git a/Control/AthenaServices/test/FooBar.h b/Control/AthenaServices/test/FooBar.h
index fe5d0863bf851f4cb6ae58ba8f5e326ba1500726..06d388e1f492b4006ed2892e9482f54c5fd9cc91 100644
--- a/Control/AthenaServices/test/FooBar.h
+++ b/Control/AthenaServices/test/FooBar.h
@@ -1,11 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TEST_FOOBAR_H
 # define TEST_FOOBAR_H
 
-#include "SGTools/CLASS_DEF.h"
+#include "AthenaKernel/CLASS_DEF.h"
 class Foo{
 private:
   double m_a;
diff --git a/Control/CxxUtils/CxxUtils/CachedUniquePtr.h b/Control/CxxUtils/CxxUtils/CachedUniquePtr.h
index 0c83de06ac5c01972454cff0aa88d5fc34e2244e..563a9e0b9b931cc92ddd8f92952a2ac76c6361bf 100644
--- a/Control/CxxUtils/CxxUtils/CachedUniquePtr.h
+++ b/Control/CxxUtils/CxxUtils/CachedUniquePtr.h
@@ -74,7 +74,8 @@ public:
 
 
   /// Atomically set the element.  If already set, then @c elt is discarded.
-  void set (std::unique_ptr<T> elt) const;
+  /// Returns the final value of the element.
+  T* set (std::unique_ptr<T> elt) const;
 
 
   /// Store a new value to the element.
diff --git a/Control/CxxUtils/CxxUtils/CachedUniquePtr.icc b/Control/CxxUtils/CxxUtils/CachedUniquePtr.icc
index f86b4c6293c802935d8669567d1570e4094c0174..2cd51041935aff088aaeaab7855b29a1e8b308d7 100644
--- a/Control/CxxUtils/CxxUtils/CachedUniquePtr.icc
+++ b/Control/CxxUtils/CxxUtils/CachedUniquePtr.icc
@@ -80,18 +80,21 @@ CachedUniquePtrT<T>::~CachedUniquePtrT()
  * If the current value of the element is null, then set it to @c elt.
  * Otherwise, delete @c elt.
  * This is done atomically.
+ * Returns the final value of the element.
  */
 template <class T>
 inline
-void CachedUniquePtrT<T>::set (std::unique_ptr<T> elt) const
+T* CachedUniquePtrT<T>::set (std::unique_ptr<T> elt) const
 {
   // Set the element to ELT if it is currently null.
   T* ptr = elt.release();
-  T* null = nullptr;
-  if (!m_ptr.compare_exchange_strong (null, ptr)) {
+  T* expected = nullptr;
+  if (!m_ptr.compare_exchange_strong (expected, ptr)) {
     // Was already set.  Delete the new value.
     delete ptr;
+    ptr = expected;
   }
+  return ptr;
 }
 
 
diff --git a/Control/CxxUtils/test/CachedUniquePtr_test.cxx b/Control/CxxUtils/test/CachedUniquePtr_test.cxx
index c396fa094f5a75c377ecd8bc2f10adcca50c81e7..e8e3801e79750bf45ab3984ba8b7486b20303bca 100644
--- a/Control/CxxUtils/test/CachedUniquePtr_test.cxx
+++ b/Control/CxxUtils/test/CachedUniquePtr_test.cxx
@@ -72,11 +72,14 @@ void test1()
   }
   assert (P::s_count == 0);
 
-  cp1.set (std::make_unique<P>(3));
+  const P* pp = nullptr;
+  pp = cp1.set (std::make_unique<P>(3));
+  assert (pp->m_x == 3);
   assert (cp1->m_x == 3);
   assert (P::s_count == 1);
 
-  cp1.set (std::make_unique<P>(4));
+  pp = cp1.set (std::make_unique<P>(4));
+  assert (pp->m_x == 3);
   assert (cp1->m_x == 3);
   assert (P::s_count == 1);
 
@@ -122,7 +125,7 @@ void ThreadingTest::writerThread::operator()()
 {
   int i = m_iworker;
   do {
-    m_test.m_vals[i].set (std::make_unique<const P>(i));
+    (void)m_test.m_vals[i].set (std::make_unique<const P>(i));
     i++;
     if (i >= NVAL) i = 0;
   } while (i != m_iworker);
diff --git a/Control/HeapMon/CMakeLists.txt b/Control/HeapMon/CMakeLists.txt
deleted file mode 100644
index 987e11ea18bcf3095285e61fc0d03c23829a77ad..0000000000000000000000000000000000000000
--- a/Control/HeapMon/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-################################################################################
-# Package: HeapMon
-################################################################################
-
-# Declare the package name:
-atlas_subdir( HeapMon )
-
-# External dependencies:
-find_package( PythonLibs )
-find_package( ROOT COMPONENTS RIO Tree Core MathCore Hist pthread )
-find_package( gperftools )
-
-# Component(s) in the package:
-atlas_add_executable( MemoryScanner
-                      src/MemoryScanner.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${GPERFTOOLS_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${PYTHON_LIBRARIES} ${GPERFTOOLS_LIBRARIES} )
-
-# Install files from the package:
-atlas_install_headers( HeapMon )
-atlas_install_python_modules( python/*.py )
-
diff --git a/Control/HeapMon/HeapMon/HeapMon.h b/Control/HeapMon/HeapMon/HeapMon.h
deleted file mode 100644
index 0687a82a800024b26bc6407a03b4423a69778837..0000000000000000000000000000000000000000
--- a/Control/HeapMon/HeapMon/HeapMon.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef HEAPMON_HEAPMON_H
-#define HEAPMON_HEAPMON_H
-
-#if defined(__linux__)
-
-#define _GNU_SOURCE 1
-
-#include <stdio.h>
-
-#ifdef _POSIX_C_SOURCE
-#undef _POSIX_C_SOURCE
-#endif
-
-#ifdef _FILE_OFFSET_BITS
-#undef _FILE_OFFSET_BITS
-#endif
-
-#endif
-
-#include "Python.h"
-
-/* control parameters for static data blocks */
-
-/* maximum available number of check points */
-#define mm_MAX_CHECKPOINTS          10
-
-/* start size of hash tables for data */
-#define mm_HASHTABLE_MINSIZE      4096
-
-/* maximum total depth of tracebacks kept in memory */
-#define mm_TRACEDEPTH       12
-/* system offset: 0 == helper, 1 == hook, 2 == malloc/realloc */
-#define mm_SYSTEMOFF         3
-/* total backtrace size left: mm_TRACEDEPTH - mm_SYSTEMOFF */
-#define mm_BACKTRACE_SIZE   mm_TRACEDEPTH - mm_SYSTEMOFF
-
-/* max size for symbols, files, and other buffers */
-#define mm_SYMBOL_BUFLEN          2048
-
-#endif /* !HEAPMON_HEAPMON_H */
diff --git a/Control/HeapMon/python/EventNotifier.py b/Control/HeapMon/python/EventNotifier.py
deleted file mode 100644
index 53efc4fa3491bb64b432c4bbcd798157492989f4..0000000000000000000000000000000000000000
--- a/Control/HeapMon/python/EventNotifier.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import AthenaPython.PyAthena as PyAthena
-import sys, os
-
-from ROOT import TTree, TFile
-from array import array
-
-
-#from HeapMon import MemoryScanner as memscanner
-#from HeapMon import MemoryMarker as memmarker
-#from Hephaestus import MemoryTracker as memtracker
-
-
-class EventExecutionNotifier( PyAthena.Alg ):
-    event_number = 0
-    max_events = 0
-    stop_scan  = 1
-    start_scan = 0
-    report_scan_number = 0
-    file_name = "heapmon.freed.root"
-    marker = 0xCD
-    
-    memmarker = 'HeapMon.MemoryMarker' in sys.modules and sys.modules[ 'HeapMon.MemoryMarker' ] or None 
-    memscanner = 'HeapMon.MemoryScanner' in sys.modules and sys.modules[ 'HeapMon.MemoryScanner' ] or None
-    memtracker = 'Hephaestus.MemoryTracker' in sys.modules and sys.modules[ 'Hephaestus.MemoryTracker' ] or None
-
-    #memtracker = 'Hephaestus.MemoryTracker' in sys.modules and \
-    #   sys.modules['Hephaestus.MemoryTracker' ] or None
-    
-    def __init__(self, name="EventExecutionNotifier"):
-        ## init the base class
-        super(EventExecutionNotifier,self).__init__()        
-        return
-
-    def initialize( self ):        
-    # INITIALIZATION MARKING    
-        print 'Notifier.initialize():'
-        #memmarker = 'HeapMon.MemoryMarker' in sys.modules and \
-        #sys.modules[ 'HeapMon.MemoryMarker' ] or None        
-        #if memmarker:
-        #    memmarker.start()        
-        
-        self.event_number = 0
-        
-        print "    file_name = ", self.file_name
-        print "    self.max_events = ", self.max_events    
-        print "    report_scan_number = ", self.report_scan_number 
-        if self.memtracker:
-            print('    starting memtracker - MemoryTracker ')
-            self.memtracker.start()
-        else:
-            print('    memtracker - MemoryTracker not loaded!')
-
-        if self.memscanner:
-            #print'    memscanner.memscan()'
-            self.memscanner.memscan(self.file_name, 2, self.event_number, self.marker); #SCAN_FLAG = 2: no holes statistics saved, just info
-        else:
-            print('    memscanner is not loaded!')   
-            
-    # Extract MallocInfo and put into root file    
-        self.mallinfo()
-        return PyAthena.StatusCode.Success
-    
-    def execute( self ):
-        print "Notifier.execute()"        
-        self.event_number +=1 
-        print "Notifier.event_number = ", self.event_number
-        
-        if self.memscanner:
-            print '    memscanner.memscan()'                
-            if   (self.start_scan == 0):
-                    self.memscanner.memscan(self.file_name, 2, self.event_number, self.marker); #SCAN_FLAG = 1:  holes statistics saved
-            elif (self.start_scan == -1):
-                    self.memscanner.memscan(self.file_name, 1, self.event_number, self.marker); #SCAN_FLAG = 2: no holes statistics saved, just info
-            elif ((self.event_number >= self.start_scan) 
-                    and (self.event_number <= self.stop_scan)):
-                       self.memscanner.memscan(self.file_name, 1, self.event_number, self.marker); #SCAN_FLAG = 2: no holes statistics saved, just info
-            else:
-                    self.memscanner.memscan(self.file_name, 2, self.event_number, self.marker); #SCAN_FLAG = 1:  holes statistics saved
-        else:
-            print('    memscanner is not loaded!')
-        
-        
-        self.mallinfo()
-        
-        if self.memtracker:
-            if self.event_number <= self.stop_scan:
-                print ('MemoryTracker is marking the memory')
-            else:
-                print("MemoryTracker configure() to stop the marking");
-                print ("MemoryTracker.gFlags = ",
-                    self.memtracker.configure(
-                        self.memtracker.LEAK_CHECK | 
-                        self.memtracker.QUICK )#| MemoryTracker.FILTER_STL)
-                    )
-        elif self.memmarker:
-            if (self.start_scan == 0):
-                print('EventNotifier.execute(): marker idling')      
-            elif self.event_number <= self.stop_scan:
-                    print 'EventNotifier.execute(): memmarker.start(), event_number=', self.event_number
-                    self.memmarker.start() 
-            else:
-                print('Notifier.execute(): MemoryMarker.stop() , event_number=', self.event_number)
-                self.memmarker.stop()
-        else:
-            print('Notifier.execute(): memmarker and memtracker are not loaded!')
-
-        return PyAthena.StatusCode.Success
-        
-    def finalize( self ):
-        self.msg.info( 'finalizing [%s]', self.name() )
-        if self.memmarker:
-            self.memmarker.stop()
-        if self.memtracker:
-            self.memtracker.stop()
-        if self.memscanner:
-            from HeapMon import HeapMonReport as memreport
-            memreport.report()
-        return PyAthena.StatusCode.Success
-
-
-    def mallinfo(self):   
-        if self.memmarker:
-            print('Notifier.mallinfo(): malloc info') 
-            (malloc_sbrk, malloc_mmap, malloc_inuse, malloc_free) = self.memmarker.get_malloc_info()
-            sbrk =  array('I', [0]); sbrk[0] = malloc_sbrk;
-            mmap =  array('I', [0]); mmap[0] = malloc_mmap;
-            inuse = array('I', [0]); inuse[0] = malloc_inuse;
-            free =  array('I', [0]); free[0] = malloc_free;
-            print 'sbrk=', sbrk, ' mmap=', mmap, ' inuse=', inuse, 'free', free
-            scan_number = array('L', [0]); scan_number[0] = self.event_number;
-            memFile = TFile(self.file_name, "update")
-            mallocTree = memFile.Get("mallocTree");
-            mallocTree.SetBranchAddress("malloc_sbrk", sbrk);
-            mallocTree.SetBranchAddress("malloc_mmap", mmap);
-            mallocTree.SetBranchAddress("malloc_inuse",inuse);
-            mallocTree.SetBranchAddress("malloc_free", free);
-            mallocTree.SetBranchAddress("scan_number", scan_number);
-            mallocTree.Fill()
-            mallocTree.Write()
-            mallocTree.Delete
-            memFile.Write()
-            memFile.Close()
-            self.memmarker.show_info()
-        else:
-            print('Notifier.mallinfo(): memmarker is not loaded!')
diff --git a/Control/HeapMon/python/HeapMonReport.py b/Control/HeapMon/python/HeapMonReport.py
deleted file mode 100644
index af1af67d2a50ec6a65ec8cdb24eb1354397f0bc5..0000000000000000000000000000000000000000
--- a/Control/HeapMon/python/HeapMonReport.py
+++ /dev/null
@@ -1,309 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import AthenaPython.PyAthena as PyAthena
-import sys, os
-import math, time   , array
-
-from ROOT import gROOT, gDirectory, gStyle, gPad
-from ROOT import TFile
-from ROOT import TH1I, TH2I, TF1
-from ROOT import TH1F, TH2F, TGraph, TMultiGraph
-from ROOT import TCanvas, TPad, TPaveLabel, TPaveText, TLegend
-
-#from ROOT import TCanvas # available at startup
-root_file = 'mems.root'  
-freed_file = 'heapmon.freed.root'
-
-hole_trace_start = 0
-
-def iReport(file):
-    global root_file
-    root_file = file
-    report()
-
-def pReport():
-    global root_file    
-    memscanner = 'HeapMon.MemoryScanner' in sys.modules and \
-    sys.modules[ 'HeapMon.MemoryScanner' ] or None    
-    if memscanner:
-        holes_file = memscanner.freescan_output
-    #root_file = file
-    report()
-
-def findStaticHoles():
-    global freed_file
-    global hole_trace_start     
-    tfile = TFile(freed_file, "READ")
-    
-    #mychain = gDirectory.Get( 'memTree' )    
-    tree = tfile.Get("holeTree")
-    entry_number = tree.GetEntries()
-    print("There are ", entry_number , " entries in ", root_file)
-    previous_scan_number = -1;
-    
-    holes_dict = dict()
-    previous_holes_dict = dict()
-
-    for i in xrange(entry_number):
-        tree.GetEntry(i)
-        if tree.scan_number < hole_trace_start:
-            continue
-        if previous_scan_number == tree.scan_number:
-            #print "add new hole ", tree.hole_start, "size ", tree.hole_size
-            holes_dict[tree.hole_start] = tree.hole_size;
-        else:
-            previous_scan_number = tree.scan_number
-            if previous_holes_dict:
-                print "looking for intersection with next scan dict"
-                intersection = dict([(item,holes_dict[item]) for item in holes_dict.keys() if previous_holes_dict.has_key(item)])
-                previous_holes_dict = intersection
-                print len(intersection), " elements in intersection"
-                #print "intersection=", intersection
-            else:
-                previous_holes_dict = holes_dict                
-            
-            holes_dict.clear()
-    
-    intersection = dict([(item,holes_dict[item]) for item in holes_dict.keys() if previous_holes_dict.has_key(item)])
-    
-    print "intersection=", intersection
-    print len(intersection), " static holes identified"
-    
-    import cPickle
-    pickle_file = "mems.dat"
-    file = open(pickle_file, 'w')
-    cPickle.dump(intersection, file)
-    file.close()    
-    del file
-    
-
-def report():
-    global freed_file
-    print'    HeapMonReport.report(): heapmon_file=', freed_file
-    
-    #findStaticHoles()
-          
-    tfile = TFile(freed_file, "READ")
-    print "   root compression factor = ", tfile.GetCompressionFactor()
-   
-    mem_canvas = TCanvas("HeapMon_report", "Memory Holes Statistics", 10, 10, 800, 1034);
-    mem_canvas.SetFillColor(17);
-    mem_canvas.cd()
-    
-    pad1 = TPad("pad1","pad1",0.01,0.57,0.50,0.93,33);
-    pad2 = TPad("pad2","pad2",0.51,0.57,0.99,0.93,33);
-    pad3 = TPad("pad3","pad3",0.01,0.01,0.99,0.50,33);
-    pad3.SetPhi(210);
-    pad3.SetTheta(25);
-
-    pad1.Draw(); pad2.Draw(); pad3.Draw();
-    memTree = tfile.Get("holeTree")
-    infoTree = tfile.Get("infoTree")
-    mallocTree = tfile.Get("mallocTree")
-    #holesm_th1i =   TH1I('holesm_th1i', 'Holes size evolution', fcount, 0, fcount)    
-    #holesn_th1i =   TH1I('holesn_th1i', 'Holes number evolution', fcount, 0, fcount)  
-    #total_th1i  =   TH1I('total_th1i', 'Total memory size evolution', fcount, 0, fcount)
-    
-    max_hole_size = memTree.GetMaximum("hole_size")
-    print "    max_hole_size=", max_hole_size, "    min_hole_size", memTree.GetMinimum("hole_size")
-    max_scan_number = memTree.GetMaximum("scan_number")
-    print "     max_scan_number=", max_scan_number
-    
-    memHist1  = TH2I("mem2d","Hole-sizes distribution evolution", 128, -0.5, max_hole_size - 0.5, 50, 0, max_scan_number) 
-    memTree.Project("mem2d", "scan_number:hole_size"); 
-    
-    multiGraph1 = TMultiGraph();
-    multiGraph2 = TMultiGraph();
-
-    print " memHist.GetMaximum() = ",    memHist1.GetMaximum();
-    
-    # Working on a Report
-    gStyle.SetOptStat(0);
-    gStyle.SetPalette(1);
-    gStyle.SetCanvasColor(33);
-    gStyle.SetFrameFillColor(18);
-    
-    memHist1.SetFillColor(30);
-    memHist1.SetFillStyle(0);
-    memHist1.GetXaxis().SetTitle("Size of holes, kb");
-    memHist1.GetXaxis().SetLabelOffset(0.02);
-    memHist1.GetXaxis().SetLabelSize(0.02);
-    memHist1.GetXaxis().SetTitleSize(0.04);
-    memHist1.GetXaxis().SetTitleColor(2);
-    memHist1.GetYaxis().SetTitle("Event number");
-    memHist1.GetYaxis().SetLabelSize(0.04);
-    memHist1.GetXaxis().SetLabelOffset(0.04);
-    memHist1.GetYaxis().SetTitleSize(0.04);
-    memHist1.GetYaxis().SetTitleColor(2);
-    memHist1.GetZaxis().SetTitle("Number of holes");
-    memHist1.GetZaxis().SetLabelSize(0.02);
-    memHist1.GetZaxis().SetTitleSize(0.04);
-    memHist1.GetZaxis().SetTitleColor(2);
-    
-    title = TPaveLabel(0.1,0.95,0.9,0.99, "Job Memory Usage Plots");
-    title.SetFillColor(42);
-    title.SetTextFont(42);
-    title.Draw();
-    
-    text_box = TPaveText(0.1,0.51,0.9,0.54);
-    text_box.AddText("Malloc freed ('marked') Heap Memory Profile");
-    text_box.SetFillColor(42);
-    text_box.SetTextAlign(12);
-    text_box.SetTextFont(42);
-    text_box.Draw();
-    
-    x1=0.2; y1=0.91; x2=0.8; y2=0.98;
-
-#Drawing upper-left corner Pad1 of the report
-    pad1.cd();
-    pad1.SetGridx();pad1.SetGridy();
-    infoTree.Draw("total_maps_memory:scan_number","", "goff")
-    mapsGraph=TGraph(int(infoTree.GetSelectedRows()), infoTree.GetV2(), infoTree.GetV1());    
-    mapsGraph.SetLineColor(1); mapsGraph.SetLineWidth(1); #mapsGraph.SetFillStyle(3001); mapsGraph.SetFillColor(2);
-    mapsGraph.SetName("total_maps_memory");
-    #VmSize, VmLck, VmRSS, VmData, VmStk, VmExe, VmLib;
-    infoTree.Draw("VmSize:scan_number", "","goff"); 
-    vmsizeGraph=TGraph(int(infoTree.GetSelectedRows()), infoTree.GetV2(), infoTree.GetV1());    
-    vmsizeGraph.SetLineColor(2); vmsizeGraph.SetLineWidth(1); #vmsizeGraph.SetFillStyle(3002); vmsizeGraph.SetFillColor(3);
-    vmsizeGraph.SetName("VmSize");
-    
-    infoTree.Draw("VmRSS:scan_number", "", "goff"); 
-    vmrssGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1());
-    vmrssGraph.SetLineColor(3); vmrssGraph.SetLineWidth(1); #vmrssGraph.SetFillStyle(3003); vmrssGraph.SetFillColor(4);
-    vmrssGraph.SetName("VmRSS"); 
-    
-    infoTree.Draw("VmData:scan_number", "", "goff"); 
-    vmdataGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1());
-    vmdataGraph.SetLineColor(4); vmdataGraph.SetLineWidth(1); #vmdataGraph.SetFillStyle(3004); vmdataGraph.SetFillColor(4);
-    vmdataGraph.SetName("VmData"); 
-    
-    infoTree.Draw("VmStk:scan_number", "", "goff"); 
-    vmstkGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1());
-    vmstkGraph.SetLineColor(5); vmstkGraph.SetLineWidth(1); #vmstkGraph.SetFillStyle(3005); vmstkGraph.SetFillColor(4);
-    vmstkGraph.SetName("VmStk")
-    
-    infoTree.Draw("VmExe:scan_number", "", "goff"); 
-    vmexeGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1());
-    vmexeGraph.SetLineColor(6); vmexeGraph.SetLineWidth(1); #vmexeGraph.SetFillStyle(3003); vmexeGraph.SetFillColor(4);
-    vmexeGraph.SetName("VmExe");
-    
-    infoTree.Draw("VmLib:scan_number", "", "goff"); 
-    vmlibGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1());
-    vmlibGraph.SetLineColor(7); vmlibGraph.SetLineWidth(1); #vmlibGraph.SetFillStyle(3003); vmlibGraph.SetFillColor(4);
-    vmlibGraph.SetName("VmLib");
-  
-    infoTree.Draw("VmLck:scan_number", "", "goff"); 
-    vmlckGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1());
-    vmlckGraph.SetLineColor(8); vmlckGraph.SetLineWidth(1); #vmlckGraph.SetFillStyle(3003); vmlckGraph.SetFillColor(4);
-    vmlckGraph.SetName("VmLck");
-
-    infoTree.Draw("total_hole_memory:scan_number", "", "goff");
-    holeGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1())    
-    holeGraph.SetLineColor(9); holeGraph.SetLineWidth(1); #holeGraph.SetFillStyle(3004); holeGraph.SetFillColor(5);
-    holeGraph.SetName("HolesSize"); 
-        
-    mallocTree.Draw("malloc_free:scan_number", "", "goff"); 
-    freeGraph=TGraph(mallocTree.GetSelectedRows(), mallocTree.GetV2(), mallocTree.GetV1())    
-    freeGraph.SetLineColor(11); freeGraph.SetLineWidth(1); freeGraph.SetFillStyle(3003); freeGraph.SetFillColor(4);
-    freeGraph.SetName("malloc_free");
-    
-    mallocTree.Draw("malloc_inuse:scan_number", "", "goff"); 
-    inuseGraph=TGraph(mallocTree.GetSelectedRows(), mallocTree.GetV2(), mallocTree.GetV1())    
-    inuseGraph.SetLineColor(21); inuseGraph.SetLineWidth(1); inuseGraph.SetFillStyle(3003); inuseGraph.SetFillColor(4);
-    inuseGraph.SetName("malloc_inuse");
-
-    mallocTree.Draw("malloc_sbrk:scan_number", "", "goff"); 
-    sbrkGraph=TGraph(mallocTree.GetSelectedRows(), mallocTree.GetV2(), mallocTree.GetV1())    
-    sbrkGraph.SetLineColor(31); sbrkGraph.SetLineWidth(1); sbrkGraph.SetFillStyle(3003); sbrkGraph.SetFillColor(4);
-    sbrkGraph.SetName("malloc_sbrk");
-    
-    mallocTree.Draw("malloc_mmap:scan_number", "", "goff"); 
-    mmapGraph=TGraph(mallocTree.GetSelectedRows(), mallocTree.GetV2(), mallocTree.GetV1())    
-    mmapGraph.SetLineColor(41); mmapGraph.SetLineWidth(1); mmapGraph.SetFillStyle(3003); mmapGraph.SetFillColor(4);
-    mmapGraph.SetName("malloc_mmap");
-    
-    pad1.cd();
-    multiGraph1.Add(mapsGraph);multiGraph1.Add(vmsizeGraph);
-    multiGraph1.Add(vmrssGraph);multiGraph1.Add(vmdataGraph);
-    multiGraph1.Add(vmlckGraph);multiGraph1.Add(vmexeGraph);
-    multiGraph1.Add(vmstkGraph);#multiGraph1.Add(vmlibGraph);
-    multiGraph1.Add(inuseGraph);
-    multiGraph1.Add(sbrkGraph);multiGraph1.Add(mmapGraph);
-    multiGraph1.Add(holeGraph);multiGraph1.Add(freeGraph);
-
-
-    
-    #multiGraph1.SetTitle("PROCESS VM and Malloc MEMORY USAGE"); 
-    title.DrawPaveLabel(x1,y1,x2,y2,"PROCESS VM and Malloc MEMORY USAGE","brNDC");
-
-    multiGraph1.Draw("ALg")
-    hist = multiGraph1.GetHistogram(); hist.SetXTitle("Event Number"); hist.SetYTitle("Memory, kb");
-    legend1 = TLegend(0.84,0.20,0.99,0.90);
-    legend1.AddEntry(mapsGraph,  "Maps",            "l");
-    legend1.AddEntry(vmsizeGraph,"VmSize",          "l");
-    legend1.AddEntry(vmrssGraph, "VmRSS",           "l");
-    legend1.AddEntry(vmdataGraph,"VmData",          "l");
-
-    legend1.AddEntry(sbrkGraph,  "MallocSbrk",      "l");
-    legend1.AddEntry(inuseGraph, "MallocInuse",     "l");    
-    #legend1.AddEntry(vmlibGraph, "VmLib",          "l");
-    legend1.AddEntry(mmapGraph,  "MallocMmap",      "l");    
-    legend1.AddEntry(freeGraph,  "MallocFree",      "l");
-    legend1.AddEntry(holeGraph,  "Freed-Holes",     "l");     
-    legend1.AddEntry(vmstkGraph, "VmStk",           "l");
-    legend1.AddEntry(vmexeGraph, "VmExe",           "l");
-    legend1.AddEntry(vmlckGraph, "VmLck",           "l");
-    legend1.Draw();
-
-    #multiGraph1.Draw("ALg")    
-    #title.DrawPaveLabel(x1,y1,x2,y2,"Process Memory Usage Charts","brNDC");
-    
-    
-#Drawing upper-left corner Pad1 of the report
-    pad2.cd();
-    pad2.SetGridx(); pad2.SetGridy();
-
-    infoTree.Draw("total_hole_memory:scan_number", "", "goff");
-    holeGraph=TGraph(infoTree.GetSelectedRows(), infoTree.GetV2(), infoTree.GetV1())    
-    holeGraph.SetLineColor(9); holeGraph.SetLineWidth(1); holeGraph.SetFillStyle(3004); holeGraph.SetFillColor(5);
-    holeGraph.SetName("total_hole_memory"); 
-
-    mallocTree.Draw("malloc_free:scan_number", "", "goff");
-    freeGraph=TGraph(mallocTree.GetSelectedRows(), mallocTree.GetV2(), mallocTree.GetV1())    
-    freeGraph.SetLineColor(11); freeGraph.SetLineWidth(1); freeGraph.SetFillStyle(3004); freeGraph.SetFillColor(5);
-    freeGraph.SetName("malloc_free");
-    
-    pad2.cd();
-    multiGraph2.Add(holeGraph);
-    multiGraph2.Add(freeGraph);
-    #multiGraph2.Add(sbrkGraph);
-    #multiGraph2.Add(mmapGraph);
-    
-    #multiGraph2.SetTitle("Free and Marked Holes Memory Graph"); 
-    title.DrawPaveLabel(x1,y1,x2,y2,"Malloc Free and Marked Holes Memory","brNDC");
-    
-    multiGraph2.Draw("ALg")    
-    hist = multiGraph2.GetHistogram(); hist.SetXTitle("Event Number"); hist.SetYTitle("Memory, kb");
-    
-    legend2 = TLegend(0.9,0.30,0.99,0.90);
-    legend2.AddEntry(freeGraph,  "Free",   "l");
-    legend2.AddEntry(holeGraph,  "Holes",  "l");
-    #legend2.AddEntry(inuseGraph, "Inuse",  "l");
-    #legend2.AddEntry(mmapGraph,  "Mmap",  "l");
-    #legend2.AddEntry(sbrkGraph,  "Sbrk",  "l");
-
-    legend2.Draw()
-    #multiGraph2.Draw("ALg")    
-    #title.DrawPaveLabel(x1,y1,x2,y2,"Malloc Memory Usage and Deallocation Charts","brNDC");  
-  
-  #PAD3
-    pad3.cd()
-    pad3.SetLogz()
-    memHist1.Draw("lego2");
-    #title.DrawPaveLabel(x1,y1,x2,y2,"TH2I-LEGO2","brNDC");
-
-    mem_canvas.SetBorderSize(1);
-    #mem_canvas.Modified()
-    mem_canvas.Update()
-    mem_canvas.Print(".pdf")
-    mem_canvas.Print(".C")
\ No newline at end of file
diff --git a/Control/HeapMon/python/MemoryScanner.py b/Control/HeapMon/python/MemoryScanner.py
deleted file mode 100644
index b565c1a40e049b0c88a488fd693c8529c27ee217..0000000000000000000000000000000000000000
--- a/Control/HeapMon/python/MemoryScanner.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import os, sys;
-
-memscan_output = 'heapmon.holes.root'
-freescan_output = 'heapmon.freed.root'
-newscan_output = 'heapmon.newed.root'
-
-pid = os.getpid();
-free_marker = 0xCD; 
-new_marker = 0xBC;
-scan_number = 0;
-scan_flag = 1;
-free_scan_number = 0;
-new_scan_number = 0;
-
-memmarker = 'HeapMon.MemoryMarker' in sys.modules and \
-sys.modules[ 'HeapMon.MemoryMarker' ] or None
-
-#meminfo_file_name = 'mem'
-#print('    RunScanner is loaded: file name for memscan=', memscan_output)
-
-def nmemscan(file_name, scan_flag, n, id, mrkr = 0xCD):
-    global pid;
-    
-    try:
-        os.kill(id, 0)
-    except OSError, err:
-        print("pid ", id , " doesn't exist, so pid stays os.getpid()=", pid)
-        id = pid;
-    
-    print(' output_file ', file_name)
-    print ' scan_flag = ', scan_flag
-    print ' scan_number = ', n
-    
-    print('MemoryScanner.exe %d %d %d %s %d %s' %(id, scan_flag, n, file_name,  mrkr) );
-    os.system( 'MemoryScanner.exe %d %d %d %s %d %s' %(id, scan_flag, n, file_name,  mrkr)  );
-    
-def imemscan():
-    global pid, free_marker, scan_number, scan_flag, memscan_output  
-    print('MemoryScanner.exe %d %d %d %s %d' %(pid, scan_flag, scan_number, memscan_output,  free_marker) );
-    os.system( 'MemoryScanner.exe %d %d %d %s %d' %(pid, scan_flag, scan_number, memscan_output,  free_marker)  );
-    scan_number+=1
-    
-def memscan(file_name, scan_f, scan_n, marker):
-    global pid 
-    print('MemoryScanner.exe %d %d %d %s %d' %(pid, scan_f, scan_n, file_name,  marker) );
-    os.system( 'MemoryScanner.exe %d %d %d %s %d' %(pid, scan_f, scan_n, file_name,  marker)  );
-    
-def freescan(scan_flag):
-    global free_scan_number, free_marker
-    global freescan_output
-    print ('MemoryScanner.freescan(', scan_flag, ')')
-    print ' scan_flag = ', scan_flag
-    print ' scan_number = ', free_scan_number
-    #print ' RunScanner.memstat()'
-    print('MemoryScanner.exe %d %d %d %s %d' %(pid, scan_flag, free_scan_number, freescan_output,  free_marker) );
-    os.system( 'MemoryScanner.exe %d %d %d %s %d' %(pid, scan_flag, free_scan_number, freescan_output,  free_marker)  );
-
-    free_scan_number+=1
-
-def newscan(scan_flag):
-    global new_scan_number, new_marker
-    global newscan_output
-    print ('MemoryScanner.newscan(', scan_flag, ')')
-    print ' scan_flag = ', scan_flag
-    print ' scan_number = ', new_scan_number
-    #print ' RunScanner.memstat()'
-    print('MemoryScanner.exe %d %d %d %s %d' %(pid, scan_flag, new_scan_number, newscan_output,  new_marker) );
-    os.system( 'MemoryScanner.exe %d %d %d %s %d' %(pid, scan_flag, new_scan_number, newscan_output,  new_marker)  );
-    new_scan_number+=1
-
diff --git a/Control/HeapMon/python/__init__.py b/Control/HeapMon/python/__init__.py
deleted file mode 100644
index a63ba62d7570caa7d1b86745aa4f5486b839063d..0000000000000000000000000000000000000000
--- a/Control/HeapMon/python/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# File: HeapMon/__init__.py
-# Author: Mous Tatarkhanov (MMTatarkhanov@lbl.gov) 
-
-__version__ = '0.0.1'
-__author__ = 'Mous Tatarkhanov (tmmous@berkeley.edu)'
-
-def setup():
-   import atexit, os
-   __path__.append( os.path.join( __path__[0], os.environ[ 'CMTCONFIG' ] ) )
-
-   from HeapMon import MemoryMarker
-   MemoryMarker.configure( MemoryMarker.IS_RUNNING )
-
-   atexit.register( MemoryMarker.atexit )
-
-setup()
-del setup
diff --git a/Control/HeapMon/share/heapmon_jobo.py b/Control/HeapMon/share/heapmon_jobo.py
deleted file mode 100755
index 2f9081076d8a87523c26adca24a341ca891003e8..0000000000000000000000000000000000000000
--- a/Control/HeapMon/share/heapmon_jobo.py
+++ /dev/null
@@ -1,28 +0,0 @@
-OutputLevel=INFO
-doCBNT=False
-EvtMax = 5
-
-from AthenaCommon.AlgSequence import AlgSequence
-job = AlgSequence()
-assert( job == AlgSequence() )     # this is a singleton
-
-from HeapMon.EventNotifier import EventExecutionNotifier
-een =EventExecutionNotifier('EventNotifier')
-een.start_scan = 1 
-een.stop_scan  = 4
-
-job.insert(0,een) 
-
-#DetDescrVersion="ATLAS-GEO-02-01-00"
-#PoolRDOInput = [ "RDO.pool.root" ]
-
-# DetFlags modifications are best set here (uncomment RecExCommon_flags first)
-#include ("RecExCond/RecExCommon_flags.py")
-# switch off ID, calo, or muons
-#DetFlags.ID_setOff()
-#DetFlags.Calo_setOff()
-#DetFlags.Muon_setOff()
-print job
-
-include ("jobOptions.py")
-#######################################################
diff --git a/Control/HeapMon/src/MemoryMarker.c b/Control/HeapMon/src/MemoryMarker.c
deleted file mode 100644
index cb3f420e6673f8aadab0c1b5c9cdef62d572f67b..0000000000000000000000000000000000000000
--- a/Control/HeapMon/src/MemoryMarker.c
+++ /dev/null
@@ -1,877 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//#ifndef HEAPMON_HEAPMON_H
-//#define HEAPMON_HEAPMON_H
-#if defined(__linux__)
-
-#define _GNU_SOURCE 1
-
-#include <stdio.h>
-
-#ifdef _POSIX_C_SOURCE
-#undef _POSIX_C_SOURCE
-#endif
-
-#ifdef _XOPEN_SOURCE
-#undef _XOPEN_SOURCE
-#endif
-
-#ifdef _FILE_OFFSET_BITS
-#undef _FILE_OFFSET_BITS
-#endif
-
-#include "Python.h"
-
-#include <execinfo.h>
-#include <malloc.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <assert.h>
-
-#include <gperftools/malloc_hook_c.h>
-
-//#include <google/malloc_extension_c.h>
-void MallocExtension_GetStats(char*, int);
-size_t MallocExtension_GetAllocatedSize(void*);
-int mm_check(int);
-int mm_clearCheckPoint(int);
-int mm_depth(int);
-int mm_setCheckPoint(void);
-void get_trace(long);
-void get_key_list(void);
-void trace(const char*);
-
-
-// copied from malloc.c
-/* -------------- Early definitions for debugging hooks ---------------- */
-/* Define and initialize the hook variables.  These weak definitions must
-   appear before any use of the variables in a function (arena.c uses one).  */
-#ifndef weak_variable
-#ifndef _LIBC
-#define weak_variable /**/
-#else
-/* In GNU libc we want the hook variables to be weak definitions to
-   avoid a problem with Emacs.  */
-#define weak_variable weak_function
-#endif
-#endif
-
-
-/*- data ------------------------------------------------------------------- */
-
-/* holder to locate this shared library */
-void mm_dummy() {}
-
-// defined below
-static  void tc_MallocHook(const void* ptr, size_t size);
-static  void tc_FreeHook(const void* ptr);
-
-static MallocHook_NewHook old_tcMalloc_hook_ = NULL ;
-static MallocHook_DeleteHook old_tcFree_hook_ = NULL;
-
-/* forward declarations */
-static void mm_Hooks_uninstall();
-static void *mm_MallocHook( size_t size, const void *caller );
-static void *mm_ReallocHook( void *ptr, size_t size, const void *caller );
-static void mm_FreeHook( void *ptr, const void *caller );
-
-/* holders for original hooks */
-static void *(*m_OldMallocHook)  ( size_t size, const void *caller );
-static void *(*m_OldReallocHook) ( void *ptr, size_t size, const void *caller );
-static void (*m_OldFreeHook)     ( void *ptr, const void *caller );
-
-/* available flags */
-#define IS_RUNNING          1
-#define LEAK_CHECK          2
-#define PROFILE             4
-#define HIDEMEMADDR         8
-#define QUICK              16
-#define STL_CHECKS         32
-#define FILTER_STL         64
-#define IS_MARKING		  128
-
-#define SIZE_MARK 		'\xFB'
-
-static unsigned char FREE_MARKER	= 	'\xCD';
-static unsigned char NEW_MARKER 	=	'\xBC';
-//static short int MAX_EVENT_NUMBER 	=	10;
-
-static unsigned char USETCMALLOC = 1;
-
-/* module-level configuration flags */
-static long gFlags = 0;
-static size_t  LOWER_THREE_BITS = (0x01|0x02|0x04);
-static long event_counter = 0;
-
-static unsigned long long total_freed = 0;
-static unsigned long long total_allocated = 0;
-static unsigned long long number_freed = 0;
-static unsigned long long number_allocated = 0;
-static unsigned long long number_zero_allocated = 0;
-static unsigned long long number_zeroptr_freed = 0;
-static struct mallinfo mem_struct;
-
-/* handle to output stream used */
-static FILE *file_output = 0;
-
-void * old_ptr;
-static char buffer[512];
-
-
-
-/* _________________________________________________________________________ */
-static void mm_report( void ) {
-	printf("	MemoryMarker->mm_report(): gFlags = %ld\n", gFlags);
-}
-
-
-/* _________________________________________________________________________ */
-static void ignore( const char *name ) {
-	gFlags = gFlags & ~IS_MARKING;
-	printf("	MemoryMarker->ignore(): IS_MARKING flag dropped. gFlags = %ld\n", gFlags);
-}
-
-
-/* _________________________________________________________________________ */
-static void mm_Hooks_save() {
-	switch(USETCMALLOC){
-	case 0:
-		/* store old glibc hooks in buffer for reset later; prevent storing ourselves in
-		   case of a double-call by the user (e.g. from python) */
-		//printf("	MemoryMarker->mm_Hooks_save ptmalloc gFlags = %u\n", gFlags);
-
-		   /*if ( __malloc_hook != mm_MallocHook )
-		      m_OldMallocHook  = __malloc_hook;
-		   if ( __realloc_hook != mm_ReallocHook )
-		      m_OldReallocHook = __realloc_hook; */
-		   if ( __free_hook != mm_FreeHook )
-		      m_OldFreeHook    = __free_hook;
-		break;
-	case 1:
-		printf("	MemoryMarker->mm_Hooks_save tcmalloc gFlags = %ld\n", gFlags);
-		break;
-	default:
-		printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-	}
-}
-
-/* _________________________________________________________________________ */
-static long configure( long flags ) {
-	gFlags |= IS_RUNNING;
-	gFlags |= flags;
-
-	printf("	MemoryMarker->configure(): IS_RUNNING flag raised. gFlags = %ld\n", gFlags);
-
-	//setup();
-	switch(USETCMALLOC){
-	case 0:
-		mm_Hooks_save();
-		break;
-	case 1:
-		printf("	MemoryMarker->configure() tcmalloc gFlags = %ld\n", gFlags);
-		break;
-	default:
-		printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-	}
-	return gFlags;
-}
-
-static void set_marker(char m) {
-	FREE_MARKER = m;
-}
-
-static void get_test(long lkey) {
-
-	struct mallinfo mem_struct;
-
-	switch(USETCMALLOC){
-	case 0:
-			printf("MemoryMarker->get_test()->Malloc Stats:\n");
-			printf("--------------------------MALLOC INFO --------------\n");
-			malloc_stats();
-
-			mem_struct = mallinfo();
-			printf("	sbrk-Allocated Memory( ARENA) size: %u\n", mem_struct.arena);
-			printf(" 	MMAP-Allocated Memory: %u\n", mem_struct.hblkhd);
-			printf(" 	Number of chunks allocated by MMAP: %u\n", mem_struct.hblks);
-			printf(" 	MALLOC-In Use: %u\n", mem_struct.uordblks );
-			printf(" 	MALLOC-Free: %u\n", mem_struct.fordblks);
-			printf(" 	Number of chunks from OS not in use by MALLOC: %u\n", mem_struct.ordblks);
-			printf("    Top-releasable chunk keepcost: %u\n", mem_struct.keepcost);
-
-			printf("-----------------------------------------------------\n\n");
-
-			/*
-			printf("   gnu_libc_version= %s\n",gnu_get_libc_version());
-			printf("------------------Sizes and Ranges of Integer Types-------------------\n");
-			printf(" NUMBER OF BITS in types: \n");
-
-			printf("   CHAR_BIT=%u, SHRT_BIT=%u, INT_BIT=%u, LONG_BIT=%u, LONG_LONG_BIT=%u\n",
-			             CHAR_BIT, sizeof(signed short int)*CHAR_BIT,sizeof(signed int)*CHAR_BIT,
-			         sizeof(signed long int)*CHAR_BIT, sizeof(signed long long int)*CHAR_BIT);
-			printf(" \n");
-			printf("   sizeof(size_t)=%u\t\tsizeof(ptrdiff_t)=%u\n",sizeof(size_t), sizeof(ptrdiff_t));
-			printf(" TYPE RANGES:\n");
-			printf("   CHAR_MIN=%d\t\tCHAR_MAX=%d\t\tUCHAR_MAX=%u\n", CHAR_MIN, CHAR_MAX, UCHAR_MAX);
-			printf("   SHRT_MIN=%d\t\tSHRT_MAX=%d\t\tUINT_MAX=%u\n", SHRT_MIN, SHRT_MAX, USHRT_MAX);
-			printf("   INT_MIN=%d\t\tINT_MAX=%d\t\tUINT_MAX=%u\n", INT_MIN, INT_MAX, UINT_MAX);
-			printf("   LONG_MIN=%e\t\tLONG_MAX=%e\tULONG_MAX=%e\n", LONG_MIN*1.0, LONG_MAX*1.0,ULONG_MAX*1.0 );
-			printf("   LONG_LONG_MIN=%e\tLONG_LONG_MAX=%e\tULONG_LONG_MAX=%e\n", LONG_LONG_MIN*1.0, LONG_LONG_MAX*1.0, ULONG_LONG_MAX*1.0);
-			printf("----------------------------------------------------------------------\n");
-			*/
-		break;
-	case 1:
-		mem_struct = mallinfo();
-		printf("	MemoryMarker->get_test tcmalloc gFlags = %ld\n", gFlags);
-		printf("	sbrk-Allocated Memory( ARENA) size: %u\n", mem_struct.arena);
-		//printf(" 	MMAP-Allocated Memory: %u\n", mem_struct.hblkhd);
-		//printf(" 	Number of chunks allocated by MMAP: %u\n", mem_struct.hblks);
-		printf(" 	MALLOC-In Use: %u\n", mem_struct.uordblks );
-		printf(" 	MALLOC-Free: %u\n", mem_struct.fordblks);
-		//printf(" 	Number of chunks from OS not in use by MALLOC: %u\n", mem_struct.ordblks);
-		//printf("    Top-releasable chunk keepcost: %u\n", mem_struct.keepcost);
-		break;
-	default:
-		printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-	}
-
-}
-
-static void store_malloc_info() {
-	//printf("MemoryMarker->store_malloc_info() store malloc data into file:\n");
-	malloc_stats();
-}
-
-static void show_malloc_info() {
-
-	switch(USETCMALLOC){
-	case 0:
-		printf("\n--------- GLIBC ptmalloc( --stdcmalloc) INFO --------\n");
-		malloc_stats();
-		mem_struct = mallinfo();
-		printf("  SBRK-allocated memory( ARENA) size: %u bytes\n", mem_struct.arena);
-		printf("  MMAP-allocated memory: %u bytes\n", mem_struct.hblkhd);
-		printf("  MMAP-allocated number of chunks: %u\n", mem_struct.hblks);
-		printf("  MALLOC-In-use: %u bytes \n", mem_struct.uordblks );
-		printf("  MALLOC-Free: %u bytes\n", mem_struct.fordblks);
-		printf("  Number of chunks from OS not in use by MALLOC: %u \n", mem_struct.ordblks);
-		printf("  TOP-releasable chunk keepcost: %u bytes \n\n", mem_struct.keepcost);
-
-		printf("\n-------------- HEAPMON MEMORY MARKER SPECIFIC INFO -------\n");
-		printf(" Cumulative allocated memory size: %llu bytes\n", total_allocated);
-		printf(" Cumulative deallocated memory: %llu bytes \n", total_freed);
-		printf(" Number of allocations: %llu bytes \n", number_allocated);
-		printf(" Number of deallocations: %llu  \n", number_freed);
-		printf(" Number of zero allocations: %llu\n", number_zero_allocated);
-		printf(" Number of zero ptr deallocations: %llu\n", number_zeroptr_freed);
-		printf("-----------------------------------------------------------\n\n");
-		break;
-	case 1:
-
-		mem_struct = mallinfo();
-		printf("\n-------------- TCMALLOC INFO -------------------------\n");
-		printf("	MemoryMarker->get_test tcmalloc gFlags = %ld\n", gFlags);
-		printf("	SBRK-allocated Memory( ARENA) size: %u bytes\n", mem_struct.arena);
-		//printf(" 	MMAP-Allocated Memory: %u\n", mem_struct.hblkhd);
-		//printf(" 	Number of chunks allocated by MMAP: %u\n", mem_struct.hblks);
-		printf(" 	MALLOC-In Use: %u bytes \n", mem_struct.uordblks );
-		printf(" 	MALLOC-Free: %u bytes \n", mem_struct.fordblks);
-		//printf(" 	Number of chunks from OS not in use by MALLOC: %u\n", mem_struct.ordblks);
-		//printf("    Top-releasable chunk keepcost: %u\n", mem_struct.keepcost);
-		printf("-----------------------------------------------------------\n\n");
-
-
-		MallocExtension_GetStats(buffer, 512);
-		printf("  MemoryMarker->get_malloc_info() tcmalloc gFlags = %ld\n", gFlags);
-		printf("  tcmalloc stats: %s", buffer);
-
-		printf("\n-------------- HEAPMON MEMORY MARKER SPECIFIC INFO -------\n");
-		printf("	Cumulative allocated memory size: %llu\n", total_allocated);
-		printf(" 	Cumulative deallocated memory: %llu\n", total_freed);
-		printf(" 	Number of allocations: %llu\n", number_allocated);
-		printf(" 	Number of deallocations: %llu\n", number_freed);
-		printf(" 	Number of zero allocations: %llu\n", number_zero_allocated);
-		printf(" 	Number of zero ptr deallocations: %llu\n", number_zeroptr_freed);
-		printf("-----------------------------------------------------------\n\n");
-
-
-		break;
-	default:
-		printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-		printf("\n-------------- HEAPMON MEMORY MARKER SPECIFIC INFO -------\n");
-		printf("	Cumulative allocated memory size: %llu\n", total_allocated);
-		printf(" 	Cumulative deallocated memory: %llu\n", total_freed);
-		printf(" 	Number of allocations: %llu\n", number_allocated);
-		printf(" 	Number of deallocations: %llu\n", number_freed);
-		printf(" 	Number of zero allocations: %llu\n", number_zero_allocated);
-		printf(" 	Number of zero ptr deallocations: %llu\n", number_zeroptr_freed);
-		printf("-----------------------------------------------------------\n\n");
-
-	}
-}
-
-/* _________________________________________________________________________ */
-static void mm_Hooks_install() {
-
-   if ( gFlags & IS_RUNNING ) {
-		switch(USETCMALLOC){
-		case 0:
-			//printf("	MemoryMarker->mm_Hooks_install(): mm_Hooks installed. gFlags = %u\n", gFlags);
-			__free_hook    = mm_FreeHook;
-			/*__malloc_hook  = mm_MallocHook;
-			__realloc_hook = mm_ReallocHook;*/
-			break;
-		case 1:
-			printf("	MemoryMarker->mm_Hooks_install() tcmalloc gFlags = %ld\n", gFlags);
-			break;
-		default:
-			printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-		}
-
-   } else{
-	   printf("	MemoryMarker->mm_Hooks_install(): mm_Hooks failed to install. IS_RUNNING not set, gFlags = %ld\n", gFlags);
-   }
-   return ;
-}
-
-static void tc_Hooks_install() {
-   if ( gFlags & IS_RUNNING ) {
-	   printf(" MemoryMarker->tc_Hooks_install(): do nothing! gFlags = %ld\n", gFlags);
-
-   } else{
-	   printf("	MemoryMarker->tc_Hooks_install(): 'IS_RUNNING' not set, gFlags = %ld  do nothing!\n", gFlags);
-   }
-   return ;
-}
-
-/* _________________________________________________________________________ */
-static void mm_Hooks_uninstall() {
-	switch(USETCMALLOC){
-	case 0:
-		//printf("	MemoryMarker->mm_Hooks_uninstall(), gFlags = %u\n", gFlags);
-		__free_hook    = 	m_OldFreeHook;
-		/*__malloc_hook  = 	m_OldMallocHook;
-		__realloc_hook = 	m_OldReallocHook;*/
-		break;
-	case 1:
-		printf("	MemoryMarker->mm_Hooks_uninstall() tcmalloc gFlags = %ld\n", gFlags);
-		break;
-	default:
-		printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-	}
-}
-
-/* _________________________________________________________________________ */
-static void mm_Hooks_start() {
-	if ( (gFlags & IS_RUNNING) ){
-		switch(USETCMALLOC){
-		case 0:
-			printf("	MemoryMarker->mm_Hooks_start().");
-			mm_Hooks_save();
-			mm_Hooks_install();//__free_hook    = mm_FreeHook;
-			break;
-		case 1:
-			if (!(gFlags & IS_MARKING)){
-				printf("	MemoryMarker->tc_Hooks_start().");
-				old_tcFree_hook_ = MallocHook_SetDeleteHook(tc_FreeHook);
-				//old_tcMalloc_hook_ = MallocHook_SetNewHook(tc_MallocHook);
-				if (old_tcFree_hook_)
-					printf("   MemoryMarker-> HeapMon Delete hook set and old_tcFree_hook successfully saved");
-				//if (old_tcMalloc_hook_ != NULL)
-					//printf("   MemoryMarker-> HeapMon New hook set and old_tcMalloc_hook successfully saved");
-			} else{
-				printf("   MemoryMarker-> HeapMon hook has been already set");
-			}
-			break;
-		default:
-			printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-		}
-	   gFlags |= IS_MARKING;
-	   printf("	IS_MARKING flag raised, gFlags = %ld!\n", gFlags);
-	} else {
-	   printf("	MemoryMarker->mm_Hooks_start(): Attempt failed: IS_RUNNING flag is not set, gFlags = %ld!\n", gFlags);
-	}
-}
-
-/* _________________________________________________________________________ */
-static void mm_Hooks_stop() {
-	if (gFlags & IS_MARKING){
-		switch(USETCMALLOC){
-		case 0:
-			printf("	MemoryMarker->mm_Hooks_stop(): old hooks restored and IS_MARKING dropped");
-			//__free_hook   = m_OldFreeHook;
-			mm_Hooks_uninstall();
-			break;
-		case 1:
-			printf("	MemoryMarker->mm_Hooks_stop(): old tc_hooks restored\n");
-			if (MallocHook_SetDeleteHook(old_tcFree_hook_)!=NULL)
-				printf("	old tcmalloc Delete hook restored!\n");
-			//if (MallocHook_SetNewHook(old_tcMalloc_hook_)!=NULL)
-				//printf("	old tcmalloc New hook restored!\n");
-			break;
-		default:
-			printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-		}
-
-		gFlags &= gFlags ^ IS_MARKING;
-		printf(", gFlags = %ld\n", gFlags);
-	} else{
-		printf("	MemoryMarker->mm_Hooks_stop(): Attempt failed (IS_MARKING  not raised) gFlags = %ld. \n", gFlags);
-	}
-}
-
-/* _________________________________________________________________________ */
-static void mm_Hooks_atexit() {
-   printf("	MemoryMarker->mm_Hooks_atexit(): mm_Hooks _uninstall(). gFlags = %ld\n", gFlags);
-
-   switch(USETCMALLOC){
-   case 0:
-	   /* reset (system/NULL) hook to prevent tracking */
-	   mm_Hooks_uninstall();
-	   break;
-   case 1:
-	   printf("	MemoryMarker->mm_Hooks_atexit(): tc_Hooks _uninstall()\n");
-	   if (old_tcFree_hook_!=NULL){
-		   if (MallocHook_SetDeleteHook(old_tcFree_hook_)!=NULL)
-			   printf("			old tcmalloc Delete hook restored successfull!\n");
-		   //if (MallocHook_SetNewHook(old_tcMalloc_hook_)!=NULL)
-			   //printf("			old tcmalloc New hook restored successfull!\n");
-	   }
-	   break;
-   default:
-	   printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-   }
-
-   gFlags &= gFlags ^ IS_MARKING;
-   gFlags &= gFlags ^ IS_RUNNING;
-   printf("	MemoryMarker->mm_Hooks_atexit(): IS_MARKING and IS_RUNNING flags dropped  gFlags = %ld\n", gFlags);
-}
-
-
-/* _________________________________________________________________________ */
-static void *mm_MallocHook( size_t size, const void *unused ) {
-   void *result;
-
-/* reset (system/NULL) hook to prevent recursion */
-   mm_Hooks_uninstall();
-
-/* let malloc do its thing */
-   result = malloc( size );
-
-   if (size > 8 && result!=0)
-	   memset(result, NEW_MARKER, size - 8);
-
-/* store current hooks */
-   mm_Hooks_save();
-
-/* reset tracker hook */
-   mm_Hooks_install();
-
-   return result;
-}
-
-/* _________________________________________________________________________ */
-static void *mm_ReallocHook( void *ptr, size_t size, const void *unused ) {
-   void *result;
-
-/* reset (system/NULL) hook to prevent recursion */
-   mm_Hooks_uninstall();
-
-/* let realloc do its thing */
-   result = realloc( ptr, size );
-
-   //memset(result, NEW_MARKER, size);
-
-/* store current hooks */
-   mm_Hooks_save();
-
-/* reset tracker hook */
-   mm_Hooks_install();
-
-   return result;
-}
-
-void *secureMemset(void *v, int c,size_t n) {
-	volatile char *p = v;
-	while (n--)
-		*p++ = c;
-
-	return v;
-}
-
-static void tc_MallocHook(const void* ptr, size_t size){
-	if (size == 0){
-		//printf("  alloc_size=0  ");
-		number_zero_allocated+=1;
-	} else {
-
-		total_allocated +=size;
-		number_allocated +=1;
-
-		/*if (size > 1)
-			memset(ptr, FREE_MARKER, object_size - 1);*/
-
-		if (size > 50000)
-			printf("malloc=%zu", size);
-	}
-
-}
-
-static void tc_FreeHook(const void *ptrv) {
-	size_t* ptr = (size_t *) ptrv;
-	if( ptr!=NULL && ptr!=0){
-		//printf("ptr=%x", ptr);
-		size_t object_size = 0;
-		object_size = MallocExtension_GetAllocatedSize(ptr);
-
-		if (object_size < 1)
-			return;
-		total_freed +=object_size;
-		number_freed +=1;
-		if (object_size < 2){
-			printf("free=1");
-			memset(ptr , FREE_MARKER, 		object_size - 2 );
-		} else if (object_size < 10){
-			//printf("`");
-			memset(ptr, FREE_MARKER, 		object_size - 2 );
-		} else if (object_size < 250){ //14 size_t memory slots
-			//printf("!");
-			memset(ptr , FREE_MARKER, 	object_size - 8 );
-		} else if (object_size < 350){
-			//printf("#");
-			memset(ptr + 50, FREE_MARKER, 16);
-			memset(ptr + 52, SIZE_MARK, 12);
-
-			char* cp_ptr = (char*)(ptr + 53); //pointer to the memory where object_size is recorded byte-by-byte
-			char* cp_object_size = (char *)(&object_size); // get the value stored at pI
-			int x = 0;
-			for( x = 0; x < sizeof(object_size); x++){
-				char temp = *cp_object_size; // get the value of first byte of object_size
-				memset(cp_ptr + x, temp, 1);
-				cp_object_size++; // Point to next byte of object_size
-			}
-		} else {
-
-			//printf("$");
-			//memset(ptr, FREE_MARKER, object_size - 8);
-			memset(ptr + 50, FREE_MARKER, 16);
-			memset(ptr + 52, SIZE_MARK, 12);
-
-			char* cp_ptr = (char*)(ptr + 53); //pointer to the memory where object_size is recorded byte-by-byte
-			char* cp_object_size = (char *)(&object_size); // get the value stored at pI
-			int x = 0;
-			for( x = 0; x < sizeof(object_size); x++){
-				char temp = *cp_object_size; // get the value of the x-th byte of object_size
-				memset(cp_ptr + x, temp, 1);
-				cp_object_size++; // Point to next byte of object_size
-			}
-			/*if(object_size >= 350 && object_size <=450){
-				int y=0;
-				for(y = 0; y < 5; y++){
-					//printf(" ptr=%x, value=%u(%x) ",ptr+y, 	*((long *) (ptr+y)),  *((long *) (ptr+y)));
-				}
-			}*/
-  		}
-	} else{
-		//printf("ptr=NULL/0");
-		number_zeroptr_freed += 1;
-	}
-}
-
-/* _________________________________________________________________________ */
-static void mm_FreeHook( void *ptr, const void *caller ) {
-/* reset (system/NULL) hook to prevent recursion */
-   mm_Hooks_uninstall();
-
-     size_t* chunk_ptr ;
-     size_t* next_chunk_ptr;
-     unsigned long   object_size = 0;
-     unsigned long   chunk_size = 0;
-
-     if(ptr){
-                chunk_ptr = (size_t*)((char*)ptr-1*sizeof(size_t));
-		chunk_size = (*chunk_ptr) & ~LOWER_THREE_BITS;
-		//object_size = ((*chunk_ptr) & ~LOWER_THREE_BITS) - 2*sizeof(size_t);
-		object_size = chunk_size - 2*sizeof(size_t);
-		memset(ptr, FREE_MARKER, object_size);
-     }
-     free( ptr );
-
-/* store current hooks */
-   mm_Hooks_save();
-
-/* reset tracker hook */
-   mm_Hooks_install();
-
-}
-
-
-/*========================================================================== */
-/* startup and shutdown */
-/*========================================================================== */
-static void setup() __attribute__ ((constructor));
-static void report() __attribute__ ((destructor));
-
-/* _________________________________________________________________________ */
-static void setup() {
-   printf("MemoryMarker->setup()->mm_Hooks_save()\n");
-   //find out if tcmalloc was loaded
-   USETCMALLOC = strcmp(getenv("USETCMALLOC"), "true") ? 0 : 1;
-   printf("  USETCMALLOC=%d", USETCMALLOC);
-   if (USETCMALLOC) {
-	   printf("  tcmalloc is loaded \n");
-   } else {
-	   printf("  glibc malloc is working \n");
-	   mm_Hooks_save();
-   }
-
-}
-
-/* _________________________________________________________________________ */
-static void report() {
-   static int finalized = 0;
-	printf("MemoryMarker->report()->mm_Hooks_uninstall()\n");
-   //unsigned int iname;
-    //  finalized = 1;
-
-   /* reset (system/NULL) as we're done now */
-      mm_Hooks_uninstall();
-
-}
-
-
-/*========================================================================== */
-/* python interface module */
-/*========================================================================== */
-#define CPPTOPYTHON( fname )                                                  \
-static PyObject* hep_##fname( PyObject* unused, PyObject* args ) {            \
-   if ( ! PyArg_ParseTuple( args, (char*)":"#fname ) )                        \
-      return 0;                                                               \
-                                                                              \
-   mm_Hooks_##fname();                                                       \
-                                                                              \
-   Py_INCREF( Py_None );                                                      \
-   return Py_None;                                                            \
-}
-CPPTOPYTHON( install )
-CPPTOPYTHON( start )
-CPPTOPYTHON( stop )
-CPPTOPYTHON( uninstall )
-CPPTOPYTHON( atexit )
-
-/* _________________________________________________________________________ */
-#define CPPTOPYTHONWITHSTRING( fname )                                        \
-static PyObject* hep_##fname( PyObject* unused, PyObject* args ) {            \
-   const char *name;                                                          \
-   PyStringObject* pyname = 0;                                                \
-   if ( ! PyArg_ParseTuple( args, (char*)"S:"#fname, &pyname ) )              \
-      return 0;                                                               \
-                                                                              \
-   name = PyString_AS_STRING( pyname );                                       \
-   fname( name );                                                             \
-                                                                              \
-   Py_INCREF( Py_None );                                                      \
-   return Py_None;                                                            \
-}
-CPPTOPYTHONWITHSTRING( trace )
-CPPTOPYTHONWITHSTRING( ignore )
-
-/* _________________________________________________________________________ */
-#define CPPTOPYTHONWITHINT( fname )                                           \
-static PyObject* hep_##fname( PyObject* unused, PyObject* args ) {            \
-  int i,res;                                                                  \
-   if ( ! PyArg_ParseTuple( args, "i", &i ) )                                 \
-      return 0;                                                               \
-                                                                              \
-   res = mm_##fname( i );                                                    \
-   return Py_BuildValue( "i", res );                                          \
-}
-CPPTOPYTHONWITHINT( check )
-CPPTOPYTHONWITHINT( clearCheckPoint )
-CPPTOPYTHONWITHINT( depth )
-
-static PyObject* hep_set_marker(PyObject* unused, PyObject* args ){
-	char c;
-	if (! PyArg_ParseTuple(args, "c", &c) )
-		return 0;
-	set_marker(c);
-
-	Py_INCREF( Py_None );                                                      \
-	return Py_None;
-}
-
-static PyObject* hep_get_marker(PyObject* unused, PyObject* args ){
-	PyObject* py_return = 0;
-	py_return = Py_BuildValue("c", FREE_MARKER);
-	return py_return;
-}
-
-/* _________________________________________________________________________ */
-static PyObject* hep_setCheckPoint( PyObject* unused, PyObject* args ) {
-  int res = mm_setCheckPoint();
-  return Py_BuildValue( "i", res );
-}
-
-/* _________________________________________________________________________ */
-static PyObject* hep_configure( PyObject* unused, PyObject* args ) {
-   long flags = 0;
-   if ( ! PyArg_ParseTuple( args, (char*)"|l:configure", &flags ) )
-      return 0;
-
-   flags = configure( flags );
-
-   return PyLong_FromLong( flags );
-}
-
-static PyObject* hep_get_trace( PyObject* unused, PyObject* args ) {
-   long key = 0;
-   if ( ! PyArg_ParseTuple( args, (char*)"|l:get_trace", &key ) )
-      return 0;
-
-   get_trace( key );
-
-   Py_INCREF( Py_None );
-   return Py_None;
-}
-
-static PyObject* hep_get_test( PyObject* unused, PyObject* args ) {
-   long key = 0;
-   if ( ! PyArg_ParseTuple( args, (char*)"|l:get_test", &key ) )
-      return 0;
-
-   get_test( key );
-
-   Py_INCREF( Py_None );
-   return Py_None;
-}
-
-static PyObject* hep_store_malloc_info( PyObject* unused, PyObject* args ) {
-   unsigned int number = 0;
-   const char * name;
-   PyStringObject* pyname = 0;
-
-   if ( ! PyArg_ParseTuple( args, (char*)"is:store_malloc_info", &number, &pyname) )
-      return 0;
-
-   name = PyString_AS_STRING( pyname );
-   //store_malloc_info(number, name);
-
-   Py_INCREF( Py_None );
-   return Py_None;
-}
-
-static PyObject* hep_get_malloc_info( PyObject* unused, PyObject* args ) {
-   PyStringObject* pyname = 0;
-   PyObject* py_return = 0;
-   struct mallinfo mem_struct;
-   mem_struct = mallinfo();
-
-   switch(USETCMALLOC){
-   case 0: //ptmalloc(glibc)
-	   /* reset (system/NULL) hook to prevent tracking */
-		/*printf("	sbrk-Allocated Memory( ARENA) size: %lu\n", mem_struct.arena);
-		printf(" 	MMAP-Allocated Memory: %lu\n", mem_struct.hblkhd);
-		printf(" 	Number of chunks allocated by MMAP: %lu\n", mem_struct.hblks);
-		printf(" 	MALLOC-In Use: %lu\n", mem_struct.uordblks );
-		printf(" 	MALLOC-Free: %lu\n", mem_struct.fordblks);
-		printf(" 	Number of chunks from OS not in use by MALLOC: %lu\n", mem_struct.ordblks);
-		printf("    Top-releasable chunk keepcost: %lu\n", mem_struct.keepcost);*/
-
-	   py_return = Py_BuildValue("llll",
-			   mem_struct.arena/1024, 	//sbrk
-			   mem_struct.hblkhd/1024, 	//mmap
-			   mem_struct.uordblks/1024, //inuse
-			   mem_struct.fordblks/1024);//free
-	   break;
-   case 1: //tcmalloc
-	   py_return = Py_BuildValue("llll",
-			   mem_struct.arena/1024, 	//sbrk
-			   1, 	//for tcmalloc not defined
-			   mem_struct.uordblks/1024, //inuse
-			   mem_struct.fordblks/1024);//free
-	   //get_malloc_info();
-	   break;
-   default:
-	   printf(" Invalid USETCMALLOC key: %d", USETCMALLOC);
-	   show_malloc_info();
-   }
-
-   return py_return;
-}
-
-static PyObject* hep_show_info( PyObject* unused, PyObject* args ) {
-	   show_malloc_info( );
-	   Py_INCREF( Py_None );
-	   return Py_None;
-}
-
-static PyObject* hep_get_key_list( PyObject* unused, PyObject* args ) {
-   long key = 0;
-   if ( ! PyArg_ParseTuple( args, (char*)"|l:get_key_list", &key ) )
-      return 0;
-
-   get_key_list( );
-
-   Py_INCREF( Py_None );
-   return Py_None;
-}
-
-/* _________________________________________________________________________ */
-static PyObject* hep_outstream( PyObject* unused, PyObject* args ) {
-   PyObject* pyfile;
-   if ( ! PyArg_ParseTuple( args, "O!", &PyFile_Type, &pyfile ) )
-      return 0;
-
-   FILE* fp = PyFile_AsFile( pyfile );
-   if ( ! fp )
-      return 0;
-
-   int fd = dup( fileno( fp ) );
-
-   file_output = fdopen( fd, "w" );
-
-   Py_INCREF( Py_None );
-   return Py_None;
-}
-
-/* _________________________________________________________________________ */
-static PyMethodDef gMemoryMarkerMethods[] = {
-   { (char*)"install",   (PyCFunction)hep_install,   METH_VARARGS, (char*)"install/start marking" },
-   { (char*)"start",     (PyCFunction)hep_start,     METH_VARARGS, (char*)"start marking" },
-   { (char*)"stop",      (PyCFunction)hep_stop,      METH_VARARGS, (char*)"stop marking" },
-   { (char*)"uninstall", (PyCFunction)hep_uninstall, METH_VARARGS, (char*)"uninstall marking" },
-   { (char*)"atexit",    (PyCFunction)hep_atexit,    METH_VARARGS, (char*)"atexit handler" },
-   { (char*)"ignore",    (PyCFunction)hep_ignore,    METH_VARARGS, (char*)"ignore memory marking by dropping IS_MARKING flag" },
-   { (char*)"configure", (PyCFunction)hep_configure, METH_VARARGS, (char*)"prepare for memory marking by raising IS_MARKING flag" },
-   { (char*)"outstream", (PyCFunction)hep_outstream, METH_VARARGS, (char*)"set new outstream" },
-   { (char*)"get_test",  (PyCFunction)hep_get_test,  METH_VARARGS, (char*)"get test information" },
-   { (char*)"store_malloc_info", (PyCFunction)hep_store_malloc_info,  	METH_VARARGS, (char*)"store Malloc-info into ROOT file using C++ extern function - doesn't work for now" },
-   { (char*)"get_malloc_info", (PyCFunction)hep_get_malloc_info,  		METH_VARARGS, (char*)"get Malloc-info in the tuple" },
-   { (char*)"show_info", (PyCFunction)hep_show_info,  					METH_VARARGS, (char*)"show mempory usage info" },
-   { (char*)"set_marker",  (PyCFunction)hep_set_marker,  METH_VARARGS, (char*)"set marker_char to build marker" },
-   { (char*)"get_marker",  (PyCFunction)hep_get_marker,  METH_VARARGS, (char*)"get current marker_char" },
-   { NULL, NULL, 0, NULL }
-};
-
-
-/* _________________________________________________________________________ */
-void initMemoryMarker() {
-   PyObject *memmark;
-
-   memmark = Py_InitModule( (char*)"MemoryMarker", gMemoryMarkerMethods );
-
-/* configuration flags */
-   PyModule_AddObject( memmark, (char*)"LEAK_CHECK", PyLong_FromLong( LEAK_CHECK ) );
-   PyModule_AddObject( memmark, (char*)"PROFILE",    PyLong_FromLong( PROFILE ) );
-   PyModule_AddObject( memmark, (char*)"HIDEMEMADDR",PyLong_FromLong( HIDEMEMADDR ) );
-   PyModule_AddObject( memmark, (char*)"QUICK",      PyLong_FromLong( QUICK ) );
-   PyModule_AddObject( memmark, (char*)"STL_CHECKS", PyLong_FromLong( STL_CHECKS ) );
-   PyModule_AddObject( memmark, (char*)"FILTER_STL", PyLong_FromLong( FILTER_STL ) );
-   PyModule_AddObject( memmark, (char*)"IS_MARKING", PyLong_FromLong( IS_MARKING ) );
-   PyModule_AddObject( memmark, (char*)"IS_RUNNING", PyLong_FromLong( IS_RUNNING ) );
-}
-
-#endif
diff --git a/Control/HeapMon/src/MemoryScanner.cxx b/Control/HeapMon/src/MemoryScanner.cxx
deleted file mode 100644
index ab0945c2e342ac4dc55f98e818d4e30e0a0528d8..0000000000000000000000000000000000000000
--- a/Control/HeapMon/src/MemoryScanner.cxx
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*
-MEMORY SCANNER
-*/
-
-// standard includes
-#include <iostream>
-using namespace std;
-
-// C includes
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-
-//system includes
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-
-// STL includes
-#include <map>
-#include <vector>
-#include <iostream>
-#include <iterator>
-
-// ROOT includes
-#include <TTree.h>
-#include <TFile.h>
-#include <TF1.h>
-#include <TH1.h>
-#include <TH2.h>
-#ifdef __APPLE__
-#define PTRACE_ATTACH PT_ATTACH
-#define PTRACE_DETACH PT_DETACH
-#endif
-
-int usage( char* name ){
-   cout << "usage: " << name <<" <pid> <scan_flag=0|1|2|3|4> <scan_number> <output_file_name> <marker-type(not-used-yet)>\n";
-   return 2;
-}
-
-
-int main( int argc, char *argv[] ){
-	typedef unsigned int ms_uint64;
-	typedef unsigned int ms_uint32;
-
-	int result = -1;
-	FILE *maps = 0;
-	FILE *statusf = 0;
-	int mem = 0;
-	pid_t pid = 0;
-
-	unsigned short int SCAN_FLAG = 0;
-	unsigned short int scan_number = 0;
-
-	char mapfile[128], memfile[128], statusfile[128];
-	char *buffer = NULL;
-
-	ms_uint32 marker 	= 	0xCDCDCDCD; // new_marker = 	0xBCBCBCBC;
-	ms_uint32 size_mark 	= 	0xFBFBFBFB;
-	ms_uint64  addr_start = 0, addr_end = 0;
-
-	siginfo_t *infop = NULL;
-	char perm[3];
-
-
-	// Parsing of arguments
-	if ( argc != 6 )
-		return usage( argv[0] );
-
-#ifndef __APPLE__
-
-	pid = atoi( argv[1] );
-	SCAN_FLAG = atoi( argv[2]);
-	scan_number = atoi (argv[3]);
-	char* file_name  = argv[4];
-	unsigned char marker_char = atoi(argv[5]); // "the color" of memory painting
-
-	marker = (marker_char << 24) +
-				(marker_char << 16) +
-					(marker_char << 8) +
-						marker_char; // 0xCD converted -> 0xCDCDCDCD
-	cout << "  MemoryScanner: marker_char = " << marker_char << " marker = "
-			<< marker << endl;
-	cout << "  MemoryScanner: scan_flag = " << SCAN_FLAG << endl;
-	switch ( SCAN_FLAG ) {
-		   case 0 :
-			   cout << "MemoryScanner: std output, no file output produced" ;
-	       break;
-
-	       case 1 :
-			   cout << "MemoryScanner: full output of hole statistics and malloc/process memory info into " << file_name << "\n";
-	       break;
-
-	       case 2 :
-	    	   cout << "MemoryScanner: malloc/process memory info output into " << file_name << "\n";
-	       break;
-
-	       default :
-	       // Process for all other cases.
-	    	cout << "MemoryScanner: ERROR - Wrong scan_flag=" << SCAN_FLAG <<" provided.\n";
-	   		return usage( argv[0] );
-
-	}
-
-	cout <<"\n MemoryScanner: scan_number=" << scan_number <<" \n";
-
-
-	//auxiliary buffer for reading bits from proc/mem file
-	   const ms_uint64 aux_buffer_size = 1024; // 4096bytes >> 2 = 1024 size_t elements!
-	   cout << "\n buffer_page_size =" <<  aux_buffer_size <<" bytes "<< endl;
-	   size_t aux_buffer[aux_buffer_size];
-	   //size_t mem_size = addr_end - addr_start;
-
-	   //Declaration of counters
-	   ms_uint64 counter = 0; //  marker pieces ('CDCDCDCD') counter
-	   ms_uint64 block_counter = 0; //  marked blockes ('CDCD...CDCD') counter
-	   ms_uint64 maprange_counter = 0;
-
-	   //Declaration of size variables
-
-	   ms_uint64  maps_total_size = 0; // Total maps in /proc/PID/maps
-	   ms_uint64  mem_total_size = 0; //  Total scanned maps (excluding the ranges with no 'wr' permission)
-	   ms_uint64  block_total_size = 0;// Total holes size
-	   ms_uint64 mapsSize = 0, holesSize = 0; //memSize = 0, ;
-
-	   ms_uint64 malloc_total = 0;
-
-	   //Declaration of Marked block related variables
-	   ms_uint64 block_flag = 0;
-	   ms_uint64 block_size = 0;
-	   ms_uint64  block_start = 0; // auxiliary to remember block start location
-	   size_t* block_ptr = 0;
-	   size_t* block_end_ptr = 0;
-	   size_t* addr = 0;
-
-	   //variables related to the TTree building
-	   ms_uint64  hole_addr = (ms_uint64) (size_t) block_ptr;
-	   ms_uint64  hole_size = (ms_uint64) (size_t) block_size;
-
-
-
-	   //--------------------------------------------------//
-	   // ATTACHING To the pid Process
-	   // the %pid-Process restores operation after the MemoryScanner finishes it's job
-	   //--------------------------------------------------//
-	   cout << "using marker: " << marker << endl;
-	   cout << "halting process: " <<  pid << endl;
-	   result = ptrace( PTRACE_ATTACH, pid, NULL, NULL );
-	   if ( result == -1 ) {
-		  cerr << "	MemoryScanner: ERROR - cannot attach to the " << pid << " process \n";
-	      exit( -1 );
-	   }
-	   waitid( P_PID, pid, infop, WSTOPPED );
-
-	   //------------------------------------------------------//
-	   // READING /proc/%PID/status file
-	   //------------------------------------------------------//
-	   char line [128]; /* or other suitable maximum line size */
-	   char head_buffer[6];//char* head_buffer;
-	   char tail_buffer[10];//char* tail_buffer;
-	   snprintf( statusfile, 128, "/proc/%u/status", pid );
-	   statusf = fopen ( statusfile, "r" );
-	   cout << "opened /proc/" << pid << "/status file \n";
-
-	   ms_uint32 tag_value;
-	   ms_uint32 VmSize=0, VmLck=0, VmRSS=0, VmData=0, VmStk=0, VmExe=0, VmLib=0;
-
-	   if ( statusf != NULL ){
-		   while ( fgets ( line, sizeof line, statusf ) != NULL) /* read a line */{
-			   sscanf( line, "%5s %80u %9s", head_buffer, &tag_value, tail_buffer);
-			   //cout <<"h_buffer=" << head_buffer << " tag_value=" << tag_value << " t_buffer=" << tail_buffer << "\n";
-			   if (strncmp(head_buffer, 		"VmSize",5) == 0){
-				   VmSize = tag_value;
-			   } else if (strncmp(head_buffer, 	"VmLck", 5) == 0){
-				   VmLck = tag_value;
-		   	   } else if (strncmp(head_buffer, 	"VmRSS", 5) == 0){
-				   VmRSS = tag_value;
-		   	   } else if (strncmp(head_buffer, 	"VmData",5) == 0){
-				   VmData = tag_value;
-		   	   } else if (strncmp(head_buffer, 	"VmStk", 5) == 0){
-				   VmStk = tag_value;
-		   	   } else if (strncmp(head_buffer, 	"VmExe", 5) == 0){
-				   VmExe = tag_value;
-		   	   } else if (strncmp(head_buffer, 	"VmLib", 5) == 0){
-				   VmLib = tag_value;
-		   	   }
-		   }
-		   fclose ( statusf );
-	   }
-	   else{
-			perror ( statusfile); /* why didn't the file open? */
-	   }
-	   cout << "VmSize=" << VmSize << " VmRSS=" << VmRSS << " VmData=" << VmData
-		   << "VmStk=" << VmStk << "VmExe=" << VmExe << "VmLib=" << VmLib << endl;
-
-
-
-	   //---------------------------------------------------------//
-	   // READING /proc/%PID/maps file
-	   //---------------------------------------------------------//
-	   snprintf( mapfile, 128, "/proc/%u/maps", pid );
-	   maps = fopen( mapfile, "r" );
-	   if( ! maps ) {
-		   cerr << " MemoryScanner: ERROR - accessing /proc/" << pid <<"/maps file \n";
-		   exit( -1 );
-	   }
-	   cout << "opened mapfile:" << mapfile << "\n";
-
-	   //-------------------------------------------------------//
-	   // Handle to /proc/%PID/mem file
-	   //-------------------------------------------------------//
-	   snprintf( memfile, 128, "/proc/%u/mem", pid );
-	   mem = open( memfile, O_RDONLY, NULL );
-	   if ( mem == -1 ) {
-		   cerr << " MemoryScanner: ERROR - accessing /proc/" << pid << "/mem file \n";
-		   exit( -1 );
-	   }
-	   cout << "opened memfile: " << memfile << endl;
-
-
-	   // ROOT Declarations
-	   TFile *memFile ;
-	   TTree *memTree;
-	   TTree *infoTree;
-
-	   if (scan_number == 0){
-	     cout << " Prepare the memFile = " << file_name << "\n";
-		   TTree *mallocTree;
-
-		   memFile = new TFile(file_name, "recreate");
-
-		   // create hole statistics tree and it's branches:
-		   // start_addr,end_addr, scan_number, marker_char
-		   memTree = new TTree("holeTree","memory_holes_data");
-		   memTree->Branch("hole_addr", &hole_addr,"hole_addr/i");
-		   memTree->Branch("hole_size", &hole_size, "hole_size/i");
-		   memTree->Branch("scan_number",&scan_number, "scan_number/s");
-		   memTree->Branch("hole_marker", &marker, "marker/i");
-
-
-		   // create process memory usage + hole info tree and it's branches:
-		   infoTree = new TTree("infoTree","memory_usage_statistics");
-		   infoTree->Branch("total_hole_memory", &holesSize,"hole_mem/i");
-		   infoTree->Branch("total_hole_number", &block_counter,"hole_number/i");
-		   infoTree->Branch("hole_marker", &marker, "hole_marker/i");
-		   infoTree->Branch("total_maps_memory", &mapsSize, "maps_memory/i");
-		   infoTree->Branch("VmSize", 	&VmSize,"vmsize/i");
-		   infoTree->Branch("VmLck", 	&VmLck, "vmlck/i");
-		   infoTree->Branch("VmRSS", 	&VmRSS,	"vmrss/i");
-		   infoTree->Branch("VmData", 	&VmData,"vmdata/i");
-		   infoTree->Branch("VmStk", 	&VmStk,	"vmstk/i");
-		   infoTree->Branch("VmExe", 	&VmExe, "vmexe/i");
-		   infoTree->Branch("VmLib", 	&VmLib, "vmlib/i");
-		   infoTree->Branch("scan_number", &scan_number, "scan_number/s");
-
-		   // create malloc info tree and it's branches:
-		   mallocTree = new TTree("mallocTree","malloc_statistics");
-		   mallocTree->Branch("malloc_sbrk",  &malloc_total, "sbrk/i");
-		   mallocTree->Branch("malloc_mmap",  &malloc_total, "mmap/i");
-		   mallocTree->Branch("malloc_inuse", &malloc_total, "inuse/i");
-		   mallocTree->Branch("malloc_free",  &malloc_total, "free/i");
-		   mallocTree->Branch("scan_number",  &scan_number,  "scan_number/s");
-
-		   mallocTree->Fill();
-		   mallocTree->Print();
-		   mallocTree->Write();
-	   } else {
-	     cout << " Update the memFile = " << file_name << "\n";
-		   memFile = TFile::Open(file_name, "update");
-		   memTree = (TTree*)memFile->Get("holeTree");
-		   infoTree = (TTree*)memFile->Get("infoTree");
-
-		   //bind variables to the memTree  for further update/filling
-		   memTree->SetBranchAddress("hole_addr", &hole_addr);
-		   memTree->SetBranchAddress("hole_size",  &hole_size);
-		   memTree->SetBranchAddress("scan_number",&scan_number);
-		   memTree->SetBranchAddress("hole_marker", &marker);
-
-		   //bind variables to the infoTree for further update/filling
-		   infoTree->SetBranchAddress("total_hole_memory", &holesSize);
-		   infoTree->SetBranchAddress("total_hole_number", &block_counter);
-		   infoTree->SetBranchAddress("total_maps_memory", &mapsSize);
-		   infoTree->SetBranchAddress("hole_marker", &marker);
-		   infoTree->SetBranchAddress("VmSize", &VmSize);
-		   infoTree->SetBranchAddress("VmLck", 	&VmLck);
-		   infoTree->SetBranchAddress("VmRSS", 	&VmRSS);
-		   infoTree->SetBranchAddress("VmData", &VmData);
-		   infoTree->SetBranchAddress("VmStk", 	&VmStk);
-		   infoTree->SetBranchAddress("VmExe", 	&VmExe);
-		   infoTree->SetBranchAddress("VmLib", 	&VmLib);
-		   infoTree->SetBranchAddress("scan_number", &scan_number);
-	   }
-
-
-
-
-	   //----------------------------------------------------//
-	   //Main Part: The actual memory scanning, first read /proc/%pid/maps file
-	   //Then scan /proc/%pid/mem for marked holes
-	   //----------------------------------------------------//
-	   size_t len = 0;
-	   while (getline(&buffer, &len, maps) > 0) {
-	      sscanf( buffer, "%80x-%80x %2s", &addr_start, &addr_end, perm );
-	      maps_total_size += (addr_end - addr_start);
-
-	      if ( strcmp( perm, "rw" ) != 0 ){
-	         continue;
-	      }
-	      //cout << "addr_start=" << hex << addr_start << " addr_end=" << hex << addr_end << " prm=" << perm << "\n";
-
-	      maprange_counter++;
-	      mem_total_size += (addr_end - addr_start);
-	      //mem_size = addr_end - addr_start;
-
-	      addr = (size_t*) (unsigned long) addr_start;
-
-		   switch ( SCAN_FLAG ) {
-			   case 0 :
-		    	 cout <<"Maps: " << hex << addr_start
-					  << "-"	 << hex << addr_end
-					  << " size=" << addr_end -addr_start << "/n";
-		       break;
-
-		       case 1 :
-			    /*cout <<"Maps: " << hex << addr_start
-						  << "-"	 << hex << addr_end
-						  << " size=" << addr_end -addr_start << "/n";*/;
-		       break;
-
-		       case 2 :
-		    	// cout << "Maps: " << hex << addr_start
-		       break;
-
-		       default :
-		       ;// Process for all other cases.
-		   }
-	      //these are auxiliary flags and variables to define the-size of CDCDCDCD and PINNED blocks
-	      //CD blocks parameters
-	      block_flag = 0;
-	      block_size = 0;
-	      block_ptr = 0;
-	      block_end_ptr = 0;
-	      result = 0;
-
-	    /* scan /proc/%pid/mem for marked holes */
-	      while ( (ms_uint64) (size_t) addr < addr_end  &&  result != -1) {
-
-				/*for (i=0;  i<aux_buffer_size; i++)
-					aux_buffer[i] = 0;*/
-
-				result = pread( mem, &aux_buffer, sizeof(aux_buffer), (ms_uint64) (size_t) addr );
-				if (result == -1){
-					//cerr << " MemoryScanner: ERROR - reading mem at address" << addr << "\t" <<  "error=" << errno << " " << strerror(errno) << "\n";
-					continue ;
-				} else if (result == 0){
-					cerr << " MemoryScanner: WARNING - zero bytes read from mem at address" << addr <<"\n";
-					continue ;
-				}
-
-				int  i;
-
-				for (i=0; i<result; i++){
-						if ( aux_buffer[i] == marker ) {
-							//Here block_flag==0 defines the beginning of the 'CDCDCDCD' memory block
-						   if (block_flag==0) {//cout << "found CDCDCDCD block: " << endl;
-							   block_start = counter;
-							   block_ptr = addr + i;
-							   block_counter++; // 'CDCDCDCD' block counter
-							   block_flag=1; // forthcoming consecutive 'CDCDCDCD' are not the beginning
-						   }
-						   counter ++; //counter of 'CDCDCDCD' pieces
-						}else { //Here block_flag==1 defines the end of the 'CDCDCDCD' memory block
-
-							//this condition for Tcmalloc marking of freed memmory
-							if (block_flag == 1) {
-								if (aux_buffer[i] == size_mark){
-									if ((aux_buffer[i+2] == size_mark) && (aux_buffer[i+1]!=size_mark && aux_buffer[i+1] > 0)){
-										if (aux_buffer[i+1] < 65000000)
-											counter += aux_buffer[i+1]/4 - 2;
-									}
-								}
-							   block_flag = 0;
-							   block_size = counter - block_start;
-							   block_end_ptr = block_ptr + block_size;
-							   //block_size=block_size*sizeof(size_t);
-							   block_total_size +=  block_size;
-							   hole_addr = (ms_uint64 ) (size_t) block_ptr;
-							   //hole_end_addr =   (ms_uint64 ) block_end_ptr;
-							   //hole_size = hole_end_addr - hole_addr;
-							   hole_size = block_size*sizeof(size_t);
-
-							   switch ( SCAN_FLAG ) {
-							     case 0 :
-									   cout <<"C:\t" << hex << block_ptr <<"-" << hex << block_end_ptr ;
-									   cout << " size=" << block_size;
-									   cout << " counter="<< counter << "\n";
-							     break;
-
-							     case 1 :
-									   memTree -> Fill();
-							     break;
-							     case 2 :
-									  /*if(scan_number < report_scan_number)
-										  memTree -> Fill()*/;
-								 break;
-
-							     default :
-							       ;// Process for all other cases.
-							   }
-
-						   }
-						}//if
-					}//for
-					addr += aux_buffer_size;
-			  }//inner-while-end
-
-	     //cout << "hs=" << dec << 4*block_total_size << " c=" << 4*counter << " map_range=" << hex << (size_t*) addr_start << "-" << (size_t*)addr_end << " map_size=" << dec << addr_end - addr_start << " len= "<< len<<"\n";
-	     len = 1;
-	   }//outer-while-end
-
-
-//FINISHED SCANNING of the MEMORY
-	   close( mem );
-	   fclose( maps );
-	   cout << "resuming process:" << pid << endl ;
-
-	   result = ptrace( PTRACE_DETACH, pid, NULL, NULL );
-	   if ( result == -1 ) {
-		  cerr << "MemoryScanner: ERROR " << errno << " " << strerror(errno) << "\n";
-	      exit( -1 );
-	   }
-
-
-	   switch ( SCAN_FLAG ) {
-	     case 0 :
-	       // Process for scan_flag = 0
-			   cout <<"TOTAL FOUND for scan_number: " 			<< scan_number << "\n";
-			   cout << maprange_counter << " MAP_RANGES scanned"<< "\n";
-			   cout << block_counter 	<< " MARKED-Blocks" 	<< "\n";
-			   cout << counter			<< " MARKED-pieces"		<< "\n";
-			   cout << maps_total_size 	<< "(" << maps_total_size*1.0/(1048576.0)	<< " Mb)- TOTAL MAPS MEMORY SIZE   \n";
-			   cout << mem_total_size 	<< "(" << mem_total_size*1.0/(1048576.0) 	<< " Mb)- TOTAL SCANNED MEMORY SIZE\n";
-			   cout <<4*block_total_size<< "(" << 4.0*block_total_size/(1048576.0)	<< " Mb)- MARKED blocks MEMORY SIZE\n";
-			   cout <<4*counter			<< "(" 	<< 4.0*counter/(1048576.0) 	 		<< " Mb)- MARKED pieces MEMORY SIZE\n";
-
-	     break;
-
-	     case 1: case 2 :
-	       // Process for scan_flag = 1
-			   cout <<"TOTAL FOUND for scan_number: " 			<< scan_number << "\n";
-			   cout << maprange_counter << " MAP_RANGES scanned"<< "\n";
-			   cout << block_counter 	<< " MARKED-Blocks" 	<< "\n";
-			   cout << counter			<< " MARKED-pieces"		<< "\n";
-			   cout << maps_total_size 	<< "(" << maps_total_size*1.0/(1048576.0)	<< " Mb)- TOTAL MAPS MEMORY SIZE   \n";
-			   cout << mem_total_size 	<< "(" << mem_total_size*1.0/(1048576.0) 	<< " Mb)- TOTAL SCANNED MEMORY SIZE\n";
-			   cout <<4*block_total_size<< "(" << 4.0*block_total_size/(1048576.0)	<< " Mb)- MARKED blocks MEMORY SIZE\n";
-			   cout <<4*counter			<< "(" 	<< 4.0*counter/(1048576.0) 	 		<< " Mb)- MARKED pieces MEMORY SIZE\n";
-
-			   memFile->cd();
-			   memTree->Write();
-			   mapsSize = maps_total_size/1024;
-			   holesSize = 4*block_total_size/1024;
-			   infoTree->Fill();
-			   infoTree->Write();
-			   memTree->Delete();
-			   infoTree->Delete();
-			   memFile->Close();
-	      break;
-
-	     default :
-	       // Process for all other cases.
-	    	 memTree->Delete();
-	    	 infoTree->Delete();
-	    	 memFile->Close();
-	   }
-#endif
-
-	   return 0;
-}
-
-
diff --git a/Control/HeapMon/src/tcmalloc_dummy.c b/Control/HeapMon/src/tcmalloc_dummy.c
deleted file mode 100644
index 3122b45a8c3e70873602272f8616b13c37bc9cf0..0000000000000000000000000000000000000000
--- a/Control/HeapMon/src/tcmalloc_dummy.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <gperftools/malloc_hook_c.h>
-
-
-size_t MallocExtension_GetAllocatedSize(void* p){
-	return 0;
-}
-
-MallocHook_NewHook MallocHook_SetNewHook(MallocHook_NewHook hook) {
-	//printf("dummy");
-  return 0;
-}
-
-MallocHook_DeleteHook MallocHook_SetDeleteHook(MallocHook_DeleteHook hook) {
-	//printf("dummy");
-	return 0;
-}
-
-void MallocExtension_GetStats(char* buffer, int buffer_length){
- return ;
-}
-
-
diff --git a/Control/IOVSvc/src/IOVSvc.cxx b/Control/IOVSvc/src/IOVSvc.cxx
index feabca95736e2c8a787f576da977906d7df33fa2..24eedb7dc5cf5b197c4ddb4559f1f9b795772c95 100755
--- a/Control/IOVSvc/src/IOVSvc.cxx
+++ b/Control/IOVSvc/src/IOVSvc.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /*****************************************************************************
@@ -466,6 +466,8 @@ StatusCode
 IOVSvc::getRangeFromDB(const CLID& clid, const std::string& key, 
                        IOVRange& range, std::string& tag, IOpaqueAddress*& ioa) const { 
 
+  std::lock_guard<std::recursive_mutex> lock(m_lock);
+
   IIOVSvcTool *ist = getTool( clid, key );
   if (ist == 0) {
     msg() << MSG::ERROR << "getRangeFromDB: proxy for " 
@@ -484,6 +486,8 @@ IOVSvc::getRangeFromDB(const CLID& clid, const std::string& key,
                        const IOVTime& time, IOVRange& range, 
                        std::string& tag, IOpaqueAddress*& ioa) const {
 
+  std::lock_guard<std::recursive_mutex> lock(m_lock);
+
   IIOVSvcTool *ist = getTool( clid, key );
   if (ist == 0) {
     msg() << MSG::ERROR << "getRangeFromDB: proxy for "
@@ -863,8 +867,6 @@ StatusCode
 IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id, 
                       const EventIDBase& now) {
   
-  std::lock_guard<std::recursive_mutex> lock(m_lock);
-
   ATH_MSG_DEBUG("createCondObj:  id: " << id << "  t: " << now << "  valid: "
                 << ccb->valid(now));
 
@@ -910,7 +912,9 @@ IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id,
     }
   }
 
-  if (ccb->proxy() == nullptr) { 
+  if (ccb->proxy() == nullptr) {
+    // nb. We don't want to be holding the IOVSvc lock here,
+    // as SGImplSvc can call to IOVSvc with the store lock held.
     SG::DataProxy* dp = p_detStore->proxy (id.clid(), sgKey);
     ATH_MSG_DEBUG( " found DataProxy " << dp << " for " << id );
     ccb->setProxy(dp);
diff --git a/Control/PerformanceMonitoring/PerfMonComps/python/JobOptCfg.py b/Control/PerformanceMonitoring/PerfMonComps/python/JobOptCfg.py
index 40c57960ee93112c8a224e27fc2c722627a2b5be..72bb83d9143b92dc11a491bce04ae3381ba87b91 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/python/JobOptCfg.py
+++ b/Control/PerformanceMonitoring/PerfMonComps/python/JobOptCfg.py
@@ -1,11 +1,11 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 # @file: JobOptCfg.py
 # @purpose: a customized Configurable class for the PerfMonSvc
 # @author: Sebastien Binet <binet@cern.ch>
 
 ## import the automatically generated Configurables
-from PerfMonCompsConf import PerfMonSvc as _PerfMonSvc
+from PerfMonComps.PerfMonCompsConf import PerfMonSvc as _PerfMonSvc
 
 class PerfMonSvc( _PerfMonSvc ):
 
diff --git a/Control/PerformanceMonitoring/PerfMonComps/python/PyPerfMon.py b/Control/PerformanceMonitoring/PerfMonComps/python/PyPerfMon.py
index 61a98be720ba7babdee6f0ceaa0027bd7567324c..80ca6c9fc1ea245f4adc54960637ad639562cde2 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/python/PyPerfMon.py
+++ b/Control/PerformanceMonitoring/PerfMonComps/python/PyPerfMon.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 # @file: PyPerfMon.py
 # @author: Sebastien Binet <binet@cern.ch>
@@ -20,7 +20,7 @@ import AthenaCommon.Logging as L
 
 _perfMonStates = ('ini','evt','fin')
 
-from PyMonUtils import *
+from PerfMonComps.PyMonUtils import *
 
 from PyUtils.Decorators import memoize, forking
 
diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.cxx
index 81d9fbdf69937fe5fdf66c01485d3ce9f2ab0e1e..804d27ac4dbba655f314625a429c1ff9bed1fecf 100755
--- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.cxx
+++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.cxx
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /** @file DoubleEventSelectorAthenaPool.cxx
  *  @brief This file contains the implementation for the DoubleEventSelectorAthenaPool class.
- *  @author Peter van Gemmeren <gemmeren@anl.gov>
- *  $Id: DoubleEventSelectorAthenaPool.cxx,v 1.226 2009-05-20 18:04:13 gemmeren Exp $
+ *  @author Peter van Gemmeren <gemmeren      -at- anl.gov>
+ *  @author John Detek Chapman <chapman       -at- hep.phy.cam.ac.uk>
+ *  @author Miha Muskinja      <miha.muskinja -at- cern.ch>
  **/
 
 #include "DoubleEventSelectorAthenaPool.h"
@@ -15,10 +16,13 @@
 #include "AthenaPoolCnvSvc/IAthenaPoolCnvSvc.h"
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
 #include "PersistentDataModel/Token.h"
+#include "PersistentDataModel/TokenAddress.h"
 #include "PersistentDataModel/DataHeader.h"
 #include "PoolSvc/IPoolSvc.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "StoreGate/ActiveStoreSvc.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
 
 #include "AthenaKernel/IAthenaIPCTool.h"
 #include "AthenaKernel/ICollectionSize.h"
@@ -63,6 +67,7 @@ DoubleEventSelectorAthenaPool::DoubleEventSelectorAthenaPool(const std::string&
   declareProperty("Connection",          m_connection);
   declareProperty("RefName",             m_refName);
   declareProperty("AttributeListKey",    m_attrListKey = "Input");
+  declareProperty("SecondaryAttrListSuffix",    m_secondaryAttrListSuffix = "secondary");
   declareProperty("PrimaryInputCollections",    m_primaryInputCollectionsProp);
   declareProperty("SecondaryaryInputCollections",    m_secondaryInputCollectionsProp);
   declareProperty("Query",               m_query = "");
@@ -71,8 +76,6 @@ DoubleEventSelectorAthenaPool::DoubleEventSelectorAthenaPool(const std::string&
   declareProperty("SkipEventSequence",   m_skipEventSequenceProp);
   declareProperty("HelperTools",         m_helperTools);
   declareProperty("CounterTool",         m_counterTool);
-  declareProperty("PrimarySharedMemoryTool",    m_primaryEventStreamingTool);
-  declareProperty("SecondarySharedMemoryTool",    m_secondaryEventStreamingTool);
 
   // RunNumber, OldRunNumber and OverrideRunNumberFromInput are used
   // to override the run number coming in on the input stream
@@ -170,16 +173,6 @@ StatusCode DoubleEventSelectorAthenaPool::initialize() {
     ATH_MSG_FATAL("Cannot get " << m_helperTools);
     return(StatusCode::FAILURE);
   }
-  // Get SharedMemoryTools (if configured)
-  if (!m_primaryEventStreamingTool.empty() && !m_primaryEventStreamingTool.retrieve().isSuccess()) {
-    ATH_MSG_FATAL("Cannot get " << m_primaryEventStreamingTool.typeAndName() << "");
-    return(StatusCode::FAILURE);
-  }
-
-  if (!m_secondaryEventStreamingTool.empty() && !m_secondaryEventStreamingTool.retrieve().isSuccess()) {
-    ATH_MSG_FATAL("Cannot get " << m_secondaryEventStreamingTool.typeAndName() << "");
-    return(StatusCode::FAILURE);
-  }
 
   // Ensure the xAODCnvSvc is listed in the EventPersistencySvc
   ServiceHandle<IProperty> epSvc("EventPersistencySvc", name());
@@ -432,14 +425,10 @@ StatusCode DoubleEventSelectorAthenaPool::start() {
   }
   m_primaryInputCollectionsIterator = m_primaryInputCollectionsProp.value().begin();
   m_curPrimaryCollection = 0;
-  if (!m_primaryEventStreamingTool.empty() && m_primaryEventStreamingTool->isClient()) {
-    return(StatusCode::SUCCESS);
-  }
+
   m_secondaryInputCollectionsIterator = m_secondaryInputCollectionsProp.value().begin();
   m_curSecondaryCollection = 0;
-  if (!m_secondaryEventStreamingTool.empty() && m_secondaryEventStreamingTool->isClient()) {
-    return(StatusCode::SUCCESS);
-  }
+
   m_primaryPoolCollectionConverter = getCollectionCnv(m_primaryInputCollectionsIterator,
                                                       m_primaryInputCollectionsProp.value(),
                                                       m_curPrimaryCollection,
@@ -476,11 +465,6 @@ StatusCode DoubleEventSelectorAthenaPool::start() {
 }
 //________________________________________________________________________________
 StatusCode DoubleEventSelectorAthenaPool::stop() {
-  if (!m_primaryEventStreamingTool.empty() && !m_secondaryEventStreamingTool.empty()) {
-    if (m_primaryEventStreamingTool->isClient() && m_secondaryEventStreamingTool->isClient()) {
-      return(StatusCode::SUCCESS);
-    }
-  }
   IEvtSelector::Context* ctxt(nullptr);
   if (!releaseContext(ctxt).isSuccess()) {
     ATH_MSG_WARNING("Cannot release context");
@@ -510,28 +494,6 @@ void DoubleEventSelectorAthenaPool::fireEndFileIncidents(bool processMetadata, c
 
 //________________________________________________________________________________
 StatusCode DoubleEventSelectorAthenaPool::finalize() {
-  if (m_primaryEventStreamingTool.empty() || !m_primaryEventStreamingTool->isClient()) {
-    if (!m_counterTool.empty() && !m_counterTool->preFinalize().isSuccess()) {
-      ATH_MSG_WARNING("Failed to preFinalize() CounterTool");
-    }
-    for (auto& tool : m_helperTools) {
-      if (!tool->preFinalize().isSuccess()) {
-        ATH_MSG_WARNING("Failed to preFinalize() " << tool->name());
-      }
-    }
-  }
-  if (m_secondaryEventStreamingTool.empty() || !m_secondaryEventStreamingTool->isClient()) {
-    // FIXME Need to duplicate these???
-
-    // if (!m_counterTool.empty() && !m_counterTool->preFinalize().isSuccess()) {
-    //   ATH_MSG_WARNING("Failed to preFinalize() CounterTool");
-    // }
-    // for (auto& tool : m_helperTools) {
-    //   if (!tool->preFinalize().isSuccess()) {
-    //     ATH_MSG_WARNING("Failed to preFinalize() " << tool->name());
-    //   }
-    // }
-  }
   delete m_beginIter; m_beginIter = nullptr;
   delete m_endIter;   m_endIter   = nullptr;
   m_primaryHeaderIterator = nullptr;
@@ -542,13 +504,6 @@ StatusCode DoubleEventSelectorAthenaPool::finalize() {
   if (m_secondaryPoolCollectionConverter != nullptr) {
     delete m_secondaryPoolCollectionConverter; m_secondaryPoolCollectionConverter = nullptr;
   }
-  // Release AthenaSharedMemoryTools
-  if (!m_primaryEventStreamingTool.empty() && !m_primaryEventStreamingTool.release().isSuccess()) {
-    ATH_MSG_WARNING("Cannot release AthenaSharedMemoryTool");
-  }
-  if (!m_secondaryEventStreamingTool.empty() && !m_secondaryEventStreamingTool.release().isSuccess()) {
-    ATH_MSG_WARNING("Cannot release AthenaSharedMemoryTool");
-  }
   // Release CounterTool
   if (!m_counterTool.empty() && !m_counterTool.release().isSuccess()) {
     ATH_MSG_WARNING("Cannot release CounterTool.");
@@ -595,52 +550,6 @@ StatusCode DoubleEventSelectorAthenaPool::createContext(IEvtSelector::Context*&
 //________________________________________________________________________________
 StatusCode DoubleEventSelectorAthenaPool::next(IEvtSelector::Context& ctxt) const {
   std::lock_guard<CallMutex> lockGuard(m_callLock);
-  if (!m_primaryEventStreamingTool.empty() && m_primaryEventStreamingTool->isClient()) {
-    void* tokenStr = nullptr;
-    void* tokenStr_secondary = nullptr;
-    unsigned int status = 0;
-    if (!m_primaryEventStreamingTool->getLockedEvent(&tokenStr, status).isSuccess()) {
-      ATH_MSG_FATAL("Cannot get NextEvent from AthenaSharedMemoryTool for primaryEventStreamingTool");
-      delete (char*)tokenStr; tokenStr = nullptr;
-      return(StatusCode::FAILURE);
-    }
-    if (!m_secondaryEventStreamingTool->getLockedEvent(&tokenStr_secondary, status).isSuccess()) {
-      ATH_MSG_FATAL("Cannot get NextEvent from AthenaSharedMemoryTool for secondaryEventStreamingTool");
-      delete (char*)tokenStr; tokenStr = nullptr;
-      return(StatusCode::FAILURE);
-    }
-    AthenaAttributeList* athAttrList = new AthenaAttributeList();
-    ATH_MSG_DEBUG("Try to record m_attrListKey to StoreGate.");
-    if (!eventStore()->record(athAttrList, m_attrListKey.value()).isSuccess()) {
-      ATH_MSG_ERROR("Cannot record AttributeList to StoreGate.");
-      delete (char*)tokenStr; tokenStr = nullptr;
-      delete (char*)tokenStr_secondary; tokenStr_secondary = nullptr;
-      delete athAttrList; athAttrList = nullptr;
-      return(StatusCode::FAILURE);
-    }
-    athAttrList->extend("eventRef", "string");
-    athAttrList->extend("eventRef_secondary", "string");
-    (*athAttrList)["eventRef"].data<std::string>() = std::string((char*)tokenStr);
-    (*athAttrList)["eventRef_secondary"].data<std::string>() = std::string((char*)tokenStr_secondary);
-    Token token;
-    Token token_secondary;
-    token.fromString(std::string((char*)tokenStr));
-    token_secondary.fromString(std::string((char*)tokenStr_secondary));
-    delete (char*)tokenStr; tokenStr = nullptr;
-    delete (char*)tokenStr_secondary; tokenStr_secondary = nullptr;
-    Guid guid = token.dbID();
-    if (guid != m_primaryGuid && m_processPrimaryMetadata.value()) {
-      if (m_evtCount >= 0 && m_primaryGuid != Guid::null()) {
-        // Fire EndInputFile incident
-        FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + m_primaryGuid.toString());
-        m_incidentSvc->fireIncident(endInputFileIncident);
-      }
-      m_primaryGuid = guid;
-      FileIncident beginInputFileIncident(name(), "BeginInputFile", "FID:" + m_primaryGuid.toString());
-      m_incidentSvc->fireIncident(beginInputFileIncident);
-    }
-    return(StatusCode::SUCCESS);
-  }
 
   for (const auto& tool : m_helperTools) {
     if (!tool->preNext().isSuccess()) {
@@ -817,48 +726,16 @@ StatusCode DoubleEventSelectorAthenaPool::next(IEvtSelector::Context& ctxt) cons
       ATH_MSG_WARNING("Failed to preNext() CounterTool.");
     }
     if (m_evtCount > m_skipEvents && (m_skipEventSequence.empty() || m_evtCount != m_skipEventSequence.front())) {
-      if (!m_primaryEventStreamingTool.empty() && m_primaryEventStreamingTool->isServer()) {
-        std::string token = m_primaryHeaderIterator->eventRef().toString();
-        StatusCode sc = m_primaryEventStreamingTool->putEvent(m_evtCount - 1, token.c_str(), token.length() + 1, 0);
-        while (sc.isRecoverable()) {
-          while (m_athenaPoolCnvSvc->readData().isSuccess()) {
-            ATH_MSG_VERBOSE("Called last readData, while putting next event in next()");
-          }
-          // Nothing to do right now, trigger alternative (e.g. caching) here? Currently just fast loop.
-          sc = m_primaryEventStreamingTool->putEvent(m_evtCount - 1, token.c_str(), token.length() + 1, 0);
-        }
-        if (!sc.isSuccess()) {
-          ATH_MSG_ERROR("Cannot put Event " << m_evtCount - 1 << " to PrimaryAthenaSharedMemoryTool");
-          return(StatusCode::FAILURE);
-        }
-      } else {
-        ATH_MSG_DEBUG("Try recording AttributeList");
-        if (!recordAttributeList(m_primaryHeaderIterator, m_attrListKey).isSuccess()) {
-          ATH_MSG_ERROR("Failed to record AttributeList.");
-          return(StatusCode::FAILURE);
-        }
+      if (!eventStore()->clearStore().isSuccess()) {
+          ATH_MSG_WARNING("Cannot clear Store");
       }
-      if (!m_secondaryEventStreamingTool.empty() && m_secondaryEventStreamingTool->isServer()) {
-        std::string token = m_secondaryHeaderIterator->eventRef().toString();
-        StatusCode sc = m_secondaryEventStreamingTool->putEvent(m_evtCount - 1, token.c_str(), token.length() + 1, 0);
-        while (sc.isRecoverable()) {
-          while (m_athenaPoolCnvSvc->readData().isSuccess()) {
-            ATH_MSG_VERBOSE("Called last readData, while putting next event in next()");
-          }
-          // Nothing to do right now, trigger alternative (e.g. caching) here? Currently just fast loop.
-          sc = m_secondaryEventStreamingTool->putEvent(m_evtCount - 1, token.c_str(), token.length() + 1, 0);
-        }
-        if (!sc.isSuccess()) {
-          ATH_MSG_ERROR("Cannot put Event " << m_evtCount - 1 << " to SecondaryAthenaSharedMemoryTool");
-          return(StatusCode::FAILURE);
-        }
-      } else {
-        ATH_MSG_DEBUG("Try appending to AttributeList");
-        if (!recordAttributeList(m_secondaryHeaderIterator, m_attrListKey, "secondary").isSuccess()) {
-          ATH_MSG_ERROR("Failed to append to AttributeList.");
-          return(StatusCode::FAILURE);
-        }
+
+      ATH_MSG_DEBUG("Try recording AttributeLists");
+      if (!recordAllAttributeList().isSuccess()) {
+        ATH_MSG_ERROR("Failed to record AttributeLists.");
+        return(StatusCode::FAILURE);
       }
+
       StatusCode status = StatusCode::SUCCESS;
       for (const auto& tool : m_helperTools) {
         StatusCode toolStatus = tool->postNext();
@@ -882,13 +759,6 @@ StatusCode DoubleEventSelectorAthenaPool::next(IEvtSelector::Context& ctxt) cons
         }
         break;
       }
-      const DataHandle<AthenaAttributeList> primaryOldAttrList;
-      if (eventStore()->retrieve(primaryOldAttrList, m_attrListKey.value()).isSuccess()) {
-        if (!eventStore()->removeDataAndProxy(primaryOldAttrList.cptr()).isSuccess()) {
-          ATH_MSG_ERROR("Cannot remove old AttributeList from StoreGate.");
-          return(StatusCode::FAILURE);
-        }
-      }
     } else {
       if (!m_skipEventSequence.empty() && m_evtCount == m_skipEventSequence.front()) {
         m_skipEventSequence.erase(m_skipEventSequence.begin());
@@ -944,25 +814,27 @@ StatusCode DoubleEventSelectorAthenaPool::rewind(IEvtSelector::Context& /*ctxt*/
 StatusCode DoubleEventSelectorAthenaPool::createAddress(const IEvtSelector::Context& /*ctxt*/,
                                                               IOpaqueAddress*& iop) const {
   std::string tokenStr;
-  const DataHandle<AthenaAttributeList> attrList;
-  if (eventStore()->retrieve(attrList, m_attrListKey.value()).isSuccess()) {
+  SG::ReadHandle<AthenaAttributeList> attrList(m_attrListKey.value(), eventStore()->name());
+  if (attrList.isValid()) {
     try {
       if (m_refName.value().empty()) {
         tokenStr = (*attrList)["eventRef"].data<std::string>();
-        ATH_MSG_DEBUG("found PrimaryAthenaAttribute, name = eventRef = " << tokenStr);
+        ATH_MSG_DEBUG("found AthenaAttribute, name = eventRef = " << tokenStr);
       } else {
         tokenStr = (*attrList)[m_refName.value() + "_ref"].data<std::string>();
-        ATH_MSG_DEBUG("found PrimaryAthenaAttribute, name = " << m_refName.value() << "_ref = " << tokenStr);
+        ATH_MSG_DEBUG("found AthenaAttribute, name = " << m_refName.value() << "_ref = " << tokenStr);
       }
     } catch (std::exception &e) {
       ATH_MSG_ERROR(e.what());
       return(StatusCode::FAILURE);
     }
   } else {
-    ATH_MSG_WARNING("Cannot find PrimaryAthenaAttribute, key = " << m_attrListKey.value());
+    ATH_MSG_WARNING("Cannot find AthenaAttribute, key = " << m_attrListKey.value());
     tokenStr = m_primaryPoolCollectionConverter->retrieveToken(m_primaryHeaderIterator, m_refName.value());
   }
-  iop = new GenericAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), tokenStr, "EventSelector");
+  Token* token = new Token;
+  token->fromString(tokenStr);
+  iop = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", "EventSelector", IPoolSvc::kInputStream, token);
   return(StatusCode::SUCCESS);
 }
 //________________________________________________________________________________
@@ -1126,106 +998,6 @@ int DoubleEventSelectorAthenaPool::findEvent(int evtNum, std::vector<int>& numEv
   return(-1);
 }
 
-//________________________________________________________________________________
-StatusCode DoubleEventSelectorAthenaPool::makeServer(int num) {
-  if (num < 0) {
-    if (m_athenaPoolCnvSvc->makeServer(num - 1).isFailure()) {
-      ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to output DataStreaming server");
-    }
-    return(StatusCode::SUCCESS);
-  }
-  if (m_athenaPoolCnvSvc->makeServer(num + 1).isFailure()) {
-    ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to input DataStreaming server");
-    return(StatusCode::FAILURE);
-  }
-  if (m_primaryEventStreamingTool.empty()) {
-    return(StatusCode::SUCCESS);
-  }
-  m_processPrimaryMetadata = false;
-  ATH_MSG_DEBUG("makeServer: " << m_primaryEventStreamingTool << " = " << num);
-  return(m_primaryEventStreamingTool->makeServer(1));
-}
-
-//________________________________________________________________________________
-StatusCode DoubleEventSelectorAthenaPool::makeClient(int num) {
-  if (m_athenaPoolCnvSvc->makeClient(num + 1).isFailure()) {
-    ATH_MSG_ERROR("Failed to switch AthenaPoolCnvSvc to DataStreaming client");
-    return(StatusCode::FAILURE);
-  }
-  if (m_primaryEventStreamingTool.empty()) {
-    return(StatusCode::SUCCESS);
-  }
-  ATH_MSG_DEBUG("makeClient: " << m_primaryEventStreamingTool << " = " << num);
-  return(m_primaryEventStreamingTool->makeClient(0));
-}
-
-//________________________________________________________________________________
-StatusCode DoubleEventSelectorAthenaPool::share(int evtnum) {
-  if (!m_primaryEventStreamingTool.empty() && m_primaryEventStreamingTool->isClient()) {
-    StatusCode sc = m_primaryEventStreamingTool->lockEvent(evtnum);
-    while (sc.isRecoverable()) {
-      usleep(1000);
-      sc = m_primaryEventStreamingTool->lockEvent(evtnum);
-    }
-    // Send stop client and wait for restart
-    if (sc.isFailure()) {
-      if (m_athenaPoolCnvSvc->makeClient(0).isFailure()) {
-        return(StatusCode::FAILURE);
-      }
-      sc = m_primaryEventStreamingTool->lockEvent(evtnum);
-      while (sc.isRecoverable() || sc.isFailure()) {
-        usleep(1000);
-        sc = m_primaryEventStreamingTool->lockEvent(evtnum);
-      }
-      //FIXME
-      if (m_athenaPoolCnvSvc->makeClient(1).isFailure()) {
-        return(StatusCode::FAILURE);
-      }
-    }
-    return(sc);
-  }
-  return(StatusCode::FAILURE);
-}
-
-//________________________________________________________________________________
-StatusCode DoubleEventSelectorAthenaPool::readEvent(int maxevt) {
-  ATH_MSG_VERBOSE("Called read Event " << maxevt);
-  IEvtSelector::Context* ctxt = new EventContextAthenaPool(this);
-  for (int i = 0; i < maxevt || maxevt == -1; ++i) {
-    if (!next(*ctxt).isSuccess()) {
-      if (m_evtCount == -1) {
-        ATH_MSG_VERBOSE("Called read Event and read last event from input: " << i);
-        break;
-      }
-      ATH_MSG_ERROR("Cannot read Event " << m_evtCount - 1 << " into AthenaSharedMemoryTool");
-      delete ctxt; ctxt = nullptr;
-      return(StatusCode::FAILURE);
-    } else {
-      ATH_MSG_VERBOSE("Called next, read Event " << m_evtCount - 1);
-    }
-  }
-  delete ctxt; ctxt = nullptr;
-  // End of file, wait for last event to be taken
-  StatusCode sc = m_primaryEventStreamingTool->putEvent(0, 0, 0, 0);
-  while (sc.isRecoverable()) {
-    while (m_athenaPoolCnvSvc->readData().isSuccess()) {
-      ATH_MSG_VERBOSE("Called last readData, while marking last event in readEvent()");
-    }
-    // Nothing to do right now, trigger alternative (e.g. caching) here? Currently just fast loop.
-    sc = m_primaryEventStreamingTool->putEvent(0, 0, 0, 0);
-  }
-  if (!sc.isSuccess()) {
-    ATH_MSG_ERROR("Cannot put last Event marker to AthenaSharedMemoryTool");
-  } else {
-    sc = m_athenaPoolCnvSvc->readData();
-    while (sc.isSuccess() || sc.isRecoverable()) {
-      sc = m_athenaPoolCnvSvc->readData();
-    }
-    ATH_MSG_DEBUG("Failed last readData -> Clients are stopped, after marking last event in readEvent()");
-  }
-  return(StatusCode::SUCCESS);
-}
-
 //__________________________________________________________________________
 int DoubleEventSelectorAthenaPool::size(Context& /*ctxt*/) const {
   // Fetch sizes of all collections.
@@ -1294,54 +1066,53 @@ PoolCollectionConverter* DoubleEventSelectorAthenaPool::getCollectionCnv(std::ve
   }
   return(nullptr);
 }
+
 //__________________________________________________________________________
-StatusCode DoubleEventSelectorAthenaPool::recordAttributeList(pool::ICollectionCursor* HeaderIterator,
-                                                              Gaudi::Property<std::string> attrListKey,
-                                                              std::string suffix) const {
-  AthenaAttributeList* athAttrList = nullptr;
-  // Retrive AttributeList and extend it with suffix
-  if (!suffix.empty()) {
-    suffix = "_" + suffix;
-    if (!eventStore()->retrieve(athAttrList, attrListKey.value()).isSuccess()) {
-      ATH_MSG_ERROR("Cannot retrieve AttributeList from StoreGate.");
-      return(StatusCode::FAILURE);
-    }
-  }
+StatusCode DoubleEventSelectorAthenaPool::recordAllAttributeList() const {
   // Get access to AttributeList
-  else {
-    ATH_MSG_DEBUG("Get AttributeList from the collection");
-    // MN: accessing only attribute list, ignoring token list
-    const coral::AttributeList& attrList = HeaderIterator->currentRow().attributeList();
-    ATH_MSG_DEBUG("AttributeList size " << attrList.size());
-    athAttrList = new AthenaAttributeList(attrList);
-    if (!eventStore()->record(athAttrList, attrListKey.value()).isSuccess()) {
-      ATH_MSG_ERROR("Cannot record AttributeList to StoreGate.");
-      delete athAttrList; athAttrList = nullptr;
-      return(StatusCode::FAILURE);
-    }
-  }
-  const pool::TokenList& tokenList = HeaderIterator->currentRow().tokenList();
+  ATH_MSG_DEBUG("Get AttributeList from the collection");
+  // MN: accessing only attribute list, ignoring token list
+  const coral::AttributeList& attrList = m_primaryHeaderIterator->currentRow().attributeList();
+  ATH_MSG_DEBUG("AttributeList size " << attrList.size());
+  auto athAttrList = std::make_unique<AthenaAttributeList>(attrList);
+  const pool::TokenList& tokenList = m_primaryHeaderIterator->currentRow().tokenList();
   for (pool::TokenList::const_iterator iter = tokenList.begin(), last = tokenList.end(); iter != last; ++iter) {
+    athAttrList->extend(iter.tokenName(), "string");
+    (*athAttrList)[iter.tokenName()].data<std::string>() = iter->toString();
+    ATH_MSG_DEBUG("record AthenaAttribute, name = " << iter.tokenName() << " = " << iter->toString() << ".");
+  }
+  athAttrList->extend("eventRef", "string");
+  (*athAttrList)["eventRef"].data<std::string>() = m_primaryHeaderIterator->eventRef().toString();
+
+  ATH_MSG_DEBUG("Append secondary attribute list properties to the primary one with a suffix: " << m_secondaryAttrListSuffix.value());
+  std::string suffix = "_" + m_secondaryAttrListSuffix.value();
+
+  const pool::TokenList& extraTokenList = m_secondaryHeaderIterator->currentRow().tokenList();
+  for (pool::TokenList::const_iterator iter = extraTokenList.begin(), last = extraTokenList.end(); iter != last; ++iter) {
     athAttrList->extend(iter.tokenName() + suffix, "string");
     (*athAttrList)[iter.tokenName() + suffix].data<std::string>() = iter->toString();
     ATH_MSG_DEBUG("record AthenaAttribute, name = " << iter.tokenName() + suffix << " = " << iter->toString() << ".");
   }
   athAttrList->extend("eventRef" + suffix, "string");
-  (*athAttrList)["eventRef" + suffix].data<std::string>() = HeaderIterator->eventRef().toString();
-  ATH_MSG_DEBUG("record AthenaAttribute, name = eventRef" + suffix + " = " << HeaderIterator->eventRef().toString() << ".");
-  
+  (*athAttrList)["eventRef" + suffix].data<std::string>() = m_secondaryHeaderIterator->eventRef().toString();
+  ATH_MSG_DEBUG("record AthenaAttribute, name = eventRef" + suffix + " = " << m_secondaryHeaderIterator->eventRef().toString() << ".");
+
   // copy all atributes from extra attribute list
   // to the primary attribute list with a suffix 
-  if (!suffix.empty()) {
-    athAttrList->extend("hasSecondaryInput", "bool");
-    (*athAttrList)["hasSecondaryInput"].data<bool>() = true;
-    const coral::AttributeList& extraAttrList = HeaderIterator->currentRow().attributeList();
-    for (const auto &attr : extraAttrList) {
-      athAttrList->extend(attr.specification().name() + suffix, attr.specification().type());
-      (*athAttrList)[attr.specification().name() + suffix] = attr;
-    }
+  athAttrList->extend("hasSecondaryInput", "bool");
+  (*athAttrList)["hasSecondaryInput"].data<bool>() = true;
+  const coral::AttributeList& extraAttrList = m_secondaryHeaderIterator->currentRow().attributeList();
+  for (const auto &attr : extraAttrList) {
+    athAttrList->extend(attr.specification().name() + suffix, attr.specification().type());
+    (*athAttrList)[attr.specification().name() + suffix] = attr;
+  }
+
+  ATH_MSG_DEBUG("record AthenaAttribute, name = eventRef = " << m_primaryHeaderIterator->eventRef().toString() << ".");
+  SG::WriteHandle<AthenaAttributeList> wh(m_attrListKey.value(), eventStore()->name());
+  if (!wh.record(std::move(athAttrList)).isSuccess()) {
+    ATH_MSG_ERROR("Cannot record AttributeList to StoreGate " << StoreID::storeName(eventStore()->storeID()));
+    return(StatusCode::FAILURE);
   }
-    
   return(StatusCode::SUCCESS);
 }
 //__________________________________________________________________________
@@ -1366,9 +1137,6 @@ StatusCode DoubleEventSelectorAthenaPool::io_reinit() {
     ATH_MSG_FATAL("IoComponentMgr does not know about myself !");
     return(StatusCode::FAILURE);
   }
-  if (!m_primaryEventStreamingTool.empty() && m_primaryEventStreamingTool->isClient()) {
-    return(this->reinit());
-  }
   std::vector<std::string> primaryInputCollections = m_primaryInputCollectionsProp.value();
   std::set<std::size_t> updatedIndexes;
   for (std::size_t i = 0, imax = m_primaryInputCollectionsProp.value().size(); i < imax; i++) {
@@ -1531,3 +1299,31 @@ bool DoubleEventSelectorAthenaPool::disconnectIfFinished( SG::SourceID fid ) con
    }
    return false;
 }
+
+/*
+  These are needed to satisfy the requirements of the pure virtual functions
+  in the interface, but there are no implementations for the DoubleEventSelector.
+*/
+//________________________________________________________________________________
+StatusCode DoubleEventSelectorAthenaPool::makeServer(__attribute__((unused)) int num) {
+  ATH_MSG_FATAL("makeServer() not implemented in the DoubleEventSelector");
+  return(StatusCode::FAILURE);
+}
+
+//________________________________________________________________________________
+StatusCode DoubleEventSelectorAthenaPool::makeClient(__attribute__((unused)) int num) {
+  ATH_MSG_FATAL("makeClient() not implemented in the DoubleEventSelector");
+  return(StatusCode::FAILURE);
+}
+
+//________________________________________________________________________________
+StatusCode DoubleEventSelectorAthenaPool::share(__attribute__((unused)) int evtnum) {
+  ATH_MSG_FATAL("share() not implemented in the DoubleEventSelector");
+  return(StatusCode::FAILURE);
+}
+
+//________________________________________________________________________________
+StatusCode DoubleEventSelectorAthenaPool::readEvent(__attribute__((unused)) int maxevt) {
+  ATH_MSG_FATAL("readEvent() not implemented in the DoubleEventSelector");
+  return(StatusCode::FAILURE);
+}
diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.h b/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.h
index e5660d386d080cd4fda7c08f6e3c9c6f87780f2e..11821ff31dd4292e418b216d050de4792dc259e3 100755
--- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.h
+++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/DoubleEventSelectorAthenaPool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DOUBLEEVENTSELECTORATHENAPOOL_H
@@ -7,7 +7,9 @@
 
 /** @file DoubleEventSelectorAthenaPool.h
  *  @brief This file contains the class definition for the DoubleEventSelectorAthenaPool class.
- *  @author Peter van Gemmeren <gemmeren@anl.gov>
+ *  @author Peter van Gemmeren <gemmeren      -at- anl.gov>
+ *  @author John Detek Chapman <chapman       -at- hep.phy.cam.ac.uk>
+ *  @author Miha Muskinja      <miha.muskinja -at- cern.ch>
  **/
 
 #include "GaudiKernel/IEvtSelector.h"
@@ -157,7 +159,8 @@ private: // internal member functions
                                             long& curCollection, std::vector<int>& numEvt, std::vector<int>& firstEvt,
                                             bool processMetadata, bool throwIncidents = false) const;
   /// Record AttributeList in StoreGate
-  StatusCode recordAttributeList(pool::ICollectionCursor* HeaderIterator, Gaudi::Property<std::string> attrListKey, std::string suffix = "") const;
+  StatusCode recordAllAttributeList() const;
+
   /// Search for event number evtNum.
   int findEvent(int evtNum, std::vector<int>& numEvt, std::vector<int>& firstEvt, const std::vector<std::string>& inputCollections) const;
 
@@ -201,7 +204,7 @@ private: // properties
   Gaudi::Property<std::string> m_derRefName;
   /// AttributeList SG key
   Gaudi::Property<std::string> m_attrListKey;
-  Gaudi::Property<std::string> m_secondaryAttrListKey;
+  Gaudi::Property<std::string> m_secondaryAttrListSuffix;
   /// InputCollections, vector with names of the input collections.
   Gaudi::Property<std::vector<std::string>> m_primaryInputCollectionsProp;
   mutable std::vector<std::string>::const_iterator m_primaryInputCollectionsIterator;
diff --git a/Event/ByteStreamCnvSvc/CMakeLists.txt b/Event/ByteStreamCnvSvc/CMakeLists.txt
index 84da1ffa7d472eb904abb075801e0fd66c8a4151..29681add519ac69b2461782923bed2d23a895ae0 100644
--- a/Event/ByteStreamCnvSvc/CMakeLists.txt
+++ b/Event/ByteStreamCnvSvc/CMakeLists.txt
@@ -91,7 +91,7 @@ function( _add_test testName toExecute )
    # Set up the test:
    atlas_add_test( ${testName}
       SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/${testName}_test.sh
-      PROPERTIES TIMEOUT 300
+      PROPERTIES TIMEOUT 600
       ${_options} )
 
 endfunction( _add_test )
diff --git a/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h b/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h
index 56c3307f128b2f9afb1ab1964a2b2f3ad031b7fe..70f4c3064c4fcd2eeaa04c62f037bf226f42c659 100644
--- a/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h
+++ b/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef BYTESTREAMDATA_BYTESTREAMMETADATACONTAINER_H
@@ -25,7 +25,7 @@ CLASS_DEF(ByteStreamMetadataContainer, 1076128893, 1)
 #ifndef XAOD_STANDALONE
 #include "AthenaKernel/MetaCont.h"
 CLASS_DEF( MetaCont<ByteStreamMetadataContainer> , 1174128703 , 1 )
-#include "SGTools/BaseInfo.h"
+#include "AthenaKernel/BaseInfo.h"
 SG_BASE( MetaCont<ByteStreamMetadataContainer>, MetaContBase );
 #endif // not XAOD_STANDALONE
 
diff --git a/Event/ByteStreamData/CMakeLists.txt b/Event/ByteStreamData/CMakeLists.txt
index 3ea4216c32b1127d0b307141b82a2de9c0220da0..04342fcf2d5ca1d07273fec1c0867c28132d92af 100644
--- a/Event/ByteStreamData/CMakeLists.txt
+++ b/Event/ByteStreamData/CMakeLists.txt
@@ -30,7 +30,7 @@ atlas_add_library( ByteStreamData
    src/ByteStreamMetadata.cxx
    PUBLIC_HEADERS ByteStreamData
    ${extra_inc}
-   LINK_LIBRARIES AthContainers ${extra_lib} )
+   LINK_LIBRARIES AthenaKernel AthContainers ${extra_lib} )
 
 atlas_add_library( ByteStreamData_test
    src/ROBData_t.cxx
diff --git a/Event/EventContainers/EventContainers/IIdentifiableCont.h b/Event/EventContainers/EventContainers/IIdentifiableCont.h
index 9b77bb11c7e1a3386245cf2829b8a8f401df3539..1d9e18de2fded450ea7cab704e5794b832b16275 100644
--- a/Event/EventContainers/EventContainers/IIdentifiableCont.h
+++ b/Event/EventContainers/EventContainers/IIdentifiableCont.h
@@ -23,7 +23,7 @@ public:
 
     virtual size_t numberOfCollections() const =0;
 
-    virtual bool  tryFetch(IdentifierHash hashId) = 0;
+    virtual bool  tryAddFromCache(IdentifierHash hashId) = 0;
 
     virtual bool hasExternalCache() const =0;
 
diff --git a/Event/EventContainers/EventContainers/IdentifiableContTemp.h b/Event/EventContainers/EventContainers/IdentifiableContTemp.h
index d6e528368c40dd8de75fca703ca50c1191b920e9..305bdb2e053348fd52a06ecdbcf29b744df05453 100644
--- a/Event/EventContainers/EventContainers/IdentifiableContTemp.h
+++ b/Event/EventContainers/EventContainers/IdentifiableContTemp.h
@@ -75,9 +75,9 @@ public:
         return m_usedhashes.size();
     }
     
-    virtual bool  tryFetch(IdentifierHash hashId) override{
+    virtual bool  tryAddFromCache(IdentifierHash hashId) override{
       if(m_extIDC){
-          return m_extIDC->tryFetch(hashId);
+          return m_extIDC->tryAddFromCache(hashId);
       }
       return false;
     }
diff --git a/Event/EventContainers/EventContainers/IdentifiableContainerBase.h b/Event/EventContainers/EventContainers/IdentifiableContainerBase.h
index 6799b3bd50656fde5bda2b6721d7c10c37c8b6db..e9dce0ba34e4ff945c267aa7a491fd67ebdcc4c0 100644
--- a/Event/EventContainers/EventContainers/IdentifiableContainerBase.h
+++ b/Event/EventContainers/EventContainers/IdentifiableContainerBase.h
@@ -26,8 +26,8 @@ protected:
     std::vector<IdentifierHash> GetAllCurrentHashes() const;
 
     void Wait() const;
-    bool tryFetch(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock);
-    bool tryFetch(IdentifierHash hashId);
+    bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock);
+    bool tryAddFromCache(IdentifierHash hashId);
     void cleanup();
     size_t numberOfCollections() const;
     void ResetMask();
diff --git a/Event/EventContainers/EventContainers/IdentifiableContainerMT.h b/Event/EventContainers/EventContainers/IdentifiableContainerMT.h
index 5324a8aa40aedf25a7c5b8060ffb7651e4f476c5..81b2fe4780d1209f80aace19cf1215cd36709b15 100644
--- a/Event/EventContainers/EventContainers/IdentifiableContainerMT.h
+++ b/Event/EventContainers/EventContainers/IdentifiableContainerMT.h
@@ -262,7 +262,7 @@ public:
 
     /// Looks in the cache to see if item already exists if not it returns false,
     /// If it does exist it incorporates it into the IDC view but changing the mask.
-    virtual bool tryFetch(IdentifierHash hashId) override final;
+    virtual bool tryAddFromCache(IdentifierHash hashId) override final;
 
     /// Tries will look for item in cache, if it doesn't exist will call the cache IMAKER
     /// If cache doesn't have an IMAKER then this fails.
@@ -324,7 +324,7 @@ public:
        IDC_WriteHandle lock;
        lock.m_hashId = hash;
        lock.m_IDC_ptr = this;
-       lock.m_alreadyPresent = IdentifiableContainerBase::tryFetch(hash, lock);
+       lock.m_alreadyPresent = IdentifiableContainerBase::tryAddFromCache(hash, lock);
        return lock;
     }
 };
@@ -406,9 +406,9 @@ IdentifiableContainerMT<T>::fetchOrCreate(const std::vector<IdentifierHash> &has
 
 template < class T>
 bool
-IdentifiableContainerMT<T>::tryFetch(IdentifierHash hashId)
+IdentifiableContainerMT<T>::tryAddFromCache(IdentifierHash hashId)
 {
-    return IdentifiableContainerBase::tryFetch(hashId);
+    return IdentifiableContainerBase::tryAddFromCache(hashId);
 }
 
 template < class T >
diff --git a/Event/EventContainers/src/IdentifiableContainerBase.cxx b/Event/EventContainers/src/IdentifiableContainerBase.cxx
index 3010aa56fc49749014f7b7a58b46220c70cf2123..2f19b0fc100b50141b17820a5bf479d387ec06e7 100644
--- a/Event/EventContainers/src/IdentifiableContainerBase.cxx
+++ b/Event/EventContainers/src/IdentifiableContainerBase.cxx
@@ -47,10 +47,10 @@
     m_waitNeeded.store(false);
   }
 
-  bool IdentifiableContainerBase::tryFetch(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock)
+  bool IdentifiableContainerBase::tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock)
   {
     if(!m_OnlineMode){
-       return tryFetch(hashId);//No point calling expensive lock method
+       return tryAddFromCache(hashId);//No point calling expensive lock method
     }
     int flag = m_cacheLink->tryLock(hashId, lock, m_waitlist);
     //Relaxed since this should not be running in threaded situation.
@@ -62,7 +62,7 @@
     return false;
   }
 
-  bool IdentifiableContainerBase::tryFetch(IdentifierHash hashId)
+  bool IdentifiableContainerBase::tryAddFromCache(IdentifierHash hashId)
   {
     auto ptr = m_cacheLink->find(hashId);
     if(ptr==nullptr){
diff --git a/Event/EventContainers/test/IDC_Realistic_Test.cxx b/Event/EventContainers/test/IDC_Realistic_Test.cxx
index 2ba84448dd7f166775997f9543e7ab7cd57c107e..37ed5fc5bbbe5ec8ebca9ac5b7f4a7869ee61ad9 100644
--- a/Event/EventContainers/test/IDC_Realistic_Test.cxx
+++ b/Event/EventContainers/test/IDC_Realistic_Test.cxx
@@ -220,7 +220,7 @@ public:
 
         for(size_t i =RoIStart ; i < RoIEnd; i++) {
             c.fills++;
-            bool cacheh = container.tryFetch(i);
+            bool cacheh = container.tryAddFromCache(i);
             if(cacheh) {
                 c.cachehit++;
                 continue;
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/ConfiguredOverlay_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/ConfiguredOverlay_jobOptions.py
index 6b22d865c1e6ff4697bd7aef744639cde067a366..d518e7e7fe0f7d4b582b43e8d84e9aeb29515608 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/ConfiguredOverlay_jobOptions.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/ConfiguredOverlay_jobOptions.py
@@ -33,7 +33,6 @@ DetFlags.Print()
 
 if overlayFlags.isDataOverlay():
     from InDetRecExample.InDetJobProperties import InDetFlags
-    include ("InDetRecExample/InDetRecConditionsAccess.py")
     from ByteStreamCnvSvc import ReadByteStream
     include("RecExCommon/BSRead_config.py")
     ServiceMgr.ByteStreamInputSvc.FullFileName = DataInputCollections
diff --git a/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.cxx b/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.cxx
index 14636aefc59921140e9fd60c9bcd85a47e82f96c..5d4555dbc13fd7fafcc9fcc04a8e71d5b309cad7 100644
--- a/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.cxx
+++ b/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.cxx
@@ -1,12 +1,12 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id: AuxStoreWrapper.cxx 695881 2015-09-21 08:47:05Z will $
 
 // Gaudi/Athena include(s):
 #include "SGTools/DataProxy.h"
-#include "SGTools/ClassID_traits.h"
+#include "AthenaKernel/ClassID_traits.h"
 #include "AthenaKernel/errorcheck.h"
 
 // EDM include(s):
diff --git a/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h b/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h
index c1e91f909c82ee2fb7e4081eb0212ee1af8c5100..17a299d8e539ea9344f0c3b35b355cc08d20b2bb 100644
--- a/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h
+++ b/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id: EventFormat.h 629191 2014-11-18 17:01:16Z krasznaa $
@@ -22,7 +22,7 @@ CLASS_DEF( xAOD::EventFormat, 243004407, 1 )
 #ifndef XAOD_STANDALONE
 #include "AthenaKernel/MetaCont.h"
 CLASS_DEF( MetaCont<xAOD::EventFormat> , 35480469 , 1 )
-#include "SGTools/BaseInfo.h"
+#include "xAODCore/BaseInfo.h"
 SG_BASE( MetaCont<xAOD::EventFormat>, MetaContBase );
 #endif // not XAOD_STANDALONE
 
diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
index d311ce9e75693375aafc2d6b11fc99b77b01bded..f5d9a73d33a9229537c1a270f8bdaa4e89cdae93 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
@@ -48,7 +48,6 @@ def setupMessageSvc():
    # Message suppression
    MessageSvc.enableSuppression    = False
    MessageSvc.suppressRunningOnly  = True
-   MessageSvc.resetStatsAtBeginRun = True
 
    # 0 = no suppression, negative = log-suppression, positive = normal suppression
    # Do not rely on the defaultLimit property, always set each limit separately
@@ -68,7 +67,6 @@ def setupMessageSvc():
    # show summary statistics of messages in finalize
    MessageSvc.showStats = True
    MessageSvc.statLevel = WARNING
-   MessageSvc.statLevelRun = VERBOSE
 
 # online ROB data provider service
 from TrigServicesConf import HltROBDataProviderSvc as _HltROBDataProviderSvc
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.cxx b/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.cxx
index d13cc16ef6d871cbf2ea5fcf4583a98d0bc0d2e5..c13a6f1077c959de080177f8e35baa32abbf65d6 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.cxx
@@ -3,10 +3,12 @@
 */
 #include "TrigMessageSvc.h"
 #include "GaudiKernel/IAppMgrUI.h"
+#include "GaudiKernel/ITHistSvc.h"
 #include "GaudiKernel/Kernel.h"
 #include "GaudiKernel/Message.h"
 #include "GaudiKernel/StatusCode.h"
 #include "GaudiKernel/System.h"
+#include "TrigMonitorBase/TrigLockedHist.h"
 
 #include "ers/ers.h"
 
@@ -51,7 +53,7 @@ StatusCode TrigMessageSvc::initialize()
   StatusCode sc = Service::initialize();
   if (sc.isFailure()) return sc;
 
-  m_doSuppress = m_suppress;
+  m_doSuppress = m_suppress && (!m_suppressRunningOnly);
 
   if (m_color) {
     std::cout << "TrigMessageSvc WARNING: Colors are not supported by TrigMessageSvc" << std::endl;
@@ -62,9 +64,59 @@ StatusCode TrigMessageSvc::initialize()
 StatusCode TrigMessageSvc::reinitialize()
 {
   m_state = Gaudi::StateMachine::OFFLINE;
-  return initialize();
+  StatusCode sc = initialize();
+  if ( sc.isSuccess() ) m_state = Gaudi::StateMachine::INITIALIZED;
+  return sc;
+}
+
+StatusCode TrigMessageSvc::start()
+{
+  bookHistograms();
+  m_doPublish = true;
+  m_doSuppress = m_suppress;
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrigMessageSvc::stop()
+{
+  m_doPublish = false;
+  m_doSuppress = m_suppress && (!m_suppressRunningOnly);
+  return StatusCode::SUCCESS;
+}
+
+void TrigMessageSvc::bookHistograms()
+{
+  ServiceHandle<ITHistSvc> histSvc("THistSvc", name());
+  if ( histSvc.retrieve().isFailure() ) {
+    reportMessage(name(), MSG::WARNING, "Cannot find THistSvc. Message stats will not be published.");
+    m_doPublish = false;
+    return;
+  }
+
+  // monitoring information root directory
+  const std::string path = "/EXPERT/" + name() + "/";
+  const int nLevelBins = MSG::NUM_LEVELS - m_publishLevel;
+  m_msgCountHist = new TH1I("MessageCount", "Messages while RUNNING;Severity;Count",
+                            nLevelBins, 0, nLevelBins);
+
+  const int nSrcBins = 1;
+  m_msgCountSrcHist = new TH2I("MessageCountBySource", "Messages while RUNNING;Severity;Source",
+                               nLevelBins, 0, nLevelBins, nSrcBins, 0, nSrcBins);
+
+  for (int i=m_publishLevel; i<MSG::NUM_LEVELS; i++) {
+    m_msgCountHist->GetXaxis()->SetBinLabel(i-m_publishLevel+1, levelNames[i].c_str());
+    m_msgCountSrcHist->GetXaxis()->SetBinLabel(i-m_publishLevel+1, levelNames[i].c_str());
+  }
+
+  if ( histSvc->regHist(path + m_msgCountHist->GetName(), m_msgCountHist).isFailure() ) {
+    reportMessage(name(), MSG::WARNING, "Cannot register monitoring histogram 'MessageCount'");
+  }
+  if ( histSvc->regHist(path + m_msgCountSrcHist->GetName(), m_msgCountSrcHist).isFailure() ) {
+    reportMessage(name(), MSG::WARNING, "Cannot register monitoring histogram 'MessageCountBySource'");
+  }
 }
 
+
 void TrigMessageSvc::setupLimits(Gaudi::Details::PropertyBase& prop)
 {
   // Just report problems in the settings of the limits and unknown limit
@@ -189,6 +241,16 @@ void TrigMessageSvc::i_reportMessage(const Message& msg, int outputLevel)
   const int key = msg.getType();
   ++m_msgCount[key];
 
+  // Publish message statistics if enabled and only while RUNNING
+  if ( m_doPublish && key>=static_cast<int>(m_publishLevel) ) {
+    m_msgCountHist->Fill(key-m_publishLevel, 1);
+    { // Adding bins on the fly needs to be protected by mutex
+      scoped_lock_histogram lock;
+      m_msgCountSrcHist->Fill(key-m_publishLevel, msg.getSource().c_str(), 1);
+      m_msgCountSrcHist->LabelsDeflate("Y");
+    }
+  }
+
   const Message* cmsg = &msg;
 
   if (m_doSuppress || m_stats.value()) {
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.h b/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.h
index 3791d6b1aeeec3283ccc9cf8d7afa88d28d931cb..8adfedbf4ff2a070b5d05c31402b3d053f46526d 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.h
+++ b/HLT/Trigger/TrigControl/TrigServices/src/TrigMessageSvc.h
@@ -13,6 +13,9 @@
 #include <string>
 #include <vector>
 
+#include <TH1I.h>
+#include <TH2I.h>
+
 #include "CxxUtils/checker_macros.h"
 #include "GaudiKernel/IMessageSvc.h"
 #include "GaudiKernel/Message.h"
@@ -28,6 +31,8 @@
 
 // Forward declarations
 class ISvcLocator;
+class TH1I;
+class TH2I;
 
 /**@class TrigMessageSvc
  * @brief MessageSvc used by the HLT applications
@@ -54,6 +59,8 @@ public:
 
   virtual StatusCode reinitialize() override;
   virtual StatusCode initialize() override;
+  virtual StatusCode start() override;
+  virtual StatusCode stop() override;
   virtual StatusCode finalize() override;
 
   virtual void reportMessage(const Message& message) override;
@@ -108,10 +115,8 @@ private:
   Gaudi::Property<bool> m_stats{this, "showStats", false, "Show message statistics"};
   Gaudi::Property<unsigned int> m_statLevel{this, "statLevel", 0,
                                             "Show total message statistics for >= level"};
-  Gaudi::Property<unsigned int> m_statLevelRun{this, "statLevelRun", 0,
-                                               "Show per-run statistics for messages >= level"};
-  Gaudi::Property<bool> m_resetStats{this, "resetStatsAtBeginRun", false,
-                                     "Reset message statistics at BeginRun"};
+  Gaudi::Property<unsigned int> m_publishLevel{this, "publishLevel", MSG::INFO,
+                                               "Publish message statistics for this and higher message levels"};
   Gaudi::Property<unsigned int> m_eventIDLevel{this, "printEventIDLevel", MSG::NIL,
                                                "Print event ID for this and higher message levels"};
   Gaudi::Property<bool> m_color{this, "useColors", false,
@@ -176,9 +181,12 @@ private:
   std::array<int, MSG::NUM_LEVELS> m_msgCount;   ///< counts per level
   std::map<size_t, unsigned int> m_msgHashCount; ///< counts per message hash
 
-  bool m_running{false};    ///< are we in running state?
+  bool m_doPublish{false};  ///< are we publishing message statistics?
   bool m_doSuppress{false}; ///< is suppression currently enabled?
 
+  TH1I* m_msgCountHist{nullptr};    ///< Message counting per level histogram
+  TH2I* m_msgCountSrcHist{nullptr}; ///< Message counting per message source
+
   mutable std::recursive_mutex m_reportMutex;       ///< mutex for printing
   mutable std::recursive_mutex m_thresholdMapMutex; /// (@see MsgStream::doOutput).
 
@@ -187,6 +195,7 @@ private:
   bool passErsFilter(const std::string& source, const std::vector<std::string>& filter) const;
   void i_reportMessage(const Message& msg, int outputLevel);
   void i_reportERS(const Message& msg) const;
+  void bookHistograms();
 };
 
 #endif
diff --git a/InnerDetector/InDetConditions/BeamSpotConditionsData/BeamSpotConditionsData/BeamSpotData.h b/InnerDetector/InDetConditions/BeamSpotConditionsData/BeamSpotConditionsData/BeamSpotData.h
index c4f4fdad4f4cb86523d78a00935691bfce55aa45..4ff50936e9c650e22cd10c81385e0ce9f9a7ea96 100644
--- a/InnerDetector/InDetConditions/BeamSpotConditionsData/BeamSpotConditionsData/BeamSpotData.h
+++ b/InnerDetector/InDetConditions/BeamSpotConditionsData/BeamSpotConditionsData/BeamSpotData.h
@@ -55,7 +55,7 @@ namespace InDet
 
     int m_status;
 
-    std::vector<float> m_errPar;
+    std::array<float, 6> m_errPar;
 
     Amg::Vector3D m_beamPos;
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx
index 397a029c60137fccf31528dde15c832702830550..2918b51e9fe9ec594af2dc021c251663ae000bec 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx
@@ -23,7 +23,7 @@
 #include "RDBAccessSvc/IRDBRecord.h"
 #include "RDBAccessSvc/IRDBRecordset.h"
 
-#include "SGTools/ClassID_traits.h"
+#include "AthenaKernel/ClassID_traits.h"
 #include "SGTools/DataProxy.h"
 
 using InDetDD::PixelDetectorManager; 
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt b/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt
index e5575eaeb154df43282bbc4625c7f4a59f8410f8..baf0e15874fb65c77dd06d91b0413a0e5717b470 100644
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/CMakeLists.txt
@@ -41,7 +41,7 @@ atlas_add_component( TRT_GeoModel
 
 atlas_add_test( TRT_GMConfig_test
                 SCRIPT test/TRT_GMConfig_test.py
-                PROPERTIES TIMEOUT 300 )
+                PROPERTIES TIMEOUT 600 )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
index b4b249322cf7b4d2c084837e44627317990a2a48..cf5932a14943204ce41331e446e3724162bf10bb 100755
--- a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
@@ -58,8 +58,9 @@ def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
 def BCM_DigitizationCfg(flags, name="BCM_OverlayDigitization", **kwargs):
     """Return a ComponentAccumulator with configured BCM_Digitization algorithm"""
     acc = PixelGeometryCfg(flags)
-    tool = acc.popToolsAndMerge(BCM_DigitizationToolCfg(flags, **kwargs))
-    kwargs.setdefault("DigitizationTool", tool)
+    if "DigitizationTool" not in kwargs:
+        tool = acc.popToolsAndMerge(BCM_DigitizationToolCfg(flags, **kwargs))
+        kwargs["DigitizationTool"] = tool
     acc.addEventAlgo(BCM_Digitization(name, **kwargs))
     return acc
 
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
index 13654fcad62852f78b75873a01ce0026a8911da3..7ea7668edcfc20668bdd2756f7fc499af81cf812 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
@@ -48,14 +48,10 @@ def SCT_DigitizationCommonCfg(flags, name="SCT_DigitizationToolCommon", **kwargs
         kwargs.setdefault("LastXing", SCT_LastXing() )
     tool = SCT_DigitizationTool(name, **kwargs)
     # attach ToolHandles
-    frontAcc = SCT_FrontEndCfg(flags)
-    tool.FrontEnd = frontAcc.popPrivateTools()
-    surfAcc = SCT_SurfaceChargesGeneratorCfg(flags)
-    tool.SurfaceChargesGenerator = surfAcc.popPrivateTools()
+    tool.FrontEnd = acc.popToolsAndMerge(SCT_FrontEndCfg(flags))
+    tool.SurfaceChargesGenerator = acc.popToolsAndMerge(SCT_SurfaceChargesGeneratorCfg(flags))
     tool.RandomDisabledCellGenerator = SCT_RandomDisabledCellGeneratorCfg(flags)
     acc.setPrivateTools(tool)
-    acc.merge(frontAcc) 
-    acc.merge(surfAcc)
     return acc
 
 def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
@@ -95,9 +91,8 @@ def SCT_DigitizationToolOverlayCfg(flags, name="SCT_OverlayDigitizationTool",**k
         kwargs.setdefault("OutputObjectName", flags.Overlay.Legacy.EventStore + "+SCT_RDOs")
         kwargs.setdefault("OutputSDOName", flags.Overlay.Legacy.EventStore + "+SCT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    tacc=SCT_DigitizationCommonCfg(flags, name, **kwargs)
-    acc.setPrivateTools(tacc.popPrivateTools())
-    acc.merge(tacc)
+    tool = acc.popToolsAndMerge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    acc.setPrivateTools(tool)
     return acc
 
 def SCT_DigitizationToolSplitNoMergePUCfg(flags, name="SCT_DigitizationToolSplitNoMergePU",**kwargs):
@@ -145,20 +140,15 @@ def SCT_SurfaceChargesGeneratorCfg(flags, name="SCT_SurfaceChargesGenerator", **
     # experimental SCT_DetailedSurfaceChargesGenerator config dropped here
     tool = SCT_SurfaceChargesGenerator(name, **kwargs)
     tool.RadDamageSummaryTool = SCT_RadDamageSummaryTool()
-    DCSCondAcc = SCT_DCSConditionsCfg(flags)
-    DCSCondTool = DCSCondAcc.popPrivateTools()
+    DCSCondTool = acc.popToolsAndMerge(SCT_DCSConditionsCfg(flags))
     SiliCondTool = SCT_SiliconConditionsToolCfg(flags)
     SiliCondAcc = SCT_SiliconConditionsCfg(flags, DCSConditionsTool=DCSCondTool)
     SiliPropsAcc = SCT_SiPropertiesCfg(flags, SiConditionsTool=SiliCondTool)
-    LorentzAcc = SCT_LorentzAngleCfg(flags)
+    acc.merge(SiliCondAcc)
     tool.SiConditionsTool = SiliCondTool
-    tool.SiPropertiesTool = SiliPropsAcc.popPrivateTools()
-    tool.LorentzAngleTool = LorentzAcc.popPrivateTools()
+    tool.SiPropertiesTool = acc.popToolsAndMerge(SiliPropsAcc)
+    tool.LorentzAngleTool = acc.popToolsAndMerge(SCT_LorentzAngleCfg(flags))
     acc.setPrivateTools(tool)
-    acc.merge(DCSCondAcc)
-    acc.merge(SiliCondAcc)
-    acc.merge(SiliPropsAcc)
-    acc.merge(LorentzAcc)
     return acc
 
 def SCT_FrontEndCfg(flags, name="SCT_FrontEnd", **kwargs):
@@ -241,9 +231,8 @@ def SCT_DigitizationCfg(toolCfg, flags, name="SCT_Digitization", **kwargs):
     """Return a ComponentAccumulator with toolCfg type SCT digitization"""
     acc = ComponentAccumulator()
     if "DigitizationTool" not in kwargs:
-        toolAcc = toolCfg(flags)
-        kwargs["DigitizationTool"] = toolAcc.popPrivateTools()
-        acc.merge(toolAcc)
+        tool = acc.popToolsAndMerge(toolCfg(flags))
+        kwargs["DigitizationTool"] = tool
     alg = SCT_Digitization(name, **kwargs)
     acc.addEventAlgo(alg)
     return acc
diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
index 3890f4b94309db435661c94144247a525cc27331..51a634252e17dddde929759524e734f681ba4d7a 100644
--- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
+++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
@@ -649,7 +649,7 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD
               }
             }
 	    /* TODO, bring it back when IDC friendly
-            if(rdoIdc->hasExternalCache() && rdoIdc->tryFetch(offlineIdHash)){
+            if(rdoIdc->hasExternalCache() && rdoIdc->tryAddFromCache(offlineIdHash)){
                 ATH_MSG_DEBUG("Hash already in collection - cache hit " << offlineIdHash);
                 continue;
             }
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
index f3a934fd5987c83c34b90de4844e6b850db29e8e..669b8674ceefd4854070b7353bebd008eac2db19 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
@@ -4,6 +4,8 @@
 #
 #==============================================================
 
+doPrint = False
+
 #--------------------------------------------------------------
 # Standard includes
 #--------------------------------------------------------------
@@ -39,7 +41,8 @@ globalflags.DetDescrVersion="ATLAS-R2-2016-01-00-01"
 globalflags.DetGeo="atlas"
 globalflags.InputFormat="bytestream"
 globalflags.DataSource="data"
-print globalflags
+if doPrint:
+    print globalflags
 
 #--------------------------------------------------------------
 # Set Detector setup
@@ -67,7 +70,8 @@ DetFlags.readRIOBS.all_setOff()
 DetFlags.readRIOPool.all_setOff()
 DetFlags.writeRIOPool.all_setOff()
 
-DetFlags.Print()
+if doPrint:
+    DetFlags.Print()
 
 import AtlasGeoModel.SetGeometryVersion
 import AtlasGeoModel.GeoModelInit
@@ -89,17 +93,14 @@ ServiceMgr.ByteStreamInputSvc.FullFileName = inputBSFiles
 from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
 athenaCommonFlags.FilesInput = inputBSFiles
 
-# Set up event info cnv alg
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
-from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
-topSequence += xAODMaker__EventInfoCnvAlg()
 
 # Set up byte stream converters (SCTRawDataProvider, SCTRawDataProviderTool, SCT_RodDecoder, SCTEventFlagWriter)
 include("InDetRecExample/InDetReadBS_jobOptions.py")
-topSequence.InDetSCTRawDataProvider.OutputLevel = DEBUG
+topSequence.InDetSCTRawDataProvider.OutputLevel = INFO
 topSequence.InDetSCTRawDataProvider.ProviderTool.Decoder.OutputLevel = INFO
-topSequence.InDetSCTEventFlagWriter.OutputLevel = DEBUG
+topSequence.InDetSCTEventFlagWriter.OutputLevel = INFO
 if numThreads >= 2:
     topSequence.InDetSCTRawDataProvider.Cardinality = numThreads
     topSequence.InDetSCTEventFlagWriter.Cardinality = numThreads
@@ -125,13 +126,13 @@ sct_ConditionsSummaryToolSetupWithoutFlagged.ConditionsTools=[sct_ConfigurationC
 
 from SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool
 InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(name = "InDetSCT_ClusteringTool",
-                                                    OutputLevel = DEBUG,
+                                                    OutputLevel = INFO,
                                                     globalPosAlg = InDetClusterMakerTool,
                                                     timeBins = "01X",
                                                     conditionsTool = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool())
 from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization
 InDetSCT_Clusterization = InDet__SCT_Clusterization(name = "InDetSCT_Clusterization",
-                                                    OutputLevel = DEBUG,
+                                                    OutputLevel = INFO,
                                                     clusteringTool = InDetSCT_ClusteringTool,
                                                     conditionsTool = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool(),
                                                     DataObjectName = "SCT_RDOs",
@@ -145,11 +146,11 @@ topSequence += InDetSCT_Clusterization
 # Set up SCT AxAOD converters
 from InDetPrepRawDataToxAOD.InDetPrepRawDataToxAODConf import SCT_RawDataToxAOD
 xAOD_SCT_RawDataToxAOD = SCT_RawDataToxAOD(name = "SCTxAOD_SCT_RawDataToxAOD",
-                                           OutputLevel = DEBUG)
+                                           OutputLevel = INFO)
 topSequence += xAOD_SCT_RawDataToxAOD
 from InDetPrepRawDataToxAOD.InDetPrepRawDataToxAODConf import SCT_PrepDataToxAOD
 xAOD_SCT_PrepDataToxAOD = SCT_PrepDataToxAOD(name = "SCTxAOD_SCT_PrepDataToxAOD",
-                                             OutputLevel = DEBUG,
+                                             OutputLevel = INFO,
                                              UseTruthInfo = False,
                                              WriteSDOs = False)
 topSequence += xAOD_SCT_PrepDataToxAOD
@@ -168,12 +169,39 @@ SCT_ConditionsSummaryTool.ConditionsTools=[sct_ConfigurationConditionsToolSetup.
                                            sct_FlaggedConditionToolSetup.getTool().getFullName()]
 from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_ConditionsSummaryTestAlg
 topSequence += SCT_ConditionsSummaryTestAlg(SCT_ConditionsSummaryTool=SCT_ConditionsSummaryTool)
+if numThreads >= 2:
+    topSequence.SCT_ConditionsSummaryTestAlg.Cardinality = numThreads
+
+# Set up space point formation
+from AthenaCommon.AlgSequence import AthSequencer
+condSeq = AthSequencer("AthCondSeq")
+if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"):
+    from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg
+    condSeq += InDet__SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg")
+from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool
+InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(name = "InDetSiSpacePointMakerTool")
+from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder
+InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name                   = "InDetSiTrackerSpacePointFinder",
+                                                                  SiSpacePointMakerTool  = InDetSiSpacePointMakerTool,
+                                                                  PixelsClustersName     = "",
+                                                                  SCT_ClustersName       = "SCT_Clusters",
+                                                                  SpacePointsPixelName   = "",
+                                                                  SpacePointsSCTName     = "SCT_SpacePoints",
+                                                                  SpacePointsOverlapName = "OverlapSpacePoints",
+                                                                  ProcessPixels          = False,
+                                                                  ProcessSCTs            = True,
+                                                                  ProcessOverlaps        = False,
+                                                                  OverrideBeamSpot       = True)
+if numThreads >= 2:
+    InDetSiTrackerSpacePointFinder.Cardinality = numThreads
+topSequence += InDetSiTrackerSpacePointFinder
 
 # Print algorithms
-print topSequence
+if doPrint:
+    print topSequence
 
 # Set the number of events to be processed
-theApp.EvtMax = 20
+theApp.EvtMax = 10
 
 #--------------------------------------------------------------
 # Set output lvl (VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL)
@@ -183,4 +211,3 @@ ServiceMgr.MessageSvc.OutputLevel = INFO
 if numThreads >= 2:
     from SCT_ConditionsAlgorithms.SCTCondAlgCardinality import sctCondAlgCardinality
     sctCondAlgCardinality.set(numThreads)
-
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCT_RodDecoder.cxx b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCT_RodDecoder.cxx
index d3d679cb10eb6fc4f2a40ab5e6ed710a84e6b11c..4c39c8bccd40f4138a34fd260d6d181b32bd0000 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCT_RodDecoder.cxx
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCT_RodDecoder.cxx
@@ -910,7 +910,7 @@ int SCT_RodDecoder::makeRDO(int strip, int groupSize, int timeBin, uint32_t onli
     }
   }
 
-  if(rdoIDCont.hasExternalCache() and rdoIDCont.tryFetch(collIDHash)){
+  if(rdoIDCont.hasExternalCache() and rdoIDCont.tryAddFromCache(collIDHash)){
     ATH_MSG_DEBUG("Hash already in collection - cache hit " << collIDHash);
     return 0;
   }
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py
index 364ea0928c9a90ce004c309459f1784baa862dd6..42b81c6b3c35b3a0780ede8d59d871fcb05ff4a7 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py
@@ -57,6 +57,10 @@ class ConfiguredxAODTrackParticleCreation:
          if (InDetFlags.doTruth() and not InputTrackTruthCollection == ''):
              xAODTrackParticleCnvAlg.AddTruthLink = True
              xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackTruthCollection
+
+             from MCTruthClassifier.MCTruthClassifierBase import MCTruthClassifier
+             xAODTrackParticleCnvAlg.MCTruthClassifier = MCTruthClassifier
+
          elif (InDetFlags.doTruth() and InputTrackTruthCollection == ''):
              print "WARNING: ConfiguredxAODTrackParticleCreation - doTruth = True, but no input Truth collection specified!"
          else:
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index bb077e52dcfc8174360aa2140882356b8720bd6b..78406a545ddebbcb3668aff4c89c079e621309bf 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -64,8 +64,7 @@ if DetFlags.haveRIO.pixel_on():
     # Calibration Setup #
     #####################
     if not conddb.folderRequested("/PIXEL/PixCalib"):
-        conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib", className="CondAttrListCollection")
-
+        conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixCalib", "/PIXEL/PixCalib", className="CondAttrListCollection")
     if not hasattr(condSeq, 'PixelChargeCalibCondAlg'):
         from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg
         condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib")
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
index 611953cd040fcb761fa8a18cbb4b0dfa051d5036..76d1f5f954622d0fc5a1e032986ba873968e3c9e 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
@@ -99,6 +99,8 @@ def createTrackParticles(track_in, track_particle_truth_in,track_particle_out, t
         xAODTrackParticleCnvAlg.xAODTruthLinkVector =  passCollectionName( 'xAODTruthLinks', InDetFlags.doTruth() and is_mc and isValid(track_particle_truth_in) )
         xAODTrackParticleCnvAlg.TrackTruthContainerName = passCollectionName(track_particle_truth_in,(is_mc and InDetFlags.doTruth()))
         xAODTrackParticleCnvAlg.PrintIDSummaryInfo = True
+        from MCTruthClassifier.MCTruthClassifierBase import MCTruthClassifier
+        xAODTrackParticleCnvAlg.MCTruthClassifier = MCTruthClassifier
         topSequence += xAODTrackParticleCnvAlg
 
 def convertTrackParticles(aod_track_particles_in, track_particle_truth_in,track_particle_out, topSequence) :
@@ -117,6 +119,8 @@ def convertTrackParticles(aod_track_particles_in, track_particle_truth_in,track_
         xAODTrackParticleCnvAlg.xAODTruthLinkVector =  passCollectionName( 'xAODTruthLinks', InDetFlags.doTruth() and is_mc and isValid(track_particle_truth_in) )
         xAODTrackParticleCnvAlg.TrackTruthContainerName = ""
         xAODTrackParticleCnvAlg.PrintIDSummaryInfo = True
+        from MCTruthClassifier.MCTruthClassifierBase import MCTruthClassifier
+        xAODTrackParticleCnvAlg.MCTruthClassifier = MCTruthClassifier
         topSequence += xAODTrackParticleCnvAlg 
 
 if (doCreation or doConversion):# or InDetFlags.useExistingTracksAsInput()) : <---- [XXX JDC Should we included this?
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx
index 2402d3bb6f7f383c1ce0ca13492ddff75c88dfae..3a57335a0d27206c943fa9bd14cadbd9c746852b 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonKshort.cxx
@@ -36,7 +36,7 @@
 #include "TrkV0Vertex/V0Candidate.h"
 #include "TrkV0Vertex/V0Container.h"
 #include "TrkVertexAnalysisUtils/V0Tools.h"
-
+#include "CLHEP/Vector/LorentzVector.h"
 // ATLAS headers
 #include "GaudiKernel/IInterface.h"
 #include "StoreGate/StoreGateSvc.h"
diff --git a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/selection.xml b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/selection.xml
index 6a74b28e8e377da6048d0faf9c2281b91aa4bf79..9a202792579774752eeba248a51ed49e78999732 100755
--- a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/selection.xml
+++ b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/selection.xml
@@ -1,7 +1,7 @@
 <lcgdict>
  <class name="InDetSimDataCollection" id="5A50C32E-C036-4A49-AE97-716D53210BE1" />
      <class name="InDetSimData" />
-     <class pattern="std::*pair*< HepMcParticleLink , float>" /> 
+     <class pattern="*pair*<HepMcParticleLink*float>" /> 
      <class name="std::vector<std::pair< HepMcParticleLink , float> >" />
      <class name="std::map<Identifier,InDetSimData>" />
 </lcgdict>
diff --git a/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/InDetTrackPRD_Association/InDetTrackPRD_Association.h b/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/InDetTrackPRD_Association/InDetTrackPRD_Association.h
index 1fe1ae58b25bddc458c875454b356634691d8910..e8794ab3caf1fd85c97ba5e587fca44362e311e7 100755
--- a/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/InDetTrackPRD_Association/InDetTrackPRD_Association.h
+++ b/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/InDetTrackPRD_Association/InDetTrackPRD_Association.h
@@ -1,3 +1,5 @@
+//Dear emacs, this is -*-c++-*-*
+
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
@@ -9,6 +11,9 @@
 #include <string>
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
+#include "StoreGate/ReadHandleKeyArray.h"
+#include "TrkTrack/TrackCollection.h"
+
 #include "TrkToolInterfaces/IPRD_AssociationTool.h"
 
 namespace InDet {
@@ -16,7 +21,7 @@ namespace InDet {
 
   // Class-algorithm for track accotiation with PRD 
   // 
-  class InDetTrackPRD_Association : public AthAlgorithm 
+     class InDetTrackPRD_Association : public AthAlgorithm 
     {
     
       ///////////////////////////////////////////////////////////////////
@@ -35,36 +40,20 @@ namespace InDet {
       StatusCode execute();
       StatusCode finalize();
 
-      ///////////////////////////////////////////////////////////////////
-      // Print internal tool parameters and status
-      ///////////////////////////////////////////////////////////////////
-
-      MsgStream&    dump     (MsgStream&    out) const;
-      std::ostream& dump     (std::ostream& out) const;
-
-    protected:
+   private:
 
       ///////////////////////////////////////////////////////////////////
       // Protected data 
       ///////////////////////////////////////////////////////////////////
      
 
-      std::vector<std::string>              m_tracksName    ; // Name of track collections       
+      SG::ReadHandleKeyArray<TrackCollection> m_tracksName    ; // Name of track collections       
       ToolHandle<Trk::IPRD_AssociationTool> m_assoTool      ; // Assotiation tool
-      int                                   m_outputlevel   ;
-      int                                   m_tracksPRD [10];
-      int                                   m_tracksPRDn[10];
-      int                                   m_nprint        ;
-      bool                                  m_istracks  [10];
 
       ///////////////////////////////////////////////////////////////////
       // Protected methods
       ///////////////////////////////////////////////////////////////////
 
-      MsgStream&    dumptools(MsgStream&    out) const;
-      MsgStream&    dumpevent(MsgStream&    out) const;
     };
-  MsgStream&    operator << (MsgStream&   ,const InDetTrackPRD_Association&);
-  std::ostream& operator << (std::ostream&,const InDetTrackPRD_Association&); 
 }
 #endif // InDetTrackPRD_Association_H
diff --git a/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/src/InDetTrackPRD_Association.cxx b/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/src/InDetTrackPRD_Association.cxx
index 567165d8a88f3924188ae2261fe2f3d1c11672ec..880d0f30159e4cb85a44a558c498f0f94b706ec1 100755
--- a/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/src/InDetTrackPRD_Association.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetTrackPRD_Association/src/InDetTrackPRD_Association.cxx
@@ -2,7 +2,6 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "TrkTrack/TrackCollection.h"
 #include "InDetTrackPRD_Association/InDetTrackPRD_Association.h"
 
 ///////////////////////////////////////////////////////////////////
@@ -15,9 +14,6 @@ InDet::InDetTrackPRD_Association::InDetTrackPRD_Association
   AthAlgorithm(name, pSvcLocator)                           ,
   m_assoTool  ("InDet::InDetPRD_AssociationToolGangedPixels")
 {
-  m_nprint      = 0;
-  m_outputlevel = 0;
- 
   // InDetTrackPRD_Association steering parameters
   //
   declareProperty("AssociationTool", m_assoTool  );
@@ -30,7 +26,9 @@ InDet::InDetTrackPRD_Association::InDetTrackPRD_Association
 
 StatusCode InDet::InDetTrackPRD_Association::initialize() 
 {
-  
+ 
+
+  ATH_CHECK(m_tracksName.initialize());
   // Get association tool
   //
   if( m_assoTool.retrieve().isFailure()) {
@@ -42,13 +40,6 @@ StatusCode InDet::InDetTrackPRD_Association::initialize()
     msg(MSG::INFO) << "Retrieved tool " << m_assoTool << endmsg;
   }
 
-  // Get output print level
-  //
-  m_outputlevel = msg().level()-MSG::DEBUG;
-  
-  if(m_outputlevel<=0) {
-    m_nprint=0; msg(MSG::DEBUG)<<(*this)<<endmsg;
-  }
   return StatusCode::SUCCESS;
 }
 
@@ -59,41 +50,26 @@ StatusCode InDet::InDetTrackPRD_Association::initialize()
 StatusCode InDet::InDetTrackPRD_Association::execute() 
 { 
 
+
   // Assosiate tracks with PRDs
   //
   m_assoTool->reset();
 
-  std::vector<std::string>::const_iterator col=m_tracksName.begin(),cole=m_tracksName.end();
-
-  int n = 0;
-  for(; col!=cole; ++col) {
-
-    m_istracks  [n]               = false;
-    m_tracksPRD [n]               = 0    ;
-    m_tracksPRDn[n]               = 0    ;
-    const TrackCollection* tracks = 0    ;
-
-    StatusCode sc = evtStore()->retrieve(tracks,(*col));
-    if (sc.isFailure() || !tracks) continue;
-
-    m_istracks  [n] = true;
+  for (const SG::ReadHandleKey<TrackCollection>& collKey : m_tracksName) {
+    SG::ReadHandle<TrackCollection> tracks(collKey);
     
-    TrackCollection::const_iterator t  = tracks->begin();
-    TrackCollection::const_iterator te = tracks->end  ();
-
-    for ( ; t!=te; ++t) {
-      
-      if((m_assoTool->addPRDs(**t)).isFailure()) ++m_tracksPRDn[n]; else ++m_tracksPRD[n];
+    unsigned tracksPRD=0;
+    unsigned tracksPRDn=0;
+
+    for  (const Trk::Track* t : *tracks) {  
+      if((m_assoTool->addPRDs(*t)).isFailure()) 
+	++tracksPRDn; 
+      else 
+	++tracksPRD;
     }
-
-    if(n<9) ++n;
+    ATH_MSG_DEBUG("Collection " << collKey.key() << ": tracks with PRD " << tracksPRD << ",  without PRD " << tracksPRD);
   } 
 
-  // Print common event information
-  //
-  if(m_outputlevel<=0) {
-    m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
-  }
   return StatusCode::SUCCESS;
 }
 
@@ -102,107 +78,3 @@ StatusCode InDet::InDetTrackPRD_Association::execute()
 ///////////////////////////////////////////////////////////////////
 
 StatusCode InDet::InDetTrackPRD_Association::finalize() {return StatusCode::SUCCESS;}
-
-///////////////////////////////////////////////////////////////////
-// Overload of << operator MsgStream
-///////////////////////////////////////////////////////////////////
-
-MsgStream& InDet::operator    << 
-  (MsgStream& sl,const InDet::InDetTrackPRD_Association& se)
-{ 
-  return se.dump(sl);
-}
-
-///////////////////////////////////////////////////////////////////
-// Overload of << operator std::ostream
-///////////////////////////////////////////////////////////////////
-
-std::ostream& InDet::operator << 
-  (std::ostream& sl,const InDet::InDetTrackPRD_Association& se)
-{
-  return se.dump(sl);
-}   
-
-///////////////////////////////////////////////////////////////////
-// Dumps relevant information into the MsgStream
-///////////////////////////////////////////////////////////////////
-
-MsgStream& InDet::InDetTrackPRD_Association::dump( MsgStream& out ) const
-{
-  out<<std::endl;
-  if(m_nprint)  return dumpevent(out);
-  return dumptools(out);
-}
-
-///////////////////////////////////////////////////////////////////
-// Dumps relevant information into the ostream
-///////////////////////////////////////////////////////////////////
-
-std::ostream& InDet::InDetTrackPRD_Association::dump( std::ostream& out ) const
-{
-  return out;
-}
-
-///////////////////////////////////////////////////////////////////
-// Dumps conditions information into the MsgStream
-///////////////////////////////////////////////////////////////////
-
-MsgStream& InDet::InDetTrackPRD_Association::dumptools( MsgStream& out ) const
-{
-  out<<"|----------------------------------------------------------------"
-     <<"----------------------------------------------------|"
-     <<std::endl;
-  int n = 65-m_assoTool.type().size();
-
-  std::string s1; for(int i=0; i<n; ++i) s1.append(" "); s1.append("|");
-  out<<"| Tool for track-prd association                  | "<<m_assoTool.type()<<s1
-     <<std::endl;
-  out<<"|----------------------------------------------------------------"
-     <<"----------------------------------------------------|"
-     <<std::endl;
-
-  return out;
-}
-
-///////////////////////////////////////////////////////////////////
-// Dumps event information into the ostream
-///////////////////////////////////////////////////////////////////
-
-MsgStream& InDet::InDetTrackPRD_Association::dumpevent( MsgStream& out ) const
-{
-  out<<"|-------------------------------------------------------------------";
-  out<<"-----------------------------|"
-     <<std::endl;
-
-  std::vector<std::string>::const_iterator col=m_tracksName.begin(),cole=m_tracksName.end();
-
-  int N = 0;
-
-  for(; col!=cole; ++col) {
-
-    int n  = 30-(*col).size();
-    std::string s; for(int i=0; i<n; ++i) s.append(" "); s.append("|");
-    out<<"| "
-       <<(*col)<<s
-       <<" is collection "
-       <<std::setw(2)<<m_istracks  [N]
-       <<"  tracks with PRD "
-       <<std::setw(5)<<m_tracksPRD [N]
-       <<"  without PRD "
-       <<std::setw(5)<<m_tracksPRDn[N]
-       <<"     |"
-       <<std::endl;
-    if(N<9) ++N;
-  }
-
-  out<<"|-------------------------------------------------------------------";
-  out<<"-----------------------------|"
-     <<std::endl;
-
-  return out;
-}
-
-
-
-
-
diff --git a/InnerDetector/InDetRecAlgs/InDetV0Finder/CMakeLists.txt b/InnerDetector/InDetRecAlgs/InDetV0Finder/CMakeLists.txt
index b804007c888ece90024c1b8e0d22521a4df91bed..252fa09edd0e200804f8c6898491fc10b2d4f541 100644
--- a/InnerDetector/InDetRecAlgs/InDetV0Finder/CMakeLists.txt
+++ b/InnerDetector/InDetRecAlgs/InDetV0Finder/CMakeLists.txt
@@ -9,12 +9,13 @@ atlas_subdir( InDetV0Finder )
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/AthContainers
+                          Control/CxxUtils
                           GaudiKernel
                           InnerDetector/InDetRecTools/InDetConversionFinderTools
                           Reconstruction/RecoTools/ITrackToVertex
+                          InnerDetector/InDetConditions/BeamSpotConditionsData
                           PRIVATE
                           Event/xAOD/xAODTracking
-                          InnerDetector/InDetConditions/InDetBeamSpotService
                           Tracking/TrkExtrapolation/TrkExInterfaces
                           Tracking/TrkTools/TrkToolInterfaces
                           Tracking/TrkVertexFitter/TrkV0Fitter
diff --git a/InnerDetector/InDetRecAlgs/InDetV0Finder/InDetV0Finder/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecAlgs/InDetV0Finder/InDetV0Finder/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..b2c19b30c2f7be5ed10aebf5e766d9a6544fa03e
--- /dev/null
+++ b/InnerDetector/InDetRecAlgs/InDetV0Finder/InDetV0Finder/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecAlgs/InDetV0Finder
diff --git a/InnerDetector/InDetRecAlgs/InDetV0Finder/InDetV0Finder/InDetV0FinderTool.h b/InnerDetector/InDetRecAlgs/InDetV0Finder/InDetV0Finder/InDetV0FinderTool.h
index 9e062193f48f0f0ad17978e431cec951ed4d8c1c..eca1a31d74d8faedf1bb975aa64c86ef85663840 100755
--- a/InnerDetector/InDetRecAlgs/InDetV0Finder/InDetV0Finder/InDetV0FinderTool.h
+++ b/InnerDetector/InDetRecAlgs/InDetV0Finder/InDetV0Finder/InDetV0FinderTool.h
@@ -22,7 +22,8 @@
 #include "xAODTracking/VertexContainerFwd.h"
 #include "xAODTracking/VertexAuxContainer.h"
 #include "xAODTracking/TrackParticleContainer.h"
-
+#include "StoreGate/WriteDecorHandleKey.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
 /**
    The InDetV0FinderTool reads in the TrackParticle container from StoreGate,
    if useorigin = True only tracks not associated to a primary vertex are used.
@@ -69,8 +70,6 @@
 
 /* Forward declarations */
 
-class IBeamCondSvc;
-
 namespace Trk
 {
   class IVertexFitter;
@@ -174,7 +173,6 @@ namespace InDet
     unsigned int  m_Lambdabar_stored;
     unsigned int  m_Gamma_stored;
 
-    ServiceHandle <IBeamCondSvc> m_beamConditionsService;
 
     void SGError(std::string errService);
 
@@ -195,6 +193,18 @@ namespace InDet
 
     SG::ReadHandleKey<xAOD::VertexContainer> m_vertexKey { this, "VertexContainer", "PrimaryVertices", 
 	                                                   "primary vertex container" };
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_v0LinksDecorkey;
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_v0_ksLinksDecorkey;
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_v0_laLinksDecorkey;
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_v0_lbLinksDecorkey;
+
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_mDecor_gfit;
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_mDecor_gmass;
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_mDecor_gmasserr;
+    SG::WriteDecorHandleKey<xAOD::VertexContainer> m_mDecor_gprob;
+    
+    SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
+
 
   };
 
diff --git a/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx b/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx
index 773b0f70475be19063254e9e7e3b68926550be66..6fe484737129685e917a1abe755203abbb56f2e9 100755
--- a/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /***************************************************************************
@@ -36,11 +36,11 @@
 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh" // for chi2prob calculation
 
 #include "xAODTracking/TrackingPrimitives.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 
 #include "HepPDT/ParticleDataTable.hh"
 #include "xAODTracking/VertexContainer.h"
 
+#include "StoreGate/WriteDecorHandle.h"
 
 #include <vector>
 #include <cmath>
@@ -95,8 +95,7 @@ InDetV0FinderTool::InDetV0FinderTool(const std::string& t, const std::string& n,
   m_vert_lxy_sig(2.),
   m_vert_lxy_cut(500.),
   m_vert_a0xy_cut(3.),
-  m_vert_a0z_cut(15.),
-  m_beamConditionsService("BeamCondSvc", n)
+  m_vert_a0z_cut(15.)
 {
   declareInterface<InDetV0FinderTool>(this);
   declareProperty("VertexFitterTool", m_iVertexFitter);
@@ -143,7 +142,16 @@ InDetV0FinderTool::InDetV0FinderTool(const std::string& t, const std::string& n,
   declareProperty("vert_lxy_cut", m_vert_lxy_cut );
   declareProperty("vert_a0xy_cut", m_vert_a0xy_cut );
   declareProperty("vert_a0z_cut", m_vert_a0z_cut );
-  declareProperty("BeamConditionsSvc", m_beamConditionsService); 
+
+  declareProperty("V0Link", m_v0LinksDecorkey);
+  declareProperty("KshortLink", m_v0_ksLinksDecorkey);
+  declareProperty("LambdaLink", m_v0_laLinksDecorkey);
+  declareProperty("LambdabarLink", m_v0_lbLinksDecorkey);
+
+  declareProperty("gamma_fit", m_mDecor_gfit);
+  declareProperty("gamma_mass", m_mDecor_gmass);
+  declareProperty("gamma_massError", m_mDecor_gmasserr);
+  declareProperty("gamma_probability", m_mDecor_gprob);  
 }
 
 InDetV0FinderTool::~InDetV0FinderTool() {}
@@ -155,30 +163,30 @@ StatusCode InDetV0FinderTool::initialize()
 // Get the right vertex fitting tool from ToolSvc 
   if (m_useV0Fitter) {
     ATH_CHECK( m_iVertexFitter.retrieve() );
-    msg(MSG::INFO) << "Retrieved tool " << m_iVertexFitter << endmsg;
+    msg(MSG::DEBUG) << "Retrieved tool " << m_iVertexFitter << endmsg;
  
     ATH_CHECK( m_iGammaFitter.retrieve() );
-    msg(MSG::INFO) << "Retrieved tool " << m_iGammaFitter << endmsg;
+    msg(MSG::DEBUG) << "Retrieved tool " << m_iGammaFitter << endmsg;
 
   } else {
     ATH_CHECK( m_iVKVertexFitter.retrieve() );
-    msg(MSG::INFO) << "Retrieved tool " << m_iVKVertexFitter << endmsg;
+    msg(MSG::DEBUG) << "Retrieved tool " << m_iVKVertexFitter << endmsg;
 
 // Get the VKalVrt Ks vertex fitting tool from ToolSvc
     ATH_CHECK( m_iKshortFitter.retrieve() );
-    msg(MSG::INFO) << "Retrieved tool " << m_iKshortFitter << endmsg;
+    msg(MSG::DEBUG) << "Retrieved tool " << m_iKshortFitter << endmsg;
 
 // Get the VKalVrt Lambda vertex fitting tool from ToolSvc
     ATH_CHECK( m_iLambdaFitter.retrieve() );
-    msg(MSG::INFO) << "Retrieved tool " << m_iLambdaFitter << endmsg;
+    msg(MSG::DEBUG) << "Retrieved tool " << m_iLambdaFitter << endmsg;
 
 // Get the VKalVrt Lambdabar vertex fitting tool from ToolSvc
     ATH_CHECK( m_iLambdabarFitter.retrieve() );
-    msg(MSG::INFO) << "Retrieved tool " << m_iLambdabarFitter << endmsg;
+    msg(MSG::DEBUG) << "Retrieved tool " << m_iLambdabarFitter << endmsg;
 
 // Get the VKalVrt Gamma vertex fitting tool from ToolSvc
     ATH_CHECK( m_iGammaFitter.retrieve() );
-    msg(MSG::INFO) << "Retrieved tool " << m_iGammaFitter << endmsg;
+    msg(MSG::DEBUG) << "Retrieved tool " << m_iGammaFitter << endmsg;
   }
 
 // get the Particle Properties Service
@@ -188,32 +196,50 @@ StatusCode InDetV0FinderTool::initialize()
 
 // uploading the V0 tools
   ATH_CHECK( m_V0Tools.retrieve() );
-  msg(MSG::INFO) << "Retrieved tool " << m_V0Tools << endmsg;
+  msg(MSG::DEBUG) << "Retrieved tool " << m_V0Tools << endmsg;
 
 // Get the TrackToVertex extrapolator tool
   ATH_CHECK( m_trackToVertexTool.retrieve() );
 
 // Get the extrapolator
   ATH_CHECK( m_extrapolator.retrieve() );
-  msg(MSG::INFO) << "Retrieved tool " << m_extrapolator << endmsg;
+  msg(MSG::DEBUG) << "Retrieved tool " << m_extrapolator << endmsg;
+
+  // Initialize vertex container key
+  ATH_CHECK( m_vertexKey.initialize() );
+
+  m_v0LinksDecorkey = m_vertexKey.key() + ".V0Link";
+  m_v0_ksLinksDecorkey = m_vertexKey.key() + ".KshortLink";
+  m_v0_laLinksDecorkey = m_vertexKey.key() + ".LambdaLink";
+  m_v0_lbLinksDecorkey = m_vertexKey.key() + ".LambdabarLink";
+  ATH_CHECK( m_v0LinksDecorkey.initialize());
+  ATH_CHECK( m_v0_ksLinksDecorkey.initialize());
+  ATH_CHECK( m_v0_laLinksDecorkey.initialize());
+  ATH_CHECK( m_v0_lbLinksDecorkey.initialize());
+
+  m_mDecor_gfit = m_vertexKey.key() + ".gamma_fit";
+  m_mDecor_gmass = m_vertexKey.key() + ".gamma_mass";
+  m_mDecor_gmasserr = m_vertexKey.key() + ".gamma_massError";
+  m_mDecor_gprob = m_vertexKey.key() + ".gamma_probability";
+  ATH_CHECK( m_mDecor_gfit.initialize());
+  ATH_CHECK( m_mDecor_gmass.initialize());
+  ATH_CHECK( m_mDecor_gmasserr.initialize());
+  ATH_CHECK( m_mDecor_gprob.initialize());
+
+  ATH_CHECK( m_beamSpotKey.initialize());
 
-  ATH_CHECK( m_beamConditionsService.retrieve() );
-  msg(MSG::INFO) << "Retrieved service " << m_beamConditionsService << endmsg;
 
 // Get the helpertool from ToolSvc
   ATH_CHECK( m_helpertool.retrieve() );
-  msg(MSG::INFO) << "Retrieved tool " << m_helpertool << endmsg;
+  msg(MSG::DEBUG) << "Retrieved tool " << m_helpertool << endmsg;
 
 // Get the track selector tool from ToolSvc
   ATH_CHECK( m_trkSelector.retrieve() );
-  msg(MSG::INFO) << "Retrieved tool " << m_trkSelector << endmsg;
+  msg(MSG::DEBUG) << "Retrieved tool " << m_trkSelector << endmsg;
 
 // Get the vertex point estimator tool from ToolSvc
   ATH_CHECK( m_vertexEstimator.retrieve() );
-  msg(MSG::INFO) << "Retrieved tool " << m_vertexEstimator << endmsg;
-
-  // Initialize vertex container key
-  ATH_CHECK( m_vertexKey.initialize() );
+  msg(MSG::DEBUG) << "Retrieved tool " << m_vertexEstimator << endmsg;
 
   const HepPDT::ParticleData* pd_pi = m_particleDataTable->particle(PDG::pi_plus);
   const HepPDT::ParticleData* pd_p  = m_particleDataTable->particle(PDG::p_plus);
@@ -235,7 +261,7 @@ StatusCode InDetV0FinderTool::initialize()
   m_Lambda_stored    = 0;
   m_Gamma_stored     = 0;
 
-  msg(MSG::INFO) << "Initialization successful" << endmsg;
+  msg(MSG::DEBUG) << "Initialization successful" << endmsg;
 
   return StatusCode::SUCCESS;
 }
@@ -295,7 +321,8 @@ StatusCode InDetV0FinderTool::performSearch(xAOD::VertexContainer*& v0Container,
     ATH_MSG_DEBUG("Vertex  container size " << vertColl->size());
   }
 
-  Amg::Vector3D beamspot = Amg::Vector3D(m_beamConditionsService->beamVtx().position());
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  Amg::Vector3D beamspot = Amg::Vector3D(beamSpotHandle->beamVtx().position());
 
 // track preselection
   std::vector<const xAOD::TrackParticle*> posTracks; posTracks.clear();
@@ -365,6 +392,14 @@ StatusCode InDetV0FinderTool::performSearch(xAOD::VertexContainer*& v0Container,
       }
     }
 
+    SG::WriteDecorHandle<xAOD::VertexContainer, ElementLink<xAOD::VertexContainer>> v0LinksDecor(m_v0LinksDecorkey);
+    SG::WriteDecorHandle<xAOD::VertexContainer, ElementLink<xAOD::VertexContainer>> v0_ksLinksDecor(m_v0_ksLinksDecorkey);
+    SG::WriteDecorHandle<xAOD::VertexContainer, ElementLink<xAOD::VertexContainer>> v0_laLinksDecor(m_v0_laLinksDecorkey);
+    SG::WriteDecorHandle<xAOD::VertexContainer, ElementLink<xAOD::VertexContainer>> v0_lbLinksDecor(m_v0_lbLinksDecorkey);
+    SG::WriteDecorHandle<xAOD::VertexContainer, int> mDecor_gfit(m_mDecor_gfit);
+    SG::WriteDecorHandle<xAOD::VertexContainer, float> mDecor_gmass(m_mDecor_gmass);
+    SG::WriteDecorHandle<xAOD::VertexContainer, float> mDecor_gmasserr(m_mDecor_gmasserr);
+    SG::WriteDecorHandle<xAOD::VertexContainer, float> mDecor_gprob(m_mDecor_gprob); 
     unsigned int i2 = 0;
     for (tpIt2 = negTracks.begin(); tpIt2 != negTracks.end(); ++tpIt2)
     {
@@ -527,13 +562,9 @@ StatusCode InDetV0FinderTool::performSearch(xAOD::VertexContainer*& v0Container,
                       if (foundKshort || foundLambda || foundLambdabar) doGamma = true;
 
                       ElementLink<xAOD::VertexContainer> v0Link;
-                      static SG::AuxElement::Decorator< ElementLink<xAOD::VertexContainer> > v0LinksDecor("V0Link");
                       ElementLink<xAOD::VertexContainer> ksLink;
-                      static SG::AuxElement::Decorator< ElementLink<xAOD::VertexContainer> > v0_ksLinksDecor("KshortLink");
                       ElementLink<xAOD::VertexContainer> laLink;
-                      static SG::AuxElement::Decorator< ElementLink<xAOD::VertexContainer> > v0_laLinksDecor("LambdaLink");
                       ElementLink<xAOD::VertexContainer> lbLink;
-                      static SG::AuxElement::Decorator< ElementLink<xAOD::VertexContainer> > v0_lbLinksDecor("LambdabarLink");
 
                       if (m_doSimpleV0 || (!m_doSimpleV0 && doGamma)) {
                         m_V0s_stored++;
@@ -625,10 +656,7 @@ StatusCode InDetV0FinderTool::performSearch(xAOD::VertexContainer*& v0Container,
                             gamma_mass = m_V0Tools->invariantMass(myGamma.get(),m_masse,m_masse);
                             gamma_massErr = m_V0Tools->invariantMassError(myGamma.get(),m_masse,m_masse);
                           }
-                          SG::AuxElement::Decorator<int> mDecor_gfit("gamma_fit");
-                          SG::AuxElement::Decorator<float> mDecor_gmass("gamma_mass");
-                          SG::AuxElement::Decorator<float> mDecor_gmasserr("gamma_massError");
-                          SG::AuxElement::Decorator<float> mDecor_gprob("gamma_probability");
+
                           mDecor_gfit( *(v0Container->back()) ) = gamma_fit;
                           mDecor_gmass( *(v0Container->back()) ) = gamma_mass;
                           mDecor_gmasserr( *(v0Container->back()) ) = gamma_massErr;
diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h
index de872b02e17461079f4ed7827a8f48228e4f8b4f..71a8b5a1710512a55bc03cce780829e3588d3ac3 100644
--- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h
+++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h
@@ -109,9 +109,6 @@ namespace InDet {
     double                         m_pTcut{500};
     double                         m_imcut{2.};
     double                         m_zstep{0.};
-    std::vector<int>               m_nhistogram;
-    std::vector<double>            m_zhistogram;
-    std::vector<double>            m_phistogram;
 
     ///////////////////////////////////////////////////////////////////
     // Protected methods
@@ -124,8 +121,16 @@ namespace InDet {
     bool isGoodEvent() const;
     double trackQuality(const Trk::Track*) const;
     void filterSharedTracks(std::multimap<double, Trk::Track*>&) const;
-    void fillZHistogram(const Trk::Track*, Trk::PerigeeSurface&);
-    void findZvertex(std::list<Trk::Vertex>&, double*) const;
+    void fillZHistogram(const Trk::Track* Tr,
+                        Trk::PerigeeSurface& per,
+                        std::vector<int>& nhistogram,
+                        std::vector<double>& zhistogram,
+                        std::vector<double>& phistogram) const;
+    void findZvertex(std::list<Trk::Vertex>& ZV,
+                     double* ZB,
+                     std::vector<int>& nhistogram,
+                     std::vector<double>& zhistogram,
+                     std::vector<double>& phistogram) const;
     StatusCode oldStrategy();
     StatusCode newStrategy();
     void magneticFieldInit();
diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx
index 9b9ef26100a9b8ddf452685ee126ef93c2650049..47d21aa7bd34bb43100b52e899071446a02b5b2b 100644
--- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx
+++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx
@@ -58,9 +58,6 @@ StatusCode InDet::SiSPSeededTrackFinder::initialize()
       // Setup for Z-histograms
       //  
       if (m_histsize < 100) m_histsize = 100;
-      m_nhistogram.resize(m_histsize);
-      m_zhistogram.resize(m_histsize);
-      m_phistogram.resize(m_histsize);
       m_zstep = static_cast<double>(m_histsize)/(2.*m_zcut);
     } else {
       m_proptool.disable();
@@ -76,7 +73,7 @@ StatusCode InDet::SiSPSeededTrackFinder::initialize()
   if (msgLvl(MSG::DEBUG)) {
     dump(MSG::DEBUG, nullptr);
   }
-  m_counterTotal = {};
+  m_counterTotal   = {};
   m_neventsTotal   = 0;
   m_neventsTotalV  = 0;
   m_problemsTotal  = 0;
@@ -110,45 +107,38 @@ StatusCode InDet::SiSPSeededTrackFinder::oldStrategy()
     return StatusCode::SUCCESS;
   }
 
-  std::multimap<double, Trk::Track*> qualityTrack;
-
-  // Test is sct clusters collection for given event
-  //
-  bool PIX = true ;
-  bool SCT = true ;
   bool ZVE = false;
-  bool ERR = false;
-
   if (m_useZvertexTool) {
-    m_zvertexmaker->newEvent();
-    if (not m_zvertexmaker->getVertices().empty()) ZVE = true;
-    m_seedsmaker->find3Sp(m_zvertexmaker->getVertices());
+    std::list<Trk::Vertex> vertices = std::move(m_zvertexmaker->newEvent());
+    if (not vertices.empty()) ZVE = true;
+    m_seedsmaker->find3Sp(vertices);
   } else {
     m_seedsmaker->newEvent(-1);
     std::list<Trk::Vertex> VZ;
     m_seedsmaker->find3Sp(VZ);
   }
 
+  const bool PIX = true;
+  const bool SCT = true;
   m_trackmaker->newEvent(PIX, SCT);
 
+  bool ERR = false;
+  Counter_t counter{};
+  const InDet::SiSpacePointsSeed* seed = nullptr;
+  std::multimap<double, Trk::Track*> qualityTrack;
   // Loop through all seed and reconsrtucted tracks collection preparation
   //
-  
-  Counter_t counter {};
-
-  const InDet::SiSpacePointsSeed* seed = nullptr;
   while ((seed = m_seedsmaker->next())) {
     ++counter[kNSeeds];
     for (Trk::Track* t: m_trackmaker->getTracks(seed->spacePoints())) {
       qualityTrack.insert(std::make_pair(-trackQuality(t), t));
     }
-    if (ZVE == false and counter[kNSeeds] >= m_maxNumberSeeds) {
+    if (not ZVE and (counter[kNSeeds] >= m_maxNumberSeeds)) {
       ERR = true;
       ++m_problemsTotal;
       break;
     }
   }
-  
   m_trackmaker->endEvent();
 
   // Remove shared tracks with worse quality
@@ -164,12 +154,13 @@ StatusCode InDet::SiSPSeededTrackFinder::oldStrategy()
 
   m_counterTotal[kNSeeds] += counter[kNSeeds];
 
-  ZVE == true ? ++m_neventsTotalV : ++m_neventsTotal;
+  if (ZVE) ++m_neventsTotalV;
+  else     ++m_neventsTotal;
 
   if (ERR) {
     outputTracks->clear();
   } else {
-    m_counterTotal[kNTracks]+=counter[kNTracks];
+    m_counterTotal[kNTracks] += counter[kNTracks];
   }
 
   // Print common event information
@@ -177,6 +168,7 @@ StatusCode InDet::SiSPSeededTrackFinder::oldStrategy()
   if (msgLvl(MSG::DEBUG)) {
     dump(MSG::DEBUG, &counter);
   }
+
   return StatusCode::SUCCESS;
 }
 
@@ -196,41 +188,36 @@ StatusCode InDet::SiSPSeededTrackFinder::newStrategy()
 
   // Get beam information and preparation for z -histogramming
   //
-  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle{m_beamSpotKey};
   Trk::PerigeeSurface per(beamSpotHandle->beamPos());
  
-  // Initiate histograms
-  //
-  for (int i=0; i<m_histsize; ++i) {
-    m_nhistogram[i] = 0 ;
-    m_zhistogram[i] = 0.;
-    m_phistogram[i] = 0.;
-  }
-  
-  std::multimap<double, Trk::Track*> qualityTrack;
-
-  // Test is sct clusters collection for given event
-  //
-  bool PIX = true ;
-  bool SCT = true ;
-  bool ERR = false;
   m_seedsmaker->newEvent(0);
   std::list<Trk::Vertex> VZ;
   m_seedsmaker->find3Sp(VZ);
+
+  const bool PIX = true ;
+  const bool SCT = true ;
   m_trackmaker->newEvent(PIX, SCT);
-  double ZB[2];
 
-  // Loop through all seed and reconsrtucted tracks collection preparation
-  //
+  std::vector<int> nhistogram(m_histsize, 0);
+  std::vector<double> zhistogram(m_histsize, 0.);
+  std::vector<double> phistogram(m_histsize, 0.);
+
+  bool ERR = false;
   Counter_t counter{};
   const InDet::SiSpacePointsSeed* seed = nullptr;
+  std::multimap<double, Trk::Track*> qualityTrack;
+  // Loop through all seed and reconsrtucted tracks collection preparation
+  //
   while ((seed = m_seedsmaker->next())) {
     ++counter[kNSeeds];
     bool firstTrack{true};
     for (Trk::Track* t: m_trackmaker->getTracks(seed->spacePoints())) {
       qualityTrack.insert(std::make_pair(-trackQuality(t), t));
 
-      if (firstTrack and not m_ITKGeometry) fillZHistogram(t, per);
+      if (firstTrack and not m_ITKGeometry) {
+        fillZHistogram(t, per, nhistogram, zhistogram, phistogram);
+      }
       firstTrack = false;
     }
     if (counter[kNSeeds] >= m_maxNumberSeeds) {
@@ -242,8 +229,9 @@ StatusCode InDet::SiSPSeededTrackFinder::newStrategy()
 
   m_seedsmaker->newEvent(1); 
 
+  double ZB[2];
   if (not m_ITKGeometry) {
-    findZvertex(VZ, ZB);
+    findZvertex(VZ, ZB, nhistogram, zhistogram, phistogram);
     m_seedsmaker->find3Sp(VZ, ZB);
   } else {
     m_seedsmaker->find3Sp(VZ);
@@ -282,7 +270,7 @@ StatusCode InDet::SiSPSeededTrackFinder::newStrategy()
   if (ERR) {
     outputTracks->clear();
   } else {
-    m_counterTotal[kNTracks]+=counter[kNTracks];
+    m_counterTotal[kNTracks] += counter[kNTracks];
   }
 
   // Print common event information
@@ -309,7 +297,7 @@ StatusCode InDet::SiSPSeededTrackFinder::finalize()
 // Dumps relevant information into the MsgStream
 ///////////////////////////////////////////////////////////////////
 
-MsgStream& InDet::SiSPSeededTrackFinder::dump( MSG::Level assign_level, const InDet::SiSPSeededTrackFinder::Counter_t *counter ) const
+MsgStream& InDet::SiSPSeededTrackFinder::dump(MSG::Level assign_level, const InDet::SiSPSeededTrackFinder::Counter_t* counter) const
 {
   msg(assign_level) <<std::endl;
   MsgStream& out_msg=msg();
@@ -323,7 +311,7 @@ MsgStream& InDet::SiSPSeededTrackFinder::dump( MSG::Level assign_level, const In
 // Dumps conditions information into the MsgStream
 ///////////////////////////////////////////////////////////////////
 
-MsgStream& InDet::SiSPSeededTrackFinder::dumptools( MsgStream& out) const
+MsgStream& InDet::SiSPSeededTrackFinder::dumptools(MsgStream& out) const
 {
   int n = 65-m_zvertexmaker.type().size();
   std::string s1; for (int i=0; i<n; ++i) s1.append(" "); s1.append("|");
@@ -363,7 +351,7 @@ MsgStream& InDet::SiSPSeededTrackFinder::dumptools( MsgStream& out) const
 // Dumps event information into the ostream
 ///////////////////////////////////////////////////////////////////
 
-MsgStream& InDet::SiSPSeededTrackFinder::dumpevent(MsgStream& out, const InDet::SiSPSeededTrackFinder::Counter_t &counter) const
+MsgStream& InDet::SiSPSeededTrackFinder::dumpevent(MsgStream& out, const InDet::SiSPSeededTrackFinder::Counter_t& counter) const
 {
   out<<"|-------------------------------------------------------------------";
   out<<"---------------------------------|"
@@ -513,7 +501,11 @@ void InDet::SiSPSeededTrackFinder::filterSharedTracks(std::multimap<double, Trk:
 // Fill z coordinate histogram
 ///////////////////////////////////////////////////////////////////
 
-void InDet::SiSPSeededTrackFinder::fillZHistogram(const Trk::Track* Tr,Trk::PerigeeSurface& per)
+void InDet::SiSPSeededTrackFinder::fillZHistogram(const Trk::Track* Tr,
+                                                  Trk::PerigeeSurface& per,
+                                                  std::vector<int>& nhistogram,
+                                                  std::vector<double>& zhistogram,
+                                                  std::vector<double>& phistogram) const
 {
   
   if (Tr->measurementsOnTrack()->size() < 10) return;
@@ -538,9 +530,9 @@ void InDet::SiSPSeededTrackFinder::fillZHistogram(const Trk::Track* Tr,Trk::Peri
   if (fabs(par[0]) > m_imcut) return;
   int z = static_cast<int>((par[1]+m_zcut)*m_zstep);
   if (z >=0 and z < m_histsize) {
-    ++m_nhistogram[z];
-    m_zhistogram[z] += par[1];
-    m_phistogram[z] += pT;
+    ++nhistogram[z];
+    zhistogram[z] += par[1];
+    phistogram[z] += pT;
   }
   
 }
@@ -549,7 +541,11 @@ void InDet::SiSPSeededTrackFinder::fillZHistogram(const Trk::Track* Tr,Trk::Peri
 // Find verteex  z coordinates
 ///////////////////////////////////////////////////////////////////
 
-void  InDet::SiSPSeededTrackFinder::findZvertex(std::list<Trk::Vertex>& ZV, double* ZB) const
+void  InDet::SiSPSeededTrackFinder::findZvertex(std::list<Trk::Vertex>& ZV,
+                                                double* ZB,
+                                                std::vector<int>& nhistogram,
+                                                std::vector<double>& zhistogram,
+                                                std::vector<double>& phistogram) const
 {
   ZB[0] = 1000.;
   ZB[1] =-1000.;
@@ -562,17 +558,17 @@ void  InDet::SiSPSeededTrackFinder::findZvertex(std::list<Trk::Vertex>& ZV, doub
 
   for (int i=1; i<imax; ++i) { 
 
-    int n = m_nhistogram[i-1]+m_nhistogram[i]+m_nhistogram[i+1];
+    int n = nhistogram[i-1]+nhistogram[i]+nhistogram[i+1];
 
-    if (n>=nmin and (m_nhistogram[i] >= m_nhistogram[i-1] and m_nhistogram[i] >= m_nhistogram[i+1])) {
+    if (n>=nmin and (nhistogram[i] >= nhistogram[i-1] and nhistogram[i] >= nhistogram[i+1])) {
   
-      double z = (m_zhistogram[i-1]+m_zhistogram[i]+m_zhistogram[i+1])/static_cast<double>(n);
+      double z = (zhistogram[i-1]+zhistogram[i]+zhistogram[i+1])/static_cast<double>(n);
 
       if (z < ZB[0]) ZB[0] = z;
       if (z > ZB[1]) ZB[1] = z;
  
       if (m_useNewStrategy) { 
-	double p = m_phistogram[i-1]+m_phistogram[i]+m_phistogram[i+1];
+	double p = phistogram[i-1]+phistogram[i]+phistogram[i+1];
 	vern.insert(std::make_pair(-n, z));
 	verp.insert(std::make_pair(-p, z));
       }
diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h
index 0f89649a0022dcf02c921fac7ea0902b4d6b0080..61289b78c3ad7101a97e68fc5774435ad22d402c 100755
--- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h
+++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h
@@ -1,5 +1,7 @@
+// -*- C++ -*-
+
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -99,6 +101,9 @@ namespace InDet {
 
     StatusCode finalize() override;
 
+    /** Make this algorithm clonable. */
+    virtual bool isClonable() const override { return true; };
+
   private:
     // methods
 
diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
index 6cd6c38df275455c2bfd73ecbfeb00671d283cfe..f5cfaf19d70ae8a0f7cdc019d3d74df4f8ab894f 100755
--- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
+++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /***************************************************************************
@@ -116,13 +116,13 @@ StatusCode SiTrackerSpacePointFinder::initialize()
   }
   ATH_CHECK( m_Pixel_clcontainerKey.initialize(m_selectPixels) );
 
-  if (m_SpacePointContainer_SCTKey.key().empty()){
+  if (m_selectSCTs && m_SpacePointContainer_SCTKey.key().empty()){
     ATH_MSG_FATAL( "No name set for SCT space points");
     return StatusCode::FAILURE;
   }
   ATH_CHECK( m_SpacePointContainer_SCTKey.initialize(m_selectSCTs) );
 
-  if (m_SpacePointContainerPixelKey.key().empty()){
+  if (m_selectPixels && m_SpacePointContainerPixelKey.key().empty()){
     ATH_MSG_FATAL( "No name set for Pixels space points");
     return StatusCode::FAILURE;
   }
diff --git a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiZvertexMaker.h b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiZvertexMaker.h
index a68f77f92e323ab0dec44e358ca14797ecc0ed6c..818cd7fb849d0fdc348a75af4e33b53d94ef8161 100755
--- a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiZvertexMaker.h
+++ b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ISiZvertexMaker.h
@@ -1,5 +1,7 @@
+// -*- C++ -*-
+
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////////////////////
@@ -57,17 +59,11 @@ namespace InDet{
       // Methods to initialize tool for new event or region
       ///////////////////////////////////////////////////////////////////
 
-      virtual void newEvent()=0;
-      virtual void newRegion
-	(const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&)=0;
-      virtual void newRegion
-	(const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&,const IRoiDescriptor&)=0;
-
-      ///////////////////////////////////////////////////////////////////
-      // Methods for primary vertices production
-      ///////////////////////////////////////////////////////////////////
-
-      virtual const std::list<Trk::Vertex>&  getVertices ()=0;
+      virtual std::list<Trk::Vertex> newEvent()=0;
+      virtual std::list<Trk::Vertex> newRegion
+      (const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&)=0;
+      virtual std::list<Trk::Vertex> newRegion
+      (const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&,const IRoiDescriptor&)=0;
 
       ///////////////////////////////////////////////////////////////////
       // Print internal tool parameters and status
diff --git a/InnerDetector/InDetRecTools/InDetSVWithMuonTool/InDetSVWithMuonTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/InDetSVWithMuonTool/InDetSVWithMuonTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..e532418a107c8650cb469147357fa7f2f0edd863
--- /dev/null
+++ b/InnerDetector/InDetRecTools/InDetSVWithMuonTool/InDetSVWithMuonTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/InDetSVWithMuonTool
diff --git a/InnerDetector/InDetRecTools/InDetTrackScoringTools/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetTrackScoringTools/CMakeLists.txt
index 1f3115de07d13fe860c4674b5f069025c072fe0f..8bd5f35d531b7c914a6f709bb3983e4d2bb3176d 100644
--- a/InnerDetector/InDetRecTools/InDetTrackScoringTools/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetTrackScoringTools/CMakeLists.txt
@@ -13,10 +13,10 @@ atlas_depends_on_subdirs( PUBLIC
                           GaudiKernel
                           Tracking/TrkEvent/TrkEventPrimitives
                           Tracking/TrkTools/TrkToolInterfaces
+                          InnerDetector/InDetConditions/BeamSpotConditionsData
                           PRIVATE
                           Control/StoreGate
                           DetectorDescription/GeoPrimitives
-                          InnerDetector/InDetConditions/InDetBeamSpotService
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetRecEvent/InDetRIO_OnTrack
                           InnerDetector/InDetRecTools/InDetRecToolInterfaces
diff --git a/InnerDetector/InDetRecTools/InDetTrackScoringTools/InDetTrackScoringTools/InDetAmbiScoringTool.h b/InnerDetector/InDetRecTools/InDetTrackScoringTools/InDetTrackScoringTools/InDetAmbiScoringTool.h
index 7c522aba8c2e2059b986cb298119f56ddb1d3120..2f7151219d240e99d5a2e39549da845cf17372e9 100755
--- a/InnerDetector/InDetRecTools/InDetTrackScoringTools/InDetTrackScoringTools/InDetAmbiScoringTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackScoringTools/InDetTrackScoringTools/InDetAmbiScoringTool.h
@@ -22,14 +22,12 @@
 #include "AthenaKernel/IOVSvcDefs.h"
 #include <vector>
 #include <string>
-
-class IBeamCondSvc;
+#include "BeamSpotConditionsData/BeamSpotData.h"
 
 namespace Trk {
   class IExtrapolator;
   class Track;
   class TrackSummary;
-  class IBeamCondSvc;
 
 }
 
@@ -101,7 +99,7 @@ class InDetAmbiScoringTool : virtual public Trk::ITrackScoringTool,
   /**holds the scores assigned to each Trk::SummaryType from the track's Trk::TrackSummary*/
   std::vector<Trk::TrackScore>           m_summaryTypeScore;
   
-  ServiceHandle<IBeamCondSvc>            m_iBeamCondSvc; //!< pointer to the beam condition service
+  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
   
   ToolHandle<Trk::IExtrapolator>         m_extrapolator;
   ServiceHandle<MagField::IMagFieldSvc>  m_magFieldSvc;
diff --git a/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx b/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx
index 62add77587e63805719ed23161fc686c272c4c5f..536cdbfa764f2b249280d6ce892ce62e042c344a 100755
--- a/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx
@@ -13,7 +13,6 @@
 #include "TrkEventPrimitives/FitQuality.h"
 #include "TrkParameters/TrackParameters.h"
 #include "TrkExInterfaces/IExtrapolator.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
 #include "TMath.h"
 #include <vector>
@@ -47,7 +46,6 @@ InDet::InDetAmbiScoringTool::InDetAmbiScoringTool(const std::string& t,
   m_trkSummaryTool("Trk::TrackSummaryTool", this),
   m_selectortool("InDet::InDetTrtDriftCircleCutTool", this),
   m_summaryTypeScore(Trk::numberOfTrackSummaryTypes),
-  m_iBeamCondSvc("BeamCondSvc",n),
   m_extrapolator("Trk::Extrapolator", this),
   m_magFieldSvc("AtlasFieldSvc",n)
 {
@@ -84,7 +82,6 @@ InDet::InDetAmbiScoringTool::InDetAmbiScoringTool(const std::string& t,
   declareProperty("Extrapolator",      m_extrapolator);
   declareProperty("SummaryTool" ,      m_trkSummaryTool);
   declareProperty("DriftCircleCutTool",m_selectortool );
-  declareProperty("BeamPositionSvc",   m_iBeamCondSvc );
   declareProperty("MagFieldSvc",       m_magFieldSvc);
   
   declareProperty("maxRPhiImpEM",      m_maxRPhiImpEM  = 50.  );
@@ -157,11 +154,7 @@ StatusCode InDet::InDetAmbiScoringTool::initialize()
     msg(MSG::DEBUG) << "Retrieved tool " << m_selectortool << endmsg;
   }
 
-  sc = m_iBeamCondSvc.retrieve();
-  if (sc.isFailure()) {
-    msg(MSG::DEBUG) << "Could not find BeamCondSvc." << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK(m_beamSpotKey.initialize());
 
   sc =  m_magFieldSvc.retrieve();
   if (sc.isFailure()){
@@ -309,7 +302,8 @@ Trk::TrackScore InDet::InDetAmbiScoringTool::simpleScore( const Trk::Track& trac
   //
   // --- beam spot position 
   Amg::Vector3D beamSpotPosition(0,0,0);
-  if (m_iBeamCondSvc) beamSpotPosition = m_iBeamCondSvc->beamVtx().position();
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+  if (beamSpotHandle.isValid()) beamSpotPosition = beamSpotHandle->beamVtx().position();
   // --- create surface
   Trk::PerigeeSurface perigeeSurface(beamSpotPosition);
 
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/CMakeLists.txt
index 06d85db0aa3ded9c0f7778fcb11c2415188df727..1545b9f81fd310564a22411497e995c45a6069ce 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/CMakeLists.txt
@@ -11,6 +11,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/xAOD/xAODTracking
                           GaudiKernel
                           InnerDetector/InDetRecTools/InDetRecToolInterfaces
+                          InnerDetector/InDetConditions/BeamSpotConditionsData
                           Tracking/TrkEvent/TrkEventPrimitives
                           Tracking/TrkEvent/TrkParameters
                           Tracking/TrkTools/TrkToolInterfaces
@@ -18,7 +19,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthContainers
                           DetectorDescription/GeoPrimitives
                           Event/EventPrimitives
-                          InnerDetector/InDetConditions/InDetBeamSpotService
                           InnerDetector/InDetConditions/TRT_ConditionsServices
                           InnerDetector/InDetRecEvent/InDetRIO_OnTrack
                           MagneticField/MagFieldInterfaces
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetConversionTrackSelectorTool.h b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetConversionTrackSelectorTool.h
index 61365aa4b8f11932df56d3cd2eb3556c2f15efaf..7e0a55c15cf68b6d62015357149554387b382755 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetConversionTrackSelectorTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetConversionTrackSelectorTool.h
@@ -11,7 +11,7 @@
 #include "GaudiKernel/ServiceHandle.h"
 #include "TrkToolInterfaces/ITrackSelectorTool.h"
 #include "xAODTracking/TrackParticle.h"
-
+#include "BeamSpotConditionsData/BeamSpotData.h"
 /**
  * A tool to be used for track preselection in conversion 
  * vertex finding.
@@ -20,7 +20,6 @@
  * June 2008
  */
 
-class IBeamCondSvc;
 
 namespace Trk
 {
@@ -39,21 +38,19 @@ namespace InDet
  
    public:
     
-    StatusCode initialize();
-    
-    StatusCode finalize();
+    virtual StatusCode initialize() override;
     
     InDetConversionTrackSelectorTool(const std::string& t, const std::string& n, const IInterface*  p); 
  
     ~InDetConversionTrackSelectorTool();
   
     /** Select a Trk::Track  */
-    bool decision(const Trk::Track& track,const Trk::Vertex* vertex) const;
+    virtual bool decision(const Trk::Track& track,const Trk::Vertex* vertex) const override;
   
     /** Select a Trk::TrackParticleBase  */
-    bool decision(const Trk::TrackParticleBase& track,const Trk::Vertex* vertex) const;
+    virtual bool decision(const Trk::TrackParticleBase& track,const Trk::Vertex* vertex) const override;
 
-    bool decision(const xAOD::TrackParticle&,const xAOD::Vertex*) const ;
+    virtual bool decision(const xAOD::TrackParticle&,const xAOD::Vertex*) const override;
 
 
     
@@ -64,12 +61,12 @@ namespace InDet
       if( !tp.summaryValue(val,type) ) return 0;
       return val > 0 ? val : 0;
     }
-   
+    
+    Amg::Vector3D getPosOrBeamSpot(const xAOD::Vertex*) const;
    
     ToolHandle <Trk::ITrackSummaryTool>       m_trkSumTool;   //!< Track summary tool
     ToolHandle<Trk::IExtrapolator>            m_extrapolator; //!< Extrapolator tool
-    ServiceHandle<IBeamCondSvc>               m_iBeamCondSvc; //!< pointer to the beam condition service
-
+    SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
     /** Properties for track selection:all cuts are ANDed */
     double m_maxSiD0;  //!< Maximal d0 at (0,0,0) for tracks with Si hits
     double m_maxTrtD0; //!< Maximal d0 at (0,0,0) for standalone TRT tracks
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetDetailedTrackSelectorTool.h b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetDetailedTrackSelectorTool.h
index 6817f9d945791d7f39db49aafbcc23b139ff0a4c..4db9ebf6ed61b47b40388fbef8e6368d918a4ee6 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetDetailedTrackSelectorTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetDetailedTrackSelectorTool.h
@@ -12,6 +12,7 @@
 #include "TrkParameters/TrackParameters.h"
 #include "xAODTracking/TrackParticle.h"
 #include "xAODTracking/VertexFwd.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
 
 /**
  * @file InDetDetailedTrackSelectorTool.h
@@ -28,8 +29,6 @@
  * @author Daniel Kollar <daniel.kollar@cern.ch>
  */
 
-class IBeamCondSvc;
-
 
 namespace MagField {
   class IMagFieldSvc;
@@ -88,6 +87,7 @@ namespace InDet
       				const Trk::Perigee* track) const;
 
       bool preselectionBeforeExtrapolation(const Trk::Perigee & myPerigee) const;
+      Amg::Vector3D getPosOrBeamSpot(const xAOD::Vertex*) const;
 
       double m_pTMin;       //<! min. pT: |pT|>pTMin
       double m_pMin;        //<! min. p = pT/cos(theta): |p| > pMin
@@ -151,7 +151,7 @@ namespace InDet
 
       ToolHandle<Trk::ITrackSummaryTool> m_trackSumTool; //!< Track summary tool
       ToolHandle<Trk::IExtrapolator> m_extrapolator; //!< Extrapolator tool
-      ServiceHandle<IBeamCondSvc> m_iBeamCondSvc; //!< pointer to the beam condition service
+      SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
       ServiceHandle<MagField::IMagFieldSvc>  m_magFieldSvc;
       ToolHandle<ITrtDriftCircleCutTool> m_trtDCTool; //!< Tool to get eta dependent cut on number of TRT hits
 
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx
index a9f0939579e0ad0c72d41d766d852b9685beb4f1..98757b1adeec49a3ddfcc7956e3c11b7f96c6302 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx
@@ -7,7 +7,6 @@
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "VxVertex/Vertex.h"
 #include "TrkTrack/Track.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "TrkParticleBase/TrackParticleBase.h"
 // normal includes
 #include "TrkTrackSummary/TrackSummary.h"
@@ -25,7 +24,6 @@ namespace InDet
  :AthAlgTool(t,n,p),
   m_trkSumTool("Trk::TrackSummaryTool"),
   m_extrapolator("Trk::Extrapolator"),
-  m_iBeamCondSvc ("BeamCondSvc",n),
   m_maxSiD0   (35.),
   m_maxTrtD0 (100.),
   m_maxSiZ0  (200.),
@@ -58,7 +56,6 @@ namespace InDet
    declareProperty("significanceD0_Trt",   m_sD0_Trt);
    declareProperty("significanceZ0_Trt",   m_sZ0_Trt);
    declareProperty("IsConversion",         m_isConv);
-   declareProperty("BeamPositionSvc",      m_iBeamCondSvc);
    declareProperty("PIDonlyForXe",         m_PIDonlyForXe = false,
      "Only check TRT PID if all hits are Xe hits");
  }
@@ -72,18 +69,11 @@ namespace InDet
    ATH_CHECK( m_trkSumTool.retrieve());
    /* Get the extrapolator tool from ToolSvc */
    ATH_CHECK( m_extrapolator.retrieve() );
-   /* Get BeamCondSvc */
-   if (m_iBeamCondSvc.retrieve().isFailure()) {
-     ATH_MSG_INFO( "Could not find BeamCondSvc. Will use (0,0,0) if no vertex is given and extrapolation is needed." );
-   }
+   
+   ATH_CHECK(m_beamSpotKey.initialize());
    return StatusCode::SUCCESS;
  }
     
- StatusCode InDetConversionTrackSelectorTool::finalize()
- {
-  ATH_MSG_DEBUG( "Finalize successful");
-  return StatusCode::SUCCESS;
- }
     
  bool InDetConversionTrackSelectorTool::decision(const Trk::Track& track,const Trk::Vertex* vx) const
  {  
@@ -93,10 +83,11 @@ namespace InDet
    const Trk::Vertex* myVertex=vx;    
    //in case no Vertex is provided by the user, beam position will be used if available
    if (not vertexSuppliedByUser) {
-     if (!m_iBeamCondSvc.empty()) {
-       myVertex=new Trk::RecVertex(m_iBeamCondSvc->beamVtx());
+     SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+     if (beamSpotHandle.isValid()) {
+       myVertex=new Trk::RecVertex(beamSpotHandle->beamVtx());
      } else {
-       ATH_MSG_WARNING(" Cannot get beamSpot center from iBeamCondSvc. Using (0,0,0)... " );
+       ATH_MSG_WARNING(" Cannot get beamSpot center from BeamSpotData. Using (0,0,0)... " );
        myVertex=new Trk::Vertex(Amg::Vector3D(0,0,0));
      }
    }
@@ -196,10 +187,11 @@ namespace InDet
    const bool vertexSuppliedByUser{vx!=nullptr};
    //in case no Vertex is provided by the user, beam position will be used if available
    if (not vertexSuppliedByUser) {
-     if (!m_iBeamCondSvc.empty()) {
-       myVertex=new Trk::RecVertex(m_iBeamCondSvc->beamVtx());
+     SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+     if (beamSpotHandle.isValid()) {
+       myVertex=new Trk::RecVertex(beamSpotHandle->beamVtx());
      } else {
-       ATH_MSG_WARNING( " Cannot get beamSpot center from iBeamCondSvc. Using (0,0,0)... " );
+       ATH_MSG_WARNING( " Cannot get beamSpot center from BeamSpotData. Using (0,0,0)... " );
        myVertex=new Trk::Vertex(Amg::Vector3D(0,0,0));
      }
    }
@@ -288,6 +280,13 @@ namespace InDet
    return pass;
  }
  
+ Amg::Vector3D InDetConversionTrackSelectorTool::getPosOrBeamSpot(const xAOD::Vertex* vertex) const
+ {
+    if(vertex) return vertex->position();
+    SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+    if(beamSpotHandle.isValid()) return beamSpotHandle->beamVtx().position();
+    else return Amg::Vector3D(0,0,0);
+ }
  
    // ---------------------------------------------------------------------
   bool InDetConversionTrackSelectorTool::decision(const xAOD::TrackParticle& tp,const xAOD::Vertex* vertex) const 
@@ -295,7 +294,7 @@ namespace InDet
     bool pass = false;
     const Trk::Perigee& perigee=tp.perigeeParameters();
     //in case no Vertex is provided by the user, beam position will be used if available
-    Trk::PerigeeSurface perigeeSurface( vertex ? vertex->position() : (!m_iBeamCondSvc.empty() ? m_iBeamCondSvc->beamVtx().position() : Amg::Vector3D(0,0,0) ) );
+    Trk::PerigeeSurface perigeeSurface( getPosOrBeamSpot(vertex) );
     const Trk::TrackParameters* extrapolatedParameters= m_extrapolator->extrapolate(perigee,perigeeSurface,Trk::anyDirection,false,Trk::pion );
     if (extrapolatedParameters==0) {
       ATH_MSG_WARNING( "Extrapolation to the vertex failed: " << perigeeSurface << "\n" << perigee );
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx
index 4f08af0472ade8dde962beb20eb59af68dcfbbd1..4081ceee8e3a2c1f9042ebd6dc614b7464c130d0 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx
@@ -12,7 +12,6 @@
 #include "TrkTrack/Track.h"
 #include "TrkTrackSummary/TrackSummary.h"
 #include "TrkParticleBase/TrackParticleBase.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include "MagFieldInterfaces/IMagFieldSvc.h"
 #include "InDetRecToolInterfaces/ITrtDriftCircleCutTool.h"
 #include "InDetRecToolInterfaces/IInDetTestBLayerTool.h"
@@ -40,7 +39,6 @@ namespace InDet
     : AthAlgTool(t,n,p)
     , m_trackSumTool("Trk::TrackSummaryTool", this)
     , m_extrapolator("Trk::Extrapolator", this)
-    , m_iBeamCondSvc ("BeamCondSvc",n)
     , m_magFieldSvc("AtlasFieldSvc",n)
     , m_trtDCTool("InDet::InDetTrtDriftCircleCutTool", this)
     , m_inDetTestBLayerTool("", this)
@@ -109,7 +107,6 @@ namespace InDet
     
     declareProperty("TrackSummaryTool"   , m_trackSumTool);
     declareProperty("Extrapolator"       , m_extrapolator);
-    declareProperty("BeamPositionSvc"    , m_iBeamCondSvc);
     declareProperty("MagFieldSvc", m_magFieldSvc);
     declareProperty("TrtDCCutTool"       , m_trtDCTool);
     declareProperty("InDetTestBLayerTool", m_inDetTestBLayerTool);
@@ -137,9 +134,7 @@ namespace InDet
 	    }
     } 
     ATH_CHECK( m_extrapolator.retrieve() );
-    if (m_iBeamCondSvc.retrieve().isFailure()){
-      ATH_MSG_INFO("Could not find BeamCondSvc. Will use (0,0,0) if no vertex is given and extrapolation is needed.");
-    }
+    ATH_CHECK(m_beamSpotKey.initialize());
     if (m_useEtaDepententMinHitTrt || m_useEtaDepententMinHitTrtWithOutliers){
 	    if(m_trtDCTool.empty()) {
 	      ATH_MSG_ERROR(" Eta delendent cut on number of TRT hits requested but TrtDCCutTool not specified. ");
@@ -202,10 +197,11 @@ namespace InDet
     //in case no Vertex is provided by the user, beam position will be used if available
     if (myVertex==0) {
       //ATH_MSG_DEBUG( "No vertex given, using beam spot or 0,0,0" );
-      if (!m_iBeamCondSvc.empty()) {
-        myVertex=new Trk::RecVertex(m_iBeamCondSvc->beamVtx());
+      SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+      if (beamSpotHandle.isValid()) {
+        myVertex=new Trk::RecVertex(beamSpotHandle->beamVtx());
       } else {
-        ATH_MSG_WARNING( " Cannot get beamSpot center from iBeamCondSvc. Using (0,0,0)... " );
+        ATH_MSG_WARNING( " Cannot get beamSpot center from BeamSpotData. Using (0,0,0)... " );
         myVertex=new Trk::Vertex(Amg::Vector3D(0,0,0));
       }
     }
@@ -374,10 +370,11 @@ namespace InDet
     const Trk::Perigee* extrapolatedPerigee=dynamic_cast<const Trk::Perigee*>(definintParameters);
     const Trk::Vertex* myVertex=vertex;
     if (vertex==0) {
-      if (!m_iBeamCondSvc.empty()) {
-        myVertex=new Trk::RecVertex(m_iBeamCondSvc->beamVtx());
+      SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+      if (beamSpotHandle.isValid()) {
+        myVertex=new Trk::RecVertex(beamSpotHandle->beamVtx());
       } else {
-        ATH_MSG_WARNING( " Cannot get beamSpot center from iBeamCondSvc. Using (0,0,0)... " );
+        ATH_MSG_WARNING( " Cannot get beamSpot center from BeamSpotData. Using (0,0,0)... " );
         myVertex=new Trk::Vertex(Amg::Vector3D(0,0,0));
       }
     }
@@ -435,6 +432,13 @@ namespace InDet
     return true;
   }
 
+  Amg::Vector3D InDetDetailedTrackSelectorTool::getPosOrBeamSpot(const xAOD::Vertex* vertex) const
+  {
+    if(vertex) return vertex->position();
+    SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+    if(beamSpotHandle.isValid()) return beamSpotHandle->beamVtx().position();
+    else return Amg::Vector3D(0,0,0);
+  }
 
   // ---------------------------------------------------------------------
   bool 
@@ -635,7 +639,7 @@ namespace InDet
 	}
       }
     }
-    Trk::PerigeeSurface perigeeSurface( vertex ? vertex->position() : (!m_iBeamCondSvc.empty() ? m_iBeamCondSvc->beamVtx().position() : Amg::Vector3D(0,0,0) ) );
+    Trk::PerigeeSurface perigeeSurface( getPosOrBeamSpot(vertex) );
     
     const Trk::TrackParameters* extrapolatedParameters= m_extrapolator->extrapolate(perigee,perigeeSurface,Trk::anyDirection,true,Trk::pion );
     const Trk::Perigee* extrapolatedPerigee = extrapolatedParameters ? dynamic_cast<const Trk::Perigee*>(extrapolatedParameters) : 0; 
diff --git a/InnerDetector/InDetRecTools/InDetVKalPriVxFinderTool/InDetVKalPriVxFinderTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/InDetVKalPriVxFinderTool/InDetVKalPriVxFinderTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..cb633761f77cb2f97827c435389cd36c6adc264d
--- /dev/null
+++ b/InnerDetector/InDetRecTools/InDetVKalPriVxFinderTool/InDetVKalPriVxFinderTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/InDetVKalPriVxFinderTool
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..a53ee33749a0b43b3ca7c7939ef9449dcc429ef3
--- /dev/null
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/InDetVKalVxInJetTool
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
index 896aa2b9a8c0453ef50d0ca7ff3c761b4fd4cd8a..a48cfe827f54ee287559d22f30a91ccfc73dc6bd 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/InDetVKalVxInJetTool/InDetVKalVxInJetTool.h
@@ -100,7 +100,8 @@ namespace InDet {
 		     std::vector<const Rec::TrackParticle*>    TrkFromV0;
   };
 
-  class InDetVKalVxInJetTool : public AthAlgTool, virtual public ISecVertexInJetFinder{
+//This tool should not be used in a reentrant algorithm because of the mutable m_NRefPVTrk
+  class ATLAS_NOT_THREAD_SAFE InDetVKalVxInJetTool : public AthAlgTool, virtual public ISecVertexInJetFinder{
 
 
   public:
diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
index bd65a75f02d475ccfa2d3274e9d30846848c2fe0..ee2f63cc994296300492faa0d3196354a3015812 100755
--- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
+++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/src/Utilities.cxx
@@ -16,18 +16,22 @@ namespace InDet{
 
   double InDetVKalVxInJetTool::RankBTrk(double TrkPt, double JetPt, double Signif)  const
   {
-    //code re-ordered to avoid divide by zero
-     double coeffPt=10.;
-     double pfrac=(TrkPt-m_cutPt)/std::sqrt(JetPt);
-     double p_prob= pfrac/(coeffPt+pfrac);    // Old probability to be b-track
-     if (Signif == 0.) return p_prob; //should be less than some epsilon?
-     //
-     double coeffSig=1.0;
-     double s_prob=(Signif-coeffSig)/Signif;   // Old probability to be b-track
-     if(TrkPt + JetPt == 0.) return s_prob;
-     //----------------------------------Initial definition of selective variable
-     double contrib=0.4;
-     return (1.+contrib)*std::max(s_prob,0.)+(1.-contrib)*p_prob;
+    double p_prob=0.;
+    double s_prob=0.;
+    if(TrkPt > 0. &&  JetPt > 0.){
+      double coeffPt=10.;
+      double pfrac=(TrkPt-m_cutPt)/std::sqrt(JetPt);
+      p_prob= pfrac/(coeffPt+pfrac);    // Old probability to be b-track
+      if (Signif == 0.) return p_prob; //should be less than some epsilon?
+    } 
+    if( Signif != 0.) {
+      double coeffSig=1.0;
+      s_prob=(Signif-coeffSig)/Signif;   // Old probability to be b-track
+      if(TrkPt + JetPt == 0.) return s_prob;
+    }
+    //----------------------------------Initial definition of selective variable
+    double contrib=0.4;
+    return (1.+contrib)*std::max(s_prob,0.)+(1.-contrib)*p_prob;
   }
 
 
diff --git a/InnerDetector/InDetRecTools/SeedToTrackConversionTool/SeedToTrackConversionTool/SeedToTrackConversionTool.h b/InnerDetector/InDetRecTools/SeedToTrackConversionTool/SeedToTrackConversionTool/SeedToTrackConversionTool.h
index e8f4a2ecd4b3151159fee215481080f9841e08d0..8bbff9b3d08ec0652e9580d345c02ff1423aa5a1 100644
--- a/InnerDetector/InDetRecTools/SeedToTrackConversionTool/SeedToTrackConversionTool/SeedToTrackConversionTool.h
+++ b/InnerDetector/InDetRecTools/SeedToTrackConversionTool/SeedToTrackConversionTool/SeedToTrackConversionTool.h
@@ -1,5 +1,7 @@
+// -*- C++ -*-
+
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -33,54 +35,52 @@ namespace InDet
   */  
 
   class SeedToTrackConversionTool : virtual public ISeedToTrackConversionTool, public AthAlgTool
-    {
-    public:
-      SeedToTrackConversionTool(const std::string&,const std::string&,const IInterface*);
+  {
+  public:
+    SeedToTrackConversionTool(const std::string&,const std::string&,const IInterface*);
 
-       /** default destructor */
-      virtual ~SeedToTrackConversionTool ();
+    /** default destructor */
+    virtual ~SeedToTrackConversionTool() = default;
       
-       /** standard Athena-Algorithm method */
-      virtual StatusCode initialize();
-       /** standard Athena-Algorithm method */
-      virtual StatusCode finalize  ();
+    /** standard Athena-Algorithm method */
+    virtual StatusCode initialize();
+    /** standard Athena-Algorithm method */
+    virtual StatusCode finalize  ();
 
-      // Main methods for seeds conversion
-      virtual void executeSiSPSeedSegments   (const Trk::TrackParameters*,const int&, const std::list<const Trk::SpacePoint*>&); 
-      //!<seed trackparameters, number of tracks found:m_track.size(), list of spacepoints
-      virtual void newEvent();
-      virtual void newEvent(const Trk::TrackInfo&,const std::string&);
-      virtual void endEvent();
+    // Main methods for seeds conversion
+    virtual void executeSiSPSeedSegments(const Trk::TrackParameters*, const int&, const std::list<const Trk::SpacePoint*>&); 
+    //!<seed trackparameters, number of tracks found:m_track.size(), list of spacepoints
+    virtual void newEvent();
+    virtual void newEvent(const Trk::TrackInfo&,const std::string&);
+    virtual void endEvent();
 
-      //////////////////////////////////////////////////////////////////
-      // Print internal tool parameters and status
-      ///////////////////////////////////////////////////////////////////
-      
-      virtual MsgStream&    dump(MsgStream&    out) const;
-      virtual std::ostream& dump(std::ostream& out) const;
-      // enter declaration of your interface-defining member functions here
+    //////////////////////////////////////////////////////////////////
+    // Print internal tool parameters and status
+    ///////////////////////////////////////////////////////////////////
       
-    protected:
-      PublicToolHandle<Trk::IExtrapolator>        m_extrapolator
-         {this,"Extrapolator","Trk::Extrapolator",""}; //!< extrapolator
-      PublicToolHandle<Trk::IRIO_OnTrackCreator > m_rotcreator
-         {this,"RIO_OnTrackCreator","Trk::RIO_OnTrackCreator/InDetRotCreator",""}; //!< Creator ROT
-      mutable TrackCollection*              m_seedsegmentsCollection; //!< output collection for seed
-      std::string                           m_seedsegmentsOutput; //!< SiSpSeedSegments Output Collection
-      Trk::TrackInfo                        m_trackinfo     ; //!< TrackInfo for seeds 
-      std::string                           m_patternName   ; //!< Name of the pattern recognition
-      int                                   m_nprint        ; //!< Kind output information
-      int                                   m_totseed       ; //!< number of total seeds in the pass
-      int                                   m_survived      ; //!< number of survived seeds 
+    virtual MsgStream&    dump(MsgStream&    out) const;
+    virtual std::ostream& dump(std::ostream& out) const;
+    // enter declaration of your interface-defining member functions here
       
-      /** member variables for algorithm properties: */
-      // int/double/bool  m_propertyName;
-      MsgStream&    dumpconditions(MsgStream&    out) const;
-      MsgStream&    dumpevent     (MsgStream&    out) const;
+  protected:
+    PublicToolHandle<Trk::IExtrapolator> m_extrapolator
+    {this, "Extrapolator","Trk::Extrapolator", ""}; //!< extrapolator
+    PublicToolHandle<Trk::IRIO_OnTrackCreator > m_rotcreator
+    {this, "RIO_OnTrackCreator", "Trk::RIO_OnTrackCreator/InDetRotCreator", ""}; //!< Creator ROT
+    mutable TrackCollection* m_seedsegmentsCollection{nullptr}; //!< output collection for seed
+    std::string m_seedsegmentsOutput{"SiSPSeedSegments"}; //!< SiSpSeedSegments Output Collection
+    Trk::TrackInfo                        m_trackinfo     ; //!< TrackInfo for seeds 
+    StringProperty m_patternName{this, "TrackPatternRecoInfo", "SiSPSeededFinder", "Name of the pattern recognition"};
+    int                                   m_nprint{0}     ; //!< Kind output information
+    int                                   m_totseed{0}    ; //!< number of total seeds in the pass
+    int                                   m_survived{0}   ; //!< number of survived seeds 
       
-    }; 
-  MsgStream&    operator << (MsgStream&   ,const SeedToTrackConversionTool&);
-  std::ostream& operator << (std::ostream&,const SeedToTrackConversionTool&); 
+    MsgStream& dumpconditions(MsgStream& out) const;
+    MsgStream& dumpevent     (MsgStream& out) const;
+
+  }; 
+  MsgStream&    operator << (MsgStream&   , const SeedToTrackConversionTool&);
+  std::ostream& operator << (std::ostream&, const SeedToTrackConversionTool&); 
 } // end of namespace
 
 #endif 
diff --git a/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx b/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx
index 44af774a2928e3f7f574688751a649b61c9e1d2f..44043e89d03a64c90e8dc637ba1c0bb48364017f 100644
--- a/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx
+++ b/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx
@@ -1,47 +1,31 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
-// SeedToTrackConversionTool.cxx, (c) ATLAS Detector software
+// SeedToTrackConversionTool.cxx
 ///////////////////////////////////////////////////////////////////
 
-#include <iostream>
-#include <iomanip>
-#include <utility>
+#include "SeedToTrackConversionTool/SeedToTrackConversionTool.h"
 
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
-#include "TrkRIO_OnTrack/RIO_OnTrack.h"
 #include "InDetPrepRawData/SiClusterContainer.h"
-#include "SeedToTrackConversionTool/SeedToTrackConversionTool.h"
+#include "TrkRIO_OnTrack/RIO_OnTrack.h"
+
+#include <iomanip>
+#include <iostream>
+#include <utility>
 
 //================ Constructor =================================================
 
 InDet::SeedToTrackConversionTool::SeedToTrackConversionTool(const std::string& t,
-			  const std::string& n,
-			  const IInterface*  p )
-  : AthAlgTool(t,n,p),
-  m_totseed(0),
-  m_survived(0)
+                                                            const std::string& n,
+                                                            const IInterface* p)
+  : AthAlgTool(t, n, p)
 {
-    // For SiSPSeedSegment
-  //
-  m_seedsegmentsCollection = 0;
-  m_seedsegmentsOutput = "SiSPSeedSegments";
-  m_patternName = "SiSPSeededFinder"; 
-  m_nprint = 0;   
   declareInterface<ISeedToTrackConversionTool>(this);
-  declareProperty("TrackPatternRecoInfo"    ,m_patternName );
-  //  template for property decalration
-  //declareProperty("PropertyName", m_propertyName);
 }
 
-//================ Destructor =================================================
-
-InDet::SeedToTrackConversionTool::~SeedToTrackConversionTool()
-{}
-
-
 //================ Initialisation =================================================
 
 StatusCode InDet::SeedToTrackConversionTool::initialize()
@@ -50,21 +34,21 @@ StatusCode InDet::SeedToTrackConversionTool::initialize()
   StatusCode sc = AlgTool::initialize();
   if (sc.isFailure()) return sc;
 
-
- if(m_extrapolator.retrieve().isFailure()) {
+  if (m_extrapolator.retrieve().isFailure()) {
     ATH_MSG_FATAL ("Could not retrieve "<< m_extrapolator);
     return StatusCode::FAILURE;
-  } else
+  } else {
     ATH_MSG_VERBOSE( "initialize() Retrieved service " << m_extrapolator);
+  }
 
   // Retrieve the Track RotCreator tool
-
-  if(m_rotcreator.retrieve().isFailure()) {
+  if (m_rotcreator.retrieve().isFailure()) {
     ATH_MSG_FATAL ("Could not retrieve "<< m_rotcreator);
     return StatusCode::FAILURE;
-  } else
+  } else {
     ATH_MSG_VERBOSE( "initialize() Retrieved service " << m_rotcreator);
-  
+  }  
+
   ATH_MSG_INFO ("initialize() successful in " << name());
   return StatusCode::SUCCESS;
 }
@@ -73,23 +57,22 @@ StatusCode InDet::SeedToTrackConversionTool::initialize()
 
 StatusCode InDet::SeedToTrackConversionTool::finalize()
 {
-  StatusCode sc = AlgTool::finalize();
- return sc;
+  return AlgTool::finalize();
 }
 
 void InDet::SeedToTrackConversionTool::newEvent()
 {
   m_seedsegmentsCollection = new TrackCollection;
   m_totseed = 0;
-  m_survived = 0; 
+  m_survived = 0;
 }
 
 void InDet::SeedToTrackConversionTool::newEvent(const Trk::TrackInfo& info, const std::string& patternName)
 {
-  newEvent(); 
+  newEvent();
   m_trackinfo = info;
   m_patternName = patternName;
-  if((int)m_patternName.find("Forward")>-1){
+  if (static_cast<int>(m_patternName.value().find("Forward"))>-1) {
     m_trackinfo.setPatternRecognitionInfo(Trk::TrackInfo::SiSpacePointsSeedMaker_ForwardTracks);
   }
 }
@@ -99,83 +82,76 @@ void InDet::SeedToTrackConversionTool::endEvent()
   // Print event information
   //
   if (msgLevel()<=0) {
-    m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
+    m_nprint=1;
+    ATH_MSG_DEBUG(*this);
   }
 
-  const TrackCollection*  inputTracks = 0;
+  const TrackCollection* inputTracks = nullptr;
 
-  if(evtStore()->retrieve(inputTracks, m_seedsegmentsOutput)&&inputTracks) {
-    TrackCollection::const_iterator t,te = inputTracks->end();
-    for (t=inputTracks->begin(); t!=te; ++t) {
-      m_seedsegmentsCollection->push_back(new Trk::Track(*(*t)) );
+  if (evtStore()->retrieve(inputTracks, m_seedsegmentsOutput) && inputTracks) {
+    for (const Trk::Track* t: *inputTracks) {
+      m_seedsegmentsCollection->push_back(new Trk::Track(*t));
     }
 
-    msg(MSG::INFO)<<"Check SiSPSeedSegments Collection "<<m_seedsegmentsCollection->size()<<" inputTracks: "
-		  <<inputTracks->size()<<" trackinfo: "<<m_trackinfo<< endmsg;
-    StatusCode s = evtStore()->overwrite(m_seedsegmentsCollection,m_seedsegmentsOutput,true);
-    if (s.isFailure() ) {
-      msg(MSG::ERROR)<<"Could not overwrite converted SiSPSeedSegments tracks" <<endmsg;
+    ATH_MSG_INFO("Check SiSPSeedSegments Collection " << m_seedsegmentsCollection->size() <<
+                 " inputTracks: " << inputTracks->size() << 
+                 " trackinfo: " << m_trackinfo);
+    StatusCode s = evtStore()->overwrite(m_seedsegmentsCollection, m_seedsegmentsOutput, true);
+    if (s.isFailure()) {
+      ATH_MSG_ERROR("Could not overwrite converted SiSPSeedSegments tracks");
     }
-  }
-  else{
-    msg(MSG::INFO)<<" Check SiSPSeedSegments Collection "<<m_seedsegmentsCollection->size()<<" trackinfo: " 
-		  <<m_trackinfo<<endmsg;
-    StatusCode s = evtStore()->record(m_seedsegmentsCollection,m_seedsegmentsOutput,true);
-    if (s.isFailure() ) {
-      msg(MSG::ERROR)<<"Could not save converted SiSPSeedSegments tracks" <<endmsg;
+  } else {
+    ATH_MSG_INFO(" Check SiSPSeedSegments Collection " << m_seedsegmentsCollection->size() << " trackinfo: "
+                 << m_trackinfo);
+    StatusCode s = evtStore()->record(m_seedsegmentsCollection, m_seedsegmentsOutput, true);
+    if (s.isFailure()) {
+      ATH_MSG_ERROR("Could not save converted SiSPSeedSegments tracks");
     }
   }
-
 }
 
-void  InDet::SeedToTrackConversionTool::executeSiSPSeedSegments(const Trk::TrackParameters* Tp,const int& mtrk, const std::list<const Trk::SpacePoint*>& Sp)
+void  InDet::SeedToTrackConversionTool::executeSiSPSeedSegments(const Trk::TrackParameters* Tp, const int& mtrk, const std::list<const Trk::SpacePoint*>& Sp)
 {
   ++m_totseed; // accumulate all seeds
-  if(mtrk>0)++m_survived; // survided seeds 
+  if (mtrk>0) ++m_survived; // survided seeds 
   std::vector<const Trk::PrepRawData*> prdsInSp;
-  std::list<const Trk::SpacePoint*>::const_iterator is=Sp.begin(),ise=Sp.end();
-
-  for(; is !=ise; ++is){
-    const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& prds = (**is).clusterList();
-    if(prds.first)prdsInSp.push_back(prds.first);
-    if(prds.second&&prds.first != prds.second)prdsInSp.push_back(prds.second);
+  for (const Trk::SpacePoint* s: Sp) {
+    const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& prds = s->clusterList();
+    if (prds.first) prdsInSp.push_back(prds.first);
+    if (prds.second && prds.first != prds.second) prdsInSp.push_back(prds.second);
   }
   Trk::PerigeeSurface persurf;
-  const Trk::TrackParameters *per = m_extrapolator->extrapolate(*Tp,persurf,Trk::anyDirection,false,Trk::nonInteracting);
-  const Trk::TrackParameters *prevpar = Tp;
-  if(per){
+  const Trk::TrackParameters* per = m_extrapolator->extrapolate(*Tp, persurf, Trk::anyDirection, false, Trk::nonInteracting);
+  const Trk::TrackParameters* prevpar = Tp;
+  if (per) {
     std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
     typePattern.set(Trk::TrackStateOnSurface::Perigee);
-    const Trk::TrackStateOnSurface *pertsos=new Trk::TrackStateOnSurface(0,per,0,0,typePattern);
+    const Trk::TrackStateOnSurface* pertsos = new Trk::TrackStateOnSurface(0, per, 0, 0, typePattern);
     DataVector<const Trk::TrackStateOnSurface>* traj = new DataVector<const Trk::TrackStateOnSurface>;
     traj->push_back(pertsos);
-    int ix1=0;
-    int i=0;
-    for ( ;i<(int)prdsInSp.size();i++){
-      const Trk::Surface &surf=prdsInSp[i]->detectorElement()->surface(prdsInSp[i]->identify());
-      const Trk::TrackParameters *thispar = m_extrapolator->extrapolate(*prevpar,surf,Trk::alongMomentum,false,Trk::nonInteracting);
-      if(thispar){
-        const Trk::TrackParameters *tmppar=thispar->clone();
+    for (const Trk::PrepRawData* prd: prdsInSp) {
+      const Trk::Surface& surf = prd->detectorElement()->surface(prd->identify());
+      const Trk::TrackParameters* thispar = m_extrapolator->extrapolate(*prevpar, surf, Trk::alongMomentum, false, Trk::nonInteracting);
+      if (thispar) {
+        const Trk::TrackParameters* tmppar = thispar->clone();
         delete thispar;
-        thispar=tmppar;
+        thispar = tmppar;
         std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
         typePattern.set(Trk::TrackStateOnSurface::Measurement);
-        const Trk::RIO_OnTrack *rot=0;
-        rot=m_rotcreator->correct(*prdsInSp[i],*thispar);
-        if (rot){
-          const Trk::TrackStateOnSurface *tsos=new Trk::TrackStateOnSurface(rot,thispar,0,0,typePattern);
+        const Trk::RIO_OnTrack* rot = m_rotcreator->correct(*prd, *thispar);
+        if (rot) {
+          const Trk::TrackStateOnSurface* tsos = new Trk::TrackStateOnSurface(rot, thispar, 0, 0, typePattern);
           traj->push_back(tsos);
-          prevpar=thispar;
-          ix1++;
+          prevpar = thispar;
         }
       }
     }
     Trk::TrackInfo trkinfo = m_trackinfo;
-    if(mtrk>0){ // survived seeds set as
+    if (mtrk>0) { // survived seeds set as
       trkinfo.setTrackFitter(Trk::TrackInfo::xKalman); // xk seedfinder
     }
-    Trk::Track* t = new Trk::Track(trkinfo,traj,0);
-    if(t)m_seedsegmentsCollection->push_back(t);
+    Trk::Track* t = new Trk::Track(trkinfo, traj, 0);
+    if (t) m_seedsegmentsCollection->push_back(t);
   }
 }
 
@@ -183,44 +159,44 @@ void  InDet::SeedToTrackConversionTool::executeSiSPSeedSegments(const Trk::Track
 // Dumps relevant information into the MsgStream
 ///////////////////////////////////////////////////////////////////
  
-MsgStream&  InDet::SeedToTrackConversionTool::dump( MsgStream& out ) const
+MsgStream& InDet::SeedToTrackConversionTool::dump(MsgStream& out) const
 {
-  out<<std::endl;
-  if(m_nprint) dumpevent(out);
+  out << std::endl;
+  if (m_nprint) dumpevent(out);
   return dumpconditions(out);
 }
  
 ///////////////////////////////////////////////////////////////////
 // Dumps conditions information into the MsgStream
 ///////////////////////////////////////////////////////////////////
-MsgStream& InDet::SeedToTrackConversionTool::dumpconditions( MsgStream& out ) const
+MsgStream& InDet::SeedToTrackConversionTool::dumpconditions(MsgStream& out) const
 {
-  out<<"|----------------------------------------------------------------------"
-     <<"-------------------|"
-     <<std::endl;
-  out<<"| Output Collection Name   | "<<m_seedsegmentsOutput <<std::endl;
-  out<<"} Name of pattern recognition | "<<m_patternName<<std::endl;
-  out<<"|----------------------------------------------------------------------"
-     <<"-------------------|"
-     <<std::endl;
+  out << "|----------------------------------------------------------------------"
+      << "-------------------|"
+      << std::endl;
+  out << "| Output Collection Name   | " << m_seedsegmentsOutput << std::endl;
+  out << "} Name of pattern recognition | " << m_patternName << std::endl;
+  out << "|----------------------------------------------------------------------"
+      << "-------------------|"
+      << std::endl;
   return out;
 }
 ///////////////////////////////////////////////////////////////////
 // Dumps event information into the MsgStream
 ///////////////////////////////////////////////////////////////////
 
-MsgStream& InDet::SeedToTrackConversionTool::dumpevent( MsgStream& out ) const
+MsgStream& InDet::SeedToTrackConversionTool::dumpevent(MsgStream& out) const
 {
-  out<<"|---------------------------------------------------------------------|"
-     <<std::endl;
-  out<<"| Name of SeedFinder      | "<<m_patternName
-     <<"                              |"<<std::endl;
-  out<<"| Number of All seeds      | "<<std::setw(12)<<m_totseed 
-     <<"                              |"<<std::endl;
-  out<<"| Number of survived seeds    | "<<std::setw(12)<<m_survived  
-     <<"                              |"<<std::endl;
-  out<<"|---------------------------------------------------------------------|"
-     <<std::endl;
+  out << "|---------------------------------------------------------------------|"
+      << std::endl;
+  out << "| Name of SeedFinder          | " << m_patternName
+      << "                              | " << std::endl;
+  out << "| Number of All seeds         | " << std::setw(12) << m_totseed 
+      << "                              | " << std::endl;
+  out << "| Number of survived seeds    | " << std::setw(12) << m_survived  
+      << "                              | " << std::endl;
+  out << "|---------------------------------------------------------------------|"
+      << std::endl;
   return out;
 }
 
@@ -228,7 +204,7 @@ MsgStream& InDet::SeedToTrackConversionTool::dumpevent( MsgStream& out ) const
 // Dumps relevant information into the ostream
 ///////////////////////////////////////////////////////////////////
  
-std::ostream& InDet::SeedToTrackConversionTool::dump( std::ostream& out ) const
+std::ostream& InDet::SeedToTrackConversionTool::dump(std::ostream& out) const
 {
   return out;
 }
@@ -236,11 +212,11 @@ std::ostream& InDet::SeedToTrackConversionTool::dump( std::ostream& out ) const
 ///////////////////////////////////////////////////////////////////
 // Overload of << operator MsgStream
 ///////////////////////////////////////////////////////////////////
- 
-MsgStream& InDet::operator    << 
-(MsgStream& sl,const InDet::SeedToTrackConversionTool& se)
+
+MsgStream& InDet::operator << 
+(MsgStream& sl, const InDet::SeedToTrackConversionTool& se)
 { 
-  return se.dump(sl); 
+  return se.dump(sl);
 }
 
 ///////////////////////////////////////////////////////////////////
@@ -248,10 +224,9 @@ MsgStream& InDet::operator    <<
 ///////////////////////////////////////////////////////////////////
 
 std::ostream& InDet::operator << 
-(std::ostream& sl,const InDet::SeedToTrackConversionTool& se)
+(std::ostream& sl, const InDet::SeedToTrackConversionTool& se)
 {
-  return se.dump(sl); 
+  return se.dump(sl);
 }   
 
 //============================================================================================
-
diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h
index e7f14a2a95135ee0eef96afee30b465538f47353..106fa627324802ab22128ac005d096b246cc07b2 100755
--- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h
+++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h
@@ -1,5 +1,7 @@
+// -*- C++ -*-
+
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////////////////////
@@ -16,376 +18,402 @@
 #ifndef SiSpacePointsSeedMaker_ATLxk_H
 #define SiSpacePointsSeedMaker_ATLxk_H
 
-
-#include "GaudiKernel/ServiceHandle.h"
-#include "MagFieldInterfaces/IMagFieldSvc.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "AthenaBaseComps/AthAlgTool.h"
 #include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h"
-#include "TrkSpacePoint/SpacePointContainer.h" 
-#include "TrkSpacePoint/SpacePointOverlapCollection.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+
 #include "BeamSpotConditionsData/BeamSpotData.h"
+#include "MagFieldInterfaces/IMagFieldSvc.h"
 #include "SiSpacePointsSeedTool_xk/SiSpacePointForSeed.h"
 #include "SiSpacePointsSeedTool_xk/SiSpacePointsProSeed.h" 
+#include "TrkToolInterfaces/IPRD_AssociationTool.h"
+#include "TrkSpacePoint/SpacePointContainer.h" 
+#include "TrkSpacePoint/SpacePointOverlapCollection.h"
+
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
+
 #include <iosfwd>
 #include <list>
-#include <set>
 #include <map>
+#include <set>
 #include <vector>
 
-class MsgStream   ;
-
-namespace Trk {
-  class IPRD_AssociationTool;
-}
+class MsgStream;
 
 namespace InDet {
 
 
   class SiSpacePointsSeedMaker_ATLxk : 
     virtual public ISiSpacePointsSeedMaker, public AthAlgTool
-    {
-      ///////////////////////////////////////////////////////////////////
-      // Public methods:
-      ///////////////////////////////////////////////////////////////////
+  {
+    ///////////////////////////////////////////////////////////////////
+    // Public methods:
+    ///////////////////////////////////////////////////////////////////
       
-    public:
+  public:
       
-      ///////////////////////////////////////////////////////////////////
-      // Standard tool methods
-      ///////////////////////////////////////////////////////////////////
-
-      SiSpacePointsSeedMaker_ATLxk
-	(const std::string&,const std::string&,const IInterface*);
-      virtual ~SiSpacePointsSeedMaker_ATLxk();
-      virtual StatusCode               initialize();
-      virtual StatusCode               finalize  ();
-
-      ///////////////////////////////////////////////////////////////////
-      // Methods to initialize tool for new event or region
-      ///////////////////////////////////////////////////////////////////
-
-      void newEvent (int);
-      void newRegion
-	(const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&);
-      void newRegion
-	(const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&,const IRoiDescriptor&);
+    ///////////////////////////////////////////////////////////////////
+    // Standard tool methods
+    ///////////////////////////////////////////////////////////////////
+
+    SiSpacePointsSeedMaker_ATLxk
+    (const std::string&,const std::string&,const IInterface*);
+    virtual ~SiSpacePointsSeedMaker_ATLxk();
+    virtual StatusCode               initialize();
+    virtual StatusCode               finalize  ();
+
+    ///////////////////////////////////////////////////////////////////
+    // Methods to initialize tool for new event or region
+    ///////////////////////////////////////////////////////////////////
+
+    void newEvent (int);
+    void newRegion
+    (const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&);
+    void newRegion
+    (const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&,const IRoiDescriptor&);
       
-      ///////////////////////////////////////////////////////////////////
-      // Methods to initilize different strategies of seeds production
-      // with two space points with or without vertex constraint
-      ///////////////////////////////////////////////////////////////////
-
-      void find2Sp (const std::list<Trk::Vertex>&);
-
-      ///////////////////////////////////////////////////////////////////
-      // Methods to initilize different strategies of seeds production
-      // with three space points with or without vertex constraint
-      ///////////////////////////////////////////////////////////////////
-
-      void find3Sp (const std::list<Trk::Vertex>&);
-      void find3Sp (const std::list<Trk::Vertex>&,const double*);
-
-      ///////////////////////////////////////////////////////////////////
-      // Methods to initilize different strategies of seeds production
-      // with variable number space points with or without vertex constraint
-      // Variable means (2,3,4,....) any number space points
-      ///////////////////////////////////////////////////////////////////
+    ///////////////////////////////////////////////////////////////////
+    // Methods to initilize different strategies of seeds production
+    // with two space points with or without vertex constraint
+    ///////////////////////////////////////////////////////////////////
+
+    void find2Sp (const std::list<Trk::Vertex>&);
+
+    ///////////////////////////////////////////////////////////////////
+    // Methods to initilize different strategies of seeds production
+    // with three space points with or without vertex constraint
+    ///////////////////////////////////////////////////////////////////
+
+    void find3Sp (const std::list<Trk::Vertex>&);
+    void find3Sp (const std::list<Trk::Vertex>&,const double*);
+
+    ///////////////////////////////////////////////////////////////////
+    // Methods to initilize different strategies of seeds production
+    // with variable number space points with or without vertex constraint
+    // Variable means (2,3,4,....) any number space points
+    ///////////////////////////////////////////////////////////////////
  
-      void findVSp (const std::list<Trk::Vertex>&);
+    void findVSp (const std::list<Trk::Vertex>&);
       
-      ///////////////////////////////////////////////////////////////////
-      // Iterator through seeds pseudo collection produced accordingly
-      // methods find    
-      ///////////////////////////////////////////////////////////////////
+    ///////////////////////////////////////////////////////////////////
+    // Iterator through seeds pseudo collection produced accordingly
+    // methods find    
+    ///////////////////////////////////////////////////////////////////
       
-      const SiSpacePointsSeed* next();
+    const SiSpacePointsSeed* next();
       
-      ///////////////////////////////////////////////////////////////////
-      // Print internal tool parameters and status
-      ///////////////////////////////////////////////////////////////////
-
-      MsgStream&    dump          (MsgStream   & out) const;
-      std::ostream& dump          (std::ostream& out) const;
-
-    protected:
-              /**    @name Disallow default instantiation, copy, assignment */
-  //@{
-  SiSpacePointsSeedMaker_ATLxk() = delete;
-  SiSpacePointsSeedMaker_ATLxk(const SiSpacePointsSeedMaker_ATLxk&) = delete;
-  SiSpacePointsSeedMaker_ATLxk &operator=(const SiSpacePointsSeedMaker_ATLxk&) = delete;
-  //@}
-      ///////////////////////////////////////////////////////////////////
-      // Protected data and methods
-      ///////////////////////////////////////////////////////////////////
-  
-      ServiceHandle<MagField::IMagFieldSvc>  m_fieldServiceHandle ;
-      MagField::IMagFieldSvc*                m_fieldService{}       ;
-        
-      SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
-      bool                        m_pixel{}                         ;
-      bool                        m_sct{}                           ;
-      bool                        m_endlist{}                       ;
-      bool                        m_useOverlap{}                    ;
-      bool                        m_useassoTool{}                   ;
-      bool                        m_trigger{}                       ;
-      bool                        m_checketa{}                      ;
-      bool                        m_isvertex{}                      ;
-      bool                        m_dbm{}                           ;
-      int                         m_outputlevel{}                   ;
-      int                         m_nprint{}                        ;
-      int                         m_state{}                         ;
-      int                         m_nspoint{}                       ;
-      int                         m_mode{}                          ;
-      int                         m_nlist{}                         ;
-      int                         m_maxsize{}                       ;
-      int                         m_iteration{}                     ;
-      unsigned int                m_maxNumberVertices{}             ;
-      float                       m_etamin{}, m_etamax{}              ;
-      float                       m_r1min{}, m_r1minv{}               ;
-      float                       m_r1max{}, m_r1maxv{}               ;
-      float                       m_r2min{}, m_r2minv{}               ;
-      float                       m_r2max{}, m_r2maxv{}               ;
-      float                       m_r3min{}                         ;
-      float                       m_r3max{}                         ;
-      float                       m_drmin{}, m_drminv{}               ;
-      float                       m_drmax{}                         ;
-      float                       m_rapcut{}                        ;
-      float                       m_dzdrmin0{}                      ;
-      float                       m_dzdrmax0{}                      ;
-      float                       m_dzdrmin{}                       ;
-      float                       m_dzdrmax{}                       ;
-      float                       m_zmin{}                          ;
-      float                       m_zmax{}                          ;
-      float                       m_zminU{}                         ;
-      float                       m_zmaxU{}                         ;
-      float                       m_zminB{}                         ;
-      float                       m_zmaxB{}                         ;
-      float                       m_ftrig{}                         ;
-      float                       m_ftrigW{}                        ;
-      float                       m_r_rmax{}                        ;
-      float                       m_r_rstep{}                       ;
-      float                       m_dzver{}                         ;
-      float                       m_dzdrver{}                       ;
-      float                       m_diver{}                         ;
-      float                       m_diverpps{}                      ;
-      float                       m_diversss{}                      ;
-      float                       m_divermax{}                      ;
-      float                       m_dazmax{}                        ;
-      float                       m_ptmin{}                         ;
-      float                       m_ipt{}                           ;
-      float                       m_ipt2 {}                         ;
-      float                       m_COF{}                           ;
-      float                       m_K{}                             ;
-      float                       m_ipt2K{}                         ;
-      float                       m_ipt2C{}                         ;
-      float                       m_COFK{}                          ;  
-      float                       m_umax{}                          ;
-      int m_r_size {}                                                 ;
-      int m_r_first{}                                                 ;
-      int m_rf_size {}                                                ;
-      int m_rfz_size{}                                                ;
-      std::list<InDet::SiSpacePointForSeed*>* m_r_Sorted            ;
-      std::list<InDet::SiSpacePointForSeed*>  m_rfz_Sorted [   583] ;
-      std::list<InDet::SiSpacePointForSeed*>  m_rfzv_Sorted[   300] ;
-      std::list<InDet::SiSpacePointForSeed*>  m_l_spforseed         ;
-      std::list<InDet::SiSpacePointForSeed*>::iterator m_i_spforseed; 
-      std::list<InDet::SiSpacePointForSeed*>::iterator m_rMin     ;
-
-      int m_ns{},m_nsaz{},m_nsazv{}                                     ;
-      int m_fNmax{},m_fvNmax{}                                        ;
-      int m_fNmin{},m_fvNmin{}                                        ;
-      int m_zMin{}                                                  ;
-      int  m_nr{}     ; int* m_r_index{}   ; int* m_r_map{}                 ;
-      int  m_nrfz{}   , m_rfz_index  [583], m_rfz_map  [583]            ;
-      int  m_nrfzv{}  , m_rfzv_index [300], m_rfzv_map [300]            ;
-      int m_rfz_b[583],m_rfz_t[593],m_rfz_ib[583][9],m_rfz_it[583][9]     ;
-      int m_rfzv_n[300],m_rfzv_i[300][6]                              ;
-      float m_sF{}                                                  ;
-      float m_sFv{}                                                 ;
-
-      ///////////////////////////////////////////////////////////////////
-      // Tables for 3 space points seeds search
-      ///////////////////////////////////////////////////////////////////
-     
-      int    m_maxsizeSP{}                                          ;                    
-      InDet::SiSpacePointForSeed** m_SP{}                           ;
-      float               *  m_Zo{}                                 ; 
-      float               *  m_Tz{}                                 ;
-      float               *  m_R{}                                  ;
-      float               *  m_U{}                                  ;
-      float               *  m_V{}                                  ;
-      float               *  m_Er{}                                 ;
-
-      InDet::SiSpacePointsSeed* m_seedOutput{}                      ;
-
-      std::list<InDet::SiSpacePointsProSeed*>           m_l_seeds   ;
-      std::list<InDet::SiSpacePointsProSeed*>::iterator m_i_seed    ; 
-      std::list<InDet::SiSpacePointsProSeed*>::iterator m_i_seede   ;
-
-      std::multimap<float,InDet::SiSpacePointsProSeed*> m_seeds          ;
-      std::multimap<float,InDet::SiSpacePointsProSeed*>::iterator m_seed ;
-
-      std::multimap<float,InDet::SiSpacePointsProSeed*> m_mapOneSeeds;
-      InDet::SiSpacePointsProSeed*                      m_OneSeeds{}   ;
-      int                                               m_maxOneSize{} ;
-      int                                               m_nOneSeeds{}  ;
-      int                                               m_fillOneSeeds{};
-      std::set<float>                                   m_l_vertex   ;
-      std::vector<std::pair<float,InDet::SiSpacePointForSeed*>> m_CmSp; 
-
-      ///////////////////////////////////////////////////////////////////
-      // Beam geometry
-      ///////////////////////////////////////////////////////////////////
- 
-      float m_xbeam[4];    // x,ax,ay,az - center and x-axis direction
-      float m_ybeam[4];    // y,ax,ay,az - center and y-axis direction
-      float m_zbeam[4];    // z,ax,ay,az - center and z-axis direction
+    ///////////////////////////////////////////////////////////////////
+    // Print internal tool parameters and status
+    ///////////////////////////////////////////////////////////////////
 
-      ///////////////////////////////////////////////////////////////////
-      // Space points container
-      ///////////////////////////////////////////////////////////////////
- 
-      SG::ReadHandle<SpacePointContainer>         m_spacepointsSCT         ;
-      SG::ReadHandle<SpacePointContainer>         m_spacepointsPixel       ;
-      SG::ReadHandle<SpacePointOverlapCollection> m_spacepointsOverlap     ;
-
-      ToolHandle<Trk::IPRD_AssociationTool>  m_assoTool           ;
-
-      ///////////////////////////////////////////////////////////////////
-      // Protected methods
-      ///////////////////////////////////////////////////////////////////
-
-      MsgStream&    dumpConditions(MsgStream   & out) const;
-      MsgStream&    dumpEvent     (MsgStream   & out) const;
-
-      void buildFrameWork()                                       ;
-      void buildBeamFrameWork()                                   ;
-
-      SiSpacePointForSeed* newSpacePoint
-	(const Trk::SpacePoint*const&)                            ;
-      void newSeed
-      (SiSpacePointForSeed*&,SiSpacePointForSeed*&,float)         ; 
-
-      void newOneSeed
-	(SiSpacePointForSeed*&,SiSpacePointForSeed*&,
-	 SiSpacePointForSeed*&,float,float)                       ;
-
-      void newOneSeedWithCurvaturesComparison
-	(SiSpacePointForSeed*&,SiSpacePointForSeed*&,float);
-
-      void fillSeeds()                                            ;
-      void fillLists     ()                                       ;
-      void erase         ()                                       ;
-      void production2Sp ()                                       ;
-      void production3Sp ()                                       ;
-      void production3Sp
-	(std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 int,int,int&);
-      void production3SpTrigger
-	(std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 std::list<InDet::SiSpacePointForSeed*>::iterator*,
-	 int,int,int&);
+    MsgStream&    dump(MsgStream   & out) const;
+    std::ostream& dump(std::ostream& out) const;
+
+  protected:
+    ///////////////////////////////////////////////////////////////////
+    // Protected data and methods
+    ///////////////////////////////////////////////////////////////////
+  
+    ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle{this, "MagFieldSvc", "AtlasFieldSvc"};
+    PublicToolHandle<Trk::IPRD_AssociationTool> m_assoTool{this, "AssociationTool", "InDet::InDetPRD_AssociationToolGangedPixels"};
+
+    ///////////////////////////////////////////////////////////////////
+    // Space points containers
+    ///////////////////////////////////////////////////////////////////
+    SG::ReadHandleKey<SpacePointContainer> m_spacepointsPixelKey{this, "SpacePointsPixelName", "PixelSpacePoints"};
+    SG::ReadHandleKey<SpacePointContainer> m_spacepointsSCTKey{this, "SpacePointsSCTName", "SCT_SpacePoints"};
+    SG::ReadHandleKey<SpacePointOverlapCollection> m_spacepointsOverlapKey{this, "SpacePointsOverlapName", "OverlapSpacePoints"};
+
+    SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
+
+    // Properties, which will not be changed after construction
+    BooleanProperty m_pixel{this, "usePixel", true};
+    BooleanProperty m_sct{this, "useSCT", true};
+    BooleanProperty m_dbm{this, "useDBM", false};
+    BooleanProperty m_useOverlap{this, "useOverlapSpCollection", true};
+    BooleanProperty m_useassoTool{this, "UseAssociationTool", false};
+    IntegerProperty m_maxsize{this, "maxSize", 50000};
+    IntegerProperty m_maxsizeSP{this, "maxSizeSP", 5000};
+    IntegerProperty m_maxOneSize{this, "maxSeedsForSpacePoint", 5};
+    FloatProperty m_etamax{this, "etaMax", 2.7};
+    FloatProperty m_r1minv{this, "minVRadius1", 0.};
+    FloatProperty m_r1maxv{this, "maxVRadius1", 60.};
+    FloatProperty m_r2minv{this, "minVRadius2", 70.};
+    FloatProperty m_r2maxv{this, "maxVRadius2", 200.};
+    FloatProperty m_drmax{this, "maxdRadius", 270.};
+    FloatProperty m_zmin{this, "minZ", -250.};
+    FloatProperty m_zmax{this, "maxZ", +250.};
+    FloatProperty m_dzver{this, "maxdZver", 5.};
+    FloatProperty m_dzdrver{this, "maxdZdRver", .02};
+
+    // Properties, which can be updated in buildFrameWork method which is called in initialize method
+    FloatProperty m_etamin{this, "etaMin", 0.};
+    FloatProperty m_r_rmax{this, "radMax", 600.};
+    FloatProperty m_r_rstep{this, "radStep", 2.};
+    FloatProperty m_r3max{this, "maxRadius3", 600.}; // This is always overwritten by m_r_rmax.
+    FloatProperty m_drmin{this, "mindRadius", 5.};
+    FloatProperty m_diver{this, "maxdImpact", 10.};
+    FloatProperty m_diversss{this, "maxdImpactSSS", 50.};
+    FloatProperty m_divermax{this, "maxdImpactForDecays", 20.};
+    FloatProperty m_ptmin{this, "pTmin", 500.};
+
+    // Properties, which can be updated in newEvent method
+    BooleanProperty m_checketa{this, "checkEta", false};
+
+    // Properties, which are not used in this implementation of SiSpacePointsSeedMaker_ATLxk class
+    UnsignedIntegerProperty m_maxNumberVertices{this, "maxNumberVertices", 99};
+    FloatProperty m_r1min{this, "minRadius1", 0.};
+    FloatProperty m_r1max{this, "maxRadius1", 600.};
+    FloatProperty m_r2min{this, "minRadius2", 0.};
+    FloatProperty m_r2max{this, "maxRadius2", 600.};
+    FloatProperty m_r3min{this, "minRadius3", 0.};
+    FloatProperty m_rapcut{this, "RapidityCut", 2.7};
+    FloatProperty m_diverpps{this, "maxdImpactPPS", 1.7};
+
+    // Not be updated at all.
+    float m_drminv{20.};
+
+    // Updated only in initialize
+    int m_outputlevel{};
+
+    // Updated only in buildFrameWork in initialize
+    float                       m_dzdrmin0{}                      ;
+    float                       m_dzdrmax0{}                      ;
+    float                       m_ipt{}                           ;
+    float                       m_ipt2{}                          ;
+    float                       m_COF{}                           ;
+    int m_r_size {}                                               ;
+    int m_fNmax{},m_fvNmax{}                                      ;
+    int m_rfz_b[583],m_rfz_t[583],m_rfz_ib[583][9],m_rfz_it[583][9];
+    int m_rfzv_n[300],m_rfzv_i[300][6]                            ;
+    float m_sF{}                                                  ;
+    float m_sFv{}                                                 ;
+
+    // Updated in buildFramework, newEvent, newRegion methods
+    float m_K{};
+    int m_ns{};
+    int m_nr{};
+    int* m_r_index{nullptr};
+    int* m_r_map{nullptr};
+    std::list<InDet::SiSpacePointForSeed*>* m_r_Sorted{nullptr};
+
+    // Updated in buildFramework and other many mthods
+    int m_nsaz{}, m_nsazv{}                                       ;
+    int m_nrfz{},  m_rfz_index  [583], m_rfz_map  [583]           ;
+    int m_nrfzv{}, m_rfzv_index [300], m_rfzv_map [300]           ;
+    std::list<InDet::SiSpacePointsProSeed*>           m_l_seeds   ;
+    std::list<InDet::SiSpacePointsProSeed*>::iterator m_i_seed    ;
+    std::list<InDet::SiSpacePointsProSeed*>::iterator m_i_seede   ;
+    InDet::SiSpacePointsSeed*                m_seedOutput{nullptr};
+    InDet::SiSpacePointsProSeed*               m_OneSeeds{nullptr};
+    ///////////////////////////////////////////////////////////////////
+    // Tables for 3 space points seeds search
+    // Updated in buildFramework and other many mthods
+    ///////////////////////////////////////////////////////////////////
+    InDet::SiSpacePointForSeed** m_SP{nullptr}                    ;
+    float               *  m_Zo{nullptr}                          ;
+    float               *  m_Tz{nullptr}                          ;
+    float               *  m_R{nullptr}                           ;
+    float               *  m_U{nullptr}                           ;
+    float               *  m_V{nullptr}                           ;
+    float               *  m_Er{nullptr}                          ;
+
+    // Updated only in newEvent and newRegion
+    float              m_dzdrmin{}; // Always equals to m_dzdrmin0
+    float              m_dzdrmax{}; // Always equals to m_dzdrmax0
+    float              m_ipt2C{}; // Always equals to m_ipt2*m_COF
+    bool               m_trigger{false}                  ;
+    int                m_iteration{}                     ;
+    float              m_ipt2K{}                         ;
+    float              m_COFK{}                          ;
+    int                m_r_first{}                       ;
+
+    ///////////////////////////////////////////////////////////////////
+    // Beam geometry
+    // Updated only in buildBeamFrameWork,
+    // which is called by newEvent and newRegion
+    ///////////////////////////////////////////////////////////////////
+    float m_xbeam[4]{0., 1., 0., 0.}; // x,ax,ay,az - center and x-axis direction
+    float m_ybeam[4]{0., 0., 1., 0.}; // y,ax,ay,az - center and y-axis direction
+    float m_zbeam[4]{0., 0., 0., 1.}; // z,ax,ay,az - center and z-axis direction
+
+    // Updated in many methods
+    bool                        m_endlist{true}                   ;
+    bool                        m_isvertex{false}                 ;
+    int                         m_nprint{}                        ;
+    int                         m_state{0}                        ;
+    int                         m_nspoint{2}                      ;
+    int                         m_mode{0}                         ;
+    int                         m_nlist{0}                        ;
+    float                       m_zminU{}                         ;
+    float                       m_zmaxU{}                         ;
+    float                       m_zminB{}                         ;
+    float                       m_zmaxB{}                         ;
+    float                       m_ftrig{}                         ;
+    float                       m_ftrigW{}                        ;
+    float                       m_umax{}                          ;
+    std::list<InDet::SiSpacePointForSeed*>  m_rfz_Sorted [   583] ;
+    std::list<InDet::SiSpacePointForSeed*>  m_rfzv_Sorted[   300] ;
+    std::list<InDet::SiSpacePointForSeed*>  m_l_spforseed         ;
+    std::list<InDet::SiSpacePointForSeed*>::iterator m_i_spforseed;
+    std::list<InDet::SiSpacePointForSeed*>::iterator m_rMin       ;
+    int m_fNmin{},m_fvNmin{}                                      ;
+    int m_zMin{}                                                  ;
+
+    std::multimap<float,InDet::SiSpacePointsProSeed*> m_seeds         ;
+    std::multimap<float,InDet::SiSpacePointsProSeed*>::iterator m_seed;
+
+    std::multimap<float,InDet::SiSpacePointsProSeed*> m_mapOneSeeds;
+    int                                               m_nOneSeeds{};
+    int                                               m_fillOneSeeds{};
+    std::set<float>                                   m_l_vertex   ;
+    std::vector<std::pair<float,InDet::SiSpacePointForSeed*>> m_CmSp;
+
+    ///////////////////////////////////////////////////////////////////
+    // Protected methods
+    ///////////////////////////////////////////////////////////////////
+
+    /**    @name Disallow default instantiation, copy, assignment */
+    //@{
+    SiSpacePointsSeedMaker_ATLxk() = delete;
+    SiSpacePointsSeedMaker_ATLxk(const SiSpacePointsSeedMaker_ATLxk&) = delete;
+    SiSpacePointsSeedMaker_ATLxk &operator=(const SiSpacePointsSeedMaker_ATLxk&) = delete;
+    //@}
+
+    MsgStream& dumpConditions(MsgStream& out) const;
+    MsgStream& dumpEvent     (MsgStream& out) const;
+
+    void buildFrameWork();
+    void buildBeamFrameWork();
+
+    SiSpacePointForSeed* newSpacePoint(const Trk::SpacePoint*const&);
+    void newSeed(SiSpacePointForSeed*&, SiSpacePointForSeed*&, float);
+
+    void newOneSeed(SiSpacePointForSeed*&, SiSpacePointForSeed*&,
+     SiSpacePointForSeed*&, float, float);
+
+    void newOneSeedWithCurvaturesComparison
+    (SiSpacePointForSeed*&, SiSpacePointForSeed*&, float);
+
+    void fillSeeds();
+    void fillLists();
+    void erase();
+    void production2Sp();
+    void production3Sp();
+    void production3Sp
+    (std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     int, int, int&);
+    void production3SpTrigger
+    (std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     std::list<InDet::SiSpacePointForSeed*>::iterator*,
+     int, int, int&);
  
-      bool newVertices(const std::list<Trk::Vertex>&)             ;
-      void findNext()                                             ;
-      bool isZCompatible     (float&,float&,float&)               ;
-      void convertToBeamFrameWork(const Trk::SpacePoint*const&,float*)  ;
-      bool isUsed(const Trk::SpacePoint*); 
-   };
+    bool newVertices(const std::list<Trk::Vertex>&);
+    void findNext();
+    bool isZCompatible(float& Zv, float& R, float& T) const;
+    void convertToBeamFrameWork(const Trk::SpacePoint*const& sp, float* r) const;
+    bool isUsed(const Trk::SpacePoint* sp) const;
+  };
 
   MsgStream&    operator << (MsgStream&   ,const SiSpacePointsSeedMaker_ATLxk&);
-  std::ostream& operator << (std::ostream&,const SiSpacePointsSeedMaker_ATLxk&); 
+  std::ostream& operator << (std::ostream&,const SiSpacePointsSeedMaker_ATLxk&);
 
   ///////////////////////////////////////////////////////////////////
   // Inline methods
   ///////////////////////////////////////////////////////////////////
 
   inline const SiSpacePointsSeed* SiSpacePointsSeedMaker_ATLxk::next()
-    {
-      if(m_nspoint==3) {
-	do {
-	  if(m_i_seed==m_i_seede) {findNext(); if(m_i_seed==m_i_seede) return 0;} ++m_i_seed;
-	} 
-	while(!(*m_seed++).second->set3(*m_seedOutput));
-	return(m_seedOutput);	
-      }
-      else             {
-	if(m_i_seed==m_i_seede) {findNext(); if(m_i_seed==m_i_seede) return 0;} 
-	(*m_i_seed++)->set2(*m_seedOutput); return(m_seedOutput);
-      }
-      return 0;
+  {
+    if (m_nspoint==3) {
+      do {
+        if (m_i_seed==m_i_seede) {
+          findNext();
+          if (m_i_seed==m_i_seede) return nullptr;
+        }
+        ++m_i_seed;
+      } while (!(*m_seed++).second->set3(*m_seedOutput));
+      return (m_seedOutput);
+    } else {
+      if (m_i_seed==m_i_seede) {
+        findNext();
+        if (m_i_seed==m_i_seede) return nullptr;
+      } 
+      (*m_i_seed++)->set2(*m_seedOutput);
+      return (m_seedOutput);
     }
-  
+    return nullptr;
+  }
 
   inline bool SiSpacePointsSeedMaker_ATLxk::isZCompatible  
-    (float& Zv,float& R,float& T)
-    {
-      if(Zv < m_zminU || Zv > m_zmaxU) return false;
-      if(!m_isvertex) return true;
-
-      std::set<float>::iterator v=m_l_vertex.begin(),ve=m_l_vertex.end(); 
-
-      float dZmin = fabs((*v)-Zv); 
-      for(++v; v!=ve; ++v) {
-	float dZ = fabs((*v)-Zv); if(dZ >= dZmin) break; dZmin=dZ;
-      }
-      return dZmin < (m_dzver+m_dzdrver*R)*sqrt(1.+T*T);
+  (float& Zv,float& R,float& T) const
+  {
+    if (Zv < m_zminU || Zv > m_zmaxU) return false;
+    if (!m_isvertex) return true;
+
+    std::set<float>::iterator v=m_l_vertex.begin(),ve=m_l_vertex.end();
+
+    float dZmin = fabs((*v)-Zv);
+    for (++v; v!=ve; ++v) {
+      float dZ = fabs((*v)-Zv);
+      if (dZ >= dZmin) break;
+      dZmin=dZ;
     }
+    return dZmin < (m_dzver+m_dzdrver*R)*sqrt(1.+T*T);
+  }
 
   ///////////////////////////////////////////////////////////////////
   // New space point for seeds 
   ///////////////////////////////////////////////////////////////////
 
   inline SiSpacePointForSeed* SiSpacePointsSeedMaker_ATLxk::newSpacePoint
-    (const Trk::SpacePoint*const& sp) 
-    {
-      SiSpacePointForSeed* sps;
-
-      float r[3]; convertToBeamFrameWork(sp,r);
-
-      if(m_checketa) {
-
-	float z = (fabs(r[2])+m_zmax);
-	float x = r[0]*m_dzdrmin     ;
-	float y = r[1]*m_dzdrmin     ;
-	if((z*z )<(x*x+y*y)) return 0;
-      }
-
-      if(m_i_spforseed!=m_l_spforseed.end()) {
-	sps = (*m_i_spforseed++); sps->set(sp,r); 
-      }
-      else                               {
-	m_l_spforseed.push_back((sps=new SiSpacePointForSeed(sp,r)));
-	m_i_spforseed = m_l_spforseed.end();	
-      }
-      
-      return sps;
+  (const Trk::SpacePoint*const& sp) 
+  {
+    SiSpacePointForSeed* sps;
+
+    float r[3];
+    convertToBeamFrameWork(sp,r);
+
+    if (m_checketa) {
+
+      float z = (fabs(r[2])+m_zmax);
+      float x = r[0]*m_dzdrmin     ;
+      float y = r[1]*m_dzdrmin     ;
+      if ((z*z )<(x*x+y*y)) return nullptr;
     }
 
+    if (m_i_spforseed!=m_l_spforseed.end()) {
+      sps = (*m_i_spforseed++);
+      sps->set(sp,r);
+    } else {
+      m_l_spforseed.push_back((sps=new SiSpacePointForSeed(sp,r)));
+      m_i_spforseed = m_l_spforseed.end();
+    }
+      
+    return sps;
+  }
+
   ///////////////////////////////////////////////////////////////////
   // New 2 space points seeds 
   ///////////////////////////////////////////////////////////////////
 
   inline void SiSpacePointsSeedMaker_ATLxk::newSeed
-    (SiSpacePointForSeed*& p1,SiSpacePointForSeed*& p2, float z) 
-    {
-      SiSpacePointForSeed* p3 = 0;
-
-      if(m_i_seede!=m_l_seeds.end()) {
-	SiSpacePointsProSeed* s = (*m_i_seede++);
-	s->set(p1,p2,p3,z);
-      }
-      else                  {
-	m_l_seeds.push_back(new SiSpacePointsProSeed(p1,p2,p3,z));
-	m_i_seede = m_l_seeds.end(); 
-      }
+  (SiSpacePointForSeed*& p1,SiSpacePointForSeed*& p2, float z) 
+  {
+    SiSpacePointForSeed* p3 = nullptr;
+
+    if (m_i_seede!=m_l_seeds.end()) {
+      SiSpacePointsProSeed* s = (*m_i_seede++);
+      s->set(p1,p2,p3,z);
+    } else {
+      m_l_seeds.push_back(new SiSpacePointsProSeed(p1,p2,p3,z));
+      m_i_seede = m_l_seeds.end();
     }
+  }
   
 } // end of name space
 
@@ -393,7 +421,7 @@ namespace InDet {
 // Object-function for curvature seeds comparison
 ///////////////////////////////////////////////////////////////////
 
-class comCurvature  {
+class comCurvature {
 public:
   bool operator ()
   (const std::pair<float,InDet::SiSpacePointForSeed*>& i1, 
@@ -404,4 +432,3 @@ public:
 };
 
 #endif // SiSpacePointsSeedMaker_ATLxk_H
-
diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
index f33574b7b9e33948e8f673f7ed2962800b7944e5..e028af342e642bef79225561a492ea3d658bf338 100755
--- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
+++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
      
@@ -13,12 +13,10 @@
 // Version 1.0 21/04/2004 I.Gavrilenko
 ///////////////////////////////////////////////////////////////////
 
-#include <ostream>
-#include <iomanip>
-
-#include "TrkToolInterfaces/IPRD_AssociationTool.h"
 #include "SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h"
 
+#include <iomanip>
+#include <ostream>
 
 ///////////////////////////////////////////////////////////////////
 // Constructor
@@ -26,121 +24,11 @@
 
 InDet::SiSpacePointsSeedMaker_ATLxk::SiSpacePointsSeedMaker_ATLxk
 (const std::string& t,const std::string& n,const IInterface* p)
-  : AthAlgTool(t,n,p),
-    m_fieldServiceHandle("AtlasFieldSvc",n), 
-    m_spacepointsSCT("SCT_SpacePoints"),
-    m_spacepointsPixel("PixelSpacePoints"),
-    m_spacepointsOverlap("OverlapSpacePoints"),
-    m_assoTool("InDet::InDetPRD_AssociationToolGangedPixels")
+  : AthAlgTool(t,n,p)
 {
 
-  m_useassoTool = false ;
-  m_useOverlap= true    ;
-  m_state     = 0       ;
-  m_pixel     = true    ;
-  m_sct       = true    ;
-  m_trigger   = false   ;
-  m_checketa  = false   ;
-  m_dbm       = false   ;
-  m_state     = 0       ;
-  m_nspoint   = 2       ;
-  m_mode      = 0       ;
-  m_nlist     = 0       ;
-  m_endlist   = true    ;
-  m_maxsize   = 50000   ;
-  m_ptmin     =  500.   ;
-  m_etamin    = 0.      ; m_etamax     = 2.7 ;
-  m_r1min     = 0.      ; m_r1minv     = 0.  ; 
-  m_r1max     = 600.    ; m_r1maxv     = 60. ;
-  m_r2min     = 0.      ; m_r2minv     = 70. ;
-  m_r2max     = 600.    ; m_r2maxv     = 200.;
-  m_r3min     = 0.      ;
-  m_r3max     = 600.    ;
-  m_drmin     = 5.      ; m_drminv     = 20. ;    
-  m_drmax     = 270.    ;    
-  m_rapcut    = 2.7     ;
-  m_zmin      = -250.   ;
-  m_zmax      = +250.   ;
-  m_dzver     = 5.      ;
-  m_dzdrver   = .02     ;
-  m_diver     = 10.     ;
-  m_diverpps  =  1.7    ;
-  m_diversss  =  50     ;
-  m_divermax  =  20.    ;
-  m_dazmax    = .02     ;
-  m_r_rmax      = 600.  ;
-  m_r_rstep     =  2.   ;
-  m_r_Sorted    = 0     ;
-  m_r_index     = 0     ;
-  m_r_map       = 0     ;    
-  m_maxsizeSP = 5000    ;
-  m_maxOneSize= 5       ;
-  m_SP        = 0       ;
-  m_R         = 0       ;
-  m_Tz        = 0       ;
-  m_Er        = 0       ;
-  m_U         = 0       ;
-  m_V         = 0       ;
-  m_Zo        = 0       ;
-  m_OneSeeds  = 0       ;
-  m_seedOutput= 0       ;
-  m_maxNumberVertices = 99;
- 
-  m_xbeam[0]  = 0.      ; m_xbeam[1]= 1.; m_xbeam[2]=0.; m_xbeam[3]=0.;
-  m_ybeam[0]  = 0.      ; m_ybeam[1]= 0.; m_ybeam[2]=1.; m_ybeam[3]=0.;
-  m_zbeam[0]  = 0.      ; m_zbeam[1]= 0.; m_zbeam[2]=0.; m_zbeam[3]=1.;
-  
-//  m_spacepointsSCTname     = "SCT_SpacePoints"   ;
-//  m_spacepointsPixelname   = "PixelSpacePoints"  ;
-//  m_spacepointsOverlapname = "OverlapSpacePoints"; 
-//  m_spacepointsSCT         = 0                   ;
-//  m_spacepointsPixel       = 0                   ;
-//  m_spacepointsOverlap     = 0                   ;
-
   declareInterface<ISiSpacePointsSeedMaker>(this);
 
-  declareProperty("AssociationTool"       ,m_assoTool              );
-  declareProperty("usePixel"              ,m_pixel                 );
-  declareProperty("useSCT"                ,m_sct                   );
-  declareProperty("checkEta"              ,m_checketa              );
-  declareProperty("useDBM"                ,m_dbm                   );
-  declareProperty("etaMin"                ,m_etamin                );
-  declareProperty("etaMax"                ,m_etamax                );  
-  declareProperty("pTmin"                 ,m_ptmin                 );
-  declareProperty("radMax"                ,m_r_rmax                  );
-  declareProperty("radStep"               ,m_r_rstep                 );
-  declareProperty("maxSize"               ,m_maxsize               );
-  declareProperty("maxSizeSP"             ,m_maxsizeSP             );
-  declareProperty("minZ"                  ,m_zmin                  );
-  declareProperty("maxZ"                  ,m_zmax                  );
-  declareProperty("minRadius1"            ,m_r1min                 );
-  declareProperty("minRadius2"            ,m_r2min                 );
-  declareProperty("minRadius3"            ,m_r3min                 );
-  declareProperty("maxRadius1"            ,m_r1max                 );
-  declareProperty("maxRadius2"            ,m_r2max                 );
-  declareProperty("maxRadius3"            ,m_r3max                 );
-  declareProperty("mindRadius"            ,m_drmin                 );
-  declareProperty("maxdRadius"            ,m_drmax                 );
-  declareProperty("minVRadius1"           ,m_r1minv                );
-  declareProperty("maxVRadius1"           ,m_r1maxv                );
-  declareProperty("minVRadius2"           ,m_r2minv                );
-  declareProperty("maxVRadius2"           ,m_r2maxv                );
-  declareProperty("RapidityCut"           ,m_rapcut                );
-  declareProperty("maxdZver"              ,m_dzver                 );
-  declareProperty("maxdZdRver"            ,m_dzdrver               );
-  declareProperty("maxdImpact"            ,m_diver                 );
-  declareProperty("maxdImpactPPS"         ,m_diverpps              );
-  declareProperty("maxdImpactSSS"         ,m_diversss              );
-  declareProperty("maxdImpactForDecays"   ,m_divermax              );
-
-  declareProperty("maxSeedsForSpacePoint" ,m_maxOneSize            );
-  declareProperty("maxNumberVertices"     ,m_maxNumberVertices     );
-  declareProperty("SpacePointsSCTName"    ,m_spacepointsSCT    );
-  declareProperty("SpacePointsPixelName"  ,m_spacepointsPixel  );
-  declareProperty("SpacePointsOverlapName",m_spacepointsOverlap);
-  declareProperty("useOverlapSpCollection", m_useOverlap           );
-  declareProperty("UseAssociationTool"    ,m_useassoTool           ); 
-  declareProperty("MagFieldSvc"           , m_fieldServiceHandle   );
 }
 
 ///////////////////////////////////////////////////////////////////
@@ -149,32 +37,31 @@ InDet::SiSpacePointsSeedMaker_ATLxk::SiSpacePointsSeedMaker_ATLxk
 
 InDet::SiSpacePointsSeedMaker_ATLxk::~SiSpacePointsSeedMaker_ATLxk()
 {
-  if(m_r_index ) delete [] m_r_index ;
-  if(m_r_map   ) delete [] m_r_map   ; 
-  if(m_r_Sorted) delete [] m_r_Sorted;
+  delete [] m_r_index ;
+  delete [] m_r_map   ;
+  delete [] m_r_Sorted;
 
   // Delete seeds
   //
-  for(m_i_seed=m_l_seeds.begin(); m_i_seed!=m_l_seeds.end (); ++m_i_seed) {
-    delete *m_i_seed;
+  for (InDet::SiSpacePointsProSeed* seed: m_l_seeds) {
+    delete seed;
   }
   // Delete space points for reconstruction
   //
-  m_i_spforseed=m_l_spforseed.begin();
-  for(; m_i_spforseed!=m_l_spforseed.end(); ++m_i_spforseed) {
-    delete *m_i_spforseed;
-  } 
-  if(m_seedOutput) delete m_seedOutput; 
-
-  if(m_SP) delete [] m_SP;
-  if(m_R ) delete [] m_R ;
-  if(m_Tz) delete [] m_Tz;
-  if(m_Er) delete [] m_Er;
-  if(m_U ) delete [] m_U ;
-  if(m_V ) delete [] m_V ;
-  if(m_Zo) delete [] m_Zo;
-  if(m_OneSeeds) delete [] m_OneSeeds;
- }
+  for (InDet::SiSpacePointForSeed* spforseed: m_l_spforseed) {
+    delete spforseed;
+  }
+  delete m_seedOutput;
+
+  delete [] m_SP;
+  delete [] m_R ;
+  delete [] m_Tz;
+  delete [] m_Er;
+  delete [] m_U ;
+  delete [] m_V ;
+  delete [] m_Zo;
+  delete [] m_OneSeeds;
+}
 
 ///////////////////////////////////////////////////////////////////
 // Initialisation
@@ -182,7 +69,7 @@ InDet::SiSpacePointsSeedMaker_ATLxk::~SiSpacePointsSeedMaker_ATLxk()
 
 StatusCode InDet::SiSpacePointsSeedMaker_ATLxk::initialize()
 {
-  StatusCode sc = AlgTool::initialize(); 
+  StatusCode sc = AlgTool::initialize();
 
   // Get beam geometry
   //
@@ -190,38 +77,42 @@ StatusCode InDet::SiSpacePointsSeedMaker_ATLxk::initialize()
 
   // Get magnetic field service
   //
-  if( !m_fieldServiceHandle.retrieve() ){
+  if ( !m_fieldServiceHandle.retrieve() ){
     ATH_MSG_FATAL("Failed to retrieve " << m_fieldServiceHandle );
     return StatusCode::FAILURE;
   }    
   ATH_MSG_DEBUG("Retrieved " << m_fieldServiceHandle );
-  m_fieldService = &*m_fieldServiceHandle;
 
   // Get tool for track-prd association
   //
-  if( m_useassoTool ) {
-    if( m_assoTool.retrieve().isFailure()) {
-      msg(MSG::FATAL)<<"Failed to retrieve tool "<< m_assoTool<<endmsg; 
+  if ( m_useassoTool ) {
+    if ( m_assoTool.retrieve().isFailure()) {
+      ATH_MSG_FATAL("Failed to retrieve tool "<< m_assoTool);
       return StatusCode::FAILURE;
     } else {
-      msg(MSG::INFO) << "Retrieved tool " << m_assoTool << endmsg;
+      ATH_MSG_INFO("Retrieved tool " << m_assoTool);
     }
-  }
-  else {
+  } else {
     m_assoTool.disable();
   }
   
   // Build framework
   //
   buildFrameWork();
-  m_CmSp.reserve(500); 
+  m_CmSp.reserve(500);
 
   // Get output print level
   //
   m_outputlevel = msg().level()-MSG::DEBUG;
-  if(m_outputlevel<=0) {
-    m_nprint=0; msg(MSG::DEBUG)<<(*this)<<endmsg;
+  if (m_outputlevel<=0) {
+    m_nprint=0;
+    ATH_MSG_DEBUG(*this);
   }
+
+  ATH_CHECK(m_spacepointsPixelKey.initialize(m_pixel));
+  ATH_CHECK(m_spacepointsSCTKey.initialize(m_sct));
+  ATH_CHECK(m_spacepointsOverlapKey.initialize(m_useOverlap));
+
   return sc;
 }
 
@@ -231,7 +122,7 @@ StatusCode InDet::SiSpacePointsSeedMaker_ATLxk::initialize()
 
 StatusCode InDet::SiSpacePointsSeedMaker_ATLxk::finalize()
 {
-   StatusCode sc = AlgTool::finalize(); return sc;
+  return AlgTool::finalize();
 }
 
 ///////////////////////////////////////////////////////////////////
@@ -241,74 +132,75 @@ StatusCode InDet::SiSpacePointsSeedMaker_ATLxk::finalize()
 void InDet::SiSpacePointsSeedMaker_ATLxk::newEvent(int iteration) 
 {
   m_trigger = false;
-  if(!m_pixel && !m_sct) return; 
+  if (!m_pixel && !m_sct) return;
 
   iteration <=0 ? m_iteration = 0 : m_iteration = iteration;
   erase();
   m_dzdrmin =  m_dzdrmin0;
   m_dzdrmax =  m_dzdrmax0;
   m_umax    =  100.      ;
-  if(!m_iteration) {
+  if (!m_iteration) {
     buildBeamFrameWork();
 
-    double f[3], gP[3] ={10.,10.,0.}; 
-    if(m_fieldService->solenoidOn()) {
-      m_fieldService->getFieldZR(gP,f); m_K = 2./(300.*f[2]);
+    double f[3], gP[3] ={10.,10.,0.};
+    if (m_fieldServiceHandle->solenoidOn()) {
+      m_fieldServiceHandle->getFieldZR(gP,f);
+      m_K = 2./(300.*f[2]);
+    } else {
+      m_K = 2./(300.* 5. );
     }
-    else m_K = 2./(300.* 5. );
 
     m_ipt2K     = m_ipt2/(m_K*m_K);
     m_ipt2C     = m_ipt2*m_COF    ;
-    m_COFK      = m_COF*(m_K*m_K) ;  
+    m_COFK      = m_COF*(m_K*m_K) ;
     m_i_spforseed = m_l_spforseed.begin();
-  }
-  else {
-    m_r_first = 0; fillLists(); return;
+  } else {
+    m_r_first = 0;
+    fillLists();
+    return;
   }
 
-  m_dbm ?  m_checketa = false : m_checketa = m_dzdrmin > 1.;
+  m_dbm ? m_checketa = false : m_checketa = m_dzdrmin > 1.;
 
   float irstep = 1./m_r_rstep;
   int   irmax  = m_r_size-1  ;
-  for(int i=0; i!=m_nr; ++i) {int n = m_r_index[i]; m_r_map[n] = 0; m_r_Sorted[n].clear();}
+  for (int i=0; i!=m_nr; ++i) {
+    int n = m_r_index[i];
+    m_r_map[n] = 0;
+    m_r_Sorted[n].clear();
+  }
   m_ns = m_nr = 0;
 
   // Get pixels space points containers from store gate 
   //
   m_r_first = 0;
-  if(!m_dbm && m_pixel) {
+  if (!m_dbm && m_pixel) {
 
-//    m_spacepointsPixel = 0;
-//    StatusCode sc = evtStore()->retrieve(m_spacepointsPixel,m_spacepointsPixelname);
+    SG::ReadHandle<SpacePointContainer> spacepointsPixel{m_spacepointsPixelKey};
+    if (spacepointsPixel.isValid()) {
 
-    if(m_spacepointsPixel.isValid()) {
+      for (const SpacePointCollection* spc: *spacepointsPixel) {
+        for (const Trk::SpacePoint* sp: *spc) {
 
-      SpacePointContainer::const_iterator spc  =  m_spacepointsPixel->begin();
-      SpacePointContainer::const_iterator spce =  m_spacepointsPixel->end  ();
+          if ((m_useassoTool &&  isUsed(sp)) || sp->r() > m_r_rmax) continue;
 
-      for(; spc != spce; ++spc) {
+          // Remove DBM space points
+          //
+          const InDetDD::SiDetectorElement* de= 
+            static_cast<const InDetDD::SiDetectorElement*>(sp->clusterList().first->detectorElement());
+          if (!de || de->isDBM()) continue;
 
-	SpacePointCollection::const_iterator sp  = (*spc)->begin();
-	SpacePointCollection::const_iterator spe = (*spc)->end  ();
-    
-	for(; sp != spe; ++sp) {
-
-	  if ((m_useassoTool &&  isUsed(*sp)) || (*sp)->r() > m_r_rmax) continue;
-
-	  // Remove DBM space points
-	  //
-	  const InDetDD::SiDetectorElement* de= 
-	    static_cast<const InDetDD::SiDetectorElement*>((*sp)->clusterList().first->detectorElement());
-	  if(!de || de->isDBM()) continue;
-
-	  InDet::SiSpacePointForSeed* sps = newSpacePoint((*sp)); if(!sps) continue;
+          InDet::SiSpacePointForSeed* sps = newSpacePoint(sp);
+          if (!sps) continue;
 
-	  int   ir = int(sps->radius()*irstep); if(ir>irmax) ir = irmax;
-	  m_r_Sorted[ir].push_back(sps); ++m_r_map[ir];
-	  if(m_r_map[ir]==1) m_r_index[m_nr++] = ir;
-	  if(ir > m_r_first) m_r_first = ir;
-	  ++m_ns;
-	}
+          int   ir = static_cast<int>(sps->radius()*irstep);
+          if (ir>irmax) ir = irmax;
+          m_r_Sorted[ir].push_back(sps);
+          ++m_r_map[ir];
+          if (m_r_map[ir]==1) m_r_index[m_nr++] = ir;
+          if (ir > m_r_first) m_r_first = ir;
+          ++m_ns;
+        }
       }
     }
     ++m_r_first;
@@ -316,99 +208,86 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newEvent(int iteration)
 
   // Get sct space points containers from store gate 
   //
-  if(!m_dbm && m_sct) {
+  if (!m_dbm && m_sct) {
 
-//    m_spacepointsSCT = 0;
-//    StatusCode sc = evtStore()->retrieve(m_spacepointsSCT,m_spacepointsSCTname);
+    SG::ReadHandle<SpacePointContainer> spacepointsSCT{m_spacepointsSCTKey};
+    if (spacepointsSCT.isValid()) {
 
-    if(m_spacepointsSCT.isValid()) {
-
-      SpacePointContainer::const_iterator spc  =  m_spacepointsSCT->begin();
-      SpacePointContainer::const_iterator spce =  m_spacepointsSCT->end  ();
-
-      for(; spc != spce; ++spc) {
-
-	SpacePointCollection::const_iterator sp  = (*spc)->begin();
-	SpacePointCollection::const_iterator spe = (*spc)->end  ();
-    
-	for(; sp != spe; ++sp) {
+      for (const SpacePointCollection* spc: *spacepointsSCT) {
+        for (const Trk::SpacePoint* sp: *spc) {
 
-	  if ((m_useassoTool &&  isUsed(*sp)) || (*sp)->r() > m_r_rmax) continue;
+          if ((m_useassoTool &&  isUsed(sp)) || sp->r() > m_r_rmax) continue;
 
-	  InDet::SiSpacePointForSeed* sps = newSpacePoint((*sp)); if(!sps) continue;
+          InDet::SiSpacePointForSeed* sps = newSpacePoint(sp);
+          if (!sps) continue;
 
-	  int   ir = int(sps->radius()*irstep); if(ir>irmax) ir = irmax;
-	  m_r_Sorted[ir].push_back(sps); ++m_r_map[ir];
-	  if(m_r_map[ir]==1) m_r_index[m_nr++] = ir;
-	  ++m_ns;
-	}
+          int   ir = static_cast<int>(sps->radius()*irstep);
+          if (ir>irmax) ir = irmax;
+          m_r_Sorted[ir].push_back(sps);
+          ++m_r_map[ir];
+          if (m_r_map[ir]==1) m_r_index[m_nr++] = ir;
+          ++m_ns;
+        }
       }
     }
 
     // Get sct overlap space points containers from store gate 
     //
-    if(m_useOverlap && !m_checketa) {
-
-//      m_spacepointsOverlap = 0;
-//      sc = evtStore()->retrieve(m_spacepointsOverlap,m_spacepointsOverlapname);
-      if(m_spacepointsOverlap.isValid()) {
-	
-	SpacePointOverlapCollection::const_iterator sp  = m_spacepointsOverlap->begin();
-	SpacePointOverlapCollection::const_iterator spe = m_spacepointsOverlap->end  ();
-	
-	for (; sp!=spe; ++sp) {
-
-	  if ((m_useassoTool &&  isUsed(*sp)) || (*sp)->r() > m_r_rmax) continue;
-
-	  InDet::SiSpacePointForSeed* sps = newSpacePoint((*sp)); if(!sps) continue;
-
-	  int   ir = int(sps->radius()*irstep); if(ir>irmax) ir = irmax;
-	  m_r_Sorted[ir].push_back(sps); ++m_r_map[ir];
-	  if(m_r_map[ir]==1) m_r_index[m_nr++] = ir;
-	  ++m_ns;
-	}
+    if (m_useOverlap && !m_checketa) {
+
+      SG::ReadHandle<SpacePointOverlapCollection> spacepointsOverlap{m_spacepointsOverlapKey};
+      if (spacepointsOverlap.isValid()) {
+  
+        for (const Trk::SpacePoint* sp: *spacepointsOverlap) {
+
+          if ((m_useassoTool &&  isUsed(sp)) || sp->r() > m_r_rmax) continue;
+
+          InDet::SiSpacePointForSeed* sps = newSpacePoint(sp);
+          if (!sps) continue;
+
+          int   ir = static_cast<int>(sps->radius()*irstep);
+          if (ir>irmax) ir = irmax;
+          m_r_Sorted[ir].push_back(sps);
+          ++m_r_map[ir];
+          if (m_r_map[ir]==1) m_r_index[m_nr++] = ir;
+          ++m_ns;
+        }
       }
     }
   }
 
   // Get pixels space points containers from store gate for DBM reconstruction
   //
-  if(m_dbm) {
-
-//    m_spacepointsPixel = 0;
-//    StatusCode sc = evtStore()->retrieve(m_spacepointsPixel,m_spacepointsPixelname);
-
-    if(m_spacepointsPixel.isValid()) {
-
-      SpacePointContainer::const_iterator spc  =  m_spacepointsPixel->begin();
-      SpacePointContainer::const_iterator spce =  m_spacepointsPixel->end  ();
-
-      for(; spc != spce; ++spc) {
-
-	SpacePointCollection::const_iterator sp  = (*spc)->begin();
-	SpacePointCollection::const_iterator spe = (*spc)->end  ();
-    
-	for(; sp != spe; ++sp) {
-
-	  // Keep only DBM space points
-	  //
-	  const InDetDD::SiDetectorElement* de= 
-	    static_cast<const InDetDD::SiDetectorElement*>((*sp)->clusterList().first->detectorElement());
-	  if(!de || !de->isDBM() || (*sp)->r() > m_r_rmax) continue;
-
-	  InDet::SiSpacePointForSeed* sps = newSpacePoint((*sp)); if(!sps) continue;
-
-	  int   ir = int(sps->radius()*irstep); if(ir>irmax) ir = irmax;
-	  m_r_Sorted[ir].push_back(sps); ++m_r_map[ir];
-	  if(m_r_map[ir]==1) m_r_index[m_nr++] = ir;
-	  if(ir > m_r_first) m_r_first = ir;
-	  ++m_ns;
-	}
+  if (m_dbm) {
+
+    SG::ReadHandle<SpacePointContainer> spacepointsPixel{m_spacepointsPixelKey};
+    if (spacepointsPixel.isValid()) {
+
+      for (const SpacePointCollection* spc: *spacepointsPixel) {
+        for (const Trk::SpacePoint* sp: *spc) {
+
+          // Keep only DBM space points
+          //
+          const InDetDD::SiDetectorElement* de= 
+            static_cast<const InDetDD::SiDetectorElement*>(sp->clusterList().first->detectorElement());
+          if (!de || !de->isDBM() || sp->r() > m_r_rmax) continue;
+
+          InDet::SiSpacePointForSeed* sps = newSpacePoint(sp);
+          if (!sps) continue;
+
+          int   ir = static_cast<int>(sps->radius()*irstep);
+          if (ir>irmax) ir = irmax;
+          m_r_Sorted[ir].push_back(sps);
+          ++m_r_map[ir];
+          if (m_r_map[ir]==1) m_r_index[m_nr++] = ir;
+          if (ir > m_r_first) m_r_first = ir;
+          ++m_ns;
+        }
       }
     }
     ++m_r_first;
   }
-  if(iteration < 0) m_r_first = 0;
+  if (iteration < 0) m_r_first = 0;
   fillLists();
 }
 
@@ -422,7 +301,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newRegion
   m_iteration  = 0    ;
   m_trigger    = false;
   erase();
-  if(!m_pixel && !m_sct) return;
+  if (!m_pixel && !m_sct) return;
 
   m_dzdrmin =  m_dzdrmin0;
   m_dzdrmax =  m_dzdrmax0;
@@ -430,16 +309,18 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newRegion
 
   buildBeamFrameWork();
 
-  double f[3], gP[3] ={10.,10.,0.}; 
+  double f[3], gP[3] ={10.,10.,0.};
 
-  if(m_fieldService->solenoidOn()) {
-      m_fieldService->getFieldZR(gP,f); m_K = 2./(300.*f[2]);
-    }
-  else m_K = 2./(300.* 5. );
+  if (m_fieldServiceHandle->solenoidOn()) {
+    m_fieldServiceHandle->getFieldZR(gP,f);
+    m_K = 2./(300.*f[2]);
+  } else {
+    m_K = 2./(300.* 5. );
+  }
 
   m_ipt2K     = m_ipt2/(m_K*m_K);
   m_ipt2C     = m_ipt2*m_COF    ;
-  m_COFK      = m_COF*(m_K*m_K) ;  
+  m_COFK      = m_COF*(m_K*m_K) ;
 
   m_i_spforseed = m_l_spforseed.begin();
 
@@ -449,70 +330,66 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newRegion
   m_r_first      = 0         ;
   m_checketa   = false     ;
 
-  for(int i=0; i!=m_nr; ++i) {int n = m_r_index[i]; m_r_map[n] = 0; m_r_Sorted[n].clear();}
+  for (int i=0; i!=m_nr; ++i) {
+    int n = m_r_index[i];
+    m_r_map[n] = 0;
+    m_r_Sorted[n].clear();
+  }
   m_ns = m_nr = 0;
 
   // Get pixels space points containers from store gate 
   //
-  if(m_pixel && vPixel.size()) {
-
-//    m_spacepointsPixel   = 0;
-//    StatusCode sc = evtStore()->retrieve(m_spacepointsPixel,m_spacepointsPixelname);
-    
-    if( m_spacepointsPixel.isValid() ) {
-
-      SpacePointContainer::const_iterator spce =  m_spacepointsPixel->end  ();
+  if (m_pixel && !vPixel.empty()) {
 
-      std::vector<IdentifierHash>::const_iterator l = vPixel.begin(), le = vPixel.end();
+    SG::ReadHandle<SpacePointContainer> spacepointsPixel{m_spacepointsPixelKey};
+    if ( spacepointsPixel.isValid() ) {
+      SpacePointContainer::const_iterator spce = spacepointsPixel->end();
 
       // Loop through all trigger collections
       //
-      for(; l!=le; ++l) {
-	
-	SpacePointContainer::const_iterator  w =  m_spacepointsPixel->indexFind((*l));
-	if(w==spce) continue;
-	SpacePointCollection::const_iterator sp = (*w)->begin(), spe = (*w)->end();
-
-	for(; sp != spe; ++sp) {
-
-	  float r = (*sp)->r(); if(r > m_r_rmax) continue;
-	  InDet::SiSpacePointForSeed* sps = newSpacePoint((*sp)); 
-	  int   ir = int(sps->radius()*irstep); if(ir>irmax) ir = irmax;
-	  m_r_Sorted[ir].push_back(sps); ++m_r_map[ir];
-	  if(m_r_map[ir]==1) m_r_index[m_nr++] = ir;
-	  ++m_ns;
-	}
+      for (const IdentifierHash& l: vPixel) {
+        SpacePointContainer::const_iterator  w = spacepointsPixel->indexFind(l);
+        if (w==spce) continue;
+        for (const Trk::SpacePoint* sp: **w) {
+          float r = sp->r();
+          if (r > m_r_rmax) continue;
+          InDet::SiSpacePointForSeed* sps = newSpacePoint(sp);
+          int   ir = static_cast<int>(sps->radius()*irstep);
+          if (ir>irmax) ir = irmax;
+          m_r_Sorted[ir].push_back(sps);
+          ++m_r_map[ir];
+          if (m_r_map[ir]==1) m_r_index[m_nr++] = ir;
+          ++m_ns;
+        }
       }
     }
   }
 
   // Get sct space points containers from store gate 
   //
-  if(m_sct && vSCT.size()) {
+  if (m_sct && !vSCT.empty()) {
 
-    if(m_spacepointsSCT.isValid()) {
+    SG::ReadHandle<SpacePointContainer> spacepointsSCT{m_spacepointsSCTKey};
+    if (spacepointsSCT.isValid()) {
 
-      SpacePointContainer::const_iterator spce =  m_spacepointsSCT->end  ();
-
-      std::vector<IdentifierHash>::const_iterator l = vSCT.begin(), le = vSCT.end();
+      SpacePointContainer::const_iterator spce = spacepointsSCT->end();
 
       // Loop through all trigger collections
       //
-      for(; l!=le; ++l) {
-
-	SpacePointContainer::const_iterator  w =  m_spacepointsSCT->indexFind((*l));
-	if(w==spce) continue;
-	SpacePointCollection::const_iterator sp = (*w)->begin(), spe = (*w)->end();
-
-	for(; sp != spe; ++sp) {
-
-	  float r = (*sp)->r(); if(r > m_r_rmax) continue;
-	  InDet::SiSpacePointForSeed* sps = newSpacePoint((*sp)); 
-	  int   ir = int(sps->radius()*irstep); if(ir>irmax) ir = irmax;
-	  m_r_Sorted[ir].push_back(sps); ++m_r_map[ir];
-	  if(m_r_map[ir]==1) m_r_index[m_nr++] = ir;
-	  ++m_ns;
-	}
+      for (const IdentifierHash& l: vSCT) {
+        SpacePointContainer::const_iterator  w = spacepointsSCT->indexFind(l);
+        if (w==spce) continue;
+        for (const Trk::SpacePoint* sp: **w) {
+          float r = sp->r();
+          if (r > m_r_rmax) continue;
+          InDet::SiSpacePointForSeed* sps = newSpacePoint(sp); 
+          int   ir = static_cast<int>(sps->radius()*irstep);
+          if (ir>irmax) ir = irmax;
+          m_r_Sorted[ir].push_back(sps);
+          ++m_r_map[ir];
+          if (m_r_map[ir]==1) m_r_index[m_nr++] = ir;
+          ++m_ns;
+        }
       }
     }
   }
@@ -538,7 +415,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newRegion
   m_zmaxU        = m_zmaxB+550.*dzdrmax;
   double fmax    = IRD.phiPlus ();
   double fmin    = IRD.phiMinus();
-  if(fmin > fmax) fmin-=(2.*M_PI);
+  if (fmin > fmax) fmin-=(2.*M_PI);
   m_ftrig        = (fmin+fmax)*.5;
   m_ftrigW       = (fmax-fmin)*.5;
 }
@@ -553,10 +430,11 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::find2Sp(const std::list<Trk::Vertex>&
   m_zminU     = m_zmin;
   m_zmaxU     = m_zmax;
 
-  int mode; lv.begin()!=lv.end() ?  mode = 1 : mode = 0;
+  int mode;
+  lv.begin()!=lv.end() ?  mode = 1 : mode = 0;
   bool newv = newVertices(lv);
   
-  if(newv || !m_state || m_nspoint!=2 || m_mode!=mode || m_nlist) {
+  if (newv || !m_state || m_nspoint!=2 || m_mode!=mode || m_nlist) {
 
     m_i_seede   = m_l_seeds.begin();
     m_state   = 1   ;
@@ -571,8 +449,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::find2Sp(const std::list<Trk::Vertex>&
   }
   m_i_seed  = m_l_seeds.begin();
   
-  if(m_outputlevel<=0) {
-    m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
+  if (m_outputlevel<=0) {
+    m_nprint=1;
+    ATH_MSG_DEBUG(*this);
   }
 }
 
@@ -586,10 +465,11 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::find3Sp(const std::list<Trk::Vertex>&
   m_zminU     = m_zmin;
   m_zmaxU     = m_zmax;
 
-  int mode; lv.begin()!=lv.end() ? mode = 3 : mode = 2; 
+  int mode;
+  lv.begin()!=lv.end() ? mode = 3 : mode = 2;
   bool newv = newVertices(lv);
 
-  if(newv || !m_state || m_nspoint!=3 || m_mode!=mode || m_nlist) {
+  if (newv || !m_state || m_nspoint!=3 || m_mode!=mode || m_nlist) {
     m_i_seede   = m_l_seeds.begin() ;
     m_state   = 1               ;
     m_nspoint = 3               ;
@@ -604,8 +484,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::find3Sp(const std::list<Trk::Vertex>&
   m_i_seed  = m_l_seeds.begin();
   m_seed  = m_seeds.begin();
 
-  if(m_outputlevel<=0) {
-    m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
+  if (m_outputlevel<=0) {
+    m_nprint=1;
+    ATH_MSG_DEBUG(*this);
   }
 }
 
@@ -616,13 +497,16 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::find3Sp(const std::list<Trk::Vertex>&
 
 void InDet::SiSpacePointsSeedMaker_ATLxk::find3Sp(const std::list<Trk::Vertex>& lv,const double* ZVertex) 
 {
-  m_zminU     = ZVertex[0]; if(m_zminU < m_zmin) m_zminU = m_zmin; 
-  m_zmaxU     = ZVertex[1]; if(m_zmaxU > m_zmax) m_zmaxU = m_zmax;
+  m_zminU     = ZVertex[0];
+  if (m_zminU < m_zmin) m_zminU = m_zmin;
+  m_zmaxU     = ZVertex[1];
+  if (m_zmaxU > m_zmax) m_zmaxU = m_zmax;
 
-  int mode; lv.begin()!=lv.end() ? mode = 3 : mode = 2; 
+  int mode;
+  lv.begin()!=lv.end() ? mode = 3 : mode = 2;
   bool newv = newVertices(lv);
 
-  if(newv || !m_state || m_nspoint!=3 || m_mode!=mode || m_nlist) {
+  if (newv || !m_state || m_nspoint!=3 || m_mode!=mode || m_nlist) {
     m_i_seede   = m_l_seeds.begin() ;
     m_state   = 1               ;
     m_nspoint = 3               ;
@@ -637,8 +521,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::find3Sp(const std::list<Trk::Vertex>&
   m_i_seed  = m_l_seeds.begin();
   m_seed  = m_seeds.begin();
 
-  if(m_outputlevel<=0) {
-    m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
+  if (m_outputlevel<=0) {
+    m_nprint=1;
+    ATH_MSG_DEBUG(*this);
   }
 }
 
@@ -653,10 +538,11 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::findVSp (const std::list<Trk::Vertex>&
   m_zminU     = m_zmin;
   m_zmaxU     = m_zmax;
 
-  int mode; lv.begin()!=lv.end() ? mode = 6 : mode = 5; 
+  int mode;
+  lv.begin()!=lv.end() ? mode = 6 : mode = 5; 
   bool newv = newVertices(lv);
   
-  if(newv || !m_state || m_nspoint!=4 || m_mode!=mode || m_nlist) {
+  if (newv || !m_state || m_nspoint!=4 || m_mode!=mode || m_nlist) {
 
     m_i_seede   = m_l_seeds.begin() ;
     m_state   = 1               ;
@@ -672,8 +558,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::findVSp (const std::list<Trk::Vertex>&
   m_i_seed  = m_l_seeds.begin();
   m_seed  = m_seeds.begin();
 
-  if(m_outputlevel<=0) {
-    m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
+  if (m_outputlevel<=0) {
+    m_nprint=1;
+    ATH_MSG_DEBUG(*this);
   }
 }
 
@@ -683,7 +570,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::findVSp (const std::list<Trk::Vertex>&
 
 MsgStream& InDet::SiSpacePointsSeedMaker_ATLxk::dump( MsgStream& out ) const
 {
-  if(m_nprint)  return dumpEvent(out);
+  if (m_nprint) return dumpEvent(out);
   return dumpConditions(out);
 }
 
@@ -693,23 +580,31 @@ MsgStream& InDet::SiSpacePointsSeedMaker_ATLxk::dump( MsgStream& out ) const
 
 MsgStream& InDet::SiSpacePointsSeedMaker_ATLxk::dumpConditions( MsgStream& out ) const
 {
-  int n = 42-m_spacepointsPixel.name().size();
-  std::string s2; for(int i=0; i<n; ++i) s2.append(" "); s2.append("|");
-  n     = 42-m_spacepointsSCT.name().size();
-  std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|");
-  n     = 42-m_spacepointsOverlap.name().size();
-  std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|");
+  int n = 42-m_spacepointsPixelKey.key().size();
+  std::string s2;
+  for (int i=0; i<n; ++i) s2.append(" ");
+  s2.append("|");
+  n     = 42-m_spacepointsSCTKey.key().size();
+  std::string s3;
+  for (int i=0; i<n; ++i) s3.append(" ");
+  s3.append("|");
+  n     = 42-m_spacepointsOverlapKey.key().size();
+  std::string s4;
+  for (int i=0; i<n; ++i) s4.append(" ");
+  s4.append("|");
   n     = 42-m_beamSpotKey.key().size();
-  std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|");
+  std::string s5;
+  for (int i=0; i<n; ++i) s5.append(" ");
+  s5.append("|");
 
 
   out<<"|---------------------------------------------------------------------|"
      <<std::endl;
-  out<<"| Pixel    space points   | "<<m_spacepointsPixel.name() <<s2
+  out<<"| Pixel    space points   | "<<m_spacepointsPixelKey.key() <<s2
      <<std::endl;
-  out<<"| SCT      space points   | "<<m_spacepointsSCT.name()<<s3
+  out<<"| SCT      space points   | "<<m_spacepointsSCTKey.key()<<s3
      <<std::endl;
-  out<<"| Overlap  space points   | "<<m_spacepointsOverlap.name()<<s4
+  out<<"| Overlap  space points   | "<<m_spacepointsOverlapKey.key()<<s4
      <<std::endl;
   out<<"| BeamConditionsService   | "<<m_beamSpotKey.key()<<s5
      <<std::endl;
@@ -792,8 +687,8 @@ MsgStream& InDet::SiSpacePointsSeedMaker_ATLxk::dumpConditions( MsgStream& out )
      <<std::setw(12)<<std::setprecision(5)<<m_diverpps
      <<"                              |"<<std::endl;
   out<<"| max       impact sss    | "
-    <<std::setw(12)<<std::setprecision(5)<<m_diversss
-    <<"                              |"<<std::endl;
+     <<std::setw(12)<<std::setprecision(5)<<m_diversss
+     <<"                              |"<<std::endl;
   out<<"|---------------------------------------------------------------------|"
      <<std::endl;
   out<<"| Beam X center           | "
@@ -848,37 +743,6 @@ MsgStream& InDet::SiSpacePointsSeedMaker_ATLxk::dumpEvent( MsgStream& out ) cons
      <<"                              |"<<std::endl;
   out<<"|---------------------------------------------------------------------|"
      <<std::endl;
-  /*
-  if(m_outputlevel==0) return out; 
-
-  out<<"|-------------|--------|-------|-------|-------|-------|-------|";
-  out<<"-------|-------|-------|-------|-------|-------|"
-     <<std::endl;
-
-  out<<"|  Azimuthal  |    n   | z[ 0] | z[ 1] | z[ 2] | z[ 3] | z[4]  |";
-  out<<" z[ 5] | z[ 6] | z[ 7] | z[ 8] | z[ 9] | z[10] |"
-     <<std::endl;
-  out<<"|-------------|--------|-------|-------|-------|-------|-------|";
-  out<<"-------|-------|-------|-------|-------|-------|"
-     <<std::endl;
-  
-  float sF1 = pi2/float(m_fNmax+1);
-  
-  
-  for(int f=0; f<=m_fNmax; ++f) {
-    out<<"|  "
-       <<std::setw(10)<<std::setprecision(4)<<sF1*float(f)<<" | "
-       <<std::setw(6)<<rf_map[f]<<" |";
-    for(int z=0; z!=11; ++z) {
-      out<<std::setw(6)<<rfz_map[(f*11+z)]<<" |";
-    }
-    out<<std::endl;
-  } 
-  out<<"|-------------|--------|-------|-------|-------|-------|-------|";
-  out<<"-------|-------|-------|-------|-------|-------|"
-     <<std::endl;
-  out<<std::endl;
-  */
   return out;
 }
 
@@ -896,9 +760,9 @@ std::ostream& InDet::SiSpacePointsSeedMaker_ATLxk::dump( std::ostream& out ) con
 ///////////////////////////////////////////////////////////////////
 
 MsgStream& InDet::operator    << 
-  (MsgStream& sl,const InDet::SiSpacePointsSeedMaker_ATLxk& se)
+(MsgStream& sl,const InDet::SiSpacePointsSeedMaker_ATLxk& se)
 { 
-  return se.dump(sl); 
+  return se.dump(sl);
 }
 
 ///////////////////////////////////////////////////////////////////
@@ -906,9 +770,9 @@ MsgStream& InDet::operator    <<
 ///////////////////////////////////////////////////////////////////
 
 std::ostream& InDet::operator << 
-  (std::ostream& sl,const InDet::SiSpacePointsSeedMaker_ATLxk& se)
+(std::ostream& sl,const InDet::SiSpacePointsSeedMaker_ATLxk& se)
 { 
-  return se.dump(sl); 
+  return se.dump(sl);
 }   
 
 ///////////////////////////////////////////////////////////////////
@@ -917,16 +781,16 @@ std::ostream& InDet::operator <<
 
 void InDet::SiSpacePointsSeedMaker_ATLxk::findNext () 
 {
-  if(m_endlist) return;
+  if (m_endlist) return;
 
   m_i_seede = m_l_seeds.begin();
 
-  if     (m_mode==0 || m_mode==1) production2Sp ();
-  else if(m_mode==2 || m_mode==3) production3Sp ();
-  else if(m_mode==5 || m_mode==6) production3Sp ();
+  if      (m_mode==0 || m_mode==1) production2Sp ();
+  else if (m_mode==2 || m_mode==3) production3Sp ();
+  else if (m_mode==5 || m_mode==6) production3Sp ();
 
   m_i_seed  = m_l_seeds.begin();
-  m_seed  = m_seeds.begin(); 
+  m_seed  = m_seeds.begin();
   ++m_nlist;
 }                       
 
@@ -936,21 +800,24 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::findNext ()
 
 bool InDet::SiSpacePointsSeedMaker_ATLxk::newVertices(const std::list<Trk::Vertex>& lV)
 {
-  unsigned int s1 = m_l_vertex.size(); 
-  unsigned int s2 = lV      .size(); 
+  unsigned int s1 = m_l_vertex.size();
+  unsigned int s2 = lV.size();
 
   m_isvertex = false;
-  if(s1==0 && s2==0) return false;
+  if (s1==0 && s2==0) return false;
 
-  std::list<Trk::Vertex>::const_iterator v;
   m_l_vertex.clear();
-  if(s2 == 0) return false;
+  if (s2 == 0) return false;
 
   m_isvertex = true;
-  for(v=lV.begin(); v!=lV.end(); ++v) {m_l_vertex.insert(float((*v).position().z()));}
+  for (const Trk::Vertex& v: lV) {
+    m_l_vertex.insert(static_cast<float>(v.position().z()));
+  }
 
-  m_zminU = (*m_l_vertex. begin())-20.; if( m_zminU < m_zmin) m_zminU = m_zmin;
-  m_zmaxU = (*m_l_vertex.rbegin())+20.; if( m_zmaxU > m_zmax) m_zmaxU = m_zmax;
+  m_zminU = (*m_l_vertex. begin())-20.;
+  if ( m_zminU < m_zmin) m_zminU = m_zmin;
+  m_zmaxU = (*m_l_vertex.rbegin())+20.;
+  if ( m_zmaxU > m_zmax) m_zmaxU = m_zmax;
 
   return false;
 }
@@ -961,22 +828,29 @@ bool InDet::SiSpacePointsSeedMaker_ATLxk::newVertices(const std::list<Trk::Verte
 
 void InDet::SiSpacePointsSeedMaker_ATLxk::buildFrameWork() 
 {
-  m_ptmin     = fabs(m_ptmin);  
+  m_ptmin = fabs(m_ptmin);
   
   // For DBM reconstruction we use new parameters
   //
-  if     (     m_dbm    ) {m_r_rmax  = 150.; m_r_rstep = .5; m_drmin = 2.; m_ptmin = 10.; m_diver = 150.;}
-  else if(m_ptmin < 100.) m_ptmin = 100.;
+  if (m_dbm) {
+    m_r_rmax  = 150.;
+    m_r_rstep = .5;
+    m_drmin = 2.;
+    m_ptmin = 10.;
+    m_diver = 150.;
+  } else if (m_ptmin < 100.) {
+    m_ptmin = 100.;
+  }
 
-  if(m_diversss < m_diver   ) m_diversss = m_diver   ; 
-  if(m_divermax < m_diversss) m_divermax = m_diversss;
+  if (m_diversss < m_diver   ) m_diversss = m_diver   ;
+  if (m_divermax < m_diversss) m_divermax = m_diversss;
 
-  if(fabs(m_etamin) < .1) m_etamin = -m_etamax ;
+  if (fabs(m_etamin) < .1) m_etamin = -m_etamax ;
   m_dzdrmax0  = 1./tan(2.*atan(exp(-m_etamax)));
   m_dzdrmin0  = 1./tan(2.*atan(exp(-m_etamin)));
   
-  m_r3max     = m_r_rmax                         ; 
-  m_COF       =  134*.05*9.                    ;
+  m_r3max     = m_r_rmax                       ;
+  m_COF       = 134*.05*9.                     ;
   m_ipt       = 1./fabs(.9*m_ptmin)            ;
   m_ipt2      = m_ipt*m_ipt                    ;
   m_K         = 0.                             ;
@@ -985,153 +859,171 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::buildFrameWork()
 
   // Build radius sorted containers
   //
-  m_r_size = int((m_r_rmax+.1)/m_r_rstep);
+  m_r_size = static_cast<int>((m_r_rmax+.1)/m_r_rstep);
   m_r_Sorted = new std::list<InDet::SiSpacePointForSeed*>[m_r_size];
   m_r_index  = new int[m_r_size];
-  m_r_map    = new int[m_r_size];  
-  m_nr   = 0; for(int i=0; i!=m_r_size; ++i) {m_r_index[i]=0; m_r_map[i]=0;}
+  m_r_map    = new int[m_r_size];
+  m_nr   = 0;
+  for (int i=0; i!=m_r_size; ++i) {
+    m_r_index[i]=0;
+    m_r_map[i]=0;
+  }
 
   // Build radius-azimuthal sorted containers
   //
   const float pi2     = 2.*M_PI            ;
   const int   NFmax    = 53                ;
-  const float sFmax   = float(NFmax )/pi2;
+  const float sFmax   = static_cast<float>(NFmax )/pi2;
   const float sFmin = 100./60.          ;
 
-  float ptm = 400.; if(!m_dbm && m_ptmin < ptm) ptm = m_ptmin;
+  float ptm = 400.;
+  if (!m_dbm && m_ptmin < ptm) ptm = m_ptmin;
 
-  m_sF        = ptm /60. ; if(m_sF    >sFmax ) m_sF    = sFmax  ; else if(m_sF < sFmin) m_sF = sFmin;
-  m_fNmax     = int(pi2*m_sF); if(m_fNmax >=NFmax) m_fNmax = NFmax-1;
+  m_sF = ptm /60.;
+  if      (m_sF > sFmax) m_sF = sFmax;
+  else if (m_sF < sFmin) m_sF = sFmin;
+  m_fNmax = static_cast<int>(pi2*m_sF);
+  if (m_fNmax >=NFmax) m_fNmax = NFmax-1;
 
   // Build radius-azimuthal-Z sorted containers
   //
-  m_nrfz  = 0; for(int i=0; i!=583; ++i) {m_rfz_index [i]=0; m_rfz_map [i]=0;}
+  m_nrfz  = 0;
+  for (int i=0; i!=583; ++i) {
+    m_rfz_index [i]=0;
+    m_rfz_map [i]=0;
+  }
 
   // Build radius-azimuthal-Z sorted containers for Z-vertices
   //
   const int   NFtmax  = 100               ;
-  const float sFvmax = float(NFtmax)/pi2;
-  m_sFv       = m_ptmin/120.  ; if(m_sFv   >sFvmax)  m_sFv    = sFvmax; 
-  m_fvNmax    = int(pi2*m_sFv); if(m_fvNmax>=NFtmax) m_fvNmax = NFtmax-1;
-  m_nrfzv = 0; for(int i=0; i!=300; ++i) {m_rfzv_index[i]=0; m_rfzv_map[i]=0;}
+  const float sFvmax = static_cast<float>(NFtmax)/pi2;
+  m_sFv = m_ptmin/120.;
+  if (m_sFv > sFvmax) m_sFv = sFvmax;
+  m_fvNmax = static_cast<int>(pi2*m_sFv);
+  if (m_fvNmax>=NFtmax) m_fvNmax = NFtmax-1;
+  m_nrfzv = 0;
+  for (int i=0; i!=300; ++i) {
+    m_rfzv_index[i]=0;
+    m_rfzv_map[i]=0;
+  }
 
   // Build maps for radius-azimuthal-Z sorted collections 
   //
-  for(int f=0; f<=m_fNmax; ++f) {
+  for (int f=0; f<=m_fNmax; ++f) {
 
-    int fb = f-1; if(fb<0      ) fb=m_fNmax; 
-    int ft = f+1; if(ft>m_fNmax) ft=0; 
+    int fb = f-1;
+    if (fb<0) fb=m_fNmax;
+    int ft = f+1;
+    if (ft>m_fNmax) ft=0;
     
     // For each azimuthal region loop through all Z regions
     //
-    for(int z=0; z!=11; ++z) {
+    for (int z=0; z!=11; ++z) {
  
       int a        = f *11+z;
       int b        = fb*11+z;
       int c        = ft*11+z;
       m_rfz_b [a]    = 3; m_rfz_t [a]    = 3;
-      m_rfz_ib[a][0] = a; m_rfz_it[a][0] = a; 
-      m_rfz_ib[a][1] = b; m_rfz_it[a][1] = b; 
-      m_rfz_ib[a][2] = c; m_rfz_it[a][2] = c; 
-      if     (z==5) {
-
-	m_rfz_t [a]    = 9 ;
-	m_rfz_it[a][3] = a+1; 
-	m_rfz_it[a][4] = b+1; 
-	m_rfz_it[a][5] = c+1; 
-	m_rfz_it[a][6] = a-1; 
-	m_rfz_it[a][7] = b-1; 
-	m_rfz_it[a][8] = c-1; 
-      }
-      else if(z> 5) {
-
-	m_rfz_b [a]    = 6 ;
-	m_rfz_ib[a][3] = a-1; 
-	m_rfz_ib[a][4] = b-1; 
-	m_rfz_ib[a][5] = c-1; 
-
-	if(z<10) {
-
-	  m_rfz_t [a]    = 6 ;
-	  m_rfz_it[a][3] = a+1; 
-	  m_rfz_it[a][4] = b+1; 
-	  m_rfz_it[a][5] = c+1; 
-	}
-      }
-      else {
-
-	m_rfz_b [a]    = 6 ;
-	m_rfz_ib[a][3] = a+1; 
-	m_rfz_ib[a][4] = b+1; 
-	m_rfz_ib[a][5] = c+1; 
-
-	if(z>0) {
-
-	  m_rfz_t [a]    = 6 ;
-	  m_rfz_it[a][3] = a-1; 
-	  m_rfz_it[a][4] = b-1; 
-	  m_rfz_it[a][5] = c-1; 
-	}
+      m_rfz_ib[a][0] = a; m_rfz_it[a][0] = a;
+      m_rfz_ib[a][1] = b; m_rfz_it[a][1] = b;
+      m_rfz_ib[a][2] = c; m_rfz_it[a][2] = c;
+      if (z==5) {
+
+        m_rfz_t [a]    = 9 ;
+        m_rfz_it[a][3] = a+1;
+        m_rfz_it[a][4] = b+1;
+        m_rfz_it[a][5] = c+1;
+        m_rfz_it[a][6] = a-1;
+        m_rfz_it[a][7] = b-1;
+        m_rfz_it[a][8] = c-1;
+      } else if (z> 5) {
+
+        m_rfz_b [a]    = 6 ;
+        m_rfz_ib[a][3] = a-1;
+        m_rfz_ib[a][4] = b-1;
+        m_rfz_ib[a][5] = c-1;
+
+        if (z<10) {
+
+          m_rfz_t [a]    = 6 ;
+          m_rfz_it[a][3] = a+1;
+          m_rfz_it[a][4] = b+1;
+          m_rfz_it[a][5] = c+1;
+        }
+      } else {
+
+        m_rfz_b [a]    = 6 ;
+        m_rfz_ib[a][3] = a+1;
+        m_rfz_ib[a][4] = b+1;
+        m_rfz_ib[a][5] = c+1;
+
+        if (z>0) {
+
+          m_rfz_t [a]    = 6 ;
+          m_rfz_it[a][3] = a-1;
+          m_rfz_it[a][4] = b-1;
+          m_rfz_it[a][5] = c-1;
+        }
       }
 
-      if     (z==3) {
-	m_rfz_b[a]      = 9;
-	m_rfz_ib[a][6] = a+2; 
-	m_rfz_ib[a][7] = b+2; 
-	m_rfz_ib[a][8] = c+2; 
-      }
-      else if(z==7) {
-	m_rfz_b[a]      = 9;
-	m_rfz_ib[a][6] = a-2; 
-	m_rfz_ib[a][7] = b-2; 
-	m_rfz_ib[a][8] = c-2; 
+      if (z==3) {
+        m_rfz_b[a]      = 9;
+        m_rfz_ib[a][6] = a+2;
+        m_rfz_ib[a][7] = b+2;
+        m_rfz_ib[a][8] = c+2;
+      } else if (z==7) {
+        m_rfz_b[a]      = 9;
+        m_rfz_ib[a][6] = a-2;
+        m_rfz_ib[a][7] = b-2;
+        m_rfz_ib[a][8] = c-2;
       }
     }
   }
 
   // Build maps for radius-azimuthal-Z sorted collections for Z
   //
-  for(int f=0; f<=m_fvNmax; ++f) {
+  for (int f=0; f<=m_fvNmax; ++f) {
 
-    int fb = f-1; if(fb<0       ) fb=m_fvNmax; 
-    int ft = f+1; if(ft>m_fvNmax) ft=0; 
+    int fb = f-1;
+    if (fb<0) fb=m_fvNmax;
+    int ft = f+1;
+    if (ft>m_fvNmax) ft=0;
     
     // For each azimuthal region loop through central Z regions
     //
-    for(int z=0; z!=3; ++z) {
+    for (int z=0; z!=3; ++z) {
       
-      int a  = f *3+z; 
+      int a  = f *3+z;
       int b  = fb*3+z;
       int c  = ft*3+z;
       m_rfzv_n[a]    = 3;
       m_rfzv_i[a][0] = a;
       m_rfzv_i[a][1] = b;
       m_rfzv_i[a][2] = c;
-      if     (z>1) {
-	m_rfzv_n[a]    = 6;
-	m_rfzv_i[a][3] = a-1;
-	m_rfzv_i[a][4] = b-1;
-	m_rfzv_i[a][5] = c-1;
-      }
-      else if(z<1) {
-	m_rfzv_n[a]    = 6;
-	m_rfzv_i[a][3] = a+1;
-	m_rfzv_i[a][4] = b+1;
-	m_rfzv_i[a][5] = c+1;
+      if (z>1) {
+        m_rfzv_n[a]    = 6;
+        m_rfzv_i[a][3] = a-1;
+        m_rfzv_i[a][4] = b-1;
+        m_rfzv_i[a][5] = c-1;
+      } else if (z<1) {
+        m_rfzv_n[a]    = 6;
+        m_rfzv_i[a][3] = a+1;
+        m_rfzv_i[a][4] = b+1;
+        m_rfzv_i[a][5] = c+1;
       }
     }
   }
   
-  if(!m_SP) m_SP   = new InDet::SiSpacePointForSeed*[m_maxsizeSP];
-  if(!m_R ) m_R    = new                      float[m_maxsizeSP];
-  if(!m_Tz) m_Tz   = new                      float[m_maxsizeSP];
-  if(!m_Er) m_Er   = new                      float[m_maxsizeSP];
-  if(!m_U ) m_U    = new                      float[m_maxsizeSP]; 
-  if(!m_V ) m_V    = new                      float[m_maxsizeSP];
-  if(!m_Zo) m_Zo   = new                      float[m_maxsizeSP];
-  if(!m_OneSeeds) m_OneSeeds  = new InDet::SiSpacePointsProSeed [m_maxOneSize];  
+  if (!m_SP) m_SP   = new InDet::SiSpacePointForSeed*[m_maxsizeSP];
+  if (!m_R ) m_R    = new                      float[m_maxsizeSP];
+  if (!m_Tz) m_Tz   = new                      float[m_maxsizeSP];
+  if (!m_Er) m_Er   = new                      float[m_maxsizeSP];
+  if (!m_U ) m_U    = new                      float[m_maxsizeSP];
+  if (!m_V ) m_V    = new                      float[m_maxsizeSP];
+  if (!m_Zo) m_Zo   = new                      float[m_maxsizeSP];
+  if (!m_OneSeeds) m_OneSeeds  = new InDet::SiSpacePointsProSeed [m_maxOneSize];
 
-  if(!m_seedOutput) m_seedOutput = new InDet::SiSpacePointsSeed();
+  if (!m_seedOutput) m_seedOutput = new InDet::SiSpacePointsSeed();
 
   m_i_seed  = m_l_seeds.begin();
   m_i_seede = m_l_seeds.end  ();
@@ -1145,7 +1037,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::buildBeamFrameWork()
 { 
   SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
 
-  const Amg::Vector3D &cb =     beamSpotHandle->beamPos();
+  const Amg::Vector3D &cb = beamSpotHandle->beamPos();
   double     tx = tan(beamSpotHandle->beamTilt(0));
   double     ty = tan(beamSpotHandle->beamTilt(1));
 
@@ -1156,20 +1048,20 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::buildBeamFrameWork()
   double sinp = sin(ph);
   double cosp = cos(ph);
   
-  m_xbeam[0] = float(cb.x())                  ; 
-  m_xbeam[1] = float(cost*cosp*cosp+sinp*sinp);
-  m_xbeam[2] = float(cost*sinp*cosp-sinp*cosp);
-  m_xbeam[3] =-float(sint*cosp               );
+  m_xbeam[0] = static_cast<float>(cb.x())                  ;
+  m_xbeam[1] = static_cast<float>(cost*cosp*cosp+sinp*sinp);
+  m_xbeam[2] = static_cast<float>(cost*sinp*cosp-sinp*cosp);
+  m_xbeam[3] =-static_cast<float>(sint*cosp               );
   
-  m_ybeam[0] = float(cb.y())                  ; 
-  m_ybeam[1] = float(cost*cosp*sinp-sinp*cosp);
-  m_ybeam[2] = float(cost*sinp*sinp+cosp*cosp);
-  m_ybeam[3] =-float(sint*sinp               );
+  m_ybeam[0] = static_cast<float>(cb.y())                  ;
+  m_ybeam[1] = static_cast<float>(cost*cosp*sinp-sinp*cosp);
+  m_ybeam[2] = static_cast<float>(cost*sinp*sinp+cosp*cosp);
+  m_ybeam[3] =-static_cast<float>(sint*sinp               );
   
-  m_zbeam[0] = float(cb.z())                  ; 
-  m_zbeam[1] = float(sint*cosp)               ;
-  m_zbeam[2] = float(sint*sinp)               ;
-  m_zbeam[3] = float(cost)                    ;
+  m_zbeam[0] = static_cast<float>(cb.z())                  ;
+  m_zbeam[1] = static_cast<float>(sint*cosp)               ;
+  m_zbeam[2] = static_cast<float>(sint*sinp)               ;
+  m_zbeam[3] = static_cast<float>(cost)                    ;
 }
 
 ///////////////////////////////////////////////////////////////////
@@ -1177,12 +1069,12 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::buildBeamFrameWork()
 ///////////////////////////////////////////////////////////////////
 
 void  InDet::SiSpacePointsSeedMaker_ATLxk::convertToBeamFrameWork
-(const Trk::SpacePoint*const& sp,float* r) 
+(const Trk::SpacePoint*const& sp,float* r) const
 {
   
-  r[0] = float(sp->globalPosition().x())-m_xbeam[0];
-  r[1] = float(sp->globalPosition().y())-m_ybeam[0];
-  r[2] = float(sp->globalPosition().z())-m_zbeam[0];
+  r[0] = static_cast<float>(sp->globalPosition().x())-m_xbeam[0];
+  r[1] = static_cast<float>(sp->globalPosition().y())-m_ybeam[0];
+  r[2] = static_cast<float>(sp->globalPosition().z())-m_zbeam[0];
 }
    
 ///////////////////////////////////////////////////////////////////
@@ -1197,63 +1089,73 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::fillLists()
   int  ir0 =     0;
   bool ibl = false;
 
-  for(int i=m_r_first; i!=m_r_size;  ++i) {
+  for (int i=m_r_first; i!=m_r_size;  ++i) {
 
-    if(!m_r_map[i]) continue;
-    r = m_r_Sorted[i].begin(); re = m_r_Sorted[i].end();
+    if (!m_r_map[i]) continue;
+    r = m_r_Sorted[i].begin();
+    re = m_r_Sorted[i].end();
     
-    if(!ir0) ir0 = i;
-
-    if( m_iteration) {
-
-      if       (!(*r)->spacepoint->clusterList().second) {if(i < 20) ibl = true;}
-      else  if (  ibl  ) break;
-      else  if (i > 175) break;
+    if (!ir0) ir0 = i;
+
+    if (m_iteration) {
+      if (!(*r)->spacepoint->clusterList().second) {
+        if (i < 20) ibl = true;
+      } else if (ibl) {
+        break;
+      } else if (i > 175) {
+        break;
+      }
     }
 
-    for(; r!=re; ++r) {
+    for (; r!=re; ++r) {
       
       // Azimuthal angle sort
       //
-      float F = (*r)->phi(); if(F<0.) F+=pi2;
+      float F = (*r)->phi();
+      if (F<0.) F+=pi2;
 
-      int   f = int(F*m_sF);
-      if (f < 0)
+      int f = static_cast<int>(F*m_sF);
+      if (f < 0) {
         f = m_fNmax;
-      else if (f > m_fNmax)
+      } else if (f > m_fNmax) {
         f = 0;
+      }
 
-      int z; float Z = (*r)->z();
-
+      float Z = (*r)->z();
+      int z;
       // Azimuthal angle and Z-coordinate sort
       //
-      if(Z>0.) {
-	Z< 250.?z=5:Z< 450.?z=6:Z< 925.?z=7:Z< 1400.?z=8:Z< 2500.?z=9:z=10;
-      }
-      else     {
-	Z>-250.?z=5:Z>-450.?z=4:Z>-925.?z=3:Z>-1400.?z=2:Z>-2500.?z=1:z= 0;
+      if (Z>0.) {
+        Z< 250.?z=5:Z< 450.?z=6:Z< 925.?z=7:Z< 1400.?z=8:Z< 2500.?z=9:z=10;
+      } else {
+        Z>-250.?z=5:Z>-450.?z=4:Z>-925.?z=3:Z>-1400.?z=2:Z>-2500.?z=1:z= 0;
       }
 
-      int n = f*11+z; ++m_nsaz;
-      m_rfz_Sorted[n].push_back(*r); if(!m_rfz_map[n]++) m_rfz_index[m_nrfz++] = n;
+      int n = f*11+z;
+      ++m_nsaz;
+      m_rfz_Sorted[n].push_back(*r);
+      if (!m_rfz_map[n]++) m_rfz_index[m_nrfz++] = n;
       
-      if(!m_iteration && (*r)->spacepoint->clusterList().second == 0 && z>=3 && z<=7) { 
-	z<=4 ? z=0 : z>=6 ? z=2 : z=1;
+      if (!m_iteration && (*r)->spacepoint->clusterList().second == 0 && z>=3 && z<=7) { 
+        z<=4 ? z=0 : z>=6 ? z=2 : z=1;
 
-	// Azimuthal angle and Z-coordinate sort for fast vertex search
-	//
-	f = int(F*m_sFv);
-        if (f < 0)
+        // Azimuthal angle and Z-coordinate sort for fast vertex search
+        //
+        f = static_cast<int>(F*m_sFv);
+        if (f < 0) {
           f += m_fvNmax;
-        else if (f> m_fvNmax)
+        } else if (f> m_fvNmax) {
           f -= m_fvNmax;
+        }
 
-	n = f*3+z; ++m_nsazv;
-	m_rfzv_Sorted[n].push_back(*r); if(!m_rfzv_map[n]++) m_rfzv_index[m_nrfzv++] = n;
+        n = f*3+z;
+        ++m_nsazv;
+        m_rfzv_Sorted[n].push_back(*r);
+        if (!m_rfzv_map[n]++) m_rfzv_index[m_nrfzv++] = n;
       }
     }
   }
-  if(!m_sct && ir0 && float(ir0)*m_r_rstep < 43.) m_umax = -200.;
+  if (!m_sct && ir0 && static_cast<float>(ir0)*m_r_rstep < 43.) m_umax = -200.;
   m_state = 0;
 }
    
@@ -1263,13 +1165,15 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::fillLists()
 
 void InDet::SiSpacePointsSeedMaker_ATLxk::erase()
 {
-  for(int i=0; i!=m_nrfz;  ++i) {
-    int n = m_rfz_index[i]; m_rfz_map[n] = 0;
+  for (int i=0; i!=m_nrfz;  ++i) {
+    int n = m_rfz_index[i];
+    m_rfz_map[n] = 0;
     m_rfz_Sorted[n].clear();
   }
   
-  for(int i=0; i!=m_nrfzv; ++i) {
-    int n = m_rfzv_index[i]; m_rfzv_map[n] = 0;
+  for (int i=0; i!=m_nrfzv; ++i) {
+    int n = m_rfzv_index[i];
+    m_rfzv_map[n] = 0;
     m_rfzv_Sorted[n].clear();
   }
   m_state = 0;
@@ -1283,13 +1187,13 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::erase()
 // Test is space point used
 ///////////////////////////////////////////////////////////////////
 
-bool InDet::SiSpacePointsSeedMaker_ATLxk::isUsed(const Trk::SpacePoint* sp)
+bool InDet::SiSpacePointsSeedMaker_ATLxk::isUsed(const Trk::SpacePoint* sp) const
 {
-  const Trk::PrepRawData* d = sp->clusterList().first ; 
-  if(!d || !m_assoTool->isUsed(*d)) return false;
+  const Trk::PrepRawData* d = sp->clusterList().first ;
+  if (!d || !m_assoTool->isUsed(*d)) return false;
 
   d = sp->clusterList().second;
-  if(!d || m_assoTool->isUsed(*d)) return true;
+  if (!d || m_assoTool->isUsed(*d)) return true;
 
   return false;
 }
@@ -1301,87 +1205,98 @@ bool InDet::SiSpacePointsSeedMaker_ATLxk::isUsed(const Trk::SpacePoint* sp)
 
 void InDet::SiSpacePointsSeedMaker_ATLxk::production2Sp()
 {
-  if(m_nsazv<2) return;
+  if (m_nsazv<2) return;
 
   std::list<InDet::SiSpacePointForSeed*>::iterator r0,r0e,r,re;
-  int nseed = 0; 
+  int nseed = 0;
 
   // Loop thorugh all azimuthal regions
   //
-  for(int f=m_fvNmin; f<=m_fvNmax; ++f) {
+  for (int f=m_fvNmin; f<=m_fvNmax; ++f) {
 
     // For each azimuthal region loop through Z regions
     //
-    int z = 0; if(!m_endlist) z = m_zMin;
-    for(; z!=3; ++z) {
+    int z = 0;
+    if (!m_endlist) z = m_zMin;
+    for (; z!=3; ++z) {
       
-      int a  = f*3+z;  if(!m_rfzv_map[a]) continue; 
-      r0  = m_rfzv_Sorted[a].begin(); 
-      r0e = m_rfzv_Sorted[a].end  (); 
-
-      if(!m_endlist) {r0 = m_rMin; m_endlist = true;}
+      int a = f*3+z;
+      if (!m_rfzv_map[a]) continue;
+      r0  = m_rfzv_Sorted[a].begin();
+      r0e = m_rfzv_Sorted[a].end  ();
+
+      if (!m_endlist) {
+        r0 = m_rMin;
+        m_endlist = true;
+      }
 
       // Loop through trigger space points
       //
-      for(; r0!=r0e; ++r0) {
-
-	float X  = (*r0)->x();
-	float Y  = (*r0)->y();
-	float R  = (*r0)->radius();
-	if(R<m_r2minv) continue;
-        if(R>m_r2maxv) break;
-	float Z  = (*r0)->z();
-	float ax = X/R;
-	float ay = Y/R;
-
-	// Bottom links production
-	//
-	int NB = m_rfzv_n[a];
-	for(int i=0; i!=NB; ++i) {
-	  
-	  int an = m_rfzv_i[a][i];
-	  if(!m_rfzv_map[an]) continue; 
-
-	  r  =  m_rfzv_Sorted[an].begin();
-	  re =  m_rfzv_Sorted[an].end  ();
-	  
-	  for(; r!=re; ++r) {
-	    
-	    float Rb =(*r)->radius();
-	    if(Rb<m_r1minv) continue;
-            if(Rb>m_r1maxv) break;
-	    float dR = R-Rb; 
-	    if(dR<m_drminv) break;
-            if(dR>m_drmax) continue;
-	    float dZ = Z-(*r)->z();
-	    float Tz = dZ/dR; if(Tz<m_dzdrmin || Tz>m_dzdrmax) continue;
-	    float Zo = Z-R*Tz;	          
-
-	    // Comparison with vertices Z coordinates
-	    //
-	    if(!isZCompatible(Zo,Rb,Tz)) continue;
-
-	    // Momentum cut
-	    //
-	    float dx =(*r)->x()-X; 
-	    float dy =(*r)->y()-Y; 
-	    float x  = dx*ax+dy*ay          ;
-	    float y  =-dx*ay+dy*ax          ;
-	    float xy = x*x+y*y              ; if(xy == 0.) continue;
-	    float r2 = 1./xy                ;
-	    float Ut = x*r2                 ;
-	    float Vt = y*r2                 ;
-	    float UR = Ut*R+1.              ; if(UR == 0.) continue;
-	    float A  = Vt*R/UR              ;
-	    float B  = Vt-A*Ut              ;
-	    if(fabs(B*m_K) > m_ipt*sqrt(1.+A*A)) continue;
+      for (; r0!=r0e; ++r0) {
+
+        float X  = (*r0)->x();
+        float Y  = (*r0)->y();
+        float R  = (*r0)->radius();
+        if (R<m_r2minv) continue;
+        if (R>m_r2maxv) break;
+        float Z  = (*r0)->z();
+        float ax = X/R;
+        float ay = Y/R;
+
+        // Bottom links production
+        //
+        int NB = m_rfzv_n[a];
+        for (int i=0; i!=NB; ++i) {
+    
+          int an = m_rfzv_i[a][i];
+          if (!m_rfzv_map[an]) continue;
+
+          r  =  m_rfzv_Sorted[an].begin();
+          re =  m_rfzv_Sorted[an].end  ();
+    
+          for (; r!=re; ++r) {
+      
+            float Rb =(*r)->radius();
+            if (Rb<m_r1minv) continue;
+            if (Rb>m_r1maxv) break;
+            float dR = R-Rb;
+            if (dR<m_drminv) break;
+            if (dR>m_drmax) continue;
+            float dZ = Z-(*r)->z();
+            float Tz = dZ/dR;
+            if (Tz<m_dzdrmin || Tz>m_dzdrmax) continue;
+            float Zo = Z-R*Tz;
+
+            // Comparison with vertices Z coordinates
+            //
+            if (!isZCompatible(Zo,Rb,Tz)) continue;
+
+            // Momentum cut
+            //
+            float dx =(*r)->x()-X;
+            float dy =(*r)->y()-Y;
+            float x  = dx*ax+dy*ay          ;
+            float y  =-dx*ay+dy*ax          ;
+            float xy = x*x+y*y              ;
+            if (xy == 0.) continue;
+            float r2 = 1./xy                ;
+            float Ut = x*r2                 ;
+            float Vt = y*r2                 ;
+            float UR = Ut*R+1.              ;
+            if (UR == 0.) continue;
+            float A  = Vt*R/UR              ;
+            float B  = Vt-A*Ut              ;
+            if (fabs(B*m_K) > m_ipt*sqrt(1.+A*A)) continue;
             ++nseed;
-	    newSeed((*r),(*r0),Zo);
-	  }
-	}
-	if(nseed < m_maxsize) continue; 
-	m_endlist=false; m_rMin = (++r0); m_fvNmin=f; m_zMin=z; 
-	return;
+            newSeed((*r),(*r0),Zo);
+          }
+        }
+        if (nseed < m_maxsize) continue;
+        m_endlist=false;
+        m_rMin = (++r0);
+        m_fvNmin=f;
+        m_zMin=z;
+        return;
       }
     }
   }
@@ -1394,40 +1309,49 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production2Sp()
 
 void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp()
 { 
-  if(m_nsaz<3) return; 
+  if (m_nsaz<3) return;
   m_seeds.clear();
 
   const int   ZI[11]= {5,6,7,8,9,10,4,3,2,1,0};
   std::list<InDet::SiSpacePointForSeed*>::iterator rt[9],rte[9],rb[9],rbe[9];
-  int nseed = 0; 
+  int nseed = 0;
 
   // Loop thorugh all azimuthal regions
   //
-  for(int f=m_fNmin; f<=m_fNmax; ++f) {
+  for (int f=m_fNmin; f<=m_fNmax; ++f) {
     
     // For each azimuthal region loop through all Z regions
     //
-    int z = 0; if(!m_endlist) z = m_zMin;
+    int z = 0;
+    if (!m_endlist) z = m_zMin;
 
-    for(; z!=11; ++z) {
+    for (; z!=11; ++z) {
 
-      int a  = f *11+ZI[z];  if(!m_rfz_map[a]) continue;
+      int a  = f *11+ZI[z];
+      if (!m_rfz_map[a]) continue;
       int NB = 0, NT = 0;
-      for(int i=0; i!=m_rfz_b[a]; ++i) {
-	
-	int an =  m_rfz_ib[a][i];
-	if(!m_rfz_map[an]) continue;
-	rb [NB] = m_rfz_Sorted[an].begin(); rbe[NB++] = m_rfz_Sorted[an].end();
+      for (int i=0; i!=m_rfz_b[a]; ++i) {
+  
+        int an =  m_rfz_ib[a][i];
+        if (!m_rfz_map[an]) continue;
+        rb [NB] = m_rfz_Sorted[an].begin();
+        rbe[NB++] = m_rfz_Sorted[an].end();
+      } 
+      for (int i=0; i!=m_rfz_t[a]; ++i) {
+  
+        int an =  m_rfz_it[a][i];
+        if (!m_rfz_map[an]) continue;
+        rt [NT] = m_rfz_Sorted[an].begin();
+        rte[NT++] = m_rfz_Sorted[an].end();
       } 
-      for(int i=0; i!=m_rfz_t[a]; ++i) {
-	
-	int an =  m_rfz_it[a][i];
-	if(!m_rfz_map[an]) continue; 
-	rt [NT] = m_rfz_Sorted[an].begin(); rte[NT++] = m_rfz_Sorted[an].end();
+      if (!m_trigger) production3Sp       (rb,rbe,rt,rte,NB,NT,nseed);
+      else            production3SpTrigger(rb,rbe,rt,rte,NB,NT,nseed);
+
+      if (!m_endlist) {
+        m_fNmin=f;
+        m_zMin = z;
+        return;
       } 
-      if(!m_trigger) production3Sp       (rb,rbe,rt,rte,NB,NT,nseed);
-      else           production3SpTrigger(rb,rbe,rt,rte,NB,NT,nseed);
-      if(!m_endlist) {m_fNmin=f; m_zMin = z; return;} 
     }
   }
   m_endlist = true;
@@ -1445,11 +1369,14 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
   int NB, int NT, int& nseed) 
 {
   std::list<InDet::SiSpacePointForSeed*>::iterator r0=rb[0],r;
-  if(!m_endlist) {r0 = m_rMin; m_endlist = true;}
+  if (!m_endlist) {
+    r0 = m_rMin;
+    m_endlist = true;
+  }
 
   float ipt2K = m_ipt2K   ;
   float ipt2C = m_ipt2C   ;
-  float COFK  = m_COFK    ; 
+  float COFK  = m_COFK    ;
   float imaxp = m_diver   ;
   float imaxs = m_divermax;
 
@@ -1457,12 +1384,12 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
 
   // Loop through all trigger space points
   //
-  for(; r0!=rbe[0]; ++r0) {
+  for (; r0!=rbe[0]; ++r0) {
 
     m_nOneSeeds = 0;
     m_mapOneSeeds.clear();
 
-    float R  = (*r0)->radius(); 
+    float R  = (*r0)->radius();
 
     const Trk::Surface* sur0 = (*r0)->sur();
     const Trk::Surface* surn = (*r0)->sun();
@@ -1473,66 +1400,77 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
 
     // Bottom links production
     //
-    for(int i=0; i!=NB; ++i) {
+    for (int i=0; i!=NB; ++i) {
 
-      for(r=rb[i]; r!=rbe[i]; ++r) {
-	
-	float Rb =(*r)->radius();  
-	float dR = R-Rb; 
+      for (r=rb[i]; r!=rbe[i]; ++r) {
+  
+        float Rb =(*r)->radius();
+        float dR = R-Rb;
 
-	if(dR > m_drmax) {rb[i]=r; continue;}   
-	if(dR < m_drmin || (m_iteration && (*r)->spacepoint->clusterList().second)) break;
-	if((*r)->sur()==sur0 || (surn && surn==(*r)->sun())) continue;
+        if (dR > m_drmax) {
+          rb[i]=r;
+          continue;
+        }
+        if (dR < m_drmin || (m_iteration && (*r)->spacepoint->clusterList().second)) break;
+        if ((*r)->sur()==sur0 || (surn && surn==(*r)->sun())) continue;
 
-	float Tz = (Z-(*r)->z())/dR, aTz =fabs(Tz);
+        float Tz = (Z-(*r)->z())/dR;
+        float aTz =fabs(Tz);
 
-	if(aTz < m_dzdrmin || aTz > m_dzdrmax) continue;
-	
-	// Comparison with vertices Z coordinates
-	//
-	float Zo = Z-R*Tz; if(!isZCompatible(Zo,Rb,Tz)) continue;
-	m_SP[Nb] = (*r); if(++Nb==m_maxsizeSP) goto breakb;
+        if (aTz < m_dzdrmin || aTz > m_dzdrmax) continue;
+  
+        // Comparison with vertices Z coordinates
+        //
+        float Zo = Z-R*Tz;
+        if (!isZCompatible(Zo,Rb,Tz)) continue;
+        m_SP[Nb] = (*r);
+        if (++Nb==m_maxsizeSP) goto breakb;
       }
     }
   breakb:
-    if(!Nb || Nb==m_maxsizeSP) continue;  
+    if (!Nb || Nb==m_maxsizeSP) continue;
     int Nt = Nb;
     
     // Top   links production
     //
-    for(int i=0; i!=NT; ++i) {
+    for (int i=0; i!=NT; ++i) {
       
-      for(r=rt[i]; r!=rte[i]; ++r) {
-	
-	float Rt =(*r)->radius();
-	float dR = Rt-R; 
-	
-	if(dR<m_drmin) {rt[i]=r; continue;}
-	if(dR>m_drmax) break;
+      for (r=rt[i]; r!=rte[i]; ++r) {
+  
+        float Rt =(*r)->radius();
+        float dR = Rt-R;
+  
+        if (dR<m_drmin) {
+          rt[i]=r;
+          continue;
+        }
+        if (dR>m_drmax) break;
 
-	if( (*r)->sur()==sur0 || (surn && surn==(*r)->sun())) continue;
+        if ( (*r)->sur()==sur0 || (surn && surn==(*r)->sun())) continue;
 
-	float Tz = ((*r)->z()-Z)/dR, aTz =fabs(Tz);  
+        float Tz = ((*r)->z()-Z)/dR, aTz =fabs(Tz);
 
-	if(aTz < m_dzdrmin || aTz > m_dzdrmax) continue;
+        if (aTz < m_dzdrmin || aTz > m_dzdrmax) continue;
 
-	// Comparison with vertices Z coordinates
-	//
-	float Zo = Z-R*Tz; if(!isZCompatible(Zo,R,Tz)) continue;
-  	m_SP[Nt] = (*r); if(++Nt==m_maxsizeSP) goto breakt;
+        // Comparison with vertices Z coordinates
+        //
+        float Zo = Z-R*Tz;
+        if (!isZCompatible(Zo,R,Tz)) continue;
+        m_SP[Nt] = (*r);
+        if (++Nt==m_maxsizeSP) goto breakt;
       }
     }
     
   breakt:
-    if(!(Nt-Nb)) continue;
+    if (!(Nt-Nb)) continue;
     float covr0 = (*r0)->covr ();
     float covz0 = (*r0)->covz ();
     float ax    = X/R           ;
     float ay    = Y/R           ;
 
-    for(int i=0; i!=Nt; ++i) {
+    for (int i=0; i!=Nt; ++i) {
 
-      InDet::SiSpacePointForSeed* sp = m_SP[i];  
+      InDet::SiSpacePointForSeed* sp = m_SP[i];
 
       float dx  = sp->x()-X   ;
       float dy  = sp->y()-Y   ;
@@ -1541,7 +1479,8 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
       float y   = dy*ax-dx*ay ;
       float r2  = 1./(x*x+y*y);
       float dr  = sqrt(r2)    ;
-      float tz  = dz*dr       ; if(i < Nb) tz = -tz;
+      float tz  = dz*dr       ;
+      if (i < Nb) tz = -tz;
 
       m_Tz[i]   = tz                                            ;
       m_Zo[i]   = Z-R*tz                                        ;
@@ -1555,7 +1494,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
    
     // Three space points comparison
     //
-    for(int b=0; b!=Nb; ++b) {
+    for (int b=0; b!=Nb; ++b) {
     
       float  Zob  = m_Zo[b]      ;
       float  Tzb  = m_Tz[b]      ;
@@ -1568,32 +1507,45 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
       float sTzb2 = sqrt(Tzb2)   ;
       float  CSA  = Tzb2*COFK    ;
       float ICSA  = Tzb2*ipt2C   ;
-      float imax  = imaxp        ; if(m_SP[b]->spacepoint->clusterList().second) imax = imaxs;
+      float imax  = imaxp        ;
+      if (m_SP[b]->spacepoint->clusterList().second) imax = imaxs;
   
-      for(int t=Nb;  t!=Nt; ++t) {
-	
-	float dT  = ((Tzb-m_Tz[t])*(Tzb-m_Tz[t])-m_R[t]*Rb2z-(Erb+m_Er[t]))-(m_R[t]*Rb2r)*((Tzb+m_Tz[t])*(Tzb+m_Tz[t]));
-	if( dT > ICSA) continue;
-
-	float dU  = m_U[t]-Ub; if(dU == 0.) continue ; 
-	float A   = (m_V[t]-Vb)/dU                   ;
-	float S2  = 1.+A*A                           ;
-	float B   = Vb-A*Ub                          ;
-	float B2  = B*B                              ;
-	if(B2  > ipt2K*S2 || dT*S2 > B2*CSA) continue;
-
-	float Im  = fabs((A-B*R)*R)                  ; 
-
-	if(Im <= imax) {
-	  float dr; m_R[t] < m_R[b] ? dr = m_R[t] : dr = m_R[b]; Im+=fabs((Tzb-m_Tz[t])/(dr*sTzb2));
-	  m_CmSp.push_back(std::make_pair(B/sqrt(S2),m_SP[t])); m_SP[t]->setParam(Im);
-
-	}
+      for (int t=Nb;  t!=Nt; ++t) {
+  
+        float dT  = ((Tzb-m_Tz[t])*(Tzb-m_Tz[t])-m_R[t]*Rb2z-(Erb+m_Er[t]))-(m_R[t]*Rb2r)*((Tzb+m_Tz[t])*(Tzb+m_Tz[t]));
+        if (dT > ICSA) continue;
+
+        float dU  = m_U[t]-Ub;
+        if (dU == 0.) continue;
+        float A   = (m_V[t]-Vb)/dU                   ;
+        float S2  = 1.+A*A                           ;
+        float B   = Vb-A*Ub                          ;
+        float B2  = B*B                              ;
+        if (B2  > ipt2K*S2 || dT*S2 > B2*CSA) continue;
+
+        float Im  = fabs((A-B*R)*R)                  ;
+
+        if (Im <= imax) {
+          float dr;
+          m_R[t] < m_R[b] ? dr = m_R[t] : dr = m_R[b];
+          Im+=fabs((Tzb-m_Tz[t])/(dr*sTzb2));
+          m_CmSp.push_back(std::make_pair(B/sqrt(S2),m_SP[t]));
+          m_SP[t]->setParam(Im);
+
+        }
       }
-      if(!m_CmSp.empty()) {newOneSeedWithCurvaturesComparison(m_SP[b],(*r0),Zob);}
+      if (!m_CmSp.empty()) {
+        newOneSeedWithCurvaturesComparison(m_SP[b],(*r0),Zob);
+      }
+    }
+    fillSeeds();
+    nseed += m_fillOneSeeds;
+    if (nseed>=m_maxsize) {
+      m_endlist=false;
+      ++r0;
+      m_rMin = r0;
+      return;
     }
-    fillSeeds();  nseed += m_fillOneSeeds;
-    if(nseed>=m_maxsize) {m_endlist=false; ++r0; m_rMin = r0;  return;} 
   }
 }
 
@@ -1610,13 +1562,16 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3SpTrigger
   int NB, int NT, int& nseed) 
 {
   std::list<InDet::SiSpacePointForSeed*>::iterator r0=rb[0],r;
-  if(!m_endlist) {r0 = m_rMin; m_endlist = true;}
+  if (!m_endlist) {
+    r0 = m_rMin;
+    m_endlist = true;
+  }
 
-  const float pi = M_PI, pi2 = 2.*pi; 
+  const float pi = M_PI, pi2 = 2.*pi;
 
   float ipt2K = m_ipt2K   ;
   float ipt2C = m_ipt2C   ;
-  float COFK  = m_COFK    ; 
+  float COFK  = m_COFK    ;
   float imaxp = m_diver   ;
   float imaxs = m_diversss;
 
@@ -1624,12 +1579,12 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3SpTrigger
 
   // Loop through all trigger space points
   //
-  for(; r0!=rbe[0]; ++r0) {
+  for (; r0!=rbe[0]; ++r0) {
 
     m_nOneSeeds = 0;
     m_mapOneSeeds.clear();
-	
-    float R  = (*r0)->radius(); 
+  
+    float R  = (*r0)->radius();
 
     const Trk::Surface* sur0 = (*r0)->sur();
     float               X    = (*r0)->x()  ;
@@ -1639,63 +1594,75 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3SpTrigger
 
     // Bottom links production
     //
-    for(int i=0; i!=NB; ++i) {
-
-      for(r=rb[i]; r!=rbe[i]; ++r) {
-	
-	float Rb =(*r)->radius();  
-
-	float dR = R-Rb; 
-	if(dR > m_drmax) {rb[i]=r; continue;}   
-	if((*r)->sur()==sur0) continue;
+    for (int i=0; i!=NB; ++i) {
 
-	if(dR < m_drmin || (m_iteration && (*r)->spacepoint->clusterList().second)) break;
-
-	// Comparison with  bottom and top Z 
-	//
-	float Tz = (Z-(*r)->z())/dR;
-	float Zo = Z-R*Tz          ; if(Zo < m_zminB || Zo > m_zmaxB) continue;
-	float Zu = Z+(550.-R)*Tz   ; if(Zu < m_zminU || Zu > m_zmaxU) continue;
-	m_SP[Nb] = (*r); if(++Nb==m_maxsizeSP) goto breakb;
+      for (r=rb[i]; r!=rbe[i]; ++r) {
+  
+        float Rb =(*r)->radius();
+
+        float dR = R-Rb;
+        if (dR > m_drmax) {
+          rb[i]=r;
+          continue;
+        }
+        if ((*r)->sur()==sur0) continue;
+
+        if (dR < m_drmin || (m_iteration && (*r)->spacepoint->clusterList().second)) break;
+
+        // Comparison with  bottom and top Z 
+        //
+        float Tz = (Z-(*r)->z())/dR;
+        float Zo = Z-R*Tz          ;
+        if (Zo < m_zminB || Zo > m_zmaxB) continue;
+        float Zu = Z+(550.-R)*Tz   ;
+        if (Zu < m_zminU || Zu > m_zmaxU) continue;
+        m_SP[Nb] = (*r);
+        if (++Nb==m_maxsizeSP) goto breakb;
       }
     }
   breakb:
-    if(!Nb || Nb==m_maxsizeSP) continue;  
+    if (!Nb || Nb==m_maxsizeSP) continue;
     int Nt = Nb;
     
     // Top   links production
     //
-    for(int i=0; i!=NT; ++i) {
+    for (int i=0; i!=NT; ++i) {
       
-      for(r=rt[i]; r!=rte[i]; ++r) {
-	
-	float Rt =(*r)->radius();
-	float dR = Rt-R; 
-	
-	if(dR<m_drmin) {rt[i]=r; continue;}
-	if(dR>m_drmax) break;
-	if( (*r)->sur()==sur0) continue;
-
-	// Comparison with  bottom and top Z 
-	//
-	float Tz = ((*r)->z()-Z)/dR;  
-	float Zo = Z-R*Tz          ; if(Zo < m_zminB || Zo > m_zmaxB) continue;
-	float Zu = Z+(550.-R)*Tz   ; if(Zu < m_zminU || Zu > m_zmaxU) continue;
-  	m_SP[Nt] = (*r); if(++Nt==m_maxsizeSP) goto breakt;
+      for (r=rt[i]; r!=rte[i]; ++r) {
+  
+        float Rt =(*r)->radius();
+        float dR = Rt-R;
+  
+        if (dR<m_drmin) {
+          rt[i]=r;
+          continue;
+        }
+        if (dR>m_drmax) break;
+        if ((*r)->sur()==sur0) continue;
+
+        // Comparison with  bottom and top Z 
+        //
+        float Tz = ((*r)->z()-Z)/dR;
+        float Zo = Z-R*Tz          ;
+        if (Zo < m_zminB || Zo > m_zmaxB) continue;
+        float Zu = Z+(550.-R)*Tz   ;
+        if (Zu < m_zminU || Zu > m_zmaxU) continue;
+        m_SP[Nt] = (*r);
+        if (++Nt==m_maxsizeSP) goto breakt;
       }
     }
     
   breakt:
-    if(!(Nt-Nb)) continue;
+    if (!(Nt-Nb)) continue;
     float covr0 = (*r0)->covr ();
     float covz0 = (*r0)->covz ();
 
     float ax   = X/R;
     float ay   = Y/R;
     
-    for(int i=0; i!=Nt; ++i) {
+    for (int i=0; i!=Nt; ++i) {
 
-      InDet::SiSpacePointForSeed* sp = m_SP[i];  
+      InDet::SiSpacePointForSeed* sp = m_SP[i];
 
       float dx  = sp->x()-X   ;
       float dy  = sp->y()-Y   ;
@@ -1704,7 +1671,8 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3SpTrigger
       float y   = dy*ax-dx*ay ;
       float r2  = 1./(x*x+y*y);
       float dr  = sqrt(r2)    ;
-      float tz  = dz*dr       ; if(i < Nb) tz = -tz;
+      float tz  = dz*dr       ;
+      if (i < Nb) tz = -tz;
 
       m_Tz[i]   = tz                                            ;
       m_Zo[i]   = Z-R*tz                                        ;
@@ -1718,7 +1686,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3SpTrigger
    
     // Three space points comparison
     //
-    for(int b=0; b!=Nb; ++b) {
+    for (int b=0; b!=Nb; ++b) {
     
       float  Zob  = m_Zo[b]      ;
       float  Tzb  = m_Tz[b]      ;
@@ -1730,36 +1698,47 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3SpTrigger
       float  Tzb2 = (1.+Tzb*Tzb) ;
       float  CSA  = Tzb2*COFK    ;
       float ICSA  = Tzb2*ipt2C   ;
-      float imax  = imaxp        ; if(m_SP[b]->spacepoint->clusterList().second) imax = imaxs;
+      float imax  = imaxp        ;
+      if (m_SP[b]->spacepoint->clusterList().second) imax = imaxs;
       
-      for(int t=Nb;  t!=Nt; ++t) {
-	
-	float dT  = ((Tzb-m_Tz[t])*(Tzb-m_Tz[t])-m_R[t]*Rb2z-(Erb+m_Er[t]))-(m_R[t]*Rb2r)*((Tzb+m_Tz[t])*(Tzb+m_Tz[t]));
-	if( dT > ICSA) continue;
-
-	float dU  = m_U[t]-Ub; if(dU == 0.) continue ; 
-	float A   = (m_V[t]-Vb)/dU                   ;
-	float S2  = 1.+A*A                           ;
-	float B   = Vb-A*Ub                          ;
-	float B2  = B*B                              ;
-	if(B2  > ipt2K*S2 || dT*S2 > B2*CSA) continue;
-
-	float Im  = fabs((A-B*R)*R)                  ; 
-	if(Im > imax) continue;
-
-	// Azimuthal angle test
-	//
-	float y  = 1.;
-	float x  = 2.*B*R-A;
-	float df = fabs(atan2(ay*y-ax*x,ax*y+ay*x)-m_ftrig);
-	if(df > pi      ) df=pi2-df;
-	if(df > m_ftrigW) continue;
-	m_CmSp.push_back(std::make_pair(B/sqrt(S2),m_SP[t])); m_SP[t]->setParam(Im);
+      for (int t=Nb;  t!=Nt; ++t) {
+  
+        float dT  = ((Tzb-m_Tz[t])*(Tzb-m_Tz[t])-m_R[t]*Rb2z-(Erb+m_Er[t]))-(m_R[t]*Rb2r)*((Tzb+m_Tz[t])*(Tzb+m_Tz[t]));
+        if ( dT > ICSA) continue;
+
+        float dU  = m_U[t]-Ub;
+        if (dU == 0.) continue ;
+        float A   = (m_V[t]-Vb)/dU                   ;
+        float S2  = 1.+A*A                           ;
+        float B   = Vb-A*Ub                          ;
+        float B2  = B*B                              ;
+        if (B2  > ipt2K*S2 || dT*S2 > B2*CSA) continue;
+
+        float Im  = fabs((A-B*R)*R)                  ;
+        if (Im > imax) continue;
+
+        // Azimuthal angle test
+        //
+        float y  = 1.;
+        float x  = 2.*B*R-A;
+        float df = fabs(atan2(ay*y-ax*x,ax*y+ay*x)-m_ftrig);
+        if (df > pi      ) df=pi2-df;
+        if (df > m_ftrigW) continue;
+        m_CmSp.push_back(std::make_pair(B/sqrt(S2),m_SP[t]));
+        m_SP[t]->setParam(Im);
+      }
+      if (!m_CmSp.empty()) {
+        newOneSeedWithCurvaturesComparison(m_SP[b],(*r0),Zob);
       }
-      if(!m_CmSp.empty()) {newOneSeedWithCurvaturesComparison(m_SP[b],(*r0),Zob);}
     }
-    fillSeeds();  nseed += m_fillOneSeeds;
-    if(nseed>=m_maxsize) {m_endlist=false; ++r0; m_rMin = r0;  return;} 
+    fillSeeds();
+    nseed += m_fillOneSeeds;
+    if (nseed>=m_maxsize) {
+      m_endlist=false;
+      ++r0;
+      m_rMin = r0;
+      return;
+    } 
   }
 }
 
@@ -1771,25 +1750,28 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeed
 (InDet::SiSpacePointForSeed*& p1, InDet::SiSpacePointForSeed*& p2,
  InDet::SiSpacePointForSeed*& p3,float z,float q)
 {
-  if(m_nOneSeeds < m_maxOneSize) {
+  if (m_nOneSeeds < m_maxOneSize) {
 
-    m_OneSeeds[m_nOneSeeds].set(p1,p2,p3,z); 
+    m_OneSeeds[m_nOneSeeds].set(p1,p2,p3,z);
     m_mapOneSeeds.insert(std::make_pair(q,m_OneSeeds+m_nOneSeeds));
     ++m_nOneSeeds;
-  }
-  else                     {
+  } else {
     std::multimap<float,InDet::SiSpacePointsProSeed*>::reverse_iterator 
       l = m_mapOneSeeds.rbegin();
 
-    if((*l).first <= q) return;
+    if ((*l).first <= q) return;
     
-    InDet::SiSpacePointsProSeed* s = (*l).second; s->set(p1,p2,p3,z);
+    InDet::SiSpacePointsProSeed* s = (*l).second;
+    s->set(p1,p2,p3,z);
 
     std::multimap<float,InDet::SiSpacePointsProSeed*>::iterator 
       i = m_mapOneSeeds.insert(std::make_pair(q,s));
-	
-    for(++i; i!=m_mapOneSeeds.end(); ++i) {
-      if((*i).second==s) {m_mapOneSeeds.erase(i); return;}
+  
+    for (++i; i!=m_mapOneSeeds.end(); ++i) {
+      if ((*i).second==s) {
+        m_mapOneSeeds.erase(i);
+        return;
+      }
     }
   }
 }
@@ -1799,7 +1781,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeed
 ///////////////////////////////////////////////////////////////////
 
 void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison
-	(SiSpacePointForSeed*& SPb,SiSpacePointForSeed*& SP0,float Zob)
+(SiSpacePointForSeed*& SPb,SiSpacePointForSeed*& SP0,float Zob)
 {
   const float dC = .00003;
 
@@ -1808,51 +1790,57 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison
   float u0   = SP0->quality()                        ;
 
   std::sort(m_CmSp.begin(),m_CmSp.end(),comCurvature());
-  std::vector<std::pair<float,InDet::SiSpacePointForSeed*>>::iterator j,jn,i = m_CmSp.begin(),ie = m_CmSp.end(); jn=i; 
+  std::vector<std::pair<float,InDet::SiSpacePointForSeed*>>::iterator j,jn,i = m_CmSp.begin(),ie = m_CmSp.end();
+  jn=i;
       
-  for(; i!=ie; ++i) {
+  for (; i!=ie; ++i) {
 
-    float u    = (*i).second->param(); 
+    float u    = (*i).second->param();
     float Im   = (*i).second->param();
 
     bool                pixt = !(*i).second->spacepoint->clusterList().second;
     
     const Trk::Surface* Sui  = (*i).second->sur   ();
-    float               Ri   = (*i).second->radius();  
+    float               Ri   = (*i).second->radius();
     float               Ci1  =(*i).first-dC         ;
     float               Ci2  =(*i).first+dC         ;
     float               Rmi  = 0.                   ;
     float               Rma  = 0.                   ;
     bool                in   = false;
     
-    if     (!pixb) u-=400.;
-    else if( pixt) u-=200.;
+    if      (!pixb) u-=400.;
+    else if ( pixt) u-=200.;
 
-    for(j=jn;  j!=ie; ++j) {
+    for (j=jn;  j!=ie; ++j) {
       
-      if(       j == i           ) continue;
-      if( (*j).first < Ci1       ) {jn=j; ++jn; continue;}
-      if( (*j).first > Ci2       ) break;
-      if( (*j).second->sur()==Sui) continue;
+      if (       j == i           ) continue;
+      if ( (*j).first < Ci1       ) {jn=j; ++jn; continue;}
+      if ( (*j).first > Ci2       ) break;
+      if ( (*j).second->sur()==Sui) continue;
       
-      float Rj = (*j).second->radius(); if(fabs(Rj-Ri) < m_drmin) continue;
-
-      if(in) {
-	if     (Rj > Rma) Rma = Rj;
-	else if(Rj < Rmi) Rmi = Rj;
-	else continue;
-	if( (Rma-Rmi) > 20.) {u-=200.; break;}
-      }
-      else {
-	in=true; Rma=Rmi=Rj; u-=200.;
+      float Rj = (*j).second->radius();
+      if (fabs(Rj-Ri) < m_drmin) continue;
+
+      if (in) {
+        if      (Rj > Rma) Rma = Rj;
+        else if (Rj < Rmi) Rmi = Rj;
+        else continue;
+        if ((Rma-Rmi) > 20.) {
+          u-=200.;
+          break;
+        }
+      } else {
+        in=true;
+        Rma=Rmi=Rj;
+        u-=200.;
       }
     }
-    if(u > m_umax) continue;
-    if(pixb!=pixt) {
-      if(u > 0. || (u > ub && u > u0 && u > (*i).second->quality()) ) continue;
+    if (u > m_umax) continue;
+    if (pixb!=pixt) {
+      if (u > 0. || (u > ub && u > u0 && u > (*i).second->quality()) ) continue;
     }
 
-    if(!pixb && Im > m_diversss && u > Im-500.) continue;
+    if (!pixb && Im > m_diversss && u > Im-500.) continue;
 
     newOneSeed(SPb,SP0,(*i).second,Zob,u);
   }
@@ -1872,33 +1860,31 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::fillSeeds ()
     l  = m_mapOneSeeds.begin(),
     le = m_mapOneSeeds.end  ();
   
-  if(l==le) return;
+  if (l==le) return;
 
   SiSpacePointsProSeed* s;
 
-  for(; l!=le; ++l) {
+  for (; l!=le; ++l) {
 
     float w = (*l).first ;
     s       = (*l).second;
-    if(l!=lf && s->spacepoint0()->radius() < 43. && w > -200.) continue;
-    if(!s->setQuality(w)) continue;
+    if (l!=lf && s->spacepoint0()->radius() < 43. && w > -200.) continue;
+    if (!s->setQuality(w)) continue;
     
-    if(m_i_seede!=m_l_seeds.end()) {
+    if (m_i_seede!=m_l_seeds.end()) {
       s  = (*m_i_seede++);
       *s = *(*l).second;
-    }
-    else                  {
+    } else {
       s = new SiSpacePointsProSeed(*(*l).second);
       m_l_seeds.push_back(s);
-      m_i_seede = m_l_seeds.end(); 
+      m_i_seede = m_l_seeds.end();
     }
     
-    if     (s->spacepoint0()->spacepoint->clusterList().second) w-=3000.;
-    else if(s->spacepoint1()->spacepoint->clusterList().second) w-=2000.;
-    else if(s->spacepoint2()->spacepoint->clusterList().second) w-=1000.;
+    if      (s->spacepoint0()->spacepoint->clusterList().second) w-=3000.;
+    else if (s->spacepoint1()->spacepoint->clusterList().second) w-=2000.;
+    else if (s->spacepoint2()->spacepoint->clusterList().second) w-=1000.;
 
-    m_seeds.insert(std::make_pair(w,s)); ++m_fillOneSeeds;
+    m_seeds.insert(std::make_pair(w,s));
+    ++m_fillOneSeeds;
   }
 }
-
-
diff --git a/InnerDetector/InDetRecTools/SiZvertexTool_xk/SiZvertexTool_xk/SiZvertexMaker_xk.h b/InnerDetector/InDetRecTools/SiZvertexTool_xk/SiZvertexTool_xk/SiZvertexMaker_xk.h
old mode 100755
new mode 100644
index 8d0b9f046bd9276ec94703ef7a0c5e487bb106ee..d7329534dfec1c2c2683f13efca67469a7423762
--- a/InnerDetector/InDetRecTools/SiZvertexTool_xk/SiZvertexTool_xk/SiZvertexMaker_xk.h
+++ b/InnerDetector/InDetRecTools/SiZvertexTool_xk/SiZvertexTool_xk/SiZvertexMaker_xk.h
@@ -1,5 +1,7 @@
+// -*- C++ -*-
+
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////////////////////
@@ -16,96 +18,88 @@
 #define SiZvertexMaker_xk_H
 
 
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "InDetRecToolInterfaces/ISiZvertexMaker.h"  
-#include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+
 #include "Identifier/IdentifierHash.h"
+#include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h"
+
+#include "GaudiKernel/ToolHandle.h"
+
+#include <iosfwd>
 #include <list>
 #include <vector>
-#include <iosfwd>
 
-namespace Trk{
+namespace Trk {
   class Vertex;
 }
 
-
 class MsgStream;
 
-namespace InDet{
+namespace InDet {
 
   class SiZvertexMaker_xk : virtual public ISiZvertexMaker, public AthAlgTool
-    {
-      ///////////////////////////////////////////////////////////////////
-      // Public methods:
-      ///////////////////////////////////////////////////////////////////
+  {
+    ///////////////////////////////////////////////////////////////////
+    // Public methods:
+    ///////////////////////////////////////////////////////////////////
       
-    public:
+  public:
       
-      ///////////////////////////////////////////////////////////////////
-      // Standard tool methods
-      ///////////////////////////////////////////////////////////////////
-
-      SiZvertexMaker_xk
-	(const std::string&,const std::string&,const IInterface*);
-      virtual ~SiZvertexMaker_xk();
-      virtual StatusCode initialize ();
-      virtual StatusCode finalize   ();
-
-      ///////////////////////////////////////////////////////////////////
-      // Methods to initialize tool for new event or region
-      ///////////////////////////////////////////////////////////////////
-
-      virtual void newEvent();
-      virtual void newRegion
-	(const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&);
-      virtual void newRegion
-	(const std::vector<IdentifierHash>&,const std::vector<IdentifierHash>&,const IRoiDescriptor&);
-
-      ///////////////////////////////////////////////////////////////////
-      // Methods for primary vertices production
-      ///////////////////////////////////////////////////////////////////
-
-      virtual const std::list<Trk::Vertex>&  getVertices();
-
-      ///////////////////////////////////////////////////////////////////
-      // Print internal tool parameters and status
-      ///////////////////////////////////////////////////////////////////
-
-      MsgStream&    dump          (MsgStream   & out) const;
-      std::ostream& dump          (std::ostream& out) const;
+    ///////////////////////////////////////////////////////////////////
+    // Standard tool methods
+    ///////////////////////////////////////////////////////////////////
+
+    SiZvertexMaker_xk(const std::string&,
+                      const std::string&,
+                      const IInterface*);
+    virtual ~SiZvertexMaker_xk() = default;
+    virtual StatusCode initialize();
+    virtual StatusCode finalize();
+
+    ///////////////////////////////////////////////////////////////////
+    // Methods to initialize tool for new event or region
+    ///////////////////////////////////////////////////////////////////
+
+    virtual std::list<Trk::Vertex> newEvent();
+    virtual std::list<Trk::Vertex> newRegion(const std::vector<IdentifierHash>&,
+                                             const std::vector<IdentifierHash>&);
+    virtual std::list<Trk::Vertex> newRegion(const std::vector<IdentifierHash>&,
+                                             const std::vector<IdentifierHash>&,
+                                             const IRoiDescriptor&);
+
+    ///////////////////////////////////////////////////////////////////
+    // Print internal tool parameters and status
+    ///////////////////////////////////////////////////////////////////
+
+    MsgStream&    dump(MsgStream&    out) const;
+    std::ostream& dump(std::ostream& out) const;
       
-    protected:
+  protected:
       
-      ///////////////////////////////////////////////////////////////////
-      // Protected data and methods
-      ///////////////////////////////////////////////////////////////////
+    ///////////////////////////////////////////////////////////////////
+    // Protected data and methods
+    ///////////////////////////////////////////////////////////////////
       
-      int*                                       m_histogram{}     ;
-      double*                                    m_z_histogram{}   ;
-      int                                        m_outputlevel{}   ;
-      int                                        m_nprint {}       ;
-      int                                        m_nspoint{}       ;
-      int                                        m_histsize{}      ;
-      int                                        m_mincontent{}    ;
-      int                                        m_maxcontent{}    ;
-      double                                     m_zmin{}          ;
-      double                                     m_zmax {}         ;
-      double                                     m_ratio {}        ;
-      std::list<Trk::Vertex>                     m_vertex        ;
-      ToolHandle<InDet::ISiSpacePointsSeedMaker> m_seedsgenerator; 
-
-      ///////////////////////////////////////////////////////////////////
-      // Protected methods
-      ///////////////////////////////////////////////////////////////////
-
-      void production();
-      MsgStream&    dumpConditions(MsgStream   & out) const;
-      MsgStream&    dumpEvent     (MsgStream   & out) const;
-   };
-  MsgStream&    operator << (MsgStream&   ,const SiZvertexMaker_xk&);
-  std::ostream& operator << (std::ostream&,const SiZvertexMaker_xk&); 
+    ToolHandle<InDet::ISiSpacePointsSeedMaker> m_seedsgenerator
+    {this, "SeedMakerTool", "InDet::SiSpacePointsSeedMaker_ATLxk"};
+
+    IntegerProperty m_nspoint{this, "SeedSize", 2};
+    IntegerProperty m_histsize{this, "HistSize", 500};
+    IntegerProperty m_mincontent{this, "minContent", 20};
+    DoubleProperty m_zmin{this, "Zmin", -250.};
+    DoubleProperty m_zmax{this, "Zmax", +250.};
+    DoubleProperty m_ratio{this, "minRatio", 0.25};
+
+    ///////////////////////////////////////////////////////////////////
+    // Protected methods
+    ///////////////////////////////////////////////////////////////////
+
+    std::list<Trk::Vertex> production();
+    MsgStream& dumpConditions(MsgStream& out) const;
+  };
+  MsgStream&    operator << (MsgStream&   , const SiZvertexMaker_xk&);
+  std::ostream& operator << (std::ostream&, const SiZvertexMaker_xk&);
 }
 
 #endif // SiZvertexMaker_xk_H
-
diff --git a/InnerDetector/InDetRecTools/SiZvertexTool_xk/src/SiZvertexMaker_xk.cxx b/InnerDetector/InDetRecTools/SiZvertexTool_xk/src/SiZvertexMaker_xk.cxx
old mode 100755
new mode 100644
index 8c2385afc4debad84c4707b21a96f52380453052..3f44c3f91add6215c5db6519c86ad89d38b7df6f
--- a/InnerDetector/InDetRecTools/SiZvertexTool_xk/src/SiZvertexMaker_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiZvertexTool_xk/src/SiZvertexMaker_xk.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -10,13 +10,14 @@
 // Version 1.0 30/10/2004 I.Gavrilenko
 ///////////////////////////////////////////////////////////////////
 
-#include <ostream>
-#include <iomanip>
-
 #include "SiZvertexTool_xk/SiZvertexMaker_xk.h"
+
 #include "SiSpacePointsSeed/SiSpacePointsSeed.h"
 #include "VxVertex/Vertex.h"
+
+#include <iomanip>
 #include <map>
+#include <ostream>
 
 ///////////////////////////////////////////////////////////////////
 // Constructor
@@ -24,38 +25,9 @@
 
 InDet::SiZvertexMaker_xk::SiZvertexMaker_xk
 (const std::string& t,const std::string& n,const IInterface* p)
-  : AthAlgTool(t,n,p),
-  m_seedsgenerator("InDet::SiSpacePointsSeedMaker_ATLxk")
-{
-  m_nspoint   =  2                                   ;
-  m_histsize  =  500                                 ;  
-  m_histogram =  0                                   ;  
-  m_z_histogram =  0                                   ;
-  m_zmin      = -250.                                ;
-  m_zmax      = +250.                                ;
-  m_ratio     = .25                                  ;
-  m_mincontent=   20                                 ;
-  m_maxcontent=   0                                  ;
-
-  declareInterface<ISiZvertexMaker>(this)            ;
-
-  declareProperty("SeedMakerTool",m_seedsgenerator ) ;             
-  declareProperty("SeedSize"     ,m_nspoint   )      ;             
-  declareProperty("HistSize"     ,m_histsize  )      ;
-  declareProperty("minContent"   ,m_mincontent)      ;
-  declareProperty("minRatio"     ,m_ratio     )      ;
-  declareProperty("Zmin"         ,m_zmin      )      ;
-  declareProperty("Zmax"         ,m_zmax      )      ;
-}
-
-///////////////////////////////////////////////////////////////////
-// Destructor  
-///////////////////////////////////////////////////////////////////
-
-InDet::SiZvertexMaker_xk::~SiZvertexMaker_xk()
+  : AthAlgTool(t,n,p)
 {
-  if(m_histogram) delete [] m_histogram;
-  if(m_z_histogram) delete [] m_z_histogram;
+  declareInterface<ISiZvertexMaker>(this);
 }
 
 ///////////////////////////////////////////////////////////////////
@@ -64,22 +36,12 @@ InDet::SiZvertexMaker_xk::~SiZvertexMaker_xk()
 
 StatusCode InDet::SiZvertexMaker_xk::initialize()
 {
-
   // Get tool for seed generator
   //
-  if ( m_seedsgenerator.retrieve().isFailure() ) {
-    msg(MSG::FATAL) << "Failed to retrieve tool " << m_seedsgenerator << endmsg;
-    return StatusCode::FAILURE;
-  } else {
-    msg(MSG::INFO) << "Retrieved tool " << m_seedsgenerator << endmsg;
-  }
+  ATH_CHECK(m_seedsgenerator.retrieve());
+
+  ATH_MSG_DEBUG(*this);
 
-  // Get output print level
-  //
-  m_outputlevel = msg().level()-MSG::DEBUG;
-  if(m_outputlevel<=0) {
-    m_nprint=0; msg(MSG::DEBUG)<<(*this)<<endmsg;
-  }
   return StatusCode::SUCCESS;
 }
 
@@ -89,114 +51,105 @@ StatusCode InDet::SiZvertexMaker_xk::initialize()
 
 StatusCode InDet::SiZvertexMaker_xk::finalize()
 {
-   StatusCode sc = AlgTool::finalize(); return sc;
+  return AlgTool::finalize();
 }
+
 ///////////////////////////////////////////////////////////////////
 // Initialize tool for new event 
 ///////////////////////////////////////////////////////////////////
 
-void InDet::SiZvertexMaker_xk::newEvent()
+std::list<Trk::Vertex> InDet::SiZvertexMaker_xk::newEvent()
 {
-  if(!m_histogram) {
-    m_histogram = new int   [m_histsize+1];
-    m_z_histogram = new double[m_histsize+1];
-  }
-  m_vertex.erase(m_vertex.begin(),m_vertex.end());
   m_seedsgenerator->newEvent();
-  production();
+  return production();
 }
 
 ///////////////////////////////////////////////////////////////////
 // Initialize tool for new region
 ///////////////////////////////////////////////////////////////////
 
-void InDet::SiZvertexMaker_xk::newRegion
-(const std::vector<IdentifierHash>& vPixel, const std::vector<IdentifierHash>& vSCT )
+std::list<Trk::Vertex> InDet::SiZvertexMaker_xk::newRegion
+(const std::vector<IdentifierHash>& vPixel, const std::vector<IdentifierHash>& vSCT)
 {
-  if(!m_histogram) {
-    m_histogram = new int   [m_histsize+1];
-    m_z_histogram = new double[m_histsize+1];
-  }
-  m_vertex.erase(m_vertex.begin(),m_vertex.end());
-  m_seedsgenerator->newRegion(vPixel,vSCT);
-  production();
+  m_seedsgenerator->newRegion(vPixel, vSCT);
+  return production();
 }
 
 ///////////////////////////////////////////////////////////////////
 // Initialize tool for new region with ROI parameters (PhRt)
 ///////////////////////////////////////////////////////////////////
 
-void InDet::SiZvertexMaker_xk::newRegion
+std::list<Trk::Vertex> InDet::SiZvertexMaker_xk::newRegion
 (const std::vector<IdentifierHash>& vPixel, const std::vector<IdentifierHash>& vSCT,const IRoiDescriptor& PhEt)
 {
-  if(!m_histogram) {
-    m_histogram = new int   [m_histsize+1];
-    m_z_histogram = new double[m_histsize+1];
-  }
-  m_vertex.erase(m_vertex.begin(),m_vertex.end());
-  m_seedsgenerator->newRegion(vPixel,vSCT,PhEt);
-  production();
+  m_seedsgenerator->newRegion(vPixel, vSCT, PhEt);
+  return production();
 }
 
 ///////////////////////////////////////////////////////////////////
 // Get list vertices Z-coordinates
 ///////////////////////////////////////////////////////////////////
 
-const std::list<Trk::Vertex>&  InDet::SiZvertexMaker_xk::getVertices () 
+std::list<Trk::Vertex> InDet::SiZvertexMaker_xk::production()
 {
-  return m_vertex;
-}
+  std::list<Trk::Vertex> vertices;
 
-///////////////////////////////////////////////////////////////////
-// Get list vertices Z-coordinates
-///////////////////////////////////////////////////////////////////
+  std::vector<int> histogram(m_histsize+1, 0);
+  std::vector<double> z_histogram(m_histsize+1, 0.);
 
-void InDet::SiZvertexMaker_xk::production() 
-{
-  double sZ = double(m_histsize)/(m_zmax-m_zmin);
-  for(int i=0; i<=m_histsize; ++i) {m_histogram[i]=0; m_z_histogram[i]=0.;}
+  double sZ = static_cast<double>(m_histsize)/(m_zmax-m_zmin);
 
   std::list<int>    NMAX;
   std::list<double> ZMAX;
-  const Trk::SpacePoint*  p0 = 0;
+  const Trk::SpacePoint* p0 = nullptr;
 
   std::list<Trk::Vertex> lv;  
   
-  if     (m_nspoint==2) m_seedsgenerator->find2Sp(lv);
-  else if(m_nspoint==3) m_seedsgenerator->find3Sp(lv);
-  else                  m_seedsgenerator->findVSp(lv);
+  if      (m_nspoint==2) m_seedsgenerator->find2Sp(lv);
+  else if (m_nspoint==3) m_seedsgenerator->find3Sp(lv);
+  else                   m_seedsgenerator->findVSp(lv);
 
-  const InDet::SiSpacePointsSeed* seed = 0;
+  const InDet::SiSpacePointsSeed* seed = nullptr;
   std::multimap<int,double> ver;
 
   int    nmax = 0 ;
   int    Hmax = 0 ;
   double zmax = 0.;
 
-  while((seed = m_seedsgenerator->next())) {
+  while ((seed = m_seedsgenerator->next())) {
 
     std::list<const Trk::SpacePoint*>::const_iterator 
-      s = seed->spacePoints().begin(); ++s;
-    if((*s)!=p0) {
-      if(Hmax!=0) {NMAX.push_back(nmax); ZMAX.push_back(zmax);}
-      Hmax=nmax=0; p0=(*s);
+      s = seed->spacePoints().begin();
+    ++s;
+    if ((*s)!=p0) {
+      if (Hmax!=0) {
+        NMAX.push_back(nmax);
+        ZMAX.push_back(zmax);
+      }
+      Hmax = nmax = 0;
+      p0=(*s);
     }
-    int n = int((seed->zVertex()-m_zmin)*sZ);
-    if(n>=0 && n<=m_histsize) {
-      if(++m_histogram[n]>Hmax) {Hmax=m_histogram[n]; nmax=n; zmax=seed->zVertex();}
+    int n = static_cast<int>((seed->zVertex()-m_zmin)*sZ);
+    if (n>=0 && n<=m_histsize) {
+      if (++histogram[n]>Hmax) {
+        Hmax = histogram[n];
+        nmax = n;
+        zmax = seed->zVertex();
+      }
     } 
   } 
 
   // Clear histogram
   //
-  for(int i=0; i<=m_histsize; ++i) m_histogram[i]=0;
+  for (int i=0; i<=m_histsize; ++i) histogram[i] = 0;
 
   // Fill histogram again using NMAX information
   //
-  std::list<int>   ::iterator m,me=NMAX.end();
+  std::list<int>   ::iterator m, me = NMAX.end();
   std::list<double>::iterator z = ZMAX.begin();
-  for(m=NMAX.begin(); m!=me; ++m) {
-    ++m_histogram[(*m)]; m_z_histogram[(*m)]+=(*z++); 
+  for (m=NMAX.begin(); m!=me; ++m) {
+    ++histogram[(*m)];
+    z_histogram[(*m)] += (*z++); 
   }
    
   // Max. content seach and output bank Z coordinates of vertices production
@@ -204,57 +157,55 @@ void InDet::SiZvertexMaker_xk::production()
   int HiZm = 0; 
   int im   = 0;
   int i    = 1;
-  while(1) {
-
-    if(m_histogram[i]>=m_histogram[i-1] && m_histogram[i]>=m_histogram[i+1]) {
-      int H3 = m_histogram[i-1]+m_histogram[i]+m_histogram[i+1]; 
-      if(H3>HiZm) {HiZm=H3; im=i;}
-      if(++i==m_histsize) break;
+  while (true) {
+
+    if (histogram[i]>=histogram[i-1] && histogram[i]>=histogram[i+1]) {
+      int H3 = histogram[i-1]+histogram[i]+histogram[i+1]; 
+      if (H3>HiZm) {
+        HiZm=H3;
+        im=i;
+      }
+      if (++i==m_histsize) break;
     }
-    if(++i==m_histsize) break;
+    if (++i==m_histsize) break;
   }
 
-  m_maxcontent = HiZm;  
-  if(im==0 || HiZm < m_mincontent) {
+  if (im==0 || HiZm < m_mincontent) {
 
-    if(m_outputlevel<=0) {
-      m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
-    }
-    return;
+    return vertices;
   }
-  double zv = (m_z_histogram[im]+m_z_histogram[im-1]+m_z_histogram[im+1])/double(HiZm);
-  ver.insert(std::make_pair(-HiZm,zv));
+  double zv = (z_histogram[im]+z_histogram[im-1]+z_histogram[im+1])/static_cast<double>(HiZm);
+  ver.insert(std::make_pair(-HiZm, zv));
 
   // Z-vertex coordinates 
   //
-  HiZm = int(m_ratio*double(HiZm)); if(HiZm<m_mincontent) HiZm = m_mincontent;
-  i    = 1;
-  while(1) {
-
-    if(m_histogram[i]>=m_histogram[i-1] && m_histogram[i]>=m_histogram[i+1] && i!=im) { 
-
-      int H3 = m_histogram[i-1]+m_histogram[i]+m_histogram[i+1]; 
-      if(H3>=HiZm) {
-	zv = (m_z_histogram[i]+m_z_histogram[i-1]+m_z_histogram[i+1])/double(H3);
-	ver.insert(std::make_pair(-H3,zv));
-     }
-      if(++i==m_histsize) break;
+  HiZm = static_cast<int>(m_ratio*static_cast<double>(HiZm));
+  if (HiZm<m_mincontent) HiZm = m_mincontent;
+  i = 1;
+  while (true) {
+    if (histogram[i]>=histogram[i-1] && histogram[i]>=histogram[i+1] && i!=im) { 
+      int H3 = histogram[i-1]+histogram[i]+histogram[i+1];
+      if (H3>=HiZm) {
+        zv = (z_histogram[i]+z_histogram[i-1]+z_histogram[i+1])/static_cast<double>(H3);
+        ver.insert(std::make_pair(-H3, zv));
+      }
+      if (++i==m_histsize) break;
     }
-    if(++i==m_histsize) break;
+    if (++i==m_histsize) break;
   }
 
-  if(!ver.empty()) {
-
-    std::multimap<int,double>::iterator v = ver.begin(), ve = ver.end();
-      for(; v!=ve; ++v) {
-	Amg::Vector3D Vp(0.,0.,(*v).second); Trk::Vertex Ver(Vp);
-	m_vertex.push_back(Ver);
+  if (!ver.empty()) {
+    std::multimap<int, double>::iterator v = ver.begin(), ve = ver.end();
+    for (; v!=ve; ++v) {
+      Amg::Vector3D Vp(0., 0., (*v).second);
+      Trk::Vertex Ver(Vp);
+      vertices.push_back(Ver);
     }
   }
 
-  if(m_outputlevel<=0) {
-    m_nprint=1; msg(MSG::DEBUG)<<(*this)<<endmsg;
-  }
+  ATH_MSG_DEBUG(*this);
+
+  return vertices;
 }
 
 
@@ -262,10 +213,9 @@ void InDet::SiZvertexMaker_xk::production()
 // Dumps relevant information into the MsgStream
 ///////////////////////////////////////////////////////////////////
 
-MsgStream& InDet::SiZvertexMaker_xk::dump( MsgStream& out ) const
+MsgStream& InDet::SiZvertexMaker_xk::dump(MsgStream& out) const
 {
-  out<<std::endl;
-  if(m_nprint)  return dumpEvent(out);
+  out << std::endl;
   return dumpConditions(out);
 }
 
@@ -273,11 +223,12 @@ MsgStream& InDet::SiZvertexMaker_xk::dump( MsgStream& out ) const
 // Dumps conditions information into the MsgStream
 ///////////////////////////////////////////////////////////////////
 
-MsgStream& InDet::SiZvertexMaker_xk::dumpConditions( MsgStream& out ) const
+MsgStream& InDet::SiZvertexMaker_xk::dumpConditions(MsgStream& out) const
 {
   int n = 62-m_seedsgenerator.type().size();
-  std::string s1; for(int i=0; i<n; ++i) s1.append(" "); s1.append("|");
-
+  std::string s1;
+  for (int i=0; i<n; ++i) s1.append(" ");
+  s1.append("|");
 
   out<<"|----------------------------------------------------------------------"
      <<"-------------------|"
@@ -309,39 +260,11 @@ MsgStream& InDet::SiZvertexMaker_xk::dumpConditions( MsgStream& out ) const
   return out;
 }
 
-///////////////////////////////////////////////////////////////////
-// Dumps event information into the MsgStream
-///////////////////////////////////////////////////////////////////
-
-MsgStream& InDet::SiZvertexMaker_xk::dumpEvent( MsgStream& out ) const
-{
-  out<<"|---------------------------------------------------------------------|"
-     <<std::endl;
-  out<<"| max content of hist.bin | "
-     <<std::setw(12)<<m_maxcontent
-     <<"                              |"<<std::endl;
-  out<<"| number of vertices      | "
-     <<std::setw(12)<<m_vertex.size()
-     <<"                              |"<<std::endl;
-  std::list<Trk::Vertex>::const_iterator v,ve = m_vertex.end();  
-  for(v=m_vertex.begin(); v!=ve; ++v) {
-    out<<"| Vertex(x,y,z) mm        | "
-       <<std::setw(12)<<std::setprecision(5)<<(*v).position().x()
-       <<std::setw(12)<<std::setprecision(5)<<(*v).position().y()
-       <<std::setw(12)<<std::setprecision(5)<<(*v).position().z()
-      <<"      |"
-      <<std::endl;
-  }
-  out<<"|---------------------------------------------------------------------|"
-     <<std::endl;
-  return out;
-}
-
 ///////////////////////////////////////////////////////////////////
 // Dumps relevant information into the ostream
 ///////////////////////////////////////////////////////////////////
 
-std::ostream& InDet::SiZvertexMaker_xk::dump( std::ostream& out ) const
+std::ostream& InDet::SiZvertexMaker_xk::dump(std::ostream& out) const
 {
   return out;
 }
@@ -350,9 +273,9 @@ std::ostream& InDet::SiZvertexMaker_xk::dump( std::ostream& out ) const
 // Overload of << operator MsgStream
 ///////////////////////////////////////////////////////////////////
 
-MsgStream& InDet::operator    << 
-  (MsgStream& sl,const InDet::SiZvertexMaker_xk& se)
-{ 
+MsgStream& InDet::operator <<
+(MsgStream& sl, const InDet::SiZvertexMaker_xk& se)
+{
   return se.dump(sl); 
 }
 
@@ -361,9 +284,7 @@ MsgStream& InDet::operator    <<
 ///////////////////////////////////////////////////////////////////
 
 std::ostream& InDet::operator << 
-  (std::ostream& sl,const InDet::SiZvertexMaker_xk& se)
+(std::ostream& sl,const InDet::SiZvertexMaker_xk& se)
 { 
   return se.dump(sl); 
 }   
-
-
diff --git a/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx b/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx
index e2c1df953de27f3d8f7b64a9d75c2f459c48c3d4..7701c93dc630560a3f638c9cfc72f89ffba67faa 100755
--- a/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/SiTrigSPSeededTrackFinder/src/SiTrigSPSeededTrackFinder.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //***************************************************************************
@@ -254,31 +254,33 @@ HLT::ErrorCode InDet::SiTrigSPSeededTrackFinder::hltExecute(const HLT::TriggerEl
     if( m_useZvertexTool ) {
       
       if(doTiming()) m_timerZVertexTool->start();
+
+      std::list<Trk::Vertex> vertices;
       
       if(!m_doFullScan){
 	if (m_fastTracking){
-	  m_zvertexmaker->newRegion(listOfPixIds,listOfSCTIds,*roi);
+	  vertices = std::move(m_zvertexmaker->newRegion(listOfPixIds,listOfSCTIds,*roi));
 	}
 	else {
-	  m_zvertexmaker->newRegion(listOfPixIds,listOfSCTIds);
+	  vertices = std::move(m_zvertexmaker->newRegion(listOfPixIds,listOfSCTIds));
 	}
       }
       else{
-	m_zvertexmaker->newEvent();
+	vertices = std::move(m_zvertexmaker->newEvent());
       }
       
       if(doTiming()) m_timerZVertexTool->stop();
       
       if(doTiming()) m_timerSeedsMaker->start();
       
-      m_seedsmaker->find3Sp(m_zvertexmaker->getVertices());
+      m_seedsmaker->find3Sp(vertices);
       
       if(doTiming()) m_timerSeedsMaker->stop();
       
+      m_nZvtx = vertices.size();
       if(m_outputlevel <= 0){ 
-	msg() << MSG::DEBUG << "REGTEST: Number of zvertex found = " << (m_zvertexmaker->getVertices()).size() << endmsg;
+	ATH_MSG_DEBUG("REGTEST: Number of zvertex found = " << m_nZvtx);
       }
-      m_nZvtx = (m_zvertexmaker->getVertices()).size();
     }
     else{
       if(doTiming()) m_timerSeedsMaker->start();
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
index e96199f65029f55facb29e72637aaaef5bfa5519..1db250d7b519e841debe0de90c66f3ca4a6dcf94 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
@@ -29,7 +29,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/xAOD/xAODBase
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODJet
-                          InnerDetector/InDetConditions/InDetBeamSpotService
+                          InnerDetector/InDetConditions/BeamSpotConditionsData
                           InnerDetector/InDetRecEvent/InDetPrepRawData
                           InnerDetector/InDetRecEvent/InDetRIO_OnTrack
                           PhysicsAnalysis/MCTruthClassifier
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
index 454606b041994f9c6709dd90ce0fa308a16386ab..68b3f1f0033286d906698a0567ca4faf77eae900 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx
@@ -16,7 +16,6 @@
 #include "TDatabasePDG.h"
 #include "TParticlePDG.h"
 #include "TrkParameters/TrackParameters.h" // Contains typedef to Trk::CurvilinearParameters
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include <cmath>
 
 // ref:
@@ -27,8 +26,8 @@
 
 
 InDetPhysValTruthDecoratorAlg::InDetPhysValTruthDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator) :
-  AthReentrantAlgorithm(name, pSvcLocator),
-  m_beamSpotSvc("BeamCondSvc", name) {
+  AthReentrantAlgorithm(name, pSvcLocator)
+{
 }
 
 InDetPhysValTruthDecoratorAlg::~InDetPhysValTruthDecoratorAlg () {
@@ -38,7 +37,7 @@ InDetPhysValTruthDecoratorAlg::~InDetPhysValTruthDecoratorAlg () {
 StatusCode
 InDetPhysValTruthDecoratorAlg::initialize() {
   ATH_CHECK(m_extrapolator.retrieve());
-  ATH_CHECK(m_beamSpotSvc.retrieve());
+  ATH_CHECK(m_beamSpotKey.initialize());
   ATH_CHECK( m_truthSelectionTool.retrieve( EnableTool { not m_truthSelectionTool.name().empty() } ) );
   if (not m_truthSelectionTool.name().empty() ) {
     m_cutFlow = CutFlow(m_truthSelectionTool->nCuts() );
@@ -80,20 +79,24 @@ InDetPhysValTruthDecoratorAlg::execute(const EventContext &ctx) const {
   std::vector< std::pair<SG::WriteDecorHandle<xAOD::TruthParticleContainer, float>,const SG::AuxElement::ConstAccessor<float> &> >
     float_decor( IDPVM::createDecoratorsWithAccessor(m_decor, ctx) );
 
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
+  ATH_CHECK(beamSpotHandle.isValid());
+  const auto& beamPos = beamSpotHandle->beamPos();
+
   if ( m_truthSelectionTool.get() ) {
     CutFlow tmp_cut_flow(m_truthSelectionTool->nCuts());
     for (const xAOD::TruthParticle *truth_particle : *ptruth) {
       auto passed = m_truthSelectionTool->accept(truth_particle);
       tmp_cut_flow.update( passed.missingCuts() );
       if (not passed) continue;
-      decorateTruth(*truth_particle, float_decor);
+      decorateTruth(*truth_particle, float_decor, beamPos);
     }
     std::lock_guard<std::mutex> lock(m_mutex);
     m_cutFlow.merge(std::move(tmp_cut_flow));
   }
   else {
     for (const xAOD::TruthParticle *truth_particle : *ptruth) {
-      decorateTruth(*truth_particle, float_decor);
+      decorateTruth(*truth_particle, float_decor, beamPos);
     }
   }
   return StatusCode::SUCCESS;
@@ -104,7 +107,8 @@ InDetPhysValTruthDecoratorAlg::execute(const EventContext &ctx) const {
 bool
 InDetPhysValTruthDecoratorAlg::decorateTruth(const xAOD::TruthParticle& particle,
                                               std::vector< std::pair<SG::WriteDecorHandle<xAOD::TruthParticleContainer,float>,
-                                                                     const SG::AuxElement::ConstAccessor<float> &> > &float_decor) const {
+                                                                     const SG::AuxElement::ConstAccessor<float> &> > &float_decor,
+                                                                      const Amg::Vector3D& beamPos) const {
   ATH_MSG_VERBOSE("Decorate truth with d0 etc");
   if (particle.isNeutral()) {
     return false;
@@ -141,7 +145,7 @@ InDetPhysValTruthDecoratorAlg::decorateTruth(const xAOD::TruthParticle& particle
   // delete ptruthVertex;ptruthVertex=0;
   const Trk::CurvilinearParameters cParameters(position, momentum, charge);
 
-  Trk::PerigeeSurface persf(m_beamSpotSvc->beamPos());
+  Trk::PerigeeSurface persf(beamPos);
 
   std::unique_ptr<const Trk::TrackParameters> tP ( m_extrapolator->extrapolate(cParameters, persf, Trk::anyDirection, false) );
   if (tP) {
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h
index 11202a332889309cb371295bb057c9979ad01088..e64769abcfb26161cbe5f9578f43dee8b13a0e86 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.h
@@ -15,10 +15,10 @@
 #include "xAODTruth/TruthParticleContainer.h"
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "StoreGate/WriteDecorHandleKey.h"
 #include "StoreGate/WriteDecorHandle.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
 #include "AthContainers/AuxElement.h"
 #include "GaudiKernel/EventContext.h"
 #include "InDetPhysValMonitoring/IAthSelectionTool.h"
@@ -26,7 +26,6 @@
 #include <utility>
 #include <vector>
 
-class IBeamCondSvc;
 
 // class to decorate xAOD::TruthParticles with additional information required by validation
 class InDetPhysValTruthDecoratorAlg: public AthReentrantAlgorithm {
@@ -41,11 +40,12 @@ public:
 private:
   bool decorateTruth(const xAOD::TruthParticle& particle,
                      std::vector< std::pair<SG::WriteDecorHandle<xAOD::TruthParticleContainer,float>,
-                                            const SG::AuxElement::ConstAccessor<float> &> > &float_decor) const;
+                                            const SG::AuxElement::ConstAccessor<float> &> > &float_decor,
+                                            const Amg::Vector3D& beamPos) const;
 
   PublicToolHandle<Trk::IExtrapolator> m_extrapolator
      {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""};
-  ServiceHandle<IBeamCondSvc> m_beamSpotSvc;
+  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
 
   PublicToolHandle<IAthSelectionTool>         m_truthSelectionTool
      {this,"TruthSelectionTool","",""};
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArHVCorrMaker.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArHVCorrMaker.h
index 310291301fcd1c90786b0c4a9f00579738e73331..73b254ef236a58d9e0410fd79469bc73bac588f8 100755
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArHVCorrMaker.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArHVCorrMaker.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //Dear emacs, this is -*-c++-*-
@@ -9,11 +9,11 @@
 
 // Include files
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "LArElecCalib/ILArHVScaleCorr.h"
+#include "LArCabling/LArOnOffIdMapping.h"
 #include "GaudiKernel/ToolHandle.h"
 
-#include "LArElecCalib/ILArHVCorrTool.h"
-
-//#include "LArIdentifier/LArOnlineID.h"
 
 class LArOnlineID;
 
@@ -27,21 +27,29 @@ class LArHVCorrMaker : public AthAlgorithm
   LArHVCorrMaker(const std::string & name, ISvcLocator * pSvcLocator);
 
   // Destructor
-  ~LArHVCorrMaker();
+  virtual ~LArHVCorrMaker();
 
   // Algorithm initialization   
-  StatusCode initialize(); 
+  virtual StatusCode initialize() override;
 
   // Algorithm execution
-  StatusCode execute();
+  virtual StatusCode execute() override;
 
   // Algorithm finalization
-  StatusCode stop();
-  StatusCode finalize(){return StatusCode::SUCCESS;}
+  virtual StatusCode stop() override;
+  virtual StatusCode finalize() override {return StatusCode::SUCCESS;}
   
  private:
   const LArOnlineID*        m_lar_on_id;
-  ToolHandle<ILArHVCorrTool> m_hvCorrTool;
+  std::string m_keyOutput;
+  std::string m_folderName;
+  SG::ReadCondHandleKey<ILArHVScaleCorr> m_scaleCorrKey
+  { this, "LArHVScaleCorr", "LArHVScaleCorrRecomputed", "" };
+  SG::ReadCondHandleKey<ILArHVScaleCorr> m_onlineScaleCorrKey
+  { this, "OnlineLArHVScaleCorr", "LArHVScaleCorr", "" };
+  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey
+  { this, "CablingKey", "LArOnOffIdMap", "SG Key of LArOnOffIdMapping object" };
+  
 };
 
 #endif
diff --git a/LArCalorimeter/LArCalibUtils/doc/packagedoc.h b/LArCalorimeter/LArCalibUtils/doc/packagedoc.h
index e3512d0b6bd99a07a8b81968f82a8c5fe7be6a07..fcb79c1eaedb66f4ae35bbba725d2a806057be14 100644
--- a/LArCalorimeter/LArCalibUtils/doc/packagedoc.h
+++ b/LArCalorimeter/LArCalibUtils/doc/packagedoc.h
@@ -43,7 +43,6 @@ constants (e.g. ionization pulse, optimal filtering coefficients).
   - LArDigitOscillationCorrTool
   - LArDumpShapes
   - LArFill
-  - LArHVCorrTool
   - LArMasterWaveBuilder
   - LArOFCAlg
   - LArOFCTool
diff --git a/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx b/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx
index 2fe8f589b5bdf8cf73e09152afed23aaa62e2d6c..3b6dbd01e1e3ba20220b6a34b3edefe3ddb9b842 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArHVCorrMaker.cxx
@@ -1,11 +1,15 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // Include files
 #include "LArCalibUtils/LArHVCorrMaker.h"
-#include "LArElecCalib/ILArHVScaleCorr.h"
 #include "LArIdentifier/LArOnlineID.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "CoralBase/Blob.h"
+#include "LArCOOLConditions/LArHVScaleCorrFlat.h"
+#include "StoreGate/ReadCondHandle.h"
 
 #include <math.h>
 #include <unistd.h>
@@ -13,10 +17,11 @@
 
 LArHVCorrMaker::LArHVCorrMaker(const std::string& name, ISvcLocator* pSvcLocator) 
   : AthAlgorithm(name, pSvcLocator),
-    m_lar_on_id(0),
-    m_hvCorrTool("LArHVCorrTool",this)
+    m_lar_on_id(0)
 {
-  declareProperty("HVCorrTool", m_hvCorrTool);
+  declareProperty("keyOutput",m_keyOutput="LArHVScaleCorr","Output key for LArHVScaleCorr");
+  declareProperty("folderName",m_folderName="/LAR/ElecCalibFlat/HVScaleCorr",
+		  "Folder to store the CondAttrListCollection containing the HVScale correction");
 }
 
 //---------------------------------------------------------------------------
@@ -27,8 +32,10 @@ LArHVCorrMaker::~LArHVCorrMaker()
 StatusCode LArHVCorrMaker::initialize()
 {
   ATH_MSG_INFO ( "  in initialize " );
-  ATH_CHECK( m_hvCorrTool.retrieve() );
   ATH_CHECK( detStore()->retrieve(m_lar_on_id,"LArOnlineID") );
+  ATH_CHECK( m_scaleCorrKey.initialize() );
+  ATH_CHECK( m_onlineScaleCorrKey.initialize() );
+  ATH_CHECK( m_cablingKey.initialize() );
   return StatusCode::SUCCESS;
 }
 
@@ -44,24 +51,44 @@ StatusCode LArHVCorrMaker::execute()
 StatusCode LArHVCorrMaker::stop()
 {
   ATH_MSG_INFO ( " in stop" );
-  ATH_CHECK( m_hvCorrTool->record() );
 
-  const ILArHVScaleCorr* scaletool = nullptr;
-  ATH_CHECK( detStore()->retrieve(scaletool,"LArHVScaleCorr") );
+  const EventContext& ctx = Gaudi::Hive::currentContext();
+  SG::ReadCondHandle<ILArHVScaleCorr> scaleCorr (m_scaleCorrKey, ctx);
+  SG::ReadCondHandle<ILArHVScaleCorr> onlineScaleCorr (m_onlineScaleCorrKey, ctx);
+  SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey, ctx);
 
+  const unsigned hashMax=m_lar_on_id->channelHashMax();
+  coral::AttributeListSpecification* spec = new coral::AttributeListSpecification;
+  spec->extend("HVScaleCorr", "blob");
+  spec->extend<unsigned>("version");
+  auto coll = std::make_unique<CondAttrListCollection>(true);
+  coral::AttributeList attrList(*spec);
+  spec->release();
+  attrList["version"].setValue(0U);
+  coral::Blob& blob=attrList["HVScaleCorr"].data<coral::Blob>();
+  blob.resize(hashMax*sizeof(float));
+  float* pblob=static_cast<float*>(blob.startingAddress());
+  //Loop over online hash (to make sure that *every* field of the blob gets filled
+  for (unsigned hs=0;hs<hashMax;++hs) {
+    float value=1.0;
+    if (cabling->isOnlineConnectedFromHash(hs)) {
+      const Identifier id=cabling->cnvToIdentifierFromHash(hs);
+      const HWIdentifier hwid = cabling->createSignalChannelID (id);
+      ATH_MSG_VERBOSE("Filling value for id " << id.get_identifier32().get_compact());
+      value=scaleCorr->HVScaleCorr(hwid);
 
-  if (msgLvl(MSG::DEBUG)) { 
-    // get HWIdentifier iterator
-    std::vector<HWIdentifier>::const_iterator it  = m_lar_on_id->channel_begin();
-    std::vector<HWIdentifier>::const_iterator it_e= m_lar_on_id->channel_end();
-    // loop over Identifiers
-    for(;it!=it_e;++it)
-    {    
-      const HWIdentifier id  = *it;  
-      float scale = scaletool->HVScaleCorr(id);
-      ATH_MSG_DEBUG (  m_lar_on_id->show_to_string(id) << " " << scale );
+      // Scales in scaleCorr have been normalized by online correction.
+      // Undo to make the scale absolute.
+      value *= onlineScaleCorr->HVScaleCorr(hwid);
     }
+    pblob[hs]=value;
   }
+  coll->add(1,attrList); //Add as channel 1 to AttrListCollection
 
+  auto flatHVScale = std::make_unique<LArHVScaleCorrFlat>(coll.get());
+
+  ATH_CHECK( detStore()->record(std::move(coll), m_folderName) );
+  ATH_CHECK( detStore()->record(std::move(flatHVScale), m_keyOutput) );
+  
   return StatusCode::SUCCESS;
 }
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_HVCorr.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_HVCorr.py
index a4ab0f6b3c75dd594bd6e9d93a09a0ae493d51a0..b46c9537b8f9a2303babea14909a7836c579e17b 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_HVCorr.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_HVCorr.py
@@ -12,7 +12,7 @@ from calendar import timegm
 #set date to compute the correction
 
 if "date" not in dir():
-    date="2013-02-06:09:45:00"
+    date="2015-02-06:09:45:00"
 
 
 if "TimeStamp" not in dir():
@@ -66,7 +66,7 @@ WriteIOV      = True
 
 # global tag to read other conditions if needed
 if "GlobalTag" not in dir():
-    GlobalTag     = 'LARCALIB-RUN2-00'
+    GlobalTag     = 'CONDBR2-BLKPA-2015-05'
 
 # begin run IOV
 IOVBegin = 0
@@ -104,7 +104,7 @@ from AthenaCommon.AppMgr import theApp
 import AthenaPoolCnvSvc.AthenaPool
 
 from AthenaCommon.GlobalFlags import jobproperties
-jobproperties.Global.DetDescrVersion='ATLAS-GEO-20-00-00'
+jobproperties.Global.DetDescrVersion='ATLAS-R2-2015-03-01-00'
 
 from AtlasGeoModel import SetGeometryVersion
 from AtlasGeoModel import GeoModelInit
@@ -123,26 +123,14 @@ include( "CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py")
 #include( "TileIdCnv/TileIdCnv_jobOptions.py" )
 #include( "LArDetDescr/LArDetDescr_joboptions.py" )
 #include("TileConditions/TileConditions_jobOptions.py" )
-conddb.blockFolder(LArHVScaleCorrFolder);
 include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py")
 
 #include( "LArCondAthenaPool/LArCondAthenaPool_joboptions.py" )
 include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" )
 
 
-
-from LArConditionsCommon import LArHVDB #Sets HV Calbling and DCS Database folders
+from LArConditionsCommon import LArHVDB #Sets HV Cabling and DCS Database folders
 #conddb.addOverride("/LAR/IdentifierOfl/HVLineToElectrodeMap","LARIdentifierOflHVLineToElectrodeMap-UPD3-00")
-from LArCondUtils.LArCondUtilsConf import LArHVToolDB
-theLArHVToolDB = LArHVToolDB("LArHVToolDB")
-ToolSvc += theLArHVToolDB
-
-from LArRecUtils.LArRecUtilsConf import LArHVCorrTool
-theLArHVCorrTool = LArHVCorrTool("LArHVCorrTool")
-theLArHVCorrTool.keyOutput = keyOutput
-theLArHVCorrTool.folderName= LArHVScaleCorrFolder
-theLArHVCorrTool.HVTool = theLArHVToolDB
-ToolSvc += theLArHVCorrTool
 
 from LArCalibUtils.LArCalibUtilsConf import LArHVCorrMaker
 theLArHVCorrMaker = LArHVCorrMaker("LArHVCorrMaker")
diff --git a/LArCalorimeter/LArRecUtils/CMakeLists.txt b/LArCalorimeter/LArRecUtils/CMakeLists.txt
index a669581b359f0b8a11834f6cdb8058c15f56e9a8..d323c78e27188aa3063bacde9bb76a7f4f8ebbb7 100644
--- a/LArCalorimeter/LArRecUtils/CMakeLists.txt
+++ b/LArCalorimeter/LArRecUtils/CMakeLists.txt
@@ -69,6 +69,6 @@ atlas_install_joboptions( share/*.py )
 
 atlas_add_test( LArFCalTowerBuilderTool
                 SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/test/LArFCalTowerBuilderTool_test.sh
-                PROPERTIES TIMEOUT 300
+                PROPERTIES TIMEOUT 600
                 EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|U-shape parameter|Cs Tube parameter|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|^AthenaRootStre.* INFO|^GUID: Class pool::DbString has GUID|INFO TileDddbManager|^HGTD_ID *INFO|Unable to locate catalog|^CORAL/|TFile::Init|MetaDataSvc"
                  )
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/MuonByteStream/TgcRawDataProvider.h b/MuonSpectrometer/MuonCnv/MuonByteStream/MuonByteStream/TgcRawDataProvider.h
index 9a608150e529e63a64b312843caa8c59d9c62928..eada3802cdd54dc03b7c4cd31f41f4dcd5ae3363 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStream/MuonByteStream/TgcRawDataProvider.h
+++ b/MuonSpectrometer/MuonCnv/MuonByteStream/MuonByteStream/TgcRawDataProvider.h
@@ -10,7 +10,11 @@
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
 
-class IROBDataProviderSvc;
+// interface to region selector service
+#include "IRegionSelector/IRegSelSvc.h"
+
+// ROI Descriptor classes
+#include "TrigSteeringEvent/TrigRoiDescriptor.h"
 
 namespace Muon
 {
@@ -36,9 +40,18 @@ public:
     ~TgcRawDataProvider();
 
 private:
-    ServiceHandle<IROBDataProviderSvc>          m_robDataProvider;
+
     ToolHandle<Muon::IMuonRawDataProviderTool>  m_rawDataTool;
-    std::vector<uint32_t>                       m_robIds;
+
+    /// Handle for region selector service
+    ServiceHandle<IRegSelSvc> m_regionSelector;
+
+    /// Property to decide whether or not to do RoI based decoding
+    Gaudi::Property< bool > m_seededDecoding { this, "DoSeededDecoding", false, "If true do decoding in RoIs"};
+
+    /// ReadHandle for the input RoIs
+    SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiCollectionKey{ this, "RoIs", "OutputRoIs",  "Name of RoI collection to read in" };
+
 };
 } // ns end
 
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRawDataProvider.cxx b/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRawDataProvider.cxx
index 37b9087a3e03d8d8b8683d12955944f5635be907..5fc7ed6569449387bbbb3f9afa959cfc813d2471 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRawDataProvider.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/TgcRawDataProvider.cxx
@@ -1,9 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MuonByteStream/TgcRawDataProvider.h"
-#include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
 #include "MuonCnvToolInterfaces/IMuonRawDataProviderTool.h"
 #include "MuonRDO/TgcRdoIdHash.h"
 #include "eformat/SourceIdentifier.h"
@@ -17,10 +16,11 @@ using eformat::helper::SourceIdentifier;
 Muon::TgcRawDataProvider::TgcRawDataProvider(const std::string& name,
         ISvcLocator* pSvcLocator) :
         AthAlgorithm(name, pSvcLocator),
-        m_robDataProvider ("ROBDataProviderSvc",name),
-        m_rawDataTool     ("Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool", this)
+        m_rawDataTool     ("Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool", this),
+        m_regionSelector  ("RegSelSvc",name)
 {
     declareProperty ("ProviderTool", m_rawDataTool);
+    declareProperty ("RegionSelectionSvc", m_regionSelector, "Region Selector");
 }
 
 // Destructor
@@ -34,17 +34,21 @@ Muon::TgcRawDataProvider::~TgcRawDataProvider()
 StatusCode Muon::TgcRawDataProvider::initialize()
 {
     ATH_MSG_INFO( "TgcRawDataProvider::initialize"  );
-    ATH_CHECK( m_robDataProvider.retrieve() );
+    ATH_MSG_INFO( m_seededDecoding );
+
     ATH_CHECK( m_rawDataTool.retrieve() );
 
-    TgcRdoIdHash rdoIdHash;
-    for (int i = 0; i < rdoIdHash.max(); i++)
-    {
-        SourceIdentifier sid((eformat::SubDetector)rdoIdHash.subDetectorId(i), rdoIdHash.rodId(i));
-        m_robIds.push_back(sid.simple_code());
-    }
+    ATH_CHECK( m_roiCollectionKey.initialize(m_seededDecoding) );// pass the seeded decoding flag - this marks the RoI collection flag as not used for the case when we decode the full detector
 
-    return StatusCode::SUCCESS;
+  if(m_seededDecoding) {
+    // We only need the region selector in RoI seeded mode
+    if (m_regionSelector.retrieve().isFailure()) {
+      ATH_MSG_FATAL("Unable to retrieve RegionSelector Svc");
+      return StatusCode::FAILURE;
+    }  
+  }//seededDecoding
+
+  return StatusCode::SUCCESS;
 }
 
 StatusCode Muon::TgcRawDataProvider::finalize()
@@ -58,15 +62,34 @@ StatusCode Muon::TgcRawDataProvider::execute()
 {
     ATH_MSG_VERBOSE( "TgcRawDataProvider::execute"  );
 
-    // ask ROBDataProviderSvc for the vector of ROBFragment for all TGC ROBIDs
-    std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
-    m_robDataProvider->getROBData(m_robIds, vecOfRobf);
-
-    ATH_MSG_VERBOSE( "Number of ROB fragments " << vecOfRobf.size()  );
+  if(m_seededDecoding) {
+    
+    // read in the RoIs to process
+    SG::ReadHandle<TrigRoiDescriptorCollection> muonRoI(m_roiCollectionKey);
+    if(!muonRoI.isValid()){
+      ATH_MSG_WARNING("Cannot retrieve muonRoI "<<m_roiCollectionKey.key());
+      return StatusCode::SUCCESS;
+    }
 
-    // ask TgcRawDataProviderTool to decode it and to fill the IDC
-    if (m_rawDataTool->convert(vecOfRobf).isFailure())
+    // loop on RoIs
+    std::vector<IdentifierHash>  tgc_hash_ids;
+    for(auto roi : *muonRoI){
+      ATH_MSG_DEBUG("Get ROBs for RoI " << *roi);
+      // get list of hash IDs from region selection
+      m_regionSelector->DetHashIDList(TGC, *roi, tgc_hash_ids);
+
+      // decode the ROBs
+      if(m_rawDataTool->convert(tgc_hash_ids).isFailure()) {
+        ATH_MSG_ERROR( "RoI seeded BS conversion into RDOs failed"  );
+      }
+      // clear vector of hash IDs ready for next RoI
+      tgc_hash_ids.clear();
+    }
+  } else {
+    // ask TgcRawDataProviderTool to decode full detector and to fill the IDC
+    if (m_rawDataTool->convert().isFailure())
       ATH_MSG_ERROR( "BS conversion into RDOs failed"  );
+  }
 
     return StatusCode::SUCCESS;
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py
index 6ee21a83f9fb68755f334707cd9d3291913514d3..b71857af95b41ce29a79ef8b96b94239f6bbd031 100644
--- a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py
+++ b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py
@@ -31,18 +31,12 @@ if globalflags.DataSource() == 'data':
 log.info("configuring Muon cabling in MuonCablingConfig")
 if DetFlags.readRDOBS.RPC_on() or DetFlags.readRDOPool.RPC_on() or DetFlags.readRIOPool.RPC_on() or DetFlags.digitize.RPC_on():
     try:
-        log.info("importing the InputFilePeeker from MuoncablingConfig")
-        from RecExConfig.InputFilePeeker import inputFileSummary
-        if inputFileSummary['metadata']['/TagInfo'].has_key('RPC_CablingType'):
-            cablingTag = inputFileSummary['metadata']['/TagInfo']['RPC_CablingType']
+        log.info("importing the MetaReader for MuoncablingConfig")
+        from PyUtils.MetaReaderPeekerFull import metadata
+        if 'RPC_CablingType' in metadata['/TagInfo']:
+            cablingTag = metadata['/TagInfo']['RPC_CablingType']
             log.info("Have retrieved RPC taginfo of " + str(cablingTag) + ". Setting default mode to new" )
-            muonCnvFlags.RpcCablingMode='new'
-#    try:
-#        cablingTag = inputFileSummary['metadata']['/TagInfo']['RPC_CablingType']
-#        logMuon.info("Have retrieved RPC taginfo of " + str(cablingTag) + ". Setting default to mode to new" )
-#        setDefault(self.RpcCablingMode, 'new')
-#    except:
-#        log.info("No RPC cabling taginfo found. Using normal configuration.")
+            muonCnvFlags.RpcCablingMode = 'new'
         else:
             log.info("No RPC cabling taginfo found. Using normal configuration.")
     except:
diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h
index 8c2800749630b79aa47dc278ad4426f26e47da1b..7c866bb30d45850956d3d132dce7e15518bea751 100755
--- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h
+++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h
@@ -517,7 +517,7 @@ namespace Muon
         // Note that this means different threads may decode the same data if processing simultaneously
         // However, only one will be written to the cache using the lock
         
-        bool alreadyPresent = rdoIdc.tryFetch( it );
+        bool alreadyPresent = rdoIdc.tryAddFromCache( it );
         
         if(alreadyPresent){
           ATH_MSG_DEBUG ( "RPC RDO collection already exist with collection hash = " << static_cast<unsigned int>(it) << " converting is skipped!");
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCTriggerData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCTriggerData.h
index b9a8ee1a7fa43a9311a1056a8cbe1c296836cb22..984c4c4661b184f95df2123a9a0878f2d4ea793c 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCTriggerData.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCTriggerData.h
@@ -5,7 +5,7 @@
 #ifndef TGCTRIGGERDATA_H
 #define TGCTRIGGERDATA_H
 
-#include "SGTools/BaseInfo.h"
+#include "AthenaKernel/BaseInfo.h"
 #include "AthenaKernel/CLASS_DEF.h"
 #include <string>
 #include <map>
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h
index ce5afcf2c40528c308f9b23c674397346c4903cf..8e881b156d68ce59a8440660237b1e13ff00ae4b 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h
@@ -55,6 +55,10 @@ namespace MuonGM {
     /** strip number corresponding to local position. 
 	Should be renamed to channelNumber : the only public access for all hit types */
     int stripNumber( const Amg::Vector2D& pos, const Identifier& id ) const;
+
+    /** Channel pitch. Gives full pitch for strips, width of a full wire group
+    Gives the Height of a pad */
+    double channelPitch( const Identifier& id ) const;
      
     /** strip position - should be renamed to channel position
 	If the strip number is outside the range of valid strips, the function will return false */
@@ -236,6 +240,28 @@ namespace MuonGM {
 
   }
 
+  inline double sTgcReadoutElement::channelPitch( const Identifier& id ) const {
+
+    if (manager()->stgcIdHelper()->channelType(id)==0){
+    const MuonPadDesign* design = getPadDesign(id);
+    if( !design ) {
+      *m_MsgStream << MSG::WARNING << "no pad Design" << endmsg;
+      return -1;
+    }
+      return design->channelWidth( Amg::Vector2D (0,0),0);
+    }
+
+    const MuonChannelDesign* design = getDesign(id);
+    if( !design ) return -1;
+
+    if (manager()->stgcIdHelper()->channelType(id)==1) //sTGC strips
+      return design->inputPitch;
+    else if (manager()->stgcIdHelper()->channelType(id)==2) //sTGC wires
+      return design->inputPitch * design->groupWidth; // wire Pitch * number of wires in a group
+    else return -1;
+
+  }
+
   inline int sTgcReadoutElement::padNumber( const Amg::Vector2D& pos, const Identifier& id) const {
 
     const MuonPadDesign* design = getPadDesign(id);
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py
index 2cbb69bc4f335fe5dfa47a598e072543af774e53..b21d517cd77d4bb9c0041f9962f02daac097d242 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py
@@ -5,6 +5,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from StoreGate.StoreGateConf import StoreGateSvc
 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
+from MuonConfig.MuonCalibConfig import CscCoolStrSvcCfg
 from CSC_Digitization.CSC_DigitizationConf import (
     CscDigitizationTool, CscDigitBuilder,
 )
@@ -52,6 +53,7 @@ def CSC_DigitizationToolCfg(flags, name="CSC_DigitizationTool", **kwargs):
 def CSC_DigitBuilderCfg(flags, name="CSC_DigitBuilder", **kwargs):
     """Return a ComponentAccumulator with configured CscDigitBuilder algorithm"""
     acc = MuonGeoModelCfg(flags)
+    acc.merge(CscCoolStrSvcCfg(flags))
     tool = acc.popToolsAndMerge(CSC_DigitizationToolCfg(flags))
     kwargs.setdefault("DigitizationTool", tool)
     acc.addEventAlgo(CscDigitBuilder(name, **kwargs))
@@ -71,6 +73,7 @@ def CSC_OverlayDigitizationToolCfg(flags, name="CSC_OverlayDigitizationTool",**k
 def CSC_OverlayDigitBuilderCfg(flags, name="CSC_OverlayDigitBuilder", **kwargs):
     """Return a ComponentAccumulator with CscDigitBuilder algorithm configured for Overlay"""
     acc = MuonGeoModelCfg(flags)
+    acc.merge(CscCoolStrSvcCfg(flags))
     tool = acc.popToolsAndMerge(CSC_OverlayDigitizationToolCfg(flags))
     kwargs.setdefault("DigitizationTool", tool)
     acc.addEventAlgo(CscDigitBuilder(name, **kwargs))
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py b/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py
index 5d42452739ee797f234c14534c5946223e45813e..273eb55f767d7488d78101e38881d5878397fa08 100755
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py
@@ -14,9 +14,6 @@ from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags
 from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
-# CSC imports
-from MuonConfig.MuonCalibConfig import CscCoolStrSvcCfg
-from MuonCondSvc.MuonCondSvcConf import CSCCondSummarySvc
 from CSC_Digitization.CSC_DigitizationConfigNew import CSC_DigitBuilderCfg
 
 # Set up logging and new style config
diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py b/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py
index 780321cf631d519bbffb1772cb6d0fe9e6ff5c6e..efd6075344d8b8b32062a37d586e09a9b9ae6d09 100644
--- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py
+++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py
@@ -7,6 +7,7 @@ from StoreGate.StoreGateConf import StoreGateSvc
 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
 from RPC_Digitization.RPC_DigitizationConf import RpcDigitizationTool, RPC_Digitizer
 from PileUpComps.PileUpCompsConf import PileUpXingFolder
+from IOVDbSvc.IOVDbSvcConfig import addFolders
 
 # The earliest and last bunch crossing times for which interactions will be sent
 # to the RpcDigitizationTool.
@@ -35,6 +36,9 @@ def RPC_DigitizationToolCfg(flags, name="RPC_DigitizationTool", **kwargs):
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "RPC_SDO")
     else:
         kwargs.setdefault("OutputSDOName", "RPC_SDO")
+    # folder for RPCCondSummarySvc
+    acc.merge(addFolders(flags, "/RPC/DQMF/ELEMENT_STATUS", "RPC_OFL"))
+    # config
     kwargs.setdefault("DeadTime", 100)
     kwargs.setdefault("PatchForRpcTime", True)	    
     # kwargs.setdefault("PatchForRpcTimeShift", 9.6875)  
diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
index 8bdfb26d849ca222af6a4a31ef6b79ad2231cc53..850edb5c2ead0d39d5e8f8c132457cbd594a7e3e 100644
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
@@ -88,7 +88,6 @@ class sTgcDigitMaker {
      Calculates intrinsic time response according to incident angle of a track based on time response parameters
   */
   float timeJitter(float inAngle_time) const;
-  float getNoiseFactor(float inAngle_space) const; 
 
   /**
      Determines whether a hit is detected or not.
@@ -169,7 +168,8 @@ class sTgcDigitMaker {
   double m_GausMean;
   double m_GausSigma;
   double m_CrossTalk;
-  double m_noiseFactor;
+  double m_StripResolution;
+  double m_ChargeSpreadFactor;
 
  protected:
   //Declaring private message stream member.
diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
index 2028934a2a6a7f0e629f531f8c3037b69bd97ce6..b615d28096751a7f77641913df58621be7ece9ce 100644
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
@@ -67,7 +67,8 @@ sTgcDigitMaker::sTgcDigitMaker(sTgcHitIdHelper* hitIdHelper, const MuonGM::MuonD
   m_GausSigma               = 0.1885;//mm; VMM response from Oct/Nov 2013 test beam
   m_IntegralTimeOfElectr    = 20.00; // ns
   m_CrossTalk               = 0.03; 
-  m_noiseFactor             = 0.;
+  m_StripResolution         = 0.07; // Angular strip resolution parameter
+  m_ChargeSpreadFactor      = 0.;
   m_channelTypes            = 3; // 1 -> strips, 2 -> strips+pad, 3 -> strips/wires/pads
 }
 
@@ -261,6 +262,7 @@ sTgcDigitCollection* sTgcDigitMaker::executeDigi(const sTGCSimHit* hit, const fl
   Identifier newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, 1, true);
 
   Amg::Vector3D hitOnSurface_strip = SURF_STRIP.transform().inverse()*GPOS;
+
   Amg::Vector2D posOnSurf_strip(hitOnSurface_strip.x(),hitOnSurface_strip.y());
   bool insideBounds = SURF_STRIP.insideBounds(posOnSurf_strip);
   if(!insideBounds) { 
@@ -285,6 +287,7 @@ sTgcDigitCollection* sTgcDigitMaker::executeDigi(const sTGCSimHit* hit, const fl
   }
 
   int NumberOfStrips = detEl->numberOfStrips(newId); 
+  double stripHalfWidth = detEl->channelPitch(newId)*0.5; // 3.2/2 = 1.6 mm
 
   //************************************ spread charge among readout element ************************************** 
   //spread charge to a gaussian distribution
@@ -293,92 +296,72 @@ sTgcDigitCollection* sTgcDigitMaker::executeDigi(const sTGCSimHit* hit, const fl
   TF1 *charge_spread = new TF1("fgaus", "gaus(0)", -1000., 1000.); 
   charge_spread->SetParameters(norm, posOnSurf_strip.x(), charge_width);
   
-  m_noiseFactor = getNoiseFactor(inAngle_space);
-
-  //ATH_MSG_VERBOSE(" New hit " << m_idHelper->print_to_string(newId) << " from truth " << hitOnSurface_strip << "Edep " << 1000.*energyDeposit << "KeV" );
-  //ATH_MSG_VERBOSE(" charge_spread : posOnSurf_strip.x() =  " << posOnSurf_strip.x() );
+  // Charge Spread including tan(theta) resolution term.
+  double tan_theta = GLODIRE.perp()/GLODIRE.z();
+  // The angle dependance on strip resolution goes as tan^2(angle)
+  // We add the resolution in quadrature following sTGC test beam papers
+  m_ChargeSpreadFactor = m_StripResolution*sqrt(1+12.*tan_theta*tan_theta);
 
   int stripnum = -1;
   for(int neighbor=0; neighbor<=3; neighbor++){  // spread the charge to 7 strips for the current algorithm
     stripnum = stripNumber+neighbor;
     if(stripnum>=1&&stripnum<=NumberOfStrips){
       newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum, true, &isValid);
-      if(!isValid) continue;
+      if(isValid) {
+        Amg::Vector2D locpos(0,0);
+        if( !detEl->stripPosition(newId,locpos)){
+          ATH_MSG_WARNING("Failed to obtain local position for identifier " << m_idHelper->print_to_string(newId) );
+        }
 
-      Amg::Vector2D locpos(0,0);
-      if( !detEl->stripPosition(newId,locpos)){
-        ATH_MSG_WARNING("Failed to obtain local position for identifier " << m_idHelper->print_to_string(newId) );
-      }
-      //ATH_MSG_VERBOSE(" New hit " << m_idHelper->print_to_string(newId) << " locpos " << locpos << " from truth " << hitOnSurface_strip << "Edep " << 1000.*energyDeposit << "KeV" );
-      ////??? waiting for Sharka's update
-      //const MuonStripDesign design = detEl->getDesign(newId);
-      //if( !design ) {
-      //        ATH_MSG_WARNING("Failed to obtain strip design for identifier " 
-      //        << m_idHelper->print_to_string(newId) );
-      //}
-      //double stripHalfWidth = design->StripWidth() / 2.;
-      float stripHalfWidth = 2.7 / 2.; 
-      float xmax = locpos.x() + stripHalfWidth;
-      float xmin = locpos.x() - stripHalfWidth;
-      float charge = charge_spread->Integral(xmin, xmax);
-      charge = CLHEP::RandGauss::shoot(m_engine, charge, m_noiseFactor*charge);
-
-      //ATH_MSG_VERBOSE(" nearby strip " << m_idHelper->print_to_string(newId) << "locpos.x = " << locpos.x() << "  locpos.y = " << locpos.y() );
-
-      addDigit(newId, bctag, sDigitTimeStrip, charge, channelType);
-
-      //************************************** introduce cross talk ************************************************
-      for(int crosstalk=1; crosstalk<=3; crosstalk++){ // up to the third nearest neighbors 
-        if((stripnum-crosstalk)>=1&&(stripnum-crosstalk)<=NumberOfStrips){
-          newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum-crosstalk, true, &isValid);
-          if(!isValid) continue;
-          addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
-        } 
-        if((stripnum+crosstalk)>=1&&(stripnum+crosstalk)<=NumberOfStrips){
-          newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum+crosstalk, true, &isValid);
-          if(!isValid) continue;
-          addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
-        } 
-      }// end of introduce cross talk
+        float xmax = locpos.x() + stripHalfWidth;
+        float xmin = locpos.x() - stripHalfWidth;
+        float charge = charge_spread->Integral(xmin, xmax);
+        charge = CLHEP::RandGauss::shoot(m_engine, charge, m_ChargeSpreadFactor*charge);
+
+          addDigit(newId, bctag, sDigitTimeStrip, charge, channelType);
+          //************************************** introduce cross talk ************************************************
+          for(int crosstalk=1; crosstalk<=3; crosstalk++){ // up to the third nearest neighbors
+            if((stripnum-crosstalk)>=1&&(stripnum-crosstalk)<=NumberOfStrips){
+              newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum-crosstalk, true, &isValid);
+              if(isValid) addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
+            }
+            if((stripnum+crosstalk)>=1&&(stripnum+crosstalk)<=NumberOfStrips){
+              newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum+crosstalk, true, &isValid);
+              if(isValid) addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
+            }
+          }// end of introduce cross talk
+      } // end isValid
     }// end of when stripnum = stripNumber+neighbor
  
     if(neighbor==0) continue;
-    stripnum = stripNumber-neighbor; 
+    stripnum = stripNumber-neighbor;
     if(stripnum>=1&&stripnum<=NumberOfStrips){
-      newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum);
-
-      Amg::Vector2D locpos(0,0);
-      if( !detEl->stripPosition(newId,locpos)){
-        ATH_MSG_WARNING("Failed to obtain local position for identifier " << m_idHelper->print_to_string(newId) );
-      }
-      ////??? waiting for Sharka's update
-      //const MuonStripDesign* design = getDesign(newId);
-      //if( !design ) {
-      //        ATH_MSG_WARNING("Failed to obtain strip design for identifier " 
-      //        << m_idHelper->print_to_string(newId) );
-      //}
-      //double stripHalfWidth = design->StripWidth() / 2.;
-      float stripHalfWidth = 2.7 / 2.; 
-      float xmax = locpos.x() + stripHalfWidth;
-      float xmin = locpos.x() - stripHalfWidth;
-      float charge = charge_spread->Integral(xmin, xmax);
-      charge = CLHEP::RandGauss::shoot(m_engine, charge, m_noiseFactor*charge);
-
-      addDigit(newId, bctag, sDigitTimeStrip, charge, channelType);
-
-      //************************************** introduce cross talk ************************************************
-      for(int crosstalk=1; crosstalk<=3; crosstalk++){ // up to the third nearest neighbors 
-        if((stripnum-crosstalk)>=1&&(stripnum-crosstalk)<=NumberOfStrips){
-          newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum-crosstalk);
-          addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
-        } 
-        if((stripnum+crosstalk)>=1&&(stripnum+crosstalk)<=NumberOfStrips){
-          newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum+crosstalk);
-          addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
-        } 
-      }// end of introduce cross talk
+      newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum, true, &isValid);
+      if(isValid) {
+        Amg::Vector2D locpos(0,0);
+        if( !detEl->stripPosition(newId,locpos)){
+          ATH_MSG_WARNING("Failed to obtain local position for identifier " << m_idHelper->print_to_string(newId) );
+        }
+        float xmax = locpos.x() + stripHalfWidth;
+        float xmin = locpos.x() - stripHalfWidth;
+        float charge = charge_spread->Integral(xmin, xmax);
+        charge = CLHEP::RandGauss::shoot(m_engine, charge, m_ChargeSpreadFactor*charge);
+
+          addDigit(newId, bctag, sDigitTimeStrip, charge, channelType);
+
+          //************************************** introduce cross talk ************************************************
+          for(int crosstalk=1; crosstalk<=3; crosstalk++){ // up to the third nearest neighbors
+            if((stripnum-crosstalk)>=1&&(stripnum-crosstalk)<=NumberOfStrips){
+             newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum-crosstalk, true, &isValid);
+             if(isValid) addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
+            }
+            if((stripnum+crosstalk)>=1&&(stripnum+crosstalk)<=NumberOfStrips){
+              newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, stripnum+crosstalk, true, &isValid);
+              if(isValid) addDigit(newId, bctag, sDigitTimeStrip, charge*TMath::Power(m_CrossTalk, crosstalk), channelType);
+            }
+          }// end of introduce cross talk
+      } // end isValid
     }// end of when stripnum = stripNumber-neighbor
-
   }//end for spread the charge to 5 strips 
 
   delete charge_spread;
@@ -521,17 +504,6 @@ void sTgcDigitMaker::readFileOfTimeJitter()
   ifs.close();
 }
 
-//+++++++++++++++++++++++++++++++++++++++++++++++
-float sTgcDigitMaker::getNoiseFactor(float inAngle_space) const
-{
-  float noiseFactor = 0.0;
-  if     (inAngle_space<10) noiseFactor = 0.003*inAngle_space + 0.04;
-  else if(inAngle_space<20) noiseFactor = 0.002*inAngle_space + 0.05;
-  else                      noiseFactor = 0.09;
- 
-  return noiseFactor;
-}
-
 //+++++++++++++++++++++++++++++++++++++++++++++++
 float sTgcDigitMaker::timeJitter(float inAngle_time) const
 {
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h
index 4b58507660c0753148663808efbbb119175d3c5e..bfd45ffd843110657ee082a808478c3dba403cf9 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h
@@ -5,7 +5,7 @@
 #define ISTgcClusterBuilderTool_h
 
 //
-// Interface class for MM clustering
+// Interface class for STgc clustering
 //
 #include <vector>
 #include "GaudiKernel/IAlgTool.h"
@@ -14,6 +14,8 @@ namespace Muon {
   class sTgcPrepData;
 }
 
+class IdentifierHash;
+
 static const InterfaceID IID_ISTgcClusterBuilderTool("Muon::ISTgcClusterBuilderTool", 1, 0);
 
 namespace Muon {
@@ -22,11 +24,15 @@ namespace Muon {
   public:    // static methods
     
     static const InterfaceID& interfaceID()  { return IID_ISTgcClusterBuilderTool; } 
-    
+  
   public:    // interface methods
     
+    //
+    // build clusters having as input the hashId of the collection, the
+    // resolution of the single channel, and the vector of firing strips
+    //
     virtual StatusCode getClusters(std::vector<Muon::sTgcPrepData>& stripsVect, 
-				   std::vector<Muon::sTgcPrepData>& clustersVect)=0;
+				   std::vector<Muon::sTgcPrepData*>& clustersVect)=0;
     
   };
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx
index 18182fcf4fde401fb56f0b4e8d89e41976b3da28..a56b8e4fa423548dd6740501216571800172f2d0 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx
@@ -1,10 +1,14 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 #include "SimpleSTgcClusterBuilderTool.h"
 #include "MuonPrepRawData/sTgcPrepData.h"
 
+#include <set>
+#include <vector>
+
 using namespace Muon;
+using namespace std;
 
 Muon::SimpleSTgcClusterBuilderTool::SimpleSTgcClusterBuilderTool(const std::string& t,
 								 const std::string& n,
@@ -25,6 +29,9 @@ Muon::SimpleSTgcClusterBuilderTool::~SimpleSTgcClusterBuilderTool()
 StatusCode Muon::SimpleSTgcClusterBuilderTool::initialize()
 {
 
+  ATH_CHECK(detStore()->retrieve(m_muonMgr));  
+  m_stgcIdHelper = m_muonMgr->stgcIdHelper();
+
   return StatusCode::SUCCESS;
 }
 
@@ -34,15 +41,198 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::finalize()
 
   return StatusCode::SUCCESS;
 }
-
+//
+// Build the clusters given a vector of single-hit PRD
+//
 StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTgcPrepData>& stripsVect, 
-							   std::vector<Muon::sTgcPrepData>& clustersVect)
-
+							   std::vector<Muon::sTgcPrepData*>& clustersVect)
 {
 
   ATH_MSG_DEBUG("Size of the input vector: " << stripsVect.size()); 
-  ATH_MSG_DEBUG("Size of the output vector: " << clustersVect.size()); 
-
 
+  //
+  // define the identifier hash
+  IdentifierHash hash;
+
+  double resolution=0.;
+  bool isWire = false;
+  if ( stripsVect.size()>0 ) {
+    resolution = stripsVect.at(0).localCovariance()(0,0);
+    Identifier chanId = stripsVect.at(0).identify();
+    if ( m_stgcIdHelper->channelType(chanId)==2 ) isWire = true;
+    ATH_MSG_DEBUG("isWire: " << isWire << "Single channel resolution: " << resolution);
+  }
+  else {
+    ATH_MSG_DEBUG("Size of the channel vectors is zero");
+    return StatusCode::SUCCESS;
+  } 
+  // clear the clusters vector
+  for ( unsigned int multilayer =0 ; multilayer<3 ; ++multilayer ) {
+    for ( unsigned int gasGap=0 ; gasGap<5 ; ++gasGap ) {
+      m_clusters[multilayer][gasGap].clear();   
+      m_clustersStripNum[multilayer][gasGap].clear();
+    }
+  }
+
+  for ( auto& it : stripsVect ) {
+    if ( !addStrip(it) ) {
+      ATH_MSG_ERROR("Could not add a strip to the sTGC clusters");
+      return StatusCode::FAILURE;
+    }
+  } 
+
+  // now add the clusters to the PRD container
+  //
+  clustersVect.clear();
+
+  for ( unsigned int multilayer =0 ; multilayer<3 ; ++multilayer ) {
+    for ( unsigned int gasGap=0 ; gasGap<5 ; ++gasGap ) {
+      //
+      // loop on the clusters of that gap
+      //
+      for ( unsigned int i=0 ; i<m_clusters[multilayer][gasGap].size() ; ++i ) { 
+        // get the cluster
+        std::vector<Muon::sTgcPrepData> const &cluster = m_clusters[multilayer][gasGap].at(i);
+        //
+        // loop on the strips and set the cluster weighted position and charge
+        //
+        std::vector<Identifier> rdoList;
+        Identifier clusterId;
+        double weightedPosX = 0.0;
+        double posY = (cluster.at(0)).localPosition().y();
+
+        double maxCharge = -1.0;
+        double totalCharge  = 0.0;
+        for ( auto it : cluster ) {
+          rdoList.push_back(it.identify());
+          double weight = 0.0;
+          isWire ? weight = 1.0 : weight = it.charge(); 
+          ATH_MSG_DEBUG("isWire: " << isWire << " weight: " << weight);
+          weightedPosX += it.localPosition().x()*weight;
+          totalCharge += weight;
+          ATH_MSG_DEBUG("Channel local position and charge: " << it.localPosition().x() << " " << it.charge() );
+          //
+          // Set the cluster identifier to the max charge strip
+          //
+          if ( isWire ) {
+            clusterId = it.identify();
+          }
+          if ( !isWire && it.charge()>maxCharge ) {
+            maxCharge = it.charge();
+            clusterId = it.identify();
+          } 
+        } 
+        weightedPosX = weightedPosX/totalCharge;
+        Amg::Vector2D localPosition(weightedPosX,posY);        
+        //
+        // get the error on the cluster position
+        //
+        double sigmaSq = 0.0;
+        ATH_MSG_DEBUG("Cluster size: " << cluster.size());
+        if ( cluster.size() > 1 ) {
+          double weight = 0.0;
+          for ( auto it : cluster ) {
+            isWire ? weight = 1.0 : weight = it.charge(); 
+            ATH_MSG_DEBUG("isWire: " << isWire << " weight: " << weight);
+            //sigmaSq += weight*(it.localPosition().x()-weightedPosX)*(it.localPosition().x()-weightedPosX);
+            sigmaSq += weight*weight*resolution;
+            ATH_MSG_DEBUG(">>>> posX: " << it.localPosition().x() << " weightedPosX: " << weightedPosX); 
+          } 
+        }
+        else {
+          sigmaSq = resolution;
+        }
+        sigmaSq = sigmaSq/(totalCharge*totalCharge*12);
+        ATH_MSG_DEBUG("Uncertainty on cluster position is: " << sqrt(sigmaSq));         
+        Amg::MatrixX* covN = new Amg::MatrixX(1,1);
+        (*covN)(0,0) = sigmaSq;
+
+        //
+        // memory allocated dynamically for the PrepRawData is managed by Event Store in the converters
+        //
+        sTgcPrepData* prdN = new sTgcPrepData(clusterId,hash,localPosition,
+            rdoList, covN, cluster.at(0).detectorElement());
+        clustersVect.push_back(prdN);   
+      }
+    }
+  }
+
+  ATH_MSG_DEBUG("Size of the output cluster vector: " << clustersVect.size());
   return StatusCode::SUCCESS;
 }
+
+
+bool Muon::SimpleSTgcClusterBuilderTool::addStrip(Muon::sTgcPrepData& strip)
+{
+
+  Identifier prd_id = strip.identify();
+  int channelType = m_stgcIdHelper->channelType(prd_id);
+  int multilayer = m_stgcIdHelper->multilayer(prd_id);
+  int gasGap = m_stgcIdHelper->gasGap(prd_id);
+  unsigned int stripNum = m_stgcIdHelper->channel(prd_id);
+
+  ATH_MSG_DEBUG(">>>>>>>>>>>>>> In addStrip: channelType, multilayer, gasGap, stripNum: " << channelType 
+      << " " << multilayer << " " 
+      << gasGap << " " << stripNum);
+  
+  // if no cluster is present start creating a new one
+  if ( m_clustersStripNum[multilayer][gasGap].size()==0 ) {
+
+    ATH_MSG_DEBUG( ">>> No strip present in this gap: adding it as first cluster " );
+    set<unsigned int> clusterStripNum;
+    vector<Muon::sTgcPrepData> cluster;
+
+    clusterStripNum.insert(stripNum);
+    cluster.push_back(strip);
+
+    std::vector<std::set<unsigned int>> &clustersStripNum = m_clustersStripNum[multilayer][gasGap];
+    std::vector<std::vector<Muon::sTgcPrepData>> &clusters = m_clusters[multilayer][gasGap];
+
+    clustersStripNum.emplace_back();
+    clustersStripNum.back().insert(stripNum);
+    clusters.emplace_back();
+    clusters.back().push_back(strip);
+
+    return true;
+  }
+  else {
+    //
+    // check if the strip can be added to a cluster
+    //
+    for ( unsigned int i=0 ; i<m_clustersStripNum[multilayer][gasGap].size() ; ++i  ) {
+
+      set<unsigned int> &clusterStripNum = m_clustersStripNum[multilayer][gasGap].at(i);
+
+      unsigned int firstStrip = *(clusterStripNum.begin());
+      unsigned int lastStrip  = *(--clusterStripNum.end());
+
+      ATH_MSG_DEBUG("First strip and last strip are: " << firstStrip << " " << lastStrip);
+      if ( stripNum==lastStrip+1 || stripNum==firstStrip-1 ) {
+
+        ATH_MSG_DEBUG(">> inserting a new strip");
+	m_clustersStripNum[multilayer][gasGap].at(i).insert(stripNum);
+	m_clusters[multilayer][gasGap].at(i).push_back(strip);
+
+        ATH_MSG_DEBUG("size after inserting is: " << m_clustersStripNum[multilayer][gasGap].at(i).size());
+        ATH_MSG_DEBUG("and the first and last strip are: " 
+          << *(m_clustersStripNum[multilayer][gasGap].at(i).begin()) << " "  
+          << *(--m_clustersStripNum[multilayer][gasGap].at(i).end())); 
+	return true;
+      }
+    }
+    // if not, build a new cluster starting from it
+    //
+    set<unsigned int> clusterStripNum;
+    vector<Muon::sTgcPrepData> cluster;
+        
+    clusterStripNum.insert(stripNum);
+    cluster.push_back(strip);
+
+    m_clustersStripNum[multilayer][gasGap].push_back(clusterStripNum);
+    m_clusters[multilayer][gasGap].push_back(cluster);
+
+    return true;
+  }
+
+  return false;
+}
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h
index 79fb02528ea05c50e9f9ed225e1b7305e61433a6..da430f181b7aba24d9df2047f25c5fd1cf689df6 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h
@@ -7,8 +7,19 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "STgcClusterization/ISTgcClusterBuilderTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
+
+#include <vector>
+#include <set>
+
+class sTgcIdHelper;
+namespace MuonGM
+{
+  class MuonDetectorManager;
+}
+
+
 //
-// Simple clusterization tool for MicroMegas
+// Simple clusterization tool for STgc
 //
 namespace Muon
 {
@@ -18,6 +29,7 @@ namespace Muon
   class SimpleSTgcClusterBuilderTool : virtual public ISTgcClusterBuilderTool, public AthAlgTool {
 
   public:
+
     /** Default constructor */
     SimpleSTgcClusterBuilderTool(const std::string&, const std::string&, const IInterface*);
     
@@ -31,14 +43,23 @@ namespace Muon
     virtual StatusCode finalize();
 
     StatusCode getClusters(std::vector<Muon::sTgcPrepData>& stripsVect, 
-			   std::vector<Muon::sTgcPrepData>& clustersVect);
+			   std::vector<Muon::sTgcPrepData*>& clustersVect);
 
   private: 
   
+    /// Muon detector manager and helper
+    const MuonGM::MuonDetectorManager* m_muonMgr;
+    const sTgcIdHelper* m_stgcIdHelper;
+
+    std::vector<std::set<unsigned int>> m_clustersStripNum[3][5];
+    std::vector<std::vector<Muon::sTgcPrepData>> m_clusters[3][5];
 
+    bool addStrip(Muon::sTgcPrepData& strip);
 
-};
+
+  };
 
 
 }
 #endif
+
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepData.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepData.h
index dbc77dd42305b6d8aedb000e76978c44e18617c1..7c9465d759a37478cadcb87b84c20fefce38b637 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepData.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepData.h
@@ -84,10 +84,10 @@ namespace Muon
     int charge() const;
 
     /** @brief Returns the microTPC angle */
-    int angle() const;
+    double angle() const;
 
     /** @brief Returns the microTPC chisq Prob. */
-    int chisqProb() const;
+    double chisqProb() const;
 
     /** @brief Dumps information about the PRD*/
     MsgStream&    dump( MsgStream&    stream) const;
@@ -135,12 +135,12 @@ namespace Muon
     return m_charge;
   }
 
-  inline int MMPrepData::angle() const 
+  inline double MMPrepData::angle() const 
   {
     return m_angle;
   }
 
-  inline int MMPrepData::chisqProb() const 
+  inline double MMPrepData::chisqProb() const 
   {
     return m_chisqProb;
   }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataCollection.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataCollection.h
index c79206b3ce795bdfc7ffb93ab7d683eb6a2d7b8c..a0d67a2399da58ded0e9f9998be252bd7cc256f6 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataCollection.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataCollection.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataContainer.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataContainer.h
index 987803f6597267c3ef3211c4b03e1a5db93de736..d7b8e8688fbc23e239b0b55f28bb633be37853d4 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataContainer.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MMPrepDataContainer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h
index 7846ba76202cac0ed426a3ae2a5585c8d0113f7b..0201e2a8bc4f5ba18571d092aa3c9439113255d8 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepData.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUONPREPRAWDATA_STGCPREPDATA_H
@@ -53,6 +53,7 @@ namespace Muon
 		  const Amg::MatrixX* locErrMat,
 		  const MuonGM::sTgcReadoutElement* detEl,
 		  const int charge = 0,
+		  const int time   = 0,
 		  const uint16_t bcBitMap=0);
 
 
@@ -76,6 +77,7 @@ namespace Muon
     /** @brief Returns the bcBitMap of this PRD
 	bit2 for Previous BC, bit1 for Current BC, bit0 for Next BC */
     int charge() const;
+    int time() const;
     uint16_t getBcBitMap() const;
     enum {BCBIT_UNDEFINED=0, BCBIT_NEXT=1, BCBIT_CURRENT=2, BCBIT_PREVIOUS=4};
 
@@ -84,6 +86,7 @@ namespace Muon
     /** Cached pointer to the detector element - should never be zero.*/
     const MuonGM::sTgcReadoutElement* m_detEl;
     int m_charge;
+    int m_time;
     uint16_t m_bcBitMap;
 
   };
@@ -106,6 +109,11 @@ namespace Muon
     return m_charge;
   }
 
+  inline int sTgcPrepData::time() const
+  {
+    return m_time;
+  }
+
   inline uint16_t sTgcPrepData::getBcBitMap() const
   {
     return m_bcBitMap;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataCollection.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataCollection.h
index 1231b08777d3d3e3537f8b1a76db705f484f99ad..85d0578bab24687751ad2a9a9bb43b238d02b66a 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataCollection.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataCollection.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataContainer.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataContainer.h
index f87d36624fee8c3a27566d1a270cf102edf8a258..73181498534e64de38ee3d3167a77ea8d6b747f8 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataContainer.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/sTgcPrepDataContainer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx
index 851b306fb4c0e2c3715d9d7bbab1657b2a995b9a..875dd19598e90392a1ebefb4397a6fa8a872d1fb 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MMPrepData.cxx
@@ -20,8 +20,8 @@ namespace Muon
     m_detEl(detEl),
     m_time(time),
     m_charge(charge),
-    m_angle(0),
-    m_chisqProb(0)
+    m_angle(0.0),
+    m_chisqProb(0.0)
   { }
 
   MMPrepData::MMPrepData( const Identifier& RDOId,
@@ -34,8 +34,8 @@ namespace Muon
     m_detEl(detEl),
     m_time(0),
     m_charge(0),
-    m_angle(0),
-    m_chisqProb(0)
+    m_angle(0.0),
+    m_chisqProb(0.0)
   { }
 
   // Destructor:
@@ -50,8 +50,8 @@ namespace Muon
     m_detEl(0),
     m_time(0),
     m_charge(0),
-    m_angle(0),
-    m_chisqProb(0)
+    m_angle(0.0),
+    m_chisqProb(0.0)
   { }
 
   //copy constructor:
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx
index c284a3cff173628a8d33325266f93c176064df7d..4d43f3ebece00f8fb52362d275416f1190725843 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/sTgcPrepData.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MuonPrepRawData/sTgcPrepData.h"
@@ -15,10 +15,12 @@ namespace Muon
 			      const Amg::MatrixX* locErrMat,
 			      const MuonGM::sTgcReadoutElement* detEl,
                               const int charge,
+                              const int time, 
 			      const uint16_t bcBitMap ) :
     MuonCluster(RDOId, idDE, locpos, rdoList, locErrMat), //call base class constructor
     m_detEl(detEl),
     m_charge(charge),
+    m_time(time),
     m_bcBitMap(bcBitMap)
   { }
 
@@ -34,6 +36,7 @@ namespace Muon
     MuonCluster(),
     m_detEl(0),
     m_charge(0),
+    m_time(0),
     m_bcBitMap(0)
   { }
 
@@ -42,6 +45,7 @@ namespace Muon
     MuonCluster(RIO),
     m_detEl( RIO.m_detEl ),
     m_charge( RIO.m_charge ),
+    m_time(RIO.m_time),
     m_bcBitMap( RIO.m_bcBitMap )
   { }
 
@@ -50,6 +54,7 @@ namespace Muon
     MuonCluster(std::move(RIO)),
     m_detEl( RIO.m_detEl ),
     m_charge( RIO.m_charge ),
+    m_time(RIO.m_time),
     m_bcBitMap( RIO.m_bcBitMap )
   { }
 
@@ -62,6 +67,7 @@ namespace Muon
 	MuonCluster::operator=(RIO);
 	m_detEl =  RIO.m_detEl ;
         m_charge = RIO.m_charge;
+        m_time = RIO.m_time;
 	m_bcBitMap = RIO.m_bcBitMap;
       }
     return *this;
@@ -77,6 +83,7 @@ namespace Muon
 	MuonCluster::operator=(std::move(RIO));
 	m_detEl =  RIO.m_detEl ;
         m_charge = RIO.m_charge;
+        m_time = RIO.m_time;
 	m_bcBitMap = RIO.m_bcBitMap;
       }
     return *this;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py
index 263ea462191513d4f6abf261c67f4a22d5cb0827..21418729b1ad7fcd6a663dcc55115fc0c57ed8b2 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py
@@ -103,10 +103,11 @@ if rec.doTruth() and DetFlags.makeRIO.Muon_on():
    topSequence.MuonTruthDecorationAlg.MCTruthClassifier = CfgGetter.getPublicTool("MCTruthClassifier")
 
    try:
-       from RecExConfig.InputFilePeeker import inputFileSummary
-       truthStrategy = inputFileSummary['metadata']['/Simulation/Parameters']['TruthStrategy']
+       from PyUtils.MetaReaderPeeker import metadata
+       truthStrategy = metadata['TruthStrategy']
        if truthStrategy in ['MC15','MC18','MC18LLP']:
-           topSequence.MuonTruthDecorationAlg.BarcodeOffset=10000000
+           topSequence.MuonTruthDecorationAlg.BarcodeOffset = 10000000
+
    except:
        print "Failed to read /Simulation/Parameters/ metadata"
        pass
@@ -147,10 +148,10 @@ if muonRecFlags.doStandalone():
             topSequence.MuonStandaloneDetailedTrackTruthMaker.doNSW=True
 
         try:
-            from RecExConfig.InputFilePeeker import inputFileSummary
-            truthStrategy = inputFileSummary['metadata']['/Simulation/Parameters']['TruthStrategy']
-            if truthStrategy in ['MC15','MC18','MC18LLP']:
-                topSequence.MuonSegmentTruthAssociationAlg.BarcodeOffset=10000000
+            from PyUtils.MetaReaderPeeker import metadata
+            truthStrategy = metadata['TruthStrategy']
+            if truthStrategy in ['MC15', 'MC18', 'MC18LLP']:
+                topSequence.MuonSegmentTruthAssociationAlg.BarcodeOffset = 10000000
         except:
             print "Failed to read /Simulation/Parameters/ metadata"
             pass
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonSystemExtensionTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonSystemExtensionTool.cxx
index 791bbb324f86bd9afc499929c782765d3374cf99..93753d7a9faa25e48ea966959ea896e498f583a0 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonSystemExtensionTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonSystemExtensionTool.cxx
@@ -25,8 +25,8 @@ namespace Muon {
   MuonSystemExtensionTool::MuonSystemExtensionTool(const std::string& type, const std::string& name, const IInterface* parent):
     AthAlgTool(type,name,parent),
     m_idHelper("Muon::MuonIdHelperTool/MuonIdHelperTool"),
-    m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
-    m_extrapolator("Trk::Extrapolator/AtlasExtrapolator")
+    m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this),
+    m_extrapolator("Trk::Extrapolator/AtlasExtrapolator", this)
   {
     declareInterface<IMuonSystemExtensionTool>(this);
 
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CSCMon_jobOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CSCMon_jobOptions.py
index 6abc9037e68c04b372cb14620fdc7923aa1b35b0..e73685c547c660256f86b088e556f5b76279afc4 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CSCMon_jobOptions.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/share/CSCMon_jobOptions.py
@@ -110,12 +110,13 @@ OutputFile = 'Monitoring.CSC.root'
 
 myc = 0
 if 1:
-  isdata = inputFileSummary['evt_type'][0]
+  from PyUtils.MetaReaderPeeker import metadata
+  isdata = metadata['eventTypes'][0]
   isdata = isdata.replace('IS_','')
-  runno = inputFileSummary['run_number'][0]
-  streamname = inputFileSummary['stream_names'][0]
+  runno = metadata['runNumbers'][0]
+  streamname = metadata['processingTags'][0]
   streamname = streamname.replace('Stream','')
-  events = inputFileSummary['nentries']
+  events = metadata['nentries']
   OutputFile = 'Monitoring.CSC.'+isdata.lower()+'.'+str(runno)+'.'+streamname.lower()+'.'+str(events)+'.root'
 
 
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonSegmMonitoring/share/CSCSegmMon_topOptions.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonSegmMonitoring/share/CSCSegmMon_topOptions.py
index ad623a8aea7e8995522181f032475f84ef3e7338..1cb2cbe0f117946d6e7da85b0b8188e0fe125343 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonSegmMonitoring/share/CSCSegmMon_topOptions.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonSegmMonitoring/share/CSCSegmMon_topOptions.py
@@ -113,12 +113,13 @@ OutputFile = 'Monitoring.CSC.root'
 
 myc = 0
 if 1:
-  isdata = inputFileSummary['evt_type'][0]
+  from PyUtils.MetaReaderPeeker import metadata
+  isdata = metadata['eventTypes'][0]
   isdata = isdata.replace('IS_','')
-  runno = inputFileSummary['run_number'][0]
-  streamname = inputFileSummary['stream_names'][0]
+  runno = metadata['runNumbers'][0]
+  streamname = metadata['processingTags'][0]
   streamname = streamname.replace('Stream','')
-  events = inputFileSummary['nentries']
+  events = metadata['nentries']
   OutputFile = 'Monitoring.CSC.'+isdata.lower()+'.'+str(runno)+'.'+streamname.lower()+'.'+str(events)+'.root'
 
 
diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/CMakeLists.txt
index c78c4ca2213f8d83a5a34e39bdf396ad962a2406..5899d6b564e469bebd8895ab8d6b9ee4127bb869 100644
--- a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/CMakeLists.txt
+++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/CMakeLists.txt
@@ -57,7 +57,7 @@ if( NOT XAOD_STANDALONE )
     SOURCES test/ut_HFORTools_test.cxx
     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
     LINK_LIBRARIES ${Boost_LIBRARIES} ${GTEST_LIBRARIES} POOLRootAccess AthenaBaseComps GaudiKernel HFORToolsLib
-    PROPERTIES TIMEOUT 300 )
+    PROPERTIES TIMEOUT 600 )
 endif()
 
 # Install files from the package:
diff --git a/PhysicsAnalysis/AnalysisCommon/ReweightUtils/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/ReweightUtils/CMakeLists.txt
index b81c6e318479196bc6828f3e726394b4a9e6059e..fef3b0bbf832a900b0703b685fbc0c839fa25355 100644
--- a/PhysicsAnalysis/AnalysisCommon/ReweightUtils/CMakeLists.txt
+++ b/PhysicsAnalysis/AnalysisCommon/ReweightUtils/CMakeLists.txt
@@ -70,7 +70,7 @@ atlas_add_test( ut_ParticleScaleFactorTool_test
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AsgAnalysisInterfaces
    PATInterfaces xAODEgamma CxxUtils
-   PROPERTIES TIMEOUT 300 )
+   PROPERTIES TIMEOUT 600 )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.cxx
index e202d2c939ec323723a21190fd4cba13b085eace..9b456ec06c209182deee3013a2b6094f7e137451 100755
--- a/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.cxx
+++ b/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /* 
@@ -32,7 +32,7 @@ namespace D3PD{
       m_tilehwid(0),
       m_cabling(0),
       m_tileBadChanTool("TileBadChanTool"),
-      m_run2(false),
+      m_run2plus(false),
       m_notRealE1run2{{}}
     {
         declareProperty("SaveCellDetails",    m_saveCellDetails = true);
@@ -54,12 +54,12 @@ namespace D3PD{
       CHECK( detStore->retrieve(m_tilehwid) );
       CHECK( m_tileBadChanTool.retrieve() );
       m_cabling = TileCablingService::getInstance();
-      m_run2 = m_cabling->isRun2Cabling();
+      m_run2plus = m_cabling->isRun2PlusCabling();
 
-      if (m_run2) {
+      if (m_run2plus) {
         for (int ros = 3; ros < 5; ++ros) {
           for (int drawer = 0; drawer < 64; ++drawer) {
-            int drawer2 = m_cabling->E1_merged_with_run2(ros, drawer);
+            int drawer2 = m_cabling->E1_merged_with_run2plus(ros, drawer);
             m_notRealE1run2[ros - 3][drawer2] = (drawer2 != 0);
           }
         }
@@ -135,7 +135,7 @@ namespace D3PD{
                     if ( log.level() < MSG::DEBUG ) log << MSG::VERBOSE << " adc_id1 " << m_tilehwid->to_string(adc_id) << " hash " << hash1 << " " << gain1 << endmsg;
                     partition = m_tilehwid->ros(adc_id);
                     chan1 = m_tilehwid->channel(adc_id);
-                    if (m_run2 && partition > 2 && chan1 == E1_CHANNEL && m_notRealE1run2[partition - 3][module]) chan1 = -E1_CHANNEL;
+                    if (m_run2plus && partition > 2 && chan1 == E1_CHANNEL && m_notRealE1run2[partition - 3][module]) chan1 = -E1_CHANNEL;
                     pmt1  = m_cabling->channel2hole(partition,chan1);
                     bad1 = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(adc_id));
                 }
diff --git a/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.h b/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.h
index 37b85a11c38e6217491a4bca0caddff98ba026bf..8e34e1ec17f44e65d57798d95c0066eeacbef963 100755
--- a/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.h
+++ b/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/TileCellDetailsFillerTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /* 
@@ -65,7 +65,7 @@ namespace D3PD {
         bool m_saveCellDetails; //switching on/off cell details storage
         bool m_savePosition; // switching on/off cell position storage
 
-        bool m_run2;
+        bool m_run2plus;
 
         // variables to be in ntuple.
         
diff --git a/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/CMakeLists.txt
index 594862a177e0d5d57e73395239f349613991c43a..acedec855391e8672e1f08a5e695eddc6df3e32c 100644
--- a/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/CMakeLists.txt
@@ -15,7 +15,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/AthenaKernel
                           Control/Navigation
-                          Control/SGTools
                           Control/StoreGate
                           DetectorDescription/Identifier
                           Event/EventKernel
@@ -42,7 +41,7 @@ atlas_add_component( JetD3PDMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} TrigCaloEvent CaloEvent CaloGeoHelpers CaloIdentifier AthenaBaseComps AthenaKernel Navigation SGTools StoreGateLib SGtests Identifier EventKernel FourMomUtils GaudiKernel AnalysisTriggerEvent D3PDMakerUtils TriggerD3PDMakerLib JetTagEvent JetTagInfo JetEvent Particle TileConditionsLib TileEvent TileIdentifier VxVertex )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} TrigCaloEvent CaloEvent CaloGeoHelpers CaloIdentifier AthenaBaseComps AthenaKernel Navigation StoreGateLib SGtests Identifier EventKernel FourMomUtils GaudiKernel AnalysisTriggerEvent D3PDMakerUtils TriggerD3PDMakerLib JetTagEvent JetTagInfo JetEvent Particle TileConditionsLib TileEvent TileIdentifier VxVertex )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetL2TriggerObjectAssociationTool.cxx b/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetL2TriggerObjectAssociationTool.cxx
index d1d942070f853a43e577761f4de742bc0799cf9f..169bb43f35b5333ded7139caca47701e00e61c06 100644
--- a/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetL2TriggerObjectAssociationTool.cxx
+++ b/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetL2TriggerObjectAssociationTool.cxx
@@ -1,7 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -14,7 +14,7 @@
 
 
 #include "JetL2TriggerObjectAssociationTool.h"
-#include "SGTools/BaseInfo.h"
+#include "AthenaKernel/BaseInfo.h"
 
 
 SG_ADD_BASE(TrigT2Jet, SG_VIRTUAL(INavigable4Momentum));
diff --git a/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetSignalStateFillerTool.h b/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetSignalStateFillerTool.h
index 2f443395f5cbb9c54454d7fed0e9bb06e52b0451..8a3a0331d6cdc9a4dbe8438f5453267b0080b909 100644
--- a/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetSignalStateFillerTool.h
+++ b/PhysicsAnalysis/D3PDMaker/JetD3PDMaker/src/JetSignalStateFillerTool.h
@@ -1,7 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -42,7 +42,7 @@ namespace D3PD {
  * So the default settings give (pt, eta, phi, m).
  *
  * FIXME: This tool really should be taking @c I4Momentum as input.
- * But the @c INavigable4Momentum bases haven't been declared to SGTools,
+ * But the @c INavigable4Momentum bases haven't been declared to BaseInfo,
  * so we can't convert from @c INavigable4Momentum to @c I4Momentum.
  * So we use @c INavigable4Momentum for now.
  */
diff --git a/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/CMakeLists.txt
index e45ae18c4b12da52de7f0f6c10b741aa0f8577fa..0f4804cad9d0e59a883fe3bf36ee3d4d6deb2ed6 100644
--- a/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/CMakeLists.txt
@@ -20,7 +20,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Reconstruction/Particle
                           PRIVATE
                           Control/AthenaKernel
-                          Control/SGTools
                           Event/FourMomUtils
                           Event/xAOD/xAODMissingET
                           Reconstruction/MuonIdentification/muonEvent
@@ -36,7 +35,7 @@ atlas_add_component( MissingETD3PDMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent StoreGateLib SGtests EventKernel GaudiKernel D3PDMakerUtils JetEvent MissingETEvent MissingETGoodnessLib MissingETPerformanceLib Particle AthenaKernel SGTools FourMomUtils xAODMissingET muonEvent egammaEvent tauEvent )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent StoreGateLib SGtests EventKernel GaudiKernel D3PDMakerUtils JetEvent MissingETEvent MissingETGoodnessLib MissingETPerformanceLib Particle AthenaKernel FourMomUtils xAODMissingET muonEvent egammaEvent tauEvent )
 
 # Install files from the package:
 atlas_install_headers( MissingETD3PDMaker )
diff --git a/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/src/MissingETInheritance.cxx b/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/src/MissingETInheritance.cxx
index 4c88305c21f0a33987851a7c25f1c58cc9bf981a..a32de27b1424cdeee6aa3cb6902f6e02cf5b5e32 100644
--- a/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/src/MissingETInheritance.cxx
+++ b/PhysicsAnalysis/D3PDMaker/MissingETD3PDMaker/src/MissingETInheritance.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -14,7 +14,7 @@
 
 
 #include "MissingETEvent/MissingEtCalo.h"
-#include "SGTools/BaseInfo.h"
+#include "AthenaKernel/BaseInfo.h"
 
 
 SG_ADD_BASE (MissingEtCalo, MissingET);
diff --git a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/CMakeLists.txt
index 14f094f0a7f4aa99ba6d5e878b0ede91aa668b0e..dbadc55323ce2cd7b692144d5e294c7334bf9af7 100644
--- a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/CMakeLists.txt
@@ -9,9 +9,7 @@ atlas_subdir( MuonD3PDMaker )
 atlas_depends_on_subdirs( PRIVATE
                           Control/AthenaBaseComps
                           Control/AthenaKernel
-                          Control/CxxUtils
                           Control/AthContainers
-                          Control/SGTools
                           Control/StoreGate
                           DetectorDescription/AtlasDetDescr
                           Event/EventInfo
@@ -59,7 +57,7 @@ atlas_add_component( MuonD3PDMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils AthContainers SGTools StoreGateLib SGtests AtlasDetDescr EventInfo EventKernel FourMomUtils xAODMuon xAODTracking xAODTruth GaudiKernel MuonCalibITools MuonIdHelpersLib MuonPattern MuonPrepRawData MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonSimEvent AnalysisTriggerEvent D3PDMakerUtils TriggerD3PDMakerLib MCTruthClassifierLib McParticleEvent muonEvent TrkGeometry TrkEventPrimitives TrkPrepRawData TrkSegment TrkTrackSummary TrkTruthData TrkExInterfaces TrkToolInterfaces TrigObjectMatchingLib TrigInDetEvent TrigMuonEvent )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers StoreGateLib SGtests AtlasDetDescr EventInfo EventKernel FourMomUtils xAODMuon xAODTracking xAODTruth GaudiKernel MuonCalibITools MuonIdHelpersLib MuonPattern MuonPrepRawData MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonSimEvent AnalysisTriggerEvent D3PDMakerUtils TriggerD3PDMakerLib MCTruthClassifierLib McParticleEvent muonEvent TrkGeometry TrkEventPrimitives TrkPrepRawData TrkSegment TrkTrackSummary TrkTruthData TrkExInterfaces TrkToolInterfaces TrigObjectMatchingLib TrigInDetEvent TrigMuonEvent )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/ispellwords b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/ispellwords
index e0911aa139b46d10498b60ecbb45773705373c55..9d13622a60dd01fcb7b9e08177c22f1b945fa244 100644
--- a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/ispellwords
+++ b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/ispellwords
@@ -282,7 +282,6 @@ IncidentService
 AlgTool
 originalTrack
 TileTimingFillerTool
-SGTools
 elif
 TrackExtrapolatorToCalo
 AuditEndRun
diff --git a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonPatternCombinationMissedHitFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonPatternCombinationMissedHitFillerTool.cxx
index 37ba3caf4148d1421cca8907f2b2dfb57108b29d..6e21fd146b3502cfde65785ac14f5214fe04adba 100644
--- a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonPatternCombinationMissedHitFillerTool.cxx
+++ b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/MuonPatternCombinationMissedHitFillerTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 //////////////////////////////////////////////////////
@@ -20,7 +20,6 @@
 #include "MuonPrepRawData/MuonPrepDataContainer.h"
 #include "MuonPrepRawData/MuonPrepDataCollection.h"
 #include "MuonPattern/MuonPatternChamberIntersect.h"
-#include "CxxUtils/make_unique.h"
 
 
 using namespace std;
@@ -153,7 +152,7 @@ namespace D3PD {
       chambers.push_back(chIntersect);
     }
     //build the pattern combination
-    auto pattern = CxxUtils::make_unique<Muon::MuonPatternCombination>
+    auto pattern = std::make_unique<Muon::MuonPatternCombination>
       (new Trk::Perigee(patpos,patdir,1,patpos), chambers);
     pattern->setTrackRoadType(3);
 
diff --git a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/muonInheritance.cxx b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/muonInheritance.cxx
index cafc4bd8980208175349f9b5a9a3ff17d836e22b..a80b83d762bf58051da3d3255d5a7b1ce15541c5 100644
--- a/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/muonInheritance.cxx
+++ b/PhysicsAnalysis/D3PDMaker/MuonD3PDMaker/src/muonInheritance.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -17,7 +17,7 @@
 #include "TrigMuonEvent/CombinedMuonFeature.h"
 #include "AnalysisTriggerEvent/Muon_ROI.h"
 #include "EventKernel/INavigable4Momentum.h"
-#include "SGTools/BaseInfo.h"
+#include "AthenaKernel/BaseInfo.h"
 
 SG_ADD_BASE (TrigMuonEF,          SG_VIRTUAL(INavigable4Momentum));
 SG_ADD_BASE (CombinedMuonFeature, SG_VIRTUAL(INavigable4Momentum));
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt
index e69052ff965430987e6a6a0a53cdee8ab87e638d..3a91e562bc6c3263ebb730c280e877c05d742ba8 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/CMakeLists.txt
@@ -10,7 +10,6 @@ atlas_depends_on_subdirs( PRIVATE
                           Control/AthenaBaseComps
                           Control/AthenaKernel
                           Control/Navigation
-                          Control/SGTools
                           Event/EventInfo
                           Event/xAOD/xAODTruth
                           GaudiKernel
@@ -37,7 +36,7 @@ atlas_add_component( TruthD3PDMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel Navigation SGTools EventInfo xAODTruth GaudiKernel GeneratorObjects TruthUtils D3PDMakerUtils TruthD3PDAnalysisLib MCTruthClassifierLib McParticleEvent McParticleKernel JetEvent TrkToolInterfaces )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel Navigation EventInfo xAODTruth GaudiKernel GeneratorObjects TruthUtils D3PDMakerUtils TruthD3PDAnalysisLib MCTruthClassifierLib McParticleEvent McParticleKernel JetEvent TrkToolInterfaces )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/hepMCInheritance.cxx b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/hepMCInheritance.cxx
index 023c6a102692d2bd3a6e57af1146a6803af1f4b9..2853c8fe616896a3fba412d735a151e2937f621e 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/hepMCInheritance.cxx
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/hepMCInheritance.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -17,7 +17,7 @@
 #include "GeneratorObjects/McEventCollection.h"
 #include "Navigation/IAthenaBarCode.h"
 #include "HepMC/GenEvent.h"
-#include "SGTools/BaseInfo.h"
+#include "AthenaKernel/BaseInfo.h"
 
 SG_ADD_BASE (McEventCollection, DataVector<HepMC::GenEvent>);
 SG_ADD_BASE (TruthEtIsolationsContainer, DataVector<TruthEtIsolations>);
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..e708f37ce8b7be66d7f1795b3fca31fa35128861
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h
deleted file mode 100644
index db2f673b6bff18e482e10900adc06c2d5521540a..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// Dear emacs, this is -*-c++-*-
-
-#ifndef ELECTRONPHOTONSELECTORTOOLS_ASGELECTRONCHARGEIDSELECTORTOOL_H
-#define ELECTRONPHOTONSELECTORTOOLS_ASGELECTRONCHARGEIDSELECTORTOOL_H
-// Atlas includes
-#include "AsgTools/AsgTool.h"
-#include "PATCore/AcceptData.h"
-#include "MVAUtils/BDT.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronChargeIDSelectorTool.h"
-#include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
-#include <unordered_map>
-
-class AsgElectronChargeIDSelectorTool : public asg::AsgTool, 
-					virtual public IAsgElectronChargeIDSelectorTool
-{
-  ASG_TOOL_CLASS2(AsgElectronChargeIDSelectorTool, IAsgElectronChargeIDSelectorTool, CP::ISelectionTool)
-
-public:
-  /** Standard constructor */
-  AsgElectronChargeIDSelectorTool( const std::string myname);
-
-
-  /** Standard destructor */
-  virtual ~AsgElectronChargeIDSelectorTool();
-public:
-  /** Gaudi Service Interface method implementations */
-  virtual StatusCode initialize();
-
-  /** Gaudi Service Interface method implementations */
-  virtual StatusCode finalize();
-
-  /** Method to get the plain AcceptInfo.
-      This is needed so that one can already get the AcceptInfo 
-      and query what cuts are defined before the first object 
-      is passed to the tool. */
-  const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; }
-
-    // Main methods for IAsgSelectorTool interface
-  /** The main accept method: using the generic interface */
-  asg::AcceptData accept( const xAOD::IParticle* part ) const;
-
-  /** The main accept method: the actual cuts are applied here */
-  asg::AcceptData accept( const xAOD::Electron* eg ) const {
-    return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
-  }
-
-  /** The main accept method: the actual cuts are applied here */
-  asg::AcceptData accept( const xAOD::Egamma* eg ) const {
-    return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
-  }
-
-  /** The main accept method: in case mu not in EventInfo online */
-  asg::AcceptData accept( const xAOD::Electron* eg, double mu ) const;
-
-  /** The main accept method: in case mu not in EventInfo online */
-  asg::AcceptData accept( const xAOD::Egamma* eg, double mu ) const;
-  
-  // Main methods for IAsgCalculatorTool interface
-
-  /** The main result method: the actual likelihood is calculated here */
-  double calculate( const xAOD::IParticle* part ) const;
-
-  /** The main result method: the actual likelihood is calculated here */
-  double calculate( const xAOD::Electron* eg ) const {
-    return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
-  }
-
-  /** The main result method: the actual likelihood is calculated here */
-  double calculate( const xAOD::Egamma* eg ) const {
-    return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
-  }
-
-  /** The main result method: the actual likelihood is calculated here */
-  double calculate( const xAOD::Electron* eg, double mu ) const;
-
-  /** The main result method: the actual likelihood is calculated here */
-  double calculate( const xAOD::Egamma* eg, double mu ) const; 
-
-
-  /// Get the name of the current operating point
-  inline virtual std::string getOperatingPointName( ) const
-  // std::string AsgElectronChargeIDSelectorTool::getOperatingPointName() const
-  {    return m_WorkingPoint;  };
-  
-  // Private methods
-private:
-  /// Get the number of primary vertices
-  unsigned int getNPrimVertices() const;
-
-  //BDT instances for different ID operating points (Tight, Medium, Loose) and the vector corresponds to n-fold
-  const unsigned m_nfold  =1;
-  const unsigned m_bdt_index=0;
-  std::vector<MVAUtils::BDT*> m_v_bdts;
-
-  TString m_pid_name;
-  float m_cutOnBDT;
-
-  asg::AcceptInfo m_acceptInfo;
-  int m_cutPosition_bdt;
-
-  /** Working Point */
-  std::string m_WorkingPoint;
-
-  /// Whether to use the PV (not available for trigger)
-  bool m_usePVCont;
-
-  /// defualt nPV (when not using PVCont)
-  unsigned int m_nPVdefault;
-
-  /// The primary vertex container name
-  std::string m_primVtxContName;
-
-  /// The input ROOT file name that holds the PDFs
-  std::string m_trainingFile;
-
-  /// Flag for calo only LH
-  //bool m_caloOnly;
-
-  // BDT input variables
-  mutable std::unordered_map<std::string,float> m_map_inputs;
-  mutable std::vector<std::string> m_inputVars;
-
-  bool SetVariableRefs(std::vector<std::string> inputs, std::vector<float*> &inputPointers);
-
-}; // End: class definition
-
-
-
-
-
-#endif
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
index 809b4c30819790de7964f8083b12140996000177..bc85cb058afb3300220b1681e14792636b816c87 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
@@ -12,6 +12,5 @@
 #include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
 #include "ElectronPhotonSelectorTools/EGammaAmbiguityTool.h"
-#include "ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h"
 #include "ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h"
 #endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx
deleted file mode 100644
index f28f54b3974b7b215c9d2e7b4570e7d38f8ca31f..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
-   @class AsgElectronChargeIDSelectorTool
-   @brief Electron selector tool to select objects in Asgena using an underlying pure ROOT tool.
-
-   @author Karsten Koeneke
-   @date   October 2012
-
-   09-APR-2014, convert to ASGTool (Jovan Mitrevski)
-   22-AUG-2016, copied from AsgElectronLikelihoodTool (Kazuya Mochizuki)
-
-*/
-
-// Include this class's header
-#include "ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h"
-//#include "AsgElectronPhotonIsEMSelectorConfigHelper.h"
-//#include "EGSelectorConfigurationMapping.h"
-
-// STL includes
-#include <string>
-#include <cstdint>
-#include <cmath>
-
-//EDM includes
-#include "xAODEgamma/Electron.h"
-#include "xAODTracking/Vertex.h"
-#include "xAODTracking/VertexContainer.h"
-#include "xAODCaloEvent/CaloCluster.h"
-#include "TEnv.h"
-#include "TFile.h"
-#include "TObjString.h"
-#include "TObjArray.h"
-
-
-#include "PathResolver/PathResolver.h"
-
-
-//=============================================================================
-// Standard constructor
-//=============================================================================
-AsgElectronChargeIDSelectorTool::AsgElectronChargeIDSelectorTool(std::string myname) :
-  AsgTool(myname) ,
-  m_cutPosition_bdt(0)
-{
-  // Declare the needed properties
-  declareProperty("WorkingPoint",m_WorkingPoint="","The Working Point");
-  declareProperty("usePVContainer", m_usePVCont=true, "Whether to use the PV container");
-  declareProperty("nPVdefault", m_nPVdefault = 0, "The default number of PVs if not counted");
-  declareProperty("primaryVertexContainer", m_primVtxContName="PrimaryVertices", "The primary vertex container name" );
-  declareProperty("TrainingFile",  m_trainingFile="", "The input ROOT file name holding training" );
-  declareProperty("CutOnBDT",m_cutOnBDT=0,"Cut on BDT discriminant");
-  m_pid_name=myname.data();
-}
-
-
-//=============================================================================
-// Standard destructor
-//=============================================================================
-AsgElectronChargeIDSelectorTool::~AsgElectronChargeIDSelectorTool()
-{
-  if(finalize().isFailure()){
-    ATH_MSG_ERROR ( "Failure in AsgElectronChargeIDSelectorTool finalize()");
-  }
-  //delete m_rootTool;
-  for (auto bdt: m_v_bdts) if (bdt) delete bdt;
-}
-
-
-//=============================================================================
-// Asgena initialize method
-//=============================================================================
-StatusCode AsgElectronChargeIDSelectorTool::initialize()
-{
-  m_pid_name.ToLower();
-  if      (m_pid_name.Contains("recon") ) m_pid_name="recon" ;
-  else if (m_pid_name.Contains("loose") ) m_pid_name="loose" ;
-  else if (m_pid_name.Contains("medium")) m_pid_name="medium";
-  else if (m_pid_name.Contains("tight") ) m_pid_name="tight" ;
-  else {
-    m_pid_name="tight";
-    ATH_MSG_WARNING("PID menu was not recognized, using default PID menu: " << m_pid_name );
-  }
-  ATH_MSG_INFO("PID menu to use: " << m_pid_name );
-
-  std::string TrainingFile;
-  if (!m_trainingFile.empty()) {  //If the property was set by the user, take that.
-
-    //KM: below should be uncommented after the file is in the official place!!
-    TrainingFile= PathResolverFindCalibFile( m_trainingFile );
-    if(TrainingFile==""){//Error if it cant find the conf
-      ATH_MSG_ERROR("Could not locate " << m_trainingFile );
-      return StatusCode::FAILURE;
-    }
-    else ATH_MSG_INFO("trainingfile to use  " << TrainingFile );
-   
-  }
-  else {
-    ATH_MSG_ERROR("Could not find configuration file: \""<< m_trainingFile<<"\"");
-    return StatusCode::FAILURE;
-  }
-  
-  TFile* bdtfile = TFile::Open(TrainingFile.data());
-  if (!bdtfile) {
-    ATH_MSG_ERROR("Input file found to be empty!! "<< TrainingFile);
-    return StatusCode::FAILURE;
-  }
-
-  TObjArray* toa= (TObjArray*) bdtfile->Get("/ECIDS_"+m_pid_name+"/variables");
-  std::string commaSepVars="";
-  if (toa) {
-    TObjString *tos= 0;
-    if (toa->GetEntries()>0) tos= (TObjString*) toa->At(0);
-    commaSepVars=tos->GetString().Data();
-    ATH_MSG_INFO("Variables for ECIDS= "<<commaSepVars);
-  }
-  else ATH_MSG_FATAL("Training file does not contain a list of input variables");
-
-  //prepare m_inputVars
-  m_inputVars.clear();
-  while (commaSepVars.find(",")!=std::string::npos) {
-    m_inputVars.push_back(commaSepVars.substr(0,commaSepVars.find(",")));
-    commaSepVars.erase(0,commaSepVars.find(",")+1);
-  }
-  m_inputVars.push_back(commaSepVars.substr(0,-1));//push back the last element
-
-  std::vector<float*> inputPointers;  //KM: set pointers
-  for (unsigned i_fold=0; i_fold<m_nfold; i_fold++) {
-    TString treename="/ECIDS_"+m_pid_name+"/BDT";//=TString::Format("/CFK_tight/BDT_%do%d",i_fold,m_nfold);
-    //std::cout<<"Trying to access a ttree with name: "<<treename<<std::endl;
-    TTree* tree = (TTree*)bdtfile->Get(treename);
-    m_v_bdts.push_back(new MVAUtils::BDT(tree));
-    bool noBadVariableFound = true;
-    if (i_fold==0) noBadVariableFound = SetVariableRefs(m_inputVars,inputPointers);
-    if (!noBadVariableFound) {
-      std::cerr<<"\tUnknown input variable given, disabling the algorithm...."<<std::endl;
-      exit(1);
-      //KM: disabling feature to be implemented.
-    }
-    m_v_bdts.back()->SetPointers(inputPointers);
-  }
-  
-  ///-----------End of text config----------------------------
-
-  // Get the name of the current operating point, and massage the other strings accordingly
-  //ATH_MSG_VERBOSE( "Going to massage the labels based on the provided operating point..." );
-
-  m_cutPosition_bdt = m_acceptInfo.addCut( "bdt", "pass bdt" );
-
-  return StatusCode::SUCCESS ;
-}
-
-
-//=============================================================================
-// Asgena finalize method (now called by destructor)
-//=============================================================================
-StatusCode AsgElectronChargeIDSelectorTool::finalize()
-{
-  return StatusCode::SUCCESS;
-}
-
-//=============================================================================
-// The main accept method: the actual cuts are applied here 
-//=============================================================================
-asg::AcceptData AsgElectronChargeIDSelectorTool::accept( const xAOD::Electron* eg, double mu ) const
-{
-
-  double bdt = calculate(eg,mu);
-  
-  ATH_MSG_VERBOSE("\t accept( const xAOD::Electron* eg, double mu ), bdt="<<bdt);
-  
-  asg::AcceptData acceptData(&m_acceptInfo);
-  
-  acceptData.setCutResult(m_cutPosition_bdt, bdt > m_cutOnBDT);
-
-  return acceptData;
-}
-
-//=============================================================================
-// Accept method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly
-//=============================================================================
-asg::AcceptData AsgElectronChargeIDSelectorTool::accept( const xAOD::Egamma* eg, double mu) const
-{
-  double bdt = calculate(eg,mu);
-  
-  ATH_MSG_VERBOSE("\t accept( const xAOD::Egamma* eg, double mu ), bdt="<<bdt);
-  
-  asg::AcceptData acceptData(&m_acceptInfo);
-  
-  acceptData.setCutResult(m_cutPosition_bdt, bdt > m_cutOnBDT);
-
-  return acceptData;
-}
-
-//=============================================================================
-// The main result method: the actual likelihood is calculated here
-//=============================================================================
-double AsgElectronChargeIDSelectorTool::calculate( const xAOD::Electron* eg, double mu ) const
-{
-
-  ATH_MSG_VERBOSE("\t AsgElectronChargeIDSelectorTool::calculate( const xAOD::Electron* eg, double mu= "<<mu<<" )");
-
-  if ( !eg ) {
-    ATH_MSG_ERROR ("Failed, no egamma object.");
-    return -999;
-  }
-  
-  const xAOD::CaloCluster* cluster = eg->caloCluster();
-  if ( !cluster ) {
-    ATH_MSG_ERROR ("Failed, no cluster.");
-    return -999;
-  }  
-
-  const double energy =  cluster->e();
-  const float eta = cluster->etaBE(2); 
-  if ( fabs(eta) > 300.0 ) {
-    ATH_MSG_ERROR ("Failed, eta range.");
-    return -999;
-  }
-  
-  double et = 0.;// transverse energy of the electron (using the track eta) 
-  if (eg->trackParticle() )
-    et     = ( cosh(eg->trackParticle()->eta()) != 0.) ? energy/cosh(eg->trackParticle()->eta()) : 0.;
-  else et  = ( cosh(eta) != 0.) ? energy/cosh(eta) : 0.;
-  
-  
-  // number of track hits and other track quantities
-  uint8_t nSCT(0); 
-  // uint8_t nTRThigh(0); 
-  // uint8_t nTRThighOutliers(0); 
-  // uint8_t nTRT(0); 
-  // uint8_t nTRTOutliers(0);
-  // uint8_t nTRTXenon(0); 
-  float trackqoverp(0.0);
-  float trackqoverpsig(0.0);
-  int   charge(0.0);
-  int   lifeSign(0.0);
-  float trackchi2(0.0);
-  float d0(0.0);
-  float z0(0.0);
-  float phi0(0.0);
-  float theta(0.0);
-  float EoverP(0.0);
-  float d0sigma(0.0);
-  double dpOverp(0.0);
-  float TRT_PID(0.0);
-  //double trans_TRT_PID(0.0);
-  float deltaPhi1=0, deltaPhi2=0;
-  float deltaPhiFromLM=0;
-  float deltaPhiRescaled2=0;//deltaEta=0, 
-  //double rTRT(0.0);
-
-  TVector2 el_cluster; el_cluster.SetMagPhi(cluster->energyBE(2)/cosh(eta),cluster->phiBE(2));
-
-  bool allFound = true;
-  // retrieve associated TrackParticle
-  const xAOD::TrackParticle* t = eg->trackParticle();    
-  if (t) {
-    trackqoverp = t->qOverP();
-    charge= t->charge();
-    d0 = t->d0();
-    if(m_map_inputs.find("z0sinTheta"             )!= m_map_inputs.end()) {
-      z0 = t->z0();
-      theta = t->theta();
-    }
-    if(m_map_inputs.find("chi2oftrackfit"         )!= m_map_inputs.end())
-      trackchi2 = t->chiSquared();
-
-    phi0 = t->phi() + (d0>=0? M_PI/2 : -M_PI/2);
-    TVector2 d0_direction;	d0_direction.SetMagPhi(fabs(d0),phi0);
-    float inner_product = el_cluster.X()*d0_direction.X() + el_cluster.Y()*d0_direction.Y();
-    lifeSign = inner_product>=0? 1 : -1;
-	
-    EoverP   = energy * fabs(t->qOverP());
-    if(m_map_inputs.find("d0Err"                  )!= m_map_inputs.end() or
-       m_map_inputs.find("d0Sig"                  )!= m_map_inputs.end() ) {
-      float vard0 = t->definingParametersCovMatrix()(0,0);
-      if (vard0 > 0) {
-	d0sigma=sqrtf(vard0);
-      }
-    }
-    
-    const std::vector<float>&cov= t->definingParametersCovMatrixVec();
-    trackqoverpsig= cov[14];
-
-    if(m_map_inputs.find("nSctHits"               )!= m_map_inputs.end())
-      allFound = allFound && t->summaryValue(nSCT, xAOD::numberOfSCTHits);
-    // allFound = allFound && t->summaryValue(nTRThigh, xAOD::numberOfTRTHighThresholdHits);
-    // allFound = allFound && t->summaryValue(nTRThighOutliers, xAOD::numberOfTRTHighThresholdOutliers);
-    // allFound = allFound && t->summaryValue(nTRT, xAOD::numberOfTRTHits);
-    // allFound = allFound && t->summaryValue(nTRTOutliers, xAOD::numberOfTRTOutliers);
-    // allFound = allFound && t->summaryValue(nTRTXenon, xAOD::numberOfTRTXenonHits);
-    // allFound = allFound && t->summaryValue(TRT_PID, xAOD::eProbabilityHT);
-
-    //Transform the TRT PID output for use in the LH tool.
-    double fEpsilon = 1.0e-30;  // to avoid zero division
-    double pid_tmp = TRT_PID;
-    if (pid_tmp >= 1.0) pid_tmp = 1.0 - 1.0e-15;  //this number comes from TMVA
-    else if (pid_tmp <= fEpsilon) pid_tmp = fEpsilon;
-    // double tau = 15.0;
-    //trans_TRT_PID = - log(1.0/pid_tmp - 1.0)*(1./double(tau));
-
-    if(m_map_inputs.find("deltaPoverP"            )!= m_map_inputs.end()) {
-      unsigned int index;
-      if( t->indexOfParameterAtPosition(index, xAOD::LastMeasurement) ) {
-	
-	double refittedTrack_LMqoverp  = 
-	  t->charge() / sqrt(std::pow(t->parameterPX(index), 2) +
-			     std::pow(t->parameterPY(index), 2) +
-			     std::pow(t->parameterPZ(index), 2));
-	
-	dpOverp = 1 - trackqoverp/(refittedTrack_LMqoverp);
-      }
-    }
-	
-  }
-  else {
-    allFound=false;
-    ATH_MSG_WARNING ( "Failed, no track particle: et= " << et << "eta= " << eta );
-  }
-
-  float Rphi(0);//float Reta(0), Rphi(0),  Rhad1(0), Rhad(0), ws3(0), w2(0), f1(0), Eratio(0), f3(0);
-  allFound = allFound && eg->showerShapeValue(Rphi, xAOD::EgammaParameters::Rphi);// rphi e233/e237
-  // allFound = allFound && eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1);
-
-  // difference between the cluster phi (sampling 2) and the eta of the track extrapolated from the last measurement point.
-  allFound = allFound && eg->trackCaloMatchValue(deltaPhiRescaled2, xAOD::EgammaParameters::deltaPhiRescaled2);
-
-  if(m_map_inputs.find("deltaphi1"              )!= m_map_inputs.end())
-    allFound = allFound && eg->trackCaloMatchValue(deltaPhi1, xAOD::EgammaParameters::deltaPhi1);
-  if(m_map_inputs.find("deltaphi2"              )!= m_map_inputs.end() or 
-     m_map_inputs.find("deltaDeltaPhiFirstAndLM")!= m_map_inputs.end())
-    allFound = allFound && eg->trackCaloMatchValue(deltaPhi2, xAOD::EgammaParameters::deltaPhi2);
-  if(m_map_inputs.find("deltaDeltaPhiFirstAndLM")!= m_map_inputs.end())
-    allFound = allFound && eg->trackCaloMatchValue(deltaPhiFromLM, xAOD::EgammaParameters::deltaPhiFromLastMeasurement);
-
-  // TRT high-to-low threshold hits ratio
-  // if ( nTRTXenon > 0 )
-  //     rTRT = ((double)(nTRThigh+nTRThighOutliers)) / ((double)(nTRTXenon)) ;
-  // else if ( nTRTXenon < 0 && (nTRT+nTRTOutliers) > 0 ) // this is always false as given
-  //     rTRT = ((double)(nTRThigh+nTRThighOutliers)) / ((double)(nTRT+nTRTOutliers)) ;
-
-  // Get the number of primary vertices in this event
-  // double ip = static_cast<double>(m_nPVdefault);
-  // if(mu < 0) // use npv if mu is negative (not given)
-  //   ip = static_cast<double>(m_usePVCont ? this->getNPrimVertices() : m_nPVdefault);
-  // else ip = mu;
-
-
-  // ATH_MSG_VERBOSE("xAOD variables: pt                      = "<< et                       );
-  // ATH_MSG_VERBOSE("xAOD variables: eta                     = "<< eta                      );
-  // ATH_MSG_VERBOSE("xAOD variables: abs_eta                 = "<< fabs(eta)                );
-  // ATH_MSG_VERBOSE("xAOD variables: d0                      = "<< d0                       );
-  // ATH_MSG_VERBOSE("xAOD variables: ld0                     = "<< lifeSign*d0              );
-  // ATH_MSG_VERBOSE("xAOD variables: cd0                     = "<< charge*d0                );
-  // ATH_MSG_VERBOSE("xAOD variables: EoverP                  = "<< EoverP                   );
-  // ATH_MSG_VERBOSE("xAOD variables: deltaphi1               = "<< deltaPhi1                );
-  // ATH_MSG_VERBOSE("xAOD variables: deltaphiRes             = "<< deltaPhiRescaled2        );
-  // ATH_MSG_VERBOSE("xAOD variables: Rphi                    = "<< Rphi                     );
-  // ATH_MSG_VERBOSE("xAOD variables: qoverpSig               = "<< trackqoverpsig           );
-  // ATH_MSG_VERBOSE("xAOD variables: nSctHits                = "<< nSCT                     );
-  // ATH_MSG_VERBOSE("xAOD variables: z0sinTheta              = "<< z0*sin(theta)            );
-  // ATH_MSG_VERBOSE("xAOD variables: d0Err                   = "<< d0sigma                  );
-  // ATH_MSG_VERBOSE("xAOD variables: d0Sig                   = "<< d0/d0sigma               );
-  // ATH_MSG_VERBOSE("xAOD variables: deltaphi2               = "<< deltaPhi2                );
-  // ATH_MSG_VERBOSE("xAOD variables: chi2oftrackfit          = "<< trackchi2                );
-  // ATH_MSG_VERBOSE("xAOD variables: deltaPoverP             = "<< dpOverp                  );
-  // ATH_MSG_VERBOSE("xAOD variables: deltaDeltaPhiFirstandLM = "<< deltaPhi2-deltaPhiFromLM );
-  ATH_MSG_VERBOSE("xAOD variables: pt                      = "<< et                       <<std::endl<<
-		  "xAOD variables: eta                     = "<< eta                      <<std::endl<<
-		  "xAOD variables: abs_eta                 = "<< fabs(eta)                <<std::endl<<
-		  "xAOD variables: d0                      = "<< d0                       <<std::endl<<
-		  "xAOD variables: ld0                     = "<< lifeSign*d0              <<std::endl<<
-		  "xAOD variables: cd0                     = "<< charge*d0                <<std::endl<<
-		  "xAOD variables: EoverP                  = "<< EoverP                   <<std::endl<<
-		  "xAOD variables: deltaphi1               = "<< deltaPhi1                <<std::endl<<
-		  "xAOD variables: deltaphiRes             = "<< deltaPhiRescaled2        <<std::endl<<
-		  "xAOD variables: Rphi                    = "<< Rphi                     <<std::endl<<
-		  "xAOD variables: qoverpSig               = "<< trackqoverpsig           <<std::endl<<
-		  "xAOD variables: nSctHits                = "<< nSCT                     <<std::endl<<
-		  "xAOD variables: z0sinTheta              = "<< z0*sin(theta)            <<std::endl<<
-		  "xAOD variables: d0Err                   = "<< d0sigma                  <<std::endl<<
-		  "xAOD variables: d0Sig                   = "<< d0/d0sigma               <<std::endl<<
-		  "xAOD variables: deltaphi2               = "<< deltaPhi2                <<std::endl<<
-		  "xAOD variables: chi2oftrackfit          = "<< trackchi2                <<std::endl<<
-		  "xAOD variables: deltaPoverP             = "<< dpOverp                  <<std::endl<<
-		  "xAOD variables: deltaDeltaPhiFirstandLM = "<< deltaPhi2-deltaPhiFromLM );
-
-  if(m_map_inputs.find("pt"                     )!= m_map_inputs.end()) m_map_inputs["pt"                     ] = et               ;
-  if(m_map_inputs.find("eta"                    )!= m_map_inputs.end()) m_map_inputs["eta"                    ] = eta              ;
-  if(m_map_inputs.find("abs_eta"                )!= m_map_inputs.end()) m_map_inputs["abs_eta"                ] = fabs(eta)        ;
-  if(m_map_inputs.find("d0"                     )!= m_map_inputs.end()) m_map_inputs["d0"                     ] = d0               ;
-  if(m_map_inputs.find("ld0"                    )!= m_map_inputs.end()) m_map_inputs["ld0"                    ] = lifeSign*d0      ;
-  if(m_map_inputs.find("cd0"                    )!= m_map_inputs.end()) m_map_inputs["cd0"                    ] = charge*d0        ;
-  if(m_map_inputs.find("EoverP"                 )!= m_map_inputs.end()) m_map_inputs["EoverP"                 ] = EoverP           ;
-  if(m_map_inputs.find("deltaphi1"              )!= m_map_inputs.end()) m_map_inputs["deltaphi1"              ] = deltaPhi1        ;
-  if(m_map_inputs.find("deltaphiRes"            )!= m_map_inputs.end()) m_map_inputs["deltaphiRes"            ] = deltaPhiRescaled2;
-  if(m_map_inputs.find("Rphi"                   )!= m_map_inputs.end()) m_map_inputs["Rphi"                   ] = Rphi             ;
-  if(m_map_inputs.find("qoverpSig"              )!= m_map_inputs.end()) m_map_inputs["qoverpSig"              ] = trackqoverpsig   ;
-  if(m_map_inputs.find("nSctHits"               )!= m_map_inputs.end()) m_map_inputs["nSctHits"               ] = nSCT             ;
-  if(m_map_inputs.find("z0sinTheta"             )!= m_map_inputs.end()) m_map_inputs["z0sinTheta"             ] = z0*sin(theta)    ;
-  if(m_map_inputs.find("d0Err"                  )!= m_map_inputs.end()) m_map_inputs["d0Err"                  ] = d0sigma          ;
-  if(m_map_inputs.find("d0Sig"                  )!= m_map_inputs.end()) m_map_inputs["d0Sig"                  ] = d0/d0sigma       ;
-  if(m_map_inputs.find("deltaphi2"              )!= m_map_inputs.end()) m_map_inputs["deltaphi2"              ] = deltaPhi2        ;
-  if(m_map_inputs.find("chi2oftrackfit"         )!= m_map_inputs.end()) m_map_inputs["chi2oftrackfit"         ] = trackchi2        ;
-  if(m_map_inputs.find("deltaPoverP"            )!= m_map_inputs.end()) m_map_inputs["deltaPoverP"            ] = dpOverp          ;
-  if(m_map_inputs.find("deltaDeltaPhiFirstAndLM")!= m_map_inputs.end()) m_map_inputs["deltaDeltaPhiFirstAndLM"] = deltaPhi2-deltaPhiFromLM;
-  //m_map_inputs["PtErr"                  ] = ;//to be implemented
-
-  if (!allFound) ATH_MSG_FATAL("Missing input variable for ECIDS BDT calculation");
-
-  //long unsigned event_number=0;
-  //unsigned bdt_index=event_number%2;
-
-  ////KM: dumping variables
-  for (auto input: m_map_inputs)
-    ATH_MSG_DEBUG("\t input: "<<input.first<<"\t= "<<input.second);
-
-  ////KM: dumping variables, only variables used by BDT
-  // unsigned i=0;
-  // for (auto pointer: m_v_bdts.at(bdt_index)->GetPointers()) {
-  //   std::cout<<"\t kmdebug: "<<m_inputVars.at(i)<<"\t("<<pointer<<")\t = "<<*pointer<<std::endl; i++;
-  // }
-
-  double bdt_output = m_v_bdts.at(m_bdt_index)->GetGradBoostMVA(m_v_bdts.at(m_bdt_index)->GetPointers());
-  ATH_MSG_DEBUG("ECIDS-BDT= "<<bdt_output);
-
-  return bdt_output;
-}
-
-//=============================================================================
-// Calculate method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly
-//=============================================================================
-double AsgElectronChargeIDSelectorTool::calculate( const xAOD::Egamma* eg, double mu ) const
-{
-  ATH_MSG_VERBOSE("AsgElectronChargeIDSelectorTool::calculate( const xAOD::Egamma* "<<eg<<", double mu= "<<mu<< " ) const");
-  ATH_MSG_WARNING("Method not implemented for egamma object! Reurning -1!!");
-  
-  return -999;
-}
-
-//=============================================================================
-asg::AcceptData AsgElectronChargeIDSelectorTool::accept(const xAOD::IParticle* part) const
-{
-  ATH_MSG_VERBOSE("Entering accept( const IParticle* part )");
-  const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part);
-  if(eg)
-    {
-      return accept(eg);
-    }
-  else{
-    ATH_MSG_ERROR("AsgElectronChargeIDSelectorTool::could not cast to const Electron");
-    asg::AcceptData acceptData(&m_acceptInfo);
-    return acceptData;
-  }
-}
-
-double AsgElectronChargeIDSelectorTool::calculate(const xAOD::IParticle* part) const
-{
-  const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part);
-  if (eg)
-    {
-      return calculate(eg);
-    }
-  else
-    {
-      ATH_MSG_ERROR ( " Could not cast to const Electron " );
-      return -999;
-    }
-}
-
-
-
-
-//=============================================================================
-// Helper method to get the number of primary vertices
-// ( This is horrible! We don't want to iterate over all vertices in the event for each electron!!! 
-//   This is slow!)
-//=============================================================================
-unsigned int AsgElectronChargeIDSelectorTool::getNPrimVertices() const
-{
-  static bool PVExists = true; 
-  unsigned int nVtx(0);
-  const xAOD::VertexContainer* vxContainer(0);
-  if(PVExists)
-  {
-    if ( StatusCode::SUCCESS != evtStore()->retrieve( vxContainer, m_primVtxContName ) )
-    {
-      ATH_MSG_WARNING ( "Vertex container not found with name: " << m_primVtxContName );
-      PVExists = false; // if retrieve failed, don't try to retrieve again
-      return nVtx;
-    }
-    for ( unsigned int i=0; i<vxContainer->size(); i++ )
-    {
-      const xAOD::Vertex* vxcand = vxContainer->at(i);
-      if ( vxcand->nTrackParticles() >= 2 ) nVtx++;
-    }
-  }
-  return nVtx;
-}
-
-
-bool AsgElectronChargeIDSelectorTool::SetVariableRefs(std::vector<std::string> inputs, std::vector<float*> &inputPointers) {
-  
-  bool unknownVarFound = false;
-  unsigned nVars = 0;
-  
-  for (auto inputName: inputs) {
-    //KM:                                           create elements by assigning default values.
-    if      (inputName=="pt"                     ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="eta"                    ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="abs_eta"                ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="d0"                     ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="ld0"                    ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="cd0"                    ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="EoverP"                 ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="deltaphi1"              ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="deltaphiRes"            ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="Rphi"                   ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="qoverpSig"              ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="nSctHits"               ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="z0sinTheta"             ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="d0Err"                  ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="d0Sig"                  ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="deltaphi2"              ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="chi2oftrackfit"         ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else if (inputName=="deltaPoverP"            ) {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}         
-    else if (inputName=="deltaDeltaPhiFirstAndLM") {ATH_MSG_VERBOSE("\t Setting up BDT using variable: "<<inputName); m_map_inputs[inputName]=0; inputPointers.push_back(&m_map_inputs[inputName]); nVars++;}
-    else {
-      ATH_MSG_WARNING("Unknown variables found with name: "<<inputName);
-      unknownVarFound = true;
-    }
-  }
-  
-  return inputs.size()==nVars and !unknownVarFound;
-  
-}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/SafeTH1.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/SafeTH1.h
new file mode 100644
index 0000000000000000000000000000000000000000..4926c60abd64a0e23896c5713a7cbfc6bc63e1b9
--- /dev/null
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/SafeTH1.h
@@ -0,0 +1,70 @@
+/*
+   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ */
+
+#ifndef __EGSELECTOR_SAFETH1L__
+#define __EGSELECTOR_SAFETH1L__
+
+#include "TH1.h"
+
+namespace Root{
+namespace EGSelectors{
+class SafeTH1{
+
+public :
+  SafeTH1(TH1F* hist){
+    const int nbins = hist->GetNbinsX();
+    m_binContent.resize(nbins,0); // Note that the PDF over/underflows are unused and thus unrepresented here!
+    for(int i = 0; i < nbins; ++i){
+      m_binContent[i] = hist->GetBinContent(i+1);
+    }
+    m_firstBinLowEdge = hist->GetBinLowEdge(1);
+    m_lastBinLowEdge  = hist->GetBinLowEdge(nbins);
+    m_binWidth        = (m_lastBinLowEdge - m_firstBinLowEdge) / (GetNbinsX() - 1);
+    m_integral        = hist->Integral(1,nbins);
+  }
+  ~SafeTH1(){};
+
+  int GetNbinsX() const  {
+    int n = m_binContent.size();
+    return n;
+  }
+
+  int FindBin(double value) const{
+
+    if(value < m_firstBinLowEdge){
+      return 0; // first bin of m_binContent
+    }
+    if(value > m_lastBinLowEdge){
+      return GetNbinsX() - 1; // last bin of m_binContent
+    }
+    // note double rather than float due to incorrect rounding in O(1/10000) cases if float is used
+    double bin_double = (value - m_firstBinLowEdge) / m_binWidth; 
+    int bin = static_cast<int>(bin_double);
+    return bin;
+  }
+
+  double GetBinContent(int bin) const {
+    int nbins = this->GetNbinsX();
+    // since we store the bin content in a vector we need a protection 
+    // for cases where we try to access a non-existing bin. In these 
+    // cases just go to the last bin
+    return (bin>nbins) ? m_binContent[nbins-1] : m_binContent[bin];
+  }
+  double GetBinLowEdge(int bin) const {
+    return m_firstBinLowEdge + m_binWidth*bin;
+  }
+  double Integral() const{
+    return m_integral;
+  }
+
+private: 
+  std::vector<float> m_binContent;
+  double m_firstBinLowEdge;
+  double m_lastBinLowEdge;
+  double m_binWidth;
+  double m_integral;
+};
+}
+}
+#endif
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx
index 505fdfad8bf813df4f3c5395e4d809e0dbda696c..8ff79e0942a00ca561515b9f4fba238cf0bd4d8d 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx
@@ -1,6 +1,6 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
+   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ */
 
 #include "TElectronLikelihoodTool.h"
 #include <cmath>
@@ -16,8 +16,8 @@
 #include "ElectronPhotonSelectorTools/ElectronSelectorHelpers.h"
 
 /** 
-    Author : Kurt Brendlinger <kurb@sas.upenn.edu>
-    Please see TElectronLikelihoodTool.h for usage.
+Author : Kurt Brendlinger <kurb@sas.upenn.edu>
+Please see TElectronLikelihoodTool.h for usage.
 */
 
 //=============================================================================
@@ -57,11 +57,11 @@ Root::TElectronLikelihoodTool::TElectronLikelihoodTool(const char* name) :
   for(unsigned int varIndex = 0; varIndex < s_fnVariables; varIndex++){
     for(unsigned int s_or_b = 0; s_or_b < 2; s_or_b++){
       for (unsigned int ip = 0; ip < IP_BINS; ip++){
-	for(unsigned int et = 0; et < s_fnEtBinsHist; et++){
-	  for(unsigned int eta = 0; eta < s_fnEtaBins; eta++){
-	    fPDFbins[s_or_b][ip][et][eta][varIndex] = 0;
-	  }
-	}
+        for(unsigned int et = 0; et < s_fnEtBinsHist; et++){
+          for(unsigned int eta = 0; eta < s_fnEtaBins; eta++){
+            fPDFbins[s_or_b][ip][et][eta][varIndex] = 0;
+          }
+        }
       }
     }
   }
@@ -78,14 +78,14 @@ Root::TElectronLikelihoodTool::~TElectronLikelihoodTool()
   for(unsigned int varIndex = 0; varIndex < s_fnVariables; varIndex++){
     for(unsigned int s_or_b = 0; s_or_b < 2; s_or_b++){
       for (unsigned int ip = 0; ip < IP_BINS; ip++){
-	for(unsigned int et = 0; et < s_fnEtBinsHist; et++){
-	  for(unsigned int eta = 0; eta < s_fnEtaBins; eta++){
-	    if (fPDFbins[s_or_b][ip][et][eta][varIndex]){
-	      delete fPDFbins[s_or_b][ip][et][eta][varIndex];
-	      fPDFbins[s_or_b][ip][et][eta][varIndex] = 0;
-	    }
-	  }
-	}
+        for(unsigned int et = 0; et < s_fnEtBinsHist; et++){
+          for(unsigned int eta = 0; eta < s_fnEtaBins; eta++){
+            if (fPDFbins[s_or_b][ip][et][eta][varIndex]){
+              delete fPDFbins[s_or_b][ip][et][eta][varIndex];
+              fPDFbins[s_or_b][ip][et][eta][varIndex] = 0;
+            }
+          }
+        }
       }
     }
   }
@@ -101,11 +101,11 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
 
   // Check that all needed variables are setup
   if ( m_pdfFileName.empty() )
-    {
-      ATH_MSG_WARNING("You need to specify the input PDF file name before you call initialize() with setPDFFileName('your/file/name.root') ");
-      sc = StatusCode::FAILURE;
-    }
-  
+  {
+    ATH_MSG_WARNING("You need to specify the input PDF file name before you call initialize() with setPDFFileName('your/file/name.root') ");
+    sc = StatusCode::FAILURE;
+  }
+
   unsigned int number_of_expected_bin_combinedLH ;
   if(m_useOneExtraHighETLHBin) number_of_expected_bin_combinedLH =  s_fnDiscEtBinsOneExtra*s_fnEtaBins ;
   else number_of_expected_bin_combinedLH =  s_fnDiscEtBins*s_fnEtaBins ;
@@ -114,28 +114,28 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
 
   if( m_cutLikelihood.size() != number_of_expected_bin_combinedLH){
     ATH_MSG_ERROR("Configuration issue :  cutLikelihood expected size " << number_of_expected_bin_combinedLH << 
-		  " input size " << m_cutLikelihood.size());
+                  " input size " << m_cutLikelihood.size());
     sc = StatusCode::FAILURE;
   } 
 
   if( m_discHardCutForPileupTransform.size() >0 ) {
     if( m_discHardCutForPileupTransform.size() != number_of_expected_bin_combinedLH){
       ATH_MSG_ERROR("Configuration issue :   DiscHardCutForPileupTransform expected size " << number_of_expected_bin_combinedLH << 
-		    " input size " <<  m_discHardCutForPileupTransform.size());
+                    " input size " <<  m_discHardCutForPileupTransform.size());
       sc = StatusCode::FAILURE;
     } 
   }
   if(m_discHardCutSlopeForPileupTransform.size() >0 ) {
     if(m_discHardCutSlopeForPileupTransform.size() != number_of_expected_bin_combinedLH){
       ATH_MSG_ERROR("Configuration issue :   DiscHardCutSlopeForPileupTransform expected size " << number_of_expected_bin_combinedLH << 
-		    " input size " <<  m_discHardCutSlopeForPileupTransform.size());
+                    " input size " <<  m_discHardCutSlopeForPileupTransform.size());
       sc = StatusCode::FAILURE;
     } 
   }
   if(m_discLooseForPileupTransform.size() >0) {
     if( m_discLooseForPileupTransform.size() != number_of_expected_bin_combinedLH){
       ATH_MSG_ERROR("Configuration issue :   DiscLooseForPileupTransform expected size " << number_of_expected_bin_combinedLH << 
-		    " input size " <<  m_discLooseForPileupTransform.size());
+                    " input size " <<  m_discLooseForPileupTransform.size());
       sc = StatusCode::FAILURE;
     } 
   }
@@ -144,25 +144,25 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
   if (m_cutA0.size() >0){
     if (m_cutA0.size() != number_of_expected_bin_combinedOther){
       ATH_MSG_ERROR("Configuration issue :   CutA0  expected size " << number_of_expected_bin_combinedOther << 
-		    " input size " <<  m_cutA0.size());
+                    " input size " <<  m_cutA0.size());
       sc = StatusCode::FAILURE;
     }
   }
-    
+
   // deltaEta cut
   if (m_cutDeltaEta.size() >0){
     if (m_cutDeltaEta.size() != number_of_expected_bin_combinedOther){
       ATH_MSG_ERROR("Configuration issue :  CutDeltaEta  expected size " << number_of_expected_bin_combinedOther << 
-		    " input size " <<  m_cutDeltaEta.size());
+                    " input size " <<  m_cutDeltaEta.size());
       sc = StatusCode::FAILURE;
     }
   }
-  
+
   // deltaPhiRes cut
   if (m_cutDeltaPhiRes.size() >0){
     if (m_cutDeltaPhiRes.size() != number_of_expected_bin_combinedOther ){
       ATH_MSG_ERROR("Configuration issue :  CutDeltaPhiRes  expected size " << number_of_expected_bin_combinedOther << 
-		    " input size " <<  m_cutDeltaPhiRes.size());
+                    " input size " <<  m_cutDeltaPhiRes.size());
       sc = StatusCode::FAILURE;
     }
   }
@@ -175,7 +175,7 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
   // Register the cuts and check that the registration worked:
   // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,...
   // if ( m_cutPosition_nSCTMin < 0 ) sc == StatusCode::FAILURE; // Exceeded the number of allowed cuts (32)
-  
+
   // Cut position for the kineatic pre-selection
   m_cutPosition_kinematic = m_acceptInfo.addCut( "kinematic", "pass kinematic" );
   if ( m_cutPosition_kinematic < 0 ) {sc = StatusCode::FAILURE;}
@@ -192,7 +192,7 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
   m_cutPosition_NBlayer = m_acceptInfo.addCut( "NBlayer", "pass NBlayer" );
   if ( m_cutPosition_NBlayer < 0 ) {sc = StatusCode::FAILURE;}
 
- // Ambiguity
+  // Ambiguity
   m_cutPosition_ambiguity = m_acceptInfo.addCut( "ambiguity", "pass ambiguity" );
   if ( m_cutPosition_ambiguity < 0 ) {sc = StatusCode::FAILURE;}
 
@@ -212,7 +212,7 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
   // deltaphi
   m_cutPositionTrackMatchPhiRes = m_acceptInfo.addCut( "TrackMatchPhiRes", "Track match dphi in 2nd sampling, rescaled < Cut" );
   if ( m_cutPositionTrackMatchPhiRes < 0 ) {sc = StatusCode::FAILURE;}
-  
+
   // Wstot
   m_cutPositionWstotAtHighET = m_acceptInfo.addCut( "WstotAtHighET", "Above HighETBinThreshold, Wstot < Cut" );
   if ( m_cutPositionWstotAtHighET < 0 ) {sc = StatusCode::FAILURE;}
@@ -230,7 +230,7 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
   // ----------------------------------
   // Get the correct bit mask for the current likelihood operating point
   m_variableBitMask = getLikelihoodBitmask(m_variableNames);
-  
+
   //----------File/Histo operation------------------------------------
   // Load the ROOT file containing the PDFs
   TString tmpString(m_pdfFileName);
@@ -239,10 +239,10 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
   m_pdfFile = TFile::Open( fname.c_str(), "READ" );
   // Check that we could load the ROOT file
   if ( !m_pdfFile )
-    {
-      ATH_MSG_ERROR(" No ROOT file found here: " << m_pdfFileName);
-      return StatusCode::FAILURE;
-    }
+  {
+    ATH_MSG_ERROR(" No ROOT file found here: " << m_pdfFileName);
+    return StatusCode::FAILURE;
+  }
 
   //Load the histograms
   for(unsigned int varIndex = 0; varIndex < s_fnVariables; varIndex++){
@@ -262,29 +262,29 @@ StatusCode Root::TElectronLikelihoodTool::initialize()
   //----------End File/Histo operation------------------------------------
 
   ATH_MSG_DEBUG("Initialization complete for a LH tool with these specs:"
-		<< "\n - pdfFileName                                  : " << m_pdfFileName
-		<< "\n - Variable bitmask                             : " << m_variableBitMask);
+                << "\n - pdfFileName                                  : " << m_pdfFileName
+                << "\n - Variable bitmask                             : " << m_variableBitMask);
 
   ATH_MSG_DEBUG(   "\n - VariableNames                                : " << m_variableNames
-		<< "\n - (bool)CutBL (yes/no)                         : " << (m_cutBL.size() ? "yes" : "no")
-		<< "\n - (bool)CutPi (yes/no)                         : " << (m_cutPi.size() ? "yes" : "no")
-		<< "\n - (bool)CutSi (yes/no)                         : " << (m_cutSi.size() ? "yes" : "no")
-		<< "\n - (bool)CutAmbiguity (yes/no)                  : " << (m_cutAmbiguity.size() ? "yes" : "no")
-		<< "\n - (bool)doRemoveF3AtHighEt (yes/no)            : " << (m_doRemoveF3AtHighEt ? "yes" : "no")
-		<< "\n - (bool)doRemoveTRTPIDAtHighEt (yes/no)        : " << (m_doRemoveTRTPIDAtHighEt ? "yes" : "no")
-		<< "\n - (bool)doSmoothBinInterpolation (yes/no)      : " << (m_doSmoothBinInterpolation ? "yes" : "no")
-		<< "\n - (bool)useOneExtraHighETLHBin(yes/no)         : " << (m_useOneExtraHighETLHBin ? "yes" : "no")
-		<< "\n - (double)HighETBinThreshold                   : " << m_highETBinThreshold
-		<< "\n - (bool)doPileupTransform (yes/no)             : " << (m_doPileupTransform ? "yes" : "no")
-		<< "\n - (bool)doCentralityTransform (yes/no)         : " << (m_doCentralityTransform ? "yes" : "no")
-		<< "\n - (bool)CutLikelihood (yes/no)                 : " << (m_cutLikelihood.size() ? "yes" : "no")
-		<< "\n - (bool)CutLikelihoodPileupCorrection (yes/no) : " << (m_cutLikelihoodPileupCorrection.size() ? "yes" : "no")
-		<< "\n - (bool)CutA0 (yes/no)                         : " << (m_cutA0.size() ? "yes" : "no")
-		<< "\n - (bool)CutDeltaEta (yes/no)                   : " << (m_cutDeltaEta.size() ? "yes" : "no")
-		<< "\n - (bool)CutDeltaPhiRes (yes/no)                : " << (m_cutDeltaPhiRes.size() ? "yes" : "no")
-		<< "\n - (bool)CutWstotAtHighET (yes/no)              : " << (m_cutWstotAtHighET.size() ? "yes" : "no")
-		<< "\n - (bool)CutEoverPAtHighET (yes/no)             : " << (m_cutEoverPAtHighET.size() ? "yes" : "no")
-		);
+                   << "\n - (bool)CutBL (yes/no)                         : " << (m_cutBL.size() ? "yes" : "no")
+                   << "\n - (bool)CutPi (yes/no)                         : " << (m_cutPi.size() ? "yes" : "no")
+                   << "\n - (bool)CutSi (yes/no)                         : " << (m_cutSi.size() ? "yes" : "no")
+                   << "\n - (bool)CutAmbiguity (yes/no)                  : " << (m_cutAmbiguity.size() ? "yes" : "no")
+                   << "\n - (bool)doRemoveF3AtHighEt (yes/no)            : " << (m_doRemoveF3AtHighEt ? "yes" : "no")
+                   << "\n - (bool)doRemoveTRTPIDAtHighEt (yes/no)        : " << (m_doRemoveTRTPIDAtHighEt ? "yes" : "no")
+                   << "\n - (bool)doSmoothBinInterpolation (yes/no)      : " << (m_doSmoothBinInterpolation ? "yes" : "no")
+                   << "\n - (bool)useOneExtraHighETLHBin(yes/no)         : " << (m_useOneExtraHighETLHBin ? "yes" : "no")
+                   << "\n - (double)HighETBinThreshold                   : " << m_highETBinThreshold
+                   << "\n - (bool)doPileupTransform (yes/no)             : " << (m_doPileupTransform ? "yes" : "no")
+                   << "\n - (bool)doCentralityTransform (yes/no)         : " << (m_doCentralityTransform ? "yes" : "no")
+                   << "\n - (bool)CutLikelihood (yes/no)                 : " << (m_cutLikelihood.size() ? "yes" : "no")
+                   << "\n - (bool)CutLikelihoodPileupCorrection (yes/no) : " << (m_cutLikelihoodPileupCorrection.size() ? "yes" : "no")
+                   << "\n - (bool)CutA0 (yes/no)                         : " << (m_cutA0.size() ? "yes" : "no")
+                   << "\n - (bool)CutDeltaEta (yes/no)                   : " << (m_cutDeltaEta.size() ? "yes" : "no")
+                   << "\n - (bool)CutDeltaPhiRes (yes/no)                : " << (m_cutDeltaPhiRes.size() ? "yes" : "no")
+                   << "\n - (bool)CutWstotAtHighET (yes/no)              : " << (m_cutWstotAtHighET.size() ? "yes" : "no")
+                   << "\n - (bool)CutEoverPAtHighET (yes/no)             : " << (m_cutEoverPAtHighET.size() ? "yes" : "no")
+               );
   return sc;
 }
 
@@ -292,41 +292,41 @@ int Root::TElectronLikelihoodTool::loadVarHistograms(std::string vstr,unsigned i
   for(unsigned int s_or_b = 0; s_or_b < 2; s_or_b++){
     for (unsigned int ip = 0; ip < IP_BINS; ip++){
       for(unsigned int et = 0; et < s_fnEtBinsHist; et++){
-	for(unsigned int eta = 0; eta < s_fnEtaBins; eta++){
-	  
-	  std::string sig_bkg = (s_or_b==0) ? "sig" : "bkg" ;	  
-	  // Because eta bins in the root file don't match up exactly with cut menu
-	  // definitions, the second eta bin is an exact copy of the first,
-	  // and all subsequent eta bins are pushed back by one.
-	  unsigned int eta_tmp = (eta > 0) ? eta-1 : eta ;
-	  // The 7-10 GeV, crack bin uses the 10-15 Gev pdfs. WE DO NOT DO THIS ANYMORE!
-	  //unsigned int et_tmp = (eta == 5 && et == 1) ? 1 : et; 
-	  unsigned int et_tmp = et;
-	  char binname[200];
-	  getBinName( binname, et_tmp, eta_tmp, ip, m_ipBinning );
-          
-	  if (((std::string(binname).find("2.37") != std::string::npos)) && (vstr.find("el_f3") != std::string::npos))
-	    continue;
-
-	  if (((std::string(binname).find("2.01") != std::string::npos) || (std::string(binname).find("2.37") != std::string::npos))
-	      && (vstr.find("TRT") != std::string::npos))
-	    continue;
-	  
-	  char pdfdir[500];
-	  snprintf(pdfdir,500,"%s/%s",vstr.c_str(),sig_bkg.c_str());
-	  char pdf[500];
-	  snprintf(pdf,500,"%s_%s_smoothed_hist_from_KDE_%s",vstr.c_str(),sig_bkg.c_str(),binname);
-	  char pdf_newname[500];
-	  snprintf(pdf_newname,500,"%s_%s_%s_LHtool_copy_%s", m_name.c_str(),vstr.c_str(),sig_bkg.c_str(),binname);
-
-	  if (!m_pdfFile->GetListOfKeys()->Contains(vstr.c_str())){
-	    ATH_MSG_INFO("Warning: skipping variable " << vstr << " because the folder does not exist.");
-	    return 1;
-	  }
-	  if (!((TDirectory*)m_pdfFile->Get(vstr.c_str()))->GetListOfKeys()->Contains(sig_bkg.c_str())){
-	    ATH_MSG_INFO("Warning: skipping variable " << vstr << " because the folder does not exist.");
-	    return 1;
-	  }
+        for(unsigned int eta = 0; eta < s_fnEtaBins; eta++){
+
+          std::string sig_bkg = (s_or_b==0) ? "sig" : "bkg" ;	  
+          // Because eta bins in the root file don't match up exactly with cut menu
+          // definitions, the second eta bin is an exact copy of the first,
+          // and all subsequent eta bins are pushed back by one.
+          unsigned int eta_tmp = (eta > 0) ? eta-1 : eta ;
+          // The 7-10 GeV, crack bin uses the 10-15 Gev pdfs. WE DO NOT DO THIS ANYMORE!
+          //unsigned int et_tmp = (eta == 5 && et == 1) ? 1 : et; 
+          unsigned int et_tmp = et;
+          char binname[200];
+          getBinName( binname, et_tmp, eta_tmp, ip, m_ipBinning );
+
+          if (((std::string(binname).find("2.37") != std::string::npos)) && (vstr.find("el_f3") != std::string::npos))
+            continue;
+
+          if (((std::string(binname).find("2.01") != std::string::npos) || (std::string(binname).find("2.37") != std::string::npos))
+              && (vstr.find("TRT") != std::string::npos))
+            continue;
+
+          char pdfdir[500];
+          snprintf(pdfdir,500,"%s/%s",vstr.c_str(),sig_bkg.c_str());
+          char pdf[500];
+          snprintf(pdf,500,"%s_%s_smoothed_hist_from_KDE_%s",vstr.c_str(),sig_bkg.c_str(),binname);
+          char pdf_newname[500];
+          snprintf(pdf_newname,500,"%s_%s_%s_LHtool_copy_%s", m_name.c_str(),vstr.c_str(),sig_bkg.c_str(),binname);
+
+          if (!m_pdfFile->GetListOfKeys()->Contains(vstr.c_str())){
+            ATH_MSG_INFO("Warning: skipping variable " << vstr << " because the folder does not exist.");
+            return 1;
+          }
+          if (!((TDirectory*)m_pdfFile->Get(vstr.c_str()))->GetListOfKeys()->Contains(sig_bkg.c_str())){
+            ATH_MSG_INFO("Warning: skipping variable " << vstr << " because the folder does not exist.");
+            return 1;
+          }
 
           // We only need to load PDFs 
           // up to a certain ET value (40 GeV)
@@ -345,7 +345,7 @@ int Root::TElectronLikelihoodTool::loadVarHistograms(std::string vstr,unsigned i
           }
           if (((TDirectory*)m_pdfFile->Get(pdfdir))->GetListOfKeys()->Contains(pdf)) {
             TH1F* hist = (TH1F*)(((TDirectory*)m_pdfFile->Get(pdfdir))->Get(pdf));
-            fPDFbins[s_or_b][ip][et][eta][varIndex] = new TElectronLikelihoodTool::SafeTH1(hist);
+            fPDFbins[s_or_b][ip][et][eta][varIndex] = new EGSelectors::SafeTH1(hist);
             delete hist;
           }
           else {
@@ -353,7 +353,7 @@ int Root::TElectronLikelihoodTool::loadVarHistograms(std::string vstr,unsigned i
             ATH_MSG_INFO("Skipping all other histograms with this variable.");
             return 1;
           }
-	}
+        }
       }
     }  
   }
@@ -374,10 +374,9 @@ Root::TElectronLikelihoodTool::accept( double likelihood,
                                        double wstot,
                                        double EoverP,
                                        double ip
-                                       ) const
+                                     ) const
 {
   LikeEnum::LHAcceptVars_t vars;
-  
   vars.likelihood              = likelihood;
   vars.eta                     = eta;
   vars.eT                      = eT;
@@ -391,7 +390,7 @@ Root::TElectronLikelihoodTool::accept( double likelihood,
   vars.wstot                   = wstot;
   vars.EoverP                  = EoverP;
   vars.ip                      = ip;
-  
+
   return accept(vars);
 }
 
@@ -414,12 +413,12 @@ Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) c
   bool passDeltaPhiRes(true);
   bool passWstotAtHighET(true);
   bool passEoverPAtHighET(true);
-  
+
   if (fabs(vars_struct.eta) > 2.47) {
     ATH_MSG_DEBUG("This electron is fabs(eta)>2.47 Returning False.");
     passKine = false;
   }
-  
+
   unsigned int etbinLH = getLikelihoodEtDiscBin(vars_struct.eT,true);
   unsigned int etbinOther = getLikelihoodEtDiscBin(vars_struct.eT,false);
   unsigned int etabin = getLikelihoodEtaBin(vars_struct.eta);
@@ -444,13 +443,13 @@ Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) c
   // ambiguity bit
   if (m_cutAmbiguity.size()) {
     if ( !ElectronSelectorHelpers::passAmbiguity((xAOD::AmbiguityTool::AmbiguityType)vars_struct.ambiguityBit,
-						m_cutAmbiguity[etabin])
-	 ) {
+                                                 m_cutAmbiguity[etabin])
+       ) {
       ATH_MSG_DEBUG("Likelihood macro: ambiguity Bit Failed." );
       passAmbiguity = false;
     }
   }
-  
+
   // blayer cut
   if (m_cutBL.size() ) {
     if(m_cutBL[etabin] == 1 && !vars_struct.passBLayerRequirement) {
@@ -472,7 +471,7 @@ Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) c
       passNSilicon = false;
     }
   }
-  
+
   double cutDiscriminant;
   unsigned int ibin_combinedLH = etbinLH*s_fnEtaBins+etabin; // Must change if number of eta bins changes!. Also starts from 7-10 GeV bin.
   unsigned int ibin_combinedOther = etbinOther*s_fnEtaBins+etabin; // Must change if number of eta bins changes!. Also starts from 7-10 GeV bin.
@@ -481,35 +480,35 @@ Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) c
     // To protect against a binning mismatch, which should never happen
     if(ibin_combinedLH>=m_cutLikelihood.size()){
       ATH_MSG_ERROR("The desired eta/pt bin " << ibin_combinedLH 
-		    << " is outside of the range specified by the input" << m_cutLikelihood.size() << "This should never happen!");
+                    << " is outside of the range specified by the input" << m_cutLikelihood.size() << "This should never happen!");
       return acceptData; 
     }
 
     if (m_doSmoothBinInterpolation){
       cutDiscriminant = InterpolateCuts(m_cutLikelihood,m_cutLikelihood4GeV,vars_struct.eT,vars_struct.eta);
       if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection.size() && m_cutLikelihoodPileupCorrection4GeV.size())
-	cutDiscriminant += vars_struct.ip*InterpolateCuts(m_cutLikelihoodPileupCorrection,m_cutLikelihoodPileupCorrection4GeV,vars_struct.eT,vars_struct.eta);
+        cutDiscriminant += vars_struct.ip*InterpolateCuts(m_cutLikelihoodPileupCorrection,m_cutLikelihoodPileupCorrection4GeV,vars_struct.eT,vars_struct.eta);
     } else {
       if (vars_struct.eT > 7000. || !m_cutLikelihood4GeV.size()){
-	cutDiscriminant = m_cutLikelihood[ibin_combinedLH];
-	// If doPileupTransform, then correct the discriminant itself instead of the cut value
-	if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection.size()) 
-	  cutDiscriminant += vars_struct.ip*m_cutLikelihoodPileupCorrection[ibin_combinedLH];
+        cutDiscriminant = m_cutLikelihood[ibin_combinedLH];
+        // If doPileupTransform, then correct the discriminant itself instead of the cut value
+        if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection.size()) 
+          cutDiscriminant += vars_struct.ip*m_cutLikelihoodPileupCorrection[ibin_combinedLH];
       }
       else {
-	cutDiscriminant = m_cutLikelihood4GeV[etabin];
-	if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection4GeV.size()) 
-	  cutDiscriminant += vars_struct.ip*m_cutLikelihoodPileupCorrection4GeV[etabin];
+        cutDiscriminant = m_cutLikelihood4GeV[etabin];
+        if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection4GeV.size()) 
+          cutDiscriminant += vars_struct.ip*m_cutLikelihoodPileupCorrection4GeV[etabin];
       }
     }
 
     // Determine if the calculated likelihood value passes the cut
     ATH_MSG_DEBUG("Likelihood macro: Discriminant: ");
     if ( vars_struct.likelihood < cutDiscriminant )
-      {
-	ATH_MSG_DEBUG("Likelihood macro: Disciminant Cut Failed.");
-	passLH = false;
-      }
+    {
+      ATH_MSG_DEBUG("Likelihood macro: Disciminant Cut Failed.");
+      passLH = false;
+    }
   }
 
   // d0 cut
@@ -527,7 +526,7 @@ Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) c
       passDeltaEta = false;
     }
   }
-  
+
   // deltaPhiRes cut
   if (m_cutDeltaPhiRes.size()){
     if ( fabs(vars_struct.deltaphires) > m_cutDeltaPhiRes[ibin_combinedOther]){
@@ -541,16 +540,16 @@ Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) c
     // wstot cut
     if (m_cutWstotAtHighET.size()){
       if ( fabs(vars_struct.wstot) > m_cutWstotAtHighET[etabin]){
-	ATH_MSG_DEBUG("Likelihood macro: wstot Failed.");
-	passWstotAtHighET = false;
+        ATH_MSG_DEBUG("Likelihood macro: wstot Failed.");
+        passWstotAtHighET = false;
       }
     }
 
     // EoverP cut
     if (m_cutEoverPAtHighET.size()){
       if ( fabs(vars_struct.EoverP) > m_cutEoverPAtHighET[etabin]){
-	ATH_MSG_DEBUG("Likelihood macro: EoverP Failed.");
-	passEoverPAtHighET = false;
+        ATH_MSG_DEBUG("Likelihood macro: EoverP Failed.");
+        passEoverPAtHighET = false;
       }
     }
   }
@@ -578,7 +577,7 @@ Root::TElectronLikelihoodTool::calculate( double eta, double eT,double f3, doubl
 {
 
   LikeEnum::LHCalcVars_t vars;
- 
+
   vars.eta         = eta        ;
   vars.eT          = eT         ;
   vars.f3          = f3         ;
@@ -606,30 +605,25 @@ Root::TElectronLikelihoodTool::calculate(LikeEnum::LHCalcVars_t& vars_struct)  c
 {
   // Reset the results to defaul values
   double result = -999;
-  
+
   unsigned int etabin = getLikelihoodEtaBin(vars_struct.eta);
   double rhad_corr;
   if(etabin == 3 || etabin == 4) rhad_corr = vars_struct.rHad;
   else rhad_corr = vars_struct.rHad1;
   double d0significance = vars_struct.d0sigma == 0 ? 0. : fabs(vars_struct.d0)/vars_struct.d0sigma;
-  
-  double arr[] = {d0significance,vars_struct.eratio,vars_struct.deltaEta
-		  ,vars_struct.f1,vars_struct.f3
-		  ,vars_struct.Reta,rhad_corr,vars_struct.rphi
-		  ,vars_struct.d0,vars_struct.w2
-		  ,vars_struct.deltaPoverP,vars_struct.deltaphires
-		  ,vars_struct.TRT_PID};
-  std::vector<double> vec (arr, arr + sizeof(arr) / sizeof(double) );
-  
+
+  std::vector<double> vec ={d0significance,vars_struct.eratio,vars_struct.deltaEta
+    ,vars_struct.f1,vars_struct.f3
+      ,vars_struct.Reta,rhad_corr,vars_struct.rphi
+      ,vars_struct.d0,vars_struct.w2
+      ,vars_struct.deltaPoverP,vars_struct.deltaphires
+      ,vars_struct.TRT_PID};
   // Calculate the actual likelihood value and fill the return object
   result = this->evaluateLikelihood(vec,vars_struct.eT,vars_struct.eta,vars_struct.ip);
 
   return result;
 }
 
-
-  
-
 double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<float> varVector,double et,double eta,double ip) const
 {
   std::vector<double> vec;
@@ -639,8 +633,6 @@ double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<float> varV
   return evaluateLikelihood(vec,et,eta,ip);//,mask);  
 }
 
-
-
 double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<double> varVector,double et,double eta,double ip) const
 {
 
@@ -650,8 +642,8 @@ double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<double> var
   unsigned int ipbin  = getIpBin(ip);
 
   ATH_MSG_DEBUG("et: " << et << " eta: " << eta 
-		<< " etbin: " << etbin << " etabin: " << etabin);
-  
+                << " etbin: " << etbin << " etabin: " << etabin);
+
   if (etbin >= s_fnEtBinsHist) {
     ATH_MSG_WARNING("skipping etbin " << etbin << ", et " << et);
     return -999.;
@@ -660,10 +652,10 @@ double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<double> var
     ATH_MSG_WARNING("skipping etabin " << etabin << ", eta " << eta);
     return -999.;
   }
-  
+
   if (varVector.size() != s_fnVariables) 
     ATH_MSG_WARNING("Error! Variable vector size mismatch! Check your vector!" );
-  
+
   double SigmaS = 1.;
   double SigmaB = 1.;
 
@@ -673,9 +665,9 @@ double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<double> var
   const std::string el_TRT_PID_string = "el_TRT_PID";
 
   for(unsigned int var = 0; var < s_fnVariables; var++){
-    
+
     const std::string& varstr = fVariables[var];
-    
+
     // Skip variables that are masked off (not used) in the likelihood
     if (!(m_variableBitMask & (0x1 << var))){
       continue;
@@ -697,34 +689,31 @@ double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<double> var
       continue;
     }
     for (unsigned int s_or_b=0; s_or_b<2;s_or_b++) {
-      
+
       int bin = fPDFbins[s_or_b][ipbin][etbin][etabin][var]->FindBin(varVector[var]);
 
       double prob = 0;
       if (m_doSmoothBinInterpolation) {
-	prob = InterpolatePdfs(s_or_b,ipbin,et,eta,bin,var);
+        prob = InterpolatePdfs(s_or_b,ipbin,et,eta,bin,var);
       } 
       else {
-	double integral = double(fPDFbins[s_or_b][ipbin][etbin][etabin][var]->Integral());
-	if (integral == 0) {
-	  ATH_MSG_WARNING("Error! PDF integral == 0!");
-	  return -1.35;
-	}
-        
-	prob = double(fPDFbins[s_or_b][ipbin][etbin][etabin][var]->GetBinContent(bin)) / integral;
+        double integral = double(fPDFbins[s_or_b][ipbin][etbin][etabin][var]->Integral());
+        if (integral == 0) {
+          ATH_MSG_WARNING("Error! PDF integral == 0!");
+          return -1.35;
+        }
+
+        prob = double(fPDFbins[s_or_b][ipbin][etbin][etabin][var]->GetBinContent(bin)) / integral;
       }
 
       if   (s_or_b == 0) SigmaS *= prob;
       else if (s_or_b == 1) SigmaB *= prob;
     }
   }
-  
+
   return TransformLikelihoodOutput( SigmaS, SigmaB, ip, et, eta );
 }
 
-
-
-
 // --------------------------------------------
 double Root::TElectronLikelihoodTool::TransformLikelihoodOutput(double ps,double pb, double ip, double et, double eta) const {
   // returns transformed or non-transformed output
@@ -734,13 +723,13 @@ double Root::TElectronLikelihoodTool::TransformLikelihoodOutput(double ps,double
   if (ps < fEpsilon) ps = 0;
   if (pb < fEpsilon) pb = fEpsilon;
   double disc = ps/double(ps + pb);
-    
+
   if (disc >= 1.0) disc = 1. - 1.e-15;
   else if (disc <= 0.0) disc = fEpsilon;
-  
+
   double tau = 15.0;
   disc = - log(1.0/disc - 1.0)*(1./double(tau));
-    
+
   // Linearly transform the discriminant as a function of pileup, rather than
   // the old scheme of changing the cut value based on pileup. This is simpler for
   // the tuning, as well as ensuring subsets / making discriminants more transparent.
@@ -784,25 +773,25 @@ double Root::TElectronLikelihoodTool::TransformLikelihoodOutput(double ps,double
     } else {
       // default situation, in the case where 4-7 GeV bin is not defined
       if (et > 7000. || !m_discHardCutForPileupTransform4GeV.size()){
-	unsigned int etfinebinLH = getLikelihoodEtDiscBin(et,true);
-	unsigned int ibin_combined = etfinebinLH*s_fnEtaBins+etabin;
-	disc_hard_cut_ref       = m_discHardCutForPileupTransform[ibin_combined];
-	disc_hard_cut_ref_slope = m_discHardCutSlopeForPileupTransform[ibin_combined];
-	if (m_doCentralityTransform) disc_hard_cut_ref_quad  = m_discHardCutQuadForPileupTransform[ibin_combined];
-	disc_loose_ref          = m_discLooseForPileupTransform[ibin_combined];
+        unsigned int etfinebinLH = getLikelihoodEtDiscBin(et,true);
+        unsigned int ibin_combined = etfinebinLH*s_fnEtaBins+etabin;
+        disc_hard_cut_ref       = m_discHardCutForPileupTransform[ibin_combined];
+        disc_hard_cut_ref_slope = m_discHardCutSlopeForPileupTransform[ibin_combined];
+        if (m_doCentralityTransform) disc_hard_cut_ref_quad  = m_discHardCutQuadForPileupTransform[ibin_combined];
+        disc_loose_ref          = m_discLooseForPileupTransform[ibin_combined];
       } else {
-	if( m_discHardCutForPileupTransform4GeV.size() == 0 || m_discHardCutSlopeForPileupTransform4GeV.size() == 0 || m_discLooseForPileupTransform4GeV.size() == 0){
-	  ATH_MSG_WARNING("Vectors needed for pileup-dependent transform not correctly filled for 4-7 GeV bin! Skipping the transform.");
-	  return disc;
-	}
-	if(m_doCentralityTransform && m_discHardCutQuadForPileupTransform4GeV.size() == 0){
-	  ATH_MSG_WARNING("Vectors needed for centrality-dependent transform not correctly filled for 4-7 GeV bin! Skipping the transform.");
-	  return disc;
-	}
-	disc_hard_cut_ref       = m_discHardCutForPileupTransform4GeV[etabin];
-	disc_hard_cut_ref_slope = m_discHardCutSlopeForPileupTransform4GeV[etabin];
-	if (m_doCentralityTransform) disc_hard_cut_ref_quad  = m_discHardCutQuadForPileupTransform4GeV[etabin];
-	disc_loose_ref          = m_discLooseForPileupTransform4GeV[etabin];
+        if( m_discHardCutForPileupTransform4GeV.size() == 0 || m_discHardCutSlopeForPileupTransform4GeV.size() == 0 || m_discLooseForPileupTransform4GeV.size() == 0){
+          ATH_MSG_WARNING("Vectors needed for pileup-dependent transform not correctly filled for 4-7 GeV bin! Skipping the transform.");
+          return disc;
+        }
+        if(m_doCentralityTransform && m_discHardCutQuadForPileupTransform4GeV.size() == 0){
+          ATH_MSG_WARNING("Vectors needed for centrality-dependent transform not correctly filled for 4-7 GeV bin! Skipping the transform.");
+          return disc;
+        }
+        disc_hard_cut_ref       = m_discHardCutForPileupTransform4GeV[etabin];
+        disc_hard_cut_ref_slope = m_discHardCutSlopeForPileupTransform4GeV[etabin];
+        if (m_doCentralityTransform) disc_hard_cut_ref_quad  = m_discHardCutQuadForPileupTransform4GeV[etabin];
+        disc_loose_ref          = m_discLooseForPileupTransform4GeV[etabin];
       }
     }
 
@@ -855,12 +844,12 @@ unsigned int Root::TElectronLikelihoodTool::getIpBin(double ip) const{
 unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtaBin(double eta) const{
   const unsigned int nEtaBins = s_fnEtaBins;
   const double etaBins[nEtaBins] = {0.1,0.6,0.8,1.15,1.37,1.52,1.81,2.01,2.37,2.47};
-  
+
   for(unsigned int etaBin = 0; etaBin < nEtaBins; ++etaBin){
     if(fabs(eta) < etaBins[etaBin])
       return etaBin;
   }
-  
+
   return 9;
 }
 //---------------------------------------------------------------------------------------
@@ -890,9 +879,9 @@ unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtDiscBin(double eT, co
 
     for(unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin){
       if(eT < eTBins[eTBin])
-	return eTBin;
+        return eTBin;
     }
-    
+
     return nEtBins-1; // Return the last bin if > the last bin.
 
   }
@@ -902,15 +891,13 @@ unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtDiscBin(double eT, co
 
     for(unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin){
       if(eT < eTBins[eTBin])
-	return eTBin;
+        return eTBin;
     }
-    
+
     return nEtBins-1; // Return the last bin if > the last bin.
   }
 }
 
-
-
 //---------------------------------------------------------------------------------------
 // Gets the bin name. Given the HISTOGRAM binning (fnEtBinsHist)
 void Root::TElectronLikelihoodTool::getBinName(char* buffer, int etbin,int etabin, int ipbin, std::string iptype) const{
@@ -924,8 +911,6 @@ void Root::TElectronLikelihoodTool::getBinName(char* buffer, int etbin,int etabi
   }
   return;
 }
-
-
 //----------------------------------------------------------------------------------------
 unsigned int Root::TElectronLikelihoodTool::getLikelihoodBitmask(std::string vars) const{
   unsigned int mask = 0x0;
@@ -1003,10 +988,10 @@ double Root::TElectronLikelihoodTool::InterpolatePdfs(unsigned int s_or_b,unsign
       int NbinsPlus  = fPDFbins[s_or_b][ipbin][etbin+1][etabin][var]->GetNbinsX();
       int binplus = bin;
       if (Nbins < NbinsPlus){
-	binplus = int(round(bin*(Nbins/NbinsPlus)));
+        binplus = int(round(bin*(Nbins/NbinsPlus)));
       }
       else if (Nbins > NbinsPlus){
-	binplus = int(round(bin*(NbinsPlus/Nbins)));
+        binplus = int(round(bin*(NbinsPlus/Nbins)));
       }
       // do interpolation
       double integral_next = double(fPDFbins[s_or_b][ipbin][etbin+1][etabin][var]->Integral());
@@ -1037,78 +1022,16 @@ double Root::TElectronLikelihoodTool::InterpolatePdfs(unsigned int s_or_b,unsign
 // These are the variables availalble in the likelihood.
 const std::string Root::TElectronLikelihoodTool::fVariables[s_fnVariables] = {
   "el_d0significance"
-  ,"el_eratio"
-  ,"el_deltaeta1"
-  ,"el_f1"
-  ,"el_f3"
-  ,"el_reta"
-  ,"el_rhad"
-  ,"el_rphi"
-  ,"el_trackd0pvunbiased"
-  ,"el_weta2"
-  ,"el_DeltaPoverP"
-  ,"el_deltaphiRescaled"
-  ,"el_TRT_PID"
+    ,"el_eratio"
+    ,"el_deltaeta1"
+    ,"el_f1"
+    ,"el_f3"
+    ,"el_reta"
+    ,"el_rhad"
+    ,"el_rphi"
+    ,"el_trackd0pvunbiased"
+    ,"el_weta2"
+    ,"el_DeltaPoverP"
+    ,"el_deltaphiRescaled"
+    ,"el_TRT_PID"
 };
-
-//=============================================================================
-// SafeTH1, to allow us to immediately free the ROOT TH1 memory
-//=============================================================================
-
-Root::TElectronLikelihoodTool::SafeTH1::SafeTH1(TH1F* roothist){
-
-  int nbins = roothist->GetNbinsX();
-  m_binContent.resize(nbins,0); // Note that the PDF over/underflows are unused and thus unrepresented here!
-
-  for(int i = 0; i < nbins; ++i){
-    m_binContent[i] = roothist->GetBinContent(i+1);
-  }
-
-  m_firstBinLowEdge = roothist->GetBinLowEdge(1);
-  m_lastBinLowEdge  = roothist->GetBinLowEdge(nbins);
-  m_binWidth        = (m_lastBinLowEdge - m_firstBinLowEdge) / (GetNbinsX() - 1);
-  m_integral        = roothist->Integral(1,nbins);
-
-  return;
-}
-
-Root::TElectronLikelihoodTool::SafeTH1::~SafeTH1(){
-  return;
-}
-
-int Root::TElectronLikelihoodTool::SafeTH1::GetNbinsX(){
-  int n = m_binContent.size();
-  return n;
-}
-
-int Root::TElectronLikelihoodTool::SafeTH1::FindBin(double value){
-
-  if(value < m_firstBinLowEdge){
-    return 0; // first bin of m_binContent
-  }
-  if(value > m_lastBinLowEdge){
-    return GetNbinsX() - 1; // last bin of m_binContent
-  }
-
-  // note double rather than float due to incorrect rounding in O(1/10000) cases if float is used
-  double bin_double = (value - m_firstBinLowEdge) / m_binWidth; 
-  int bin = static_cast<int>(bin_double);
-
-  return bin;
-}
-
-double Root::TElectronLikelihoodTool::SafeTH1::GetBinContent(int bin){
-  int nbins = this->GetNbinsX();
-  // since we store the bin content in a vector we need a protection 
-  // for cases where we try to access a non-existing bin. In these 
-  // cases just go to the last bin
-  return (bin>nbins) ? m_binContent[nbins-1] : m_binContent[bin];
-}
-
-double Root::TElectronLikelihoodTool::SafeTH1::GetBinLowEdge(int bin){
-  return m_firstBinLowEdge + m_binWidth*bin;
-}
-
-double Root::TElectronLikelihoodTool::SafeTH1::Integral(){
-  return m_integral;
-}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h
index 5f0017183e2bf28d51f485989a918432b1eafe3f..4f46275c53d8dc4f437263fecb680d74568fc0f9 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h
@@ -1,385 +1,364 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
+   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ */
 
 // Dear emacs, this is -*-c++-*-
 //----------------------------------------------------------------------------------------
 
 /**
-   Author: Kurt Brendlinger <kurb@sas.upenn.edu>
-   
-   Includes the following operating points:
-   "Tight"      - Same background rejection as current (2012) tightpp  menu
-   "VeryTight"  - Same signal efficiency    as current (2012) tightpp  menu
-   "Medium"     - Same signal efficiency    as current (2012) mediumpp menu
-   "VeryLoose"  - Same background rejection as current (2012) multilepton menu
-   "Loose"      - Same signal efficiency    as current (2012) multilepton menu
-   
-   Usage:
-   In order to compile this outside the Athena framework, you also need to get PATCore from svn.
-   You need to include the header where you want to use it:
-   #include "ElectronPhotonSelectorTools/TElectronLikelihoodTool.h"
-
-   Then, before the event loop starts, you need to create an instance of this tool:
-   Root::TElectronLikelihoodTool* myElLHTool = new TElectronLikelihoodTool();
-
-   configure it:
-   myElLHTool->setPDFFileName( "path/to/package/data/ElectronLikelihoodPdfs.root" );
-
-   and initialize it:
-   myElLHTool->initialize();
-
-   To get the likelihood value for this electron, do:
-   double likelihood = double( myElLHTool->calculate(...) );
-
-   To see if an electron passes this selection (in this example, the "VeryLoose" selection), do:
-   bool passThisElectron = bool( myElLHTool->accept( likelihood, ... ) );
-
-   See below which variables you have to use.
-
-
-   In order to correctly apply the macro, you must use the following (d3pd) variables as inputs:
-   eta 		: el_etas2
-   eT (in MeV) 	: energy-rescaled (using egammaAnalysisUtils' EnergyRescalerUpgrade) pt, where pt is defined in 
-   twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/ElectronsEnergyDirection
-   so el_cl_pt if nSiHits < 4, or else 
-   el_cl_E/cosh(el_etas2)   THIS IS PROBABLY NOT CORRECT!!! Don't want to use rescaled energies. To be verified... 
-   f3               : el_f3
-   rHad 		: el_Ethad / pt (see above for pt)
-   rHad1 		: el_Ethad1/ pt
-   Reta     	: el_reta
-   w2 		: el_weta2
-   f1       	: el_f1
-   wstot    	: el_wstot
-   eratio 		: (el_emaxs1+el_Emax2 == 0.) ? 0. : (el_emaxs1-el_Emax2)/(el_emaxs1+el_Emax2)
-   (i.e. Eratio)
-   deltaEta 	: el_deltaeta1
-   d0 		: el_trackd0pvunbiased
-   TRratio 		: el_TRTHighTHitsRatio
-   eOverP 		: el_cl_E * el_trackqoverp (where el_cl_E is energy-rescaled)
-   deltaPhi 	: el_deltaphi2
-   d0sigma 		: el_tracksigd0pvunbiased
-   rphi     	: el_rphi
-   nTRT 		: el_nTRTHits
-   nTRTOutliers 	: el_nTRTOutliers
-   nSi 		: el_nSiHits
-   nSiOutliers 	: el_nPixelOutliers + el_nSCTOutliers
-   nPix 		: el_nPixHits
-   nPixOutliers 	: el_nPixelOutliers
-   nBlayer 		: el_nBLHits
-   nBlayerOutliers 	: el_nBLayerOutliers
-   expectBlayer 	: el_expectHitInBLayer
-   nNextToInnerMostLayer 		: next to the inner most 
-   nNextToInnerMostLayerOutliers 	: next to the inner most 
-   expectNextToInnerMostLayer 	: next to the inner most 
-   convBit 		: el_isEM & (0x1 << egammaPID::ConversionMatch_Electron)
-   ambiguityBit 	: cut on the ambiguity type
-   ip 		: Count number of vertices in vxp_n with >= 2 tracks in vxp_trk_n
-
-   Created:
-   June 2011
+Author: Kurt Brendlinger <kurb@sas.upenn.edu>
+
+Includes the following operating points:
+"Tight"      - Same background rejection as current (2012) tightpp  menu
+"VeryTight"  - Same signal efficiency    as current (2012) tightpp  menu
+"Medium"     - Same signal efficiency    as current (2012) mediumpp menu
+"VeryLoose"  - Same background rejection as current (2012) multilepton menu
+"Loose"      - Same signal efficiency    as current (2012) multilepton menu
+
+Usage:
+In order to compile this outside the Athena framework, you also need to get PATCore from svn.
+You need to include the header where you want to use it:
+#include "ElectronPhotonSelectorTools/TElectronLikelihoodTool.h"
+
+Then, before the event loop starts, you need to create an instance of this tool:
+Root::TElectronLikelihoodTool* myElLHTool = new TElectronLikelihoodTool();
+
+configure it:
+myElLHTool->setPDFFileName( "path/to/package/data/ElectronLikelihoodPdfs.root" );
+
+and initialize it:
+myElLHTool->initialize();
+
+To get the likelihood value for this electron, do:
+double likelihood = double( myElLHTool->calculate(...) );
+
+To see if an electron passes this selection (in this example, the "VeryLoose" selection), do:
+bool passThisElectron = bool( myElLHTool->accept( likelihood, ... ) );
+
+See below which variables you have to use.
+
+
+In order to correctly apply the macro, you must use the following (d3pd) variables as inputs:
+eta 		: el_etas2
+eT (in MeV) 	: energy-rescaled (using egammaAnalysisUtils' EnergyRescalerUpgrade) pt, where pt is defined in 
+twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/ElectronsEnergyDirection
+so el_cl_pt if nSiHits < 4, or else 
+el_cl_E/cosh(el_etas2)   THIS IS PROBABLY NOT CORRECT!!! Don't want to use rescaled energies. To be verified... 
+f3               : el_f3
+rHad 		: el_Ethad / pt (see above for pt)
+rHad1 		: el_Ethad1/ pt
+Reta     	: el_reta
+w2 		: el_weta2
+f1       	: el_f1
+wstot    	: el_wstot
+eratio 		: (el_emaxs1+el_Emax2 == 0.) ? 0. : (el_emaxs1-el_Emax2)/(el_emaxs1+el_Emax2)
+(i.e. Eratio)
+deltaEta 	: el_deltaeta1
+d0 		: el_trackd0pvunbiased
+TRratio 		: el_TRTHighTHitsRatio
+eOverP 		: el_cl_E * el_trackqoverp (where el_cl_E is energy-rescaled)
+deltaPhi 	: el_deltaphi2
+d0sigma 		: el_tracksigd0pvunbiased
+rphi     	: el_rphi
+nTRT 		: el_nTRTHits
+nTRTOutliers 	: el_nTRTOutliers
+nSi 		: el_nSiHits
+nSiOutliers 	: el_nPixelOutliers + el_nSCTOutliers
+nPix 		: el_nPixHits
+nPixOutliers 	: el_nPixelOutliers
+nBlayer 		: el_nBLHits
+nBlayerOutliers 	: el_nBLayerOutliers
+expectBlayer 	: el_expectHitInBLayer
+nNextToInnerMostLayer 		: next to the inner most 
+nNextToInnerMostLayerOutliers 	: next to the inner most 
+expectNextToInnerMostLayer 	: next to the inner most 
+convBit 		: el_isEM & (0x1 << egammaPID::ConversionMatch_Electron)
+ambiguityBit 	: cut on the ambiguity type
+ip 		: Count number of vertices in vxp_n with >= 2 tracks in vxp_trk_n
+
+Created:
+June 2011
 
 */
 //-------------------------------------------------------------------------------------------------------
-
-
 #ifndef TELECTRONLIKELIHOODTOOL_H
 #define TELECTRONLIKELIHOODTOOL_H
 
-#include <fstream>
-#include <iostream>
 // Include the return objects and the base class
 #include "AsgTools/AsgMessaging.h"
 #include "PATCore/AcceptInfo.h"
 #include "PATCore/AcceptData.h"
-
+//
 #include <string>                       // for string
 #include <vector>                       // for vector
+#include "SafeTH1.h"
 class TFile;
-class TH1F;
+
+
 namespace{
-    const unsigned int  IP_BINS=1;
+const unsigned int  IP_BINS=1;
 }
 namespace LikeEnum {
 
-    struct LHAcceptVars_t{
-        double likelihood;
-        double eta;
-        double eT;
-        int nSiHitsPlusDeadSensors;
-        int nPixHitsPlusDeadSensors;
-        bool passBLayerRequirement;
-        uint8_t ambiguityBit;
-        double d0;
-        double deltaEta;
-        double deltaphires;
-        double wstot;
-        double EoverP;
-        double ip;         
-    };
-
-    struct LHCalcVars_t{
-        double eta;
-        double eT;
-        double f3; 
-        double rHad; 
-        double rHad1;
-        double Reta;
-        double w2; 
-        double f1; 
-        double eratio;
-        double deltaEta; 
-        double d0; 
-        double d0sigma;
-        double rphi; 
-        double deltaPoverP;
-        double deltaphires;
-        double TRT_PID;
-        double ip;        
-    };
+struct LHAcceptVars_t{
+  double likelihood;
+  double eta;
+  double eT;
+  int nSiHitsPlusDeadSensors;
+  int nPixHitsPlusDeadSensors;
+  bool passBLayerRequirement;
+  uint8_t ambiguityBit;
+  double d0;
+  double deltaEta;
+  double deltaphires;
+  double wstot;
+  double EoverP;
+  double ip;         
+};
+
+struct LHCalcVars_t{
+  double eta;
+  double eT;
+  double f3; 
+  double rHad; 
+  double rHad1;
+  double Reta;
+  double w2; 
+  double f1; 
+  double eratio;
+  double deltaEta; 
+  double d0; 
+  double d0sigma;
+  double rphi; 
+  double deltaPoverP;
+  double deltaphires;
+  double TRT_PID;
+  double ip;        
+};
 }
 
 namespace Root {
-    class TElectronLikelihoodTool : public asg::AsgMessaging
-    {
-
-    public: 
-        /// Standard constructor
-
-        TElectronLikelihoodTool(const char* name = "TElectronLikelihoodTool");
-    
-        /// Standard destructor
-        ~TElectronLikelihoodTool();
-
-    private:
-        class SafeTH1{
-        public :
-            SafeTH1(TH1F* hist);
-            ~SafeTH1();
-            int GetNbinsX();
-            int FindBin(double);
-            double GetBinContent(int);
-            double GetBinLowEdge(int);
-            double Integral();
-
-        private:
-            std::vector<float> m_binContent;
-            double m_firstBinLowEdge;
-            double m_lastBinLowEdge;
-            double m_binWidth;
-            double m_integral;
-        };
-
-        // Main methods
-    public:
-        /// Initialize this class
-        StatusCode initialize();
-
-        /// accesss to the accept info object
-        const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; }
-
-        /// The main accept method: the actual cuts are applied here
-        asg::AcceptData accept(LikeEnum::LHAcceptVars_t& vars_struct) const;
-        asg::AcceptData accept( double likelihood,
-                                double eta, double eT,
-                                int nSiHitsPlusDeadSensors, int nPixHitsPlusDeadSensors,
-                                bool passBLayerRequirement,
-                                uint8_t ambiguityBit, double d0, double deltaEta, double deltaphires, 
-                                     double wstot, double EoverP, double ip ) const;
-        /** Return dummy accept with only info */
-        asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); }
-
-        double calculate(LikeEnum::LHCalcVars_t& vars_struct) const ;
-        double calculate( double eta, double eT,double f3, double rHad, double rHad1,
-                          double Reta, double w2, double f1, double eratio,
-                          double deltaEta, double d0, double d0sigma, double rphi,
-                          double deltaPoverP ,double deltaphires, double TRT_PID,
-                          double ip) const;
-    
-
-        /// Add an input file that holds the PDFs
-        inline void setPDFFileName ( const std::string& val ) { m_pdfFileName = val; }
-
-        /// Define the variable names
-        inline void setVariableNames ( const std::string& val ) { 
-            m_variableNames = val; 
-            m_variableBitMask = getLikelihoodBitmask(val);
-        }
-
-        /// Load the variable histograms from the pdf file.
-        int loadVarHistograms(std::string vstr, unsigned int varIndex);
-
-        /// Define the binning 
-        inline void setBinning ( const std::string& val ) { m_ipBinning = val; }
-
-        unsigned int getBitmask(void) const { return m_variableBitMask;} 
-        inline void setBitmask(unsigned int val) { m_variableBitMask = val; };
-
-        // Private methods
-    private:
-   
-        // For every input "varVector", make sure elements of vector are
-        // in the same order as prescribed in fVariables
-
-        /// Description???
-        double evaluateLikelihood(std::vector<double> varVector,double et,double eta,double ip=0) const;
-
-        /// Description???
-        double evaluateLikelihood(std::vector<float>  varVector,double et,double eta,double ip=0) const;
-
-
-        // To concoct a bitmask on your own, use the 
-        // variable names prescribed in fVariables.
-    
-        /// Description???
-        unsigned int getLikelihoodBitmask(std::string vars) const;
-    
-        double InterpolateCuts(const std::vector<double>& cuts,const std::vector<double>& cuts_4gev,double et,double eta) const;
-        double InterpolatePdfs(unsigned int s_or_b,unsigned int ipbin,double et,double eta,int bin,unsigned int var) const;
-    
-    public:
-        /** @brief cut min on b-layer hits*/
-        std::vector<int> m_cutBL;
-        /** @brief cut min on pixel hits*/
-        std::vector<int> m_cutPi;
-        /** @brief cut min on precision hits*/
-        std::vector<int> m_cutSi;
-        /** @brief cut max on track d0 bit*/
-        std::vector<double> m_cutA0;
-        /** @brief do cut on delta eta bit*/
-        std::vector<double> m_cutDeltaEta;
-        // /** @brief do cut on delta phi bit*/
-        std::vector<double> m_cutDeltaPhiRes;
-        /** @brief do cut on ambiguity bit*/
-        std::vector<int> m_cutAmbiguity;
-        /** @brief do remove f3 variable from likelihood at high Et (>80 GeV)*/
-        bool m_doRemoveF3AtHighEt;
-        /** @brief do remove TRTPID variable from likelihood at high Et (>80 GeV)*/
-        bool m_doRemoveTRTPIDAtHighEt;
-        /** @brief do smooth interpolation between bins */
-        bool m_doSmoothBinInterpolation;
-        /** @brief use one extra bin for high ET LH*/
-        bool m_useOneExtraHighETLHBin;
-        /** @brief ET threshold for using high ET cuts and bin */
-        double m_highETBinThreshold;
-        // /** @brief do cut on wstot above HighETBinThreshold bit*/
-        std::vector<double> m_cutWstotAtHighET;
-        // /** @brief do cut on EoverP above HighETBinThreshold bit*/
-        std::vector<double> m_cutEoverPAtHighET;
-        /** @brief do pileup-dependent transform on discriminant value*/
-        bool m_doPileupTransform;
-        /** @brief do centrality-dependent transform on discriminant value*/
-        bool m_doCentralityTransform;
-        /** @brief cut on likelihood output*/
-        std::vector<double> m_cutLikelihood;
-        /** @brief pileup correction factor for cut on likelihood output*/
-        std::vector<double> m_cutLikelihoodPileupCorrection;
-        /** @brief cut on likelihood output, 4 GeV bin*/
-        std::vector<double> m_cutLikelihood4GeV;
-        /** @brief pileup correction factor for cut on likelihood output, 4 GeV bin*/
-        std::vector<double> m_cutLikelihoodPileupCorrection4GeV;
-        /** @brief reference disc for very hard cut; used by pileup transform */
-        std::vector<double> m_discHardCutForPileupTransform;
-        /** @brief reference slope on disc for very hard cut; used by pileup transform */
-        std::vector<double> m_discHardCutSlopeForPileupTransform;
-        /** @brief reference quadratic apr on disc for very hard cut; used by centrality transform */
-        std::vector<double> m_discHardCutQuadForPileupTransform;
-        /** @brief reference disc for a pileup independent loose menu; used by pileup transform */
-        std::vector<double> m_discLooseForPileupTransform;
-        /** @brief reference disc for very hard cut; used by pileup transform - 4-7 GeV */
-        std::vector<double> m_discHardCutForPileupTransform4GeV;
-        /** @brief reference slope on disc for very hard cut; used by pileup transform - 4-7 GeV */
-        std::vector<double> m_discHardCutSlopeForPileupTransform4GeV;
-        /** @brief reference quadratic par on disc for very hard cut; used by centrality transform - 4-7 GeV */
-        std::vector<double> m_discHardCutQuadForPileupTransform4GeV;
-        /** @brief reference disc for a pileup independent loose menu; used by pileup transform - 4-7 GeV */
-        std::vector<double> m_discLooseForPileupTransform4GeV;
-        /** @brief max discriminant for which pileup transform is to be used */
-        double m_discMaxForPileupTransform;
-        /** @brief max nvtx or mu to be used in pileup transform  */
-        double m_pileupMaxForPileupTransform;
-        /** @brief variables to use in the LH*/
-        std::string m_variableNames;
-        /** Name of the pdf file*/
-        std::string m_pdfFileName;
-
-
-        // Private methods
-    private:
-        /// Apply a transform to zoom into the LH output peaks. Optionally do pileup correction too
-        double TransformLikelihoodOutput(double ps,double pb, double ip, double et, double eta) const;
-
-        /// Eta binning for pdfs and discriminant cuts.
-        unsigned int getLikelihoodEtaBin(double eta) const ;
-
-        /// Coarse Et binning. Used for the likelihood pdfs.
-        unsigned int getLikelihoodEtHistBin(double eT) const ;
-    
-        /// Fine Et binning. Used for the likelihood discriminant cuts.
-        unsigned int getLikelihoodEtDiscBin(double eT , const bool isLHbinning) const;
-
-        // Private member variables
-    private:
-        /// tool name
-        std::string         m_name;
-        
-        /// Accept info
-        asg::AcceptInfo     m_acceptInfo;
-      
-        /// The bitmask corresponding to the variables in the likelihood. For internal use.
-        unsigned int        m_variableBitMask;
-
-        /// Deprecated.
-        std::string         m_ipBinning;
-
-        /// Pointer to the opened TFile that holds the PDFs
-        TFile*              m_pdfFile;
-
-        /// The position of the kinematic cut bit in the AcceptInfo return object
-        int m_cutPosition_kinematic;
-
-        /// The position of the NSilicon cut bit in the AcceptInfo return object
-        int m_cutPosition_NSilicon;
-
-        /// The position of the NPixel cut bit in the AcceptInfo return object
-        int m_cutPosition_NPixel;
-
-        /// The position of the NBlayer cut bit in the AcceptInfo return object
-        int m_cutPosition_NBlayer;
-
-        /// The position of the ambiguity cut bit in the AcceptInfo return object
-        int m_cutPosition_ambiguity;
-
-        /// The position of the likelihood cut bit in the AcceptInfo return object
-        int m_cutPosition_LH;
-
-        /// The position of the d0 cut bit in the AcceptInfo return object
-        int m_cutPositionTrackA0;
-
-        /// The position of the deltaeta cut bit in the AcceptInfo return object
-        int m_cutPositionTrackMatchEta;
-
-        // /// The position of the deltaphi cut bit in the AcceptInfo return object
-        int m_cutPositionTrackMatchPhiRes;
-
-        // /// The position of the high ET wstot cut bit in the AcceptInfo return object
-        int m_cutPositionWstotAtHighET;
-
-        // /// The position of the high ET EoverP cut bit in the AcceptInfo return object
-        int m_cutPositionEoverPAtHighET;
-
-        static const double fIpBounds[IP_BINS+1];
-        static const unsigned int  s_fnEtBinsHist = 7;  // number of hists stored for original LH, including 4GeV bin (for backwards compatibility)
-        static const unsigned int  s_fnDiscEtBins = 9;  // number of discs stored for original LH, excluding 4GeV bin (for backwards compatibility)
-        static const unsigned int  s_fnDiscEtBinsOneExtra = 10; // number of discs stored for original LH plus one for HighETBinThreshold (useOneExtraHighETLHBin), excluding 4GeV bin
-        static const unsigned int  s_fnEtaBins        = 10;
-        static const unsigned int  s_fnVariables      = 13;
-        TElectronLikelihoodTool::SafeTH1*      fPDFbins     [2][IP_BINS][s_fnEtBinsHist][s_fnEtaBins][s_fnVariables]; // [sig(0)/bkg(1)][ip][et][eta][variable]
-        static const std::string  fVariables                [s_fnVariables];
-
-        unsigned int getIpBin(double ip) const;
-        void getBinName(char* buffer, int etbin,int etabin, int ipbin, std::string iptype) const;
-    };
+class TElectronLikelihoodTool : public asg::AsgMessaging
+{
+
+public: 
+  /// Standard constructor
+
+  TElectronLikelihoodTool(const char* name = "TElectronLikelihoodTool");
+
+  /// Standard destructor
+  ~TElectronLikelihoodTool();
+
+  // Main methods
+public:
+  /// Initialize this class
+  StatusCode initialize();
+
+  /// accesss to the accept info object
+  const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; }
+
+  /// The main accept method: the actual cuts are applied here
+  asg::AcceptData accept(LikeEnum::LHAcceptVars_t& vars_struct) const;
+  asg::AcceptData accept( double likelihood,
+                          double eta, double eT,
+                          int nSiHitsPlusDeadSensors, int nPixHitsPlusDeadSensors,
+                          bool passBLayerRequirement,
+                          uint8_t ambiguityBit, double d0, double deltaEta, double deltaphires, 
+                          double wstot, double EoverP, double ip ) const;
+  /** Return dummy accept with only info */
+  asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); }
+
+  double calculate(LikeEnum::LHCalcVars_t& vars_struct) const ;
+  double calculate( double eta, double eT,double f3, double rHad, double rHad1,
+                    double Reta, double w2, double f1, double eratio,
+                    double deltaEta, double d0, double d0sigma, double rphi,
+                    double deltaPoverP ,double deltaphires, double TRT_PID,
+                    double ip) const;
+
+
+  /// Add an input file that holds the PDFs
+  inline void setPDFFileName ( const std::string& val ) { m_pdfFileName = val; }
+
+  /// Define the variable names
+  inline void setVariableNames ( const std::string& val ) { 
+    m_variableNames = val; 
+    m_variableBitMask = getLikelihoodBitmask(val);
+  }
+
+  /// Load the variable histograms from the pdf file.
+  int loadVarHistograms(std::string vstr, unsigned int varIndex);
+
+  /// Define the binning 
+  inline void setBinning ( const std::string& val ) { m_ipBinning = val; }
+
+  unsigned int getBitmask(void) const { return m_variableBitMask;} 
+  inline void setBitmask(unsigned int val) { m_variableBitMask = val; };
+
+  // Private methods
+private:
+
+  // For every input "varVector", make sure elements of vector are
+  // in the same order as prescribed in fVariables
+
+  /// Description???
+  double evaluateLikelihood(std::vector<double> varVector,double et,double eta,double ip=0) const;
+
+  /// Description???
+  double evaluateLikelihood(std::vector<float>  varVector,double et,double eta,double ip=0) const;
+
+
+  // To concoct a bitmask on your own, use the 
+  // variable names prescribed in fVariables.
+
+  /// Description???
+  unsigned int getLikelihoodBitmask(std::string vars) const;
+
+  double InterpolateCuts(const std::vector<double>& cuts,const std::vector<double>& cuts_4gev,double et,double eta) const;
+  double InterpolatePdfs(unsigned int s_or_b,unsigned int ipbin,double et,double eta,int bin,unsigned int var) const;
+
+public:
+  /** @brief cut min on b-layer hits*/
+  std::vector<int> m_cutBL;
+  /** @brief cut min on pixel hits*/
+  std::vector<int> m_cutPi;
+  /** @brief cut min on precision hits*/
+  std::vector<int> m_cutSi;
+  /** @brief cut max on track d0 bit*/
+  std::vector<double> m_cutA0;
+  /** @brief do cut on delta eta bit*/
+  std::vector<double> m_cutDeltaEta;
+  // /** @brief do cut on delta phi bit*/
+  std::vector<double> m_cutDeltaPhiRes;
+  /** @brief do cut on ambiguity bit*/
+  std::vector<int> m_cutAmbiguity;
+  /** @brief do remove f3 variable from likelihood at high Et (>80 GeV)*/
+  bool m_doRemoveF3AtHighEt;
+  /** @brief do remove TRTPID variable from likelihood at high Et (>80 GeV)*/
+  bool m_doRemoveTRTPIDAtHighEt;
+  /** @brief do smooth interpolation between bins */
+  bool m_doSmoothBinInterpolation;
+  /** @brief use one extra bin for high ET LH*/
+  bool m_useOneExtraHighETLHBin;
+  /** @brief ET threshold for using high ET cuts and bin */
+  double m_highETBinThreshold;
+  // /** @brief do cut on wstot above HighETBinThreshold bit*/
+  std::vector<double> m_cutWstotAtHighET;
+  // /** @brief do cut on EoverP above HighETBinThreshold bit*/
+  std::vector<double> m_cutEoverPAtHighET;
+  /** @brief do pileup-dependent transform on discriminant value*/
+  bool m_doPileupTransform;
+  /** @brief do centrality-dependent transform on discriminant value*/
+  bool m_doCentralityTransform;
+  /** @brief cut on likelihood output*/
+  std::vector<double> m_cutLikelihood;
+  /** @brief pileup correction factor for cut on likelihood output*/
+  std::vector<double> m_cutLikelihoodPileupCorrection;
+  /** @brief cut on likelihood output, 4 GeV bin*/
+  std::vector<double> m_cutLikelihood4GeV;
+  /** @brief pileup correction factor for cut on likelihood output, 4 GeV bin*/
+  std::vector<double> m_cutLikelihoodPileupCorrection4GeV;
+  /** @brief reference disc for very hard cut; used by pileup transform */
+  std::vector<double> m_discHardCutForPileupTransform;
+  /** @brief reference slope on disc for very hard cut; used by pileup transform */
+  std::vector<double> m_discHardCutSlopeForPileupTransform;
+  /** @brief reference quadratic apr on disc for very hard cut; used by centrality transform */
+  std::vector<double> m_discHardCutQuadForPileupTransform;
+  /** @brief reference disc for a pileup independent loose menu; used by pileup transform */
+  std::vector<double> m_discLooseForPileupTransform;
+  /** @brief reference disc for very hard cut; used by pileup transform - 4-7 GeV */
+  std::vector<double> m_discHardCutForPileupTransform4GeV;
+  /** @brief reference slope on disc for very hard cut; used by pileup transform - 4-7 GeV */
+  std::vector<double> m_discHardCutSlopeForPileupTransform4GeV;
+  /** @brief reference quadratic par on disc for very hard cut; used by centrality transform - 4-7 GeV */
+  std::vector<double> m_discHardCutQuadForPileupTransform4GeV;
+  /** @brief reference disc for a pileup independent loose menu; used by pileup transform - 4-7 GeV */
+  std::vector<double> m_discLooseForPileupTransform4GeV;
+  /** @brief max discriminant for which pileup transform is to be used */
+  double m_discMaxForPileupTransform;
+  /** @brief max nvtx or mu to be used in pileup transform  */
+  double m_pileupMaxForPileupTransform;
+  /** @brief variables to use in the LH*/
+  std::string m_variableNames;
+  /** Name of the pdf file*/
+  std::string m_pdfFileName;
+
+
+  // Private methods
+private:
+  /// Apply a transform to zoom into the LH output peaks. Optionally do pileup correction too
+  double TransformLikelihoodOutput(double ps,double pb, double ip, double et, double eta) const;
+
+  /// Eta binning for pdfs and discriminant cuts.
+  unsigned int getLikelihoodEtaBin(double eta) const ;
+
+  /// Coarse Et binning. Used for the likelihood pdfs.
+  unsigned int getLikelihoodEtHistBin(double eT) const ;
+
+  /// Fine Et binning. Used for the likelihood discriminant cuts.
+  unsigned int getLikelihoodEtDiscBin(double eT , const bool isLHbinning) const;
+
+  // Private member variables
+private:
+  /// tool name
+  std::string         m_name;
+
+  /// Accept info
+  asg::AcceptInfo     m_acceptInfo;
+
+  /// The bitmask corresponding to the variables in the likelihood. For internal use.
+  unsigned int        m_variableBitMask;
+
+  /// Deprecated.
+  std::string         m_ipBinning;
+
+  /// Pointer to the opened TFile that holds the PDFs
+  TFile*              m_pdfFile;
+
+  /// The position of the kinematic cut bit in the AcceptInfo return object
+  int m_cutPosition_kinematic;
+
+  /// The position of the NSilicon cut bit in the AcceptInfo return object
+  int m_cutPosition_NSilicon;
+
+  /// The position of the NPixel cut bit in the AcceptInfo return object
+  int m_cutPosition_NPixel;
+
+  /// The position of the NBlayer cut bit in the AcceptInfo return object
+  int m_cutPosition_NBlayer;
+
+  /// The position of the ambiguity cut bit in the AcceptInfo return object
+  int m_cutPosition_ambiguity;
+
+  /// The position of the likelihood cut bit in the AcceptInfo return object
+  int m_cutPosition_LH;
+
+  /// The position of the d0 cut bit in the AcceptInfo return object
+  int m_cutPositionTrackA0;
+
+  /// The position of the deltaeta cut bit in the AcceptInfo return object
+  int m_cutPositionTrackMatchEta;
+
+  // /// The position of the deltaphi cut bit in the AcceptInfo return object
+  int m_cutPositionTrackMatchPhiRes;
+
+  // /// The position of the high ET wstot cut bit in the AcceptInfo return object
+  int m_cutPositionWstotAtHighET;
+
+  // /// The position of the high ET EoverP cut bit in the AcceptInfo return object
+  int m_cutPositionEoverPAtHighET;
+
+  static const double fIpBounds[IP_BINS+1];
+  static const unsigned int  s_fnEtBinsHist = 7;  // number of hists stored for original LH, including 4GeV bin (for backwards compatibility)
+  static const unsigned int  s_fnDiscEtBins = 9;  // number of discs stored for original LH, excluding 4GeV bin (for backwards compatibility)
+  static const unsigned int  s_fnDiscEtBinsOneExtra = 10; // number of discs stored for original LH plus one for HighETBinThreshold (useOneExtraHighETLHBin), excluding 4GeV bin
+  static const unsigned int  s_fnEtaBins        = 10;
+  static const unsigned int  s_fnVariables      = 13;
+  EGSelectors::SafeTH1*      fPDFbins     [2][IP_BINS][s_fnEtBinsHist][s_fnEtaBins][s_fnVariables]; // [sig(0)/bkg(1)][ip][et][eta][variable]
+  static const std::string  fVariables                [s_fnVariables];
+
+  unsigned int getIpBin(double ip) const;
+  void getBinName(char* buffer, int etbin,int etabin, int ipbin, std::string iptype) const;
+};
 
 } // End: namespace Root
 
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
index 8b2545996bae176fa03f66bd5120d1c9e37ae22f..5cfdd1c4ce651cb311690efd869771576270ad13 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
@@ -4,7 +4,6 @@
 #include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/EGammaAmbiguityTool.h"
-#include "ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h"
 #include "ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h"
 
 DECLARE_COMPONENT( AsgElectronIsEMSelector )
@@ -13,6 +12,5 @@ DECLARE_COMPONENT( AsgElectronLikelihoodTool )
 DECLARE_COMPONENT( AsgPhotonIsEMSelector )
 DECLARE_COMPONENT( AsgForwardElectronIsEMSelector )
 DECLARE_COMPONENT( EGammaAmbiguityTool )
-DECLARE_COMPONENT( AsgElectronChargeIDSelectorTool )
 DECLARE_COMPONENT( AsgDeadHVCellRemovalTool )
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagToolConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagToolConfig.py
index 39a3cf32cccba54f3cadb3e57aac0fec407ab577..b7ca2a9959e5dfc02e11bda83e9c5bb4dbfa8c6f 100644
--- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagToolConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagToolConfig.py
@@ -61,7 +61,7 @@ def BTagToolCfg(ConfigFlags, jetcol, TaggerList, useBTagFlagsDefaults = True, Ve
       
       if 'SoftMu' in TaggerList:
           from JetTagTools.SoftMuonTagConfig import SoftMuonTagCfg
-          accSoftMu = SoftMuonTagCfg(ConfigFlags, 'SoftMu')
+          accSoftMu = SoftMuonTagCfg(ConfigFlags, 'SoftMuonTag')
           softmutool = accSoftMu.popPrivateTools()
           acc.merge(accSoftMu)
           tagToolList.append(softmutool)
diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAssociationConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAssociationConfig.py
index 318d9a431be91d0a68f69f00e07d7e7d34f6a854..7f2b3f16aecaa48e0f42ae4dd437f6574f173a28 100644
--- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAssociationConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAssociationConfig.py
@@ -16,42 +16,29 @@ def BTagTrackAssociationCfg(flags, name, JetCollection, TaggerList, Verbose = Fa
     BTagTrackToJetAssocNameList = []
     if 'IP2D' in TaggerList or 'IP3D' in TaggerList:
         # calling simplified version of TrackAssociator to be checked with BTaggingConfiguration.py
-        accTrackAssociator = BTagTrackToJetAssociatorCfg(flags, 'BTagTrackToJetAssociator', **options)
-        tracktojetassociator = accTrackAssociator.popPrivateTools()
-        #tracktojetassociator = setupTrackAssociator('BTagTrackToJetAssociator', **options)
+        tracktojetassociator = acc.popToolsAndMerge(BTagTrackToJetAssociatorCfg(flags, 'BTagTrackToJetAssociator', **options))
         BTagTrackToJetAssociatorList.append(tracktojetassociator)
         BTagTrackToJetAssocNameList.append('BTagTrackToJetAssociator')
-        acc.merge(accTrackAssociator)
         
     if 'MultiSVbb1' in TaggerList or 'MultiSVbb2' in TaggerList:
         # calling simplified version of TrackAssociator to be checked with BTaggingConfiguration.py
-        accTrackAssociatorBB = BTagTrackToJetAssociatorCfg(flags, 'BTagTrackToJetAssociatorBB',
+        tracktojetassociatorbb = acc.popToolsAndMerge(BTagTrackToJetAssociatorCfg(flags, 'BTagTrackToJetAssociatorBB',
                                           options={'shareTracks': False,
                                              'useVariableSizedTrackCone' : True,
                                              'coneSizeFitPar1' : 3.15265e-01,
                                              'coneSizeFitPar2' : -3.66502e-01,
-                                             'coneSizeFitPar3' : -1.56387e-05})
-        tracktojetassociatorbb = accTrackAssociatorBB.popPrivateTools()
-        #tracktojetassociatorbb = setupTrackAssociator('BTagTrackToJetAssociatorBB',  
-        #                                  options={'shareTracks': False,
-        #                                     'useVariableSizedTrackCone' : True,
-        #                                     'coneSizeFitPar1' : 3.15265e-01,
-        #                                     'coneSizeFitPar2' : -3.66502e-01,
-        #                                     'coneSizeFitPar3' : -1.56387e-05})
+                                             'coneSizeFitPar3' : -1.56387e-05}))
         BTagTrackToJetAssociatorList.append(tracktojetassociatorbb)
         BTagTrackToJetAssocNameList.append('BTagTrackToJetAssociatorBB')
-        acc.merge(accTrackAssociatorBB)
 
     MuonToJetAssociatorList = []
     MuonToJetAssocNameList = []
     MuonContainerNameList = []
     if 'SoftMu' in TaggerList:
-        accMuonAssociator = BTagMuonToJetAssociatorCfg(flags, 'BTagMuonToJetAssociator', JetCollection)
-        tool = accMuonAssociator.popPrivateTools()
+        tool = acc.popToolsAndMerge(BTagMuonToJetAssociatorCfg(flags, 'BTagMuonToJetAssociator', JetCollection))
         MuonToJetAssociatorList.append(tool)
-        MuonToJetAssocNameList.append('BTagMuonToJetAssociator')
+        MuonToJetAssocNameList.append('Muons')
         MuonContainerNameList.append('Muons')
-        acc.merge(accMuonAssociator)
 
         
   # NOTE: The secondary vertex finders etc. don't need to be set up here depending on the flags; they are set up when needed by the
diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetBTaggerAlgConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetBTaggerAlgConfig.py
index 5c0e3aa9c872ae37c0754b256ea20de55484b62d..6da099a5042a15f7796fb33f7e896df10ea01456 100644
--- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetBTaggerAlgConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetBTaggerAlgConfig.py
@@ -39,7 +39,7 @@ def JetBTaggerAlgCfg(ConfigFlags, JetCollection="", TaggerList=[], SetupScheme="
 
     # Set remaining options
     btagname = ConfInstance.getOutputFilesPrefix() + jetcol
-    options.setdefault('name', 'FTAG')
+    options.setdefault('name', 'btagging_antikt4emtopo')
     options.setdefault('JetCollectionName', jetcol.replace('Track','PV0Track') + "Jets")
     options.setdefault('BTaggingCollectionName', btagname)
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/VxInternalEdmFactoryConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/VxInternalEdmFactoryConfig.py
index ae7fe8abd0d9ba8bb5518a74cc834dc1d9d718f3..47dc396570bdb86fb6e65a5e745d94509e2d95cb 100644
--- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/VxInternalEdmFactoryConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/VxInternalEdmFactoryConfig.py
@@ -18,9 +18,7 @@ def VxInternalEdmFactoryCfg(name, useBTagFlagsDefaults = True, **options):
     output: The actual tool, which can then by added to ToolSvc via ToolSvc += output."""
     acc = ComponentAccumulator()
     if useBTagFlagsDefaults:
-        accJetFitterFullLinearizedTrackFactory = JetFitterFullLinearizedTrackFactoryCfg('JetFitterFullLinearizedTrackFactory')
-        jetFitterFullLinearizedTrackFactory = accJetFitterFullLinearizedTrackFactory.popPrivateTools()
-        acc.merge(accJetFitterFullLinearizedTrackFactory)
+        jetFitterFullLinearizedTrackFactory = acc.popToolsAndMerge(JetFitterFullLinearizedTrackFactoryCfg('JetFitterFullLinearizedTrkFactory'))
         defaults = {
                      'LinearizedTrackFactory'  : jetFitterFullLinearizedTrackFactory, }
         for option in defaults:
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt
index 0c61897d751f9c54dbfd99663becd0d3d2637296..3faa52873f5adc3789ef07c3964500fdd387568e 100644
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt
@@ -11,10 +11,10 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/StoreGate
                           GaudiKernel
                           PRIVATE
-#                          PhysicsAnalysis/JetTagging/JetTagTools
                           Database/APR/FileCatalog
                           Database/AthenaPOOL/AthenaPoolUtilities
                           Database/AthenaPOOL/PoolSvc
+                          Reconstruction/MVAUtils
                           DetectorDescription/DetDescrCond/DetDescrCondTools )
 
 # External dependencies:
@@ -27,7 +27,7 @@ atlas_add_library( JetTagCalibrationLib
                    src/*.cxx
                    PUBLIC_HEADERS JetTagCalibration
                    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${LWTNN_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} ${LWTNN_LIBRARIES} AthenaBaseComps GaudiKernel StoreGateLib SGtests FileCatalog
+                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} ${LWTNN_LIBRARIES} AthenaBaseComps GaudiKernel StoreGateLib SGtests FileCatalog MVAUtils
                    PRIVATE_LINK_LIBRARIES AthenaPoolUtilities )
 
 atlas_add_component( JetTagCalibration
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h
index 75aa3a6b9d461268fd3056ae85fe230070a281e5..91cd51f3f5df64325d1bfaae1d2a9d95d0bb371d 100644
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -17,6 +17,7 @@
 #include "lwtnn/NNLayerConfig.hh"
 #include "lwtnn/LightweightNeuralNetwork.hh"
 #include "lwtnn/Exceptions.hh"
+#include "MVAUtils/BDT.h"
 
 class TObject;
 class TH1;
@@ -44,13 +45,17 @@ public:
   void clear();
   void printAliasesStatus() const; 
   void printHistosStatus() const; 
+  void printBdtsStatus() const;
   std::string getChannelAlias(const std::string& originalChannel) const;
   void addHisto(const unsigned int indexTagger, const std::string& name, TObject *);
   void deleteHistos();
+  void deleteBdts();
   void addDL1NN(const std::string& tagger, const std::string& channel, const lwt::JSONConfig& );
+  void addBdt(const std::string& tagger, const std::string& name, MVAUtils::BDT *);
   void addChannelAlias(const std::string& channel, const std::string& alias);
   TH1* retrieveHistogram(const std::string& folder, const std::string& channel, const std::string& hname) const; 
   lwt::JSONConfig retrieveDL1NN(std::string& tagger, const std::string& channel) const;
+  MVAUtils::BDT* retrieveBdt(const std::string& tagger, const std::string& channel) const;
   template <class T> T* retrieveTObject(const std::string& folder, const std::string& channel, const std::string& hname) const;
   
   std::string channelName(const std::string& fullHistoName) const;
@@ -62,6 +67,8 @@ private:
   std::map< std::string, std::string > m_channelAliasesMap;
   std::vector< std::string> m_taggers;
 
+  //MV2 and SoftMuon BDT
+  std::map< std::string, std::map<std::string, MVAUtils::BDT*> > m_bdts;
   //DL1 NN Json config
   std::map< std::string, std::map< std::string, lwt::JSONConfig >> m_DL1_NNConfig;
 };
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.icc b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.icc
index a65075dcfa701445504ece22bcac04c20af72780..e7554bdceeefb78a296abed1e57699295f794bdc 100755
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.icc
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/JetTagCalibration/JetTagCalibCondData.icc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TObject.h"
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx
index 02aef493682ea77bfa25f39bf882c60d834f2c93..833ec30896cf811d543d6905f92f841e84fcf11f 100644
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx
@@ -550,12 +550,25 @@ namespace Analysis {
                 writeCdo->addDL1NN(tagger, channel, nn_config);
               }
               else {
-                if (tagger == "IP2D" || tagger == "IP3D" || tagger == "SV1") {
-                  ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << hname << " ...");
-                  smoothAndNormalizeHistogram(hPointer, hname);
+                if ((tagger.find("MV2")!=std::string::npos ) or (tagger.find("SoftMu")!=std::string::npos ) or (tagger.find("MultiSV") !=std::string::npos)) {
+                  ATH_MSG_DEBUG("#BTAG# Build BDT for tagger " << tagger << " and jet collection " << channel << " and write it in condition data");
+                  TTree *tree = dynamic_cast<TTree*>(hPointer);
+                  if (tree) {
+                    ATH_MSG_DEBUG("#BTAG# The TTree to build the BDT for " << tagger<< " is valid");
+                    MVAUtils::BDT* bdt = new MVAUtils::BDT(tree);
+                    writeCdo->addBdt(tagger,channel,bdt);
+                  }
+                  else {
+                    writeCdo->addHisto(i,fname,hPointer);
+                  }
+                }
+                else {
+                  if (tagger == "IP2D" || tagger == "IP3D" || tagger == "SV1") {
+                    ATH_MSG_VERBOSE("#BTAG# Smoothing histogram " << hname << " ...");
+                    smoothAndNormalizeHistogram(hPointer, hname);
+                  }
+                  writeCdo->addHisto(i,fname,hPointer);
                 }
-
-                writeCdo->addHisto(i,fname,hPointer);
               }
 
               const TString rootClassName=hPointer->ClassName();
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx
index 4dc531a2f034f5225cc60894dcecb8c7b895312f..ce182507cea51bfab65587363bed379e46b5a581 100644
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx
@@ -28,6 +28,7 @@ JetTagCalibCondData::JetTagCalibCondData()
 
 JetTagCalibCondData::~JetTagCalibCondData() {
     this->deleteHistos();
+    this->deleteBdts();
 }
 
 void JetTagCalibCondData::deleteHistos() {
@@ -36,19 +37,31 @@ void JetTagCalibCondData::deleteHistos() {
     for(unsigned int i=0;i<m_histos.size();i++) {
       iter_hist = m_histos[i].begin();
       for(;iter_hist!=m_histos[i].end();++iter_hist) {
-        log << MSG::DEBUG << "#BTAG# delete histo of " << iter_hist->first << endmsg;
+        log << MSG::DEBUG << "#BTAG# delete histo of tagger " << i << " for channel " << iter_hist->first << endmsg;
         delete iter_hist->second;
       }
     }
 }
 
+void JetTagCalibCondData::deleteBdts() {
+    MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData");
+    for( auto const &tagger : m_bdts) {
+      for( auto const &channel : tagger.second) {
+        log << MSG::DEBUG << "#BTAG# Delete BDT of tagger " << tagger.first << " for channel " << channel.first << endmsg;
+        delete channel.second;
+      }
+    }
+    m_bdts.clear();
+}
+
+
 void JetTagCalibCondData::resize(const std::vector<std::string> taggers) {
     m_histos.reserve(taggers.size());
     for(uint i=0;i<taggers.size();i++) {
       m_taggers.push_back(taggers[i]);
       std::map<std::string, TObject* > hmap;
       m_histos.push_back(hmap);
-    }  
+    }
 }
 
 void JetTagCalibCondData::clear() {
@@ -56,7 +69,16 @@ void JetTagCalibCondData::clear() {
 }
 
 void JetTagCalibCondData::addHisto(const unsigned int indexTagger, const std::string& name, TObject * obj) {
+  MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData");
   m_histos[indexTagger].insert(std::make_pair(name, obj));
+  log << MSG::DEBUG << "#BTAG# m_histos size " << m_histos.size() << endmsg;
+}
+
+void JetTagCalibCondData::addBdt(const std::string&tagger, const std::string& channel, MVAUtils::BDT* bdt) {
+  MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData");
+  log << MSG::DEBUG << "#BTAG# Adding BDT of " << tagger << " in cond data for channel " << channel << endmsg;
+  m_bdts[tagger].insert(std::make_pair(channel, bdt));
+  log << MSG::DEBUG << "#BTAG# m_bdts size " << m_bdts.size() << endmsg;
 }
 
 void JetTagCalibCondData::addDL1NN(const std::string&tagger, const std::string& channel, const lwt::JSONConfig& obj) {
@@ -107,10 +129,47 @@ void JetTagCalibCondData::printHistosStatus() const {
   }
 }
 
+void JetTagCalibCondData::printBdtsStatus() const {
+  MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData");
+  log << MSG::DEBUG << "#BTAG# There are " << m_bdts.size() << " BDTs build with TTree retrieved from DB" << endmsg;
+  for( auto const &tagger : m_bdts) {
+    log << MSG::DEBUG << "#BTAG# BDT for Tagger " << tagger.first << endmsg;
+    for( auto const &channel : tagger.second) {
+      log << MSG::DEBUG << "#BTAG# Channel "<< channel.first << " has many trees " << channel.second->GetNTrees() << endmsg;
+    }
+  }
+}
+
 TH1* JetTagCalibCondData::retrieveHistogram(const std::string& folder, const std::string& channel, const std::string& hname) const {
   return this->retrieveTObject<TH1>(folder,channel,hname);
 }
 
+MVAUtils::BDT* JetTagCalibCondData::retrieveBdt(const std::string& tagger, const std::string& channel) const {
+  MVAUtils::BDT* bdt(nullptr);
+  std::string channelAlias = this->getChannelAlias(channel);
+  MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData");
+  log << MSG::DEBUG << "#BTAG# retrieving BDT for " << tagger
+	   << " (channel " << channel << " -> " << channelAlias << ") " << endmsg;
+  std::map< std::string , std::map<std::string, MVAUtils::BDT*>>::const_iterator mI;
+  mI = m_bdts.find(tagger);
+  if (mI != m_bdts.end()) {
+    log << MSG::DEBUG << "#BTAG# " << tagger << " BDT config found"<< endmsg;
+    std::map<std::string, MVAUtils::BDT*>::const_iterator mJ = mI->second.find(channelAlias);
+    if (mJ != mI->second.end()) {
+      log << MSG::DEBUG << "#BTAG# "<< tagger << " BDT config found for jet collection " << channel << endmsg;
+      bdt = mJ->second;
+    }
+    else {
+      log << MSG::DEBUG << "#BTAG# "<< tagger << " BDT config not found for jet collection " << channel << endmsg;
+    }
+  }
+  else {
+    log << MSG::DEBUG << "#BTAG# " << tagger << " BDT config not found"<< endmsg;
+  }
+
+  return bdt;
+}
+
 lwt::JSONConfig JetTagCalibCondData::retrieveDL1NN(std::string& tagger, const std::string& channel) const {
   MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData");
   lwt::JSONConfig  config;
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt
index 910e3d5721f78ea460efb5fc05aa95a210fa1c21..3623baab1362e546708ee208eab0137d04f57b17 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt
@@ -11,7 +11,6 @@ atlas_depends_on_subdirs(
     PUBLIC
     Control/AthToolSupport/AsgTools
     Control/AthenaBaseComps
-    Control/SGTools
     Control/StoreGate
     DetectorDescription/GeoPrimitives
     Event/xAOD/xAODBTagging
@@ -91,7 +90,7 @@ atlas_add_library( JetTagToolsLib
     DEFINITIONS ${CLHEP_DEFINITIONS}
 
     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${LWTNN_LIBRARIES}
-    AsgTools AthenaBaseComps SGTools GeoPrimitives xAODBTagging xAODJet
+    AsgTools AthenaBaseComps GeoPrimitives xAODBTagging xAODJet
     xAODTracking GaudiKernel JetTagInfo JetSubStructureUtils TrkParameters
     JetRecLib JetSubStructureMomentToolsLib egammaMVACalibLib MVAUtils
     TrackVertexAssociationToolLib ParticleJetToolsLib JetTagCalibrationLib
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h
index 40adba7e85d859295c44300793fd4b403b752596..27bb42b99f799493c7e24d59753b7c23feaee8b8 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MV2Tag.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JETTAGTOOLS_MV2TAG_H
@@ -75,7 +75,6 @@ namespace Analysis {
     //const xAOD::Vertex* m_priVtx;
 
     /** reader to define the MVA algorithms */
-    std::map<std::string, const MVAUtils::BDT*> m_egammaBDTs;
     std::list<std::string> m_undefinedReaders; // keep track of undefined readers to prevent too many warnings.
 
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h
index fb4686b59427d176bbde5989d9fdbf3864fa9949..1fc05b2665dc3b2e8a90574059419cec50e5c5a7 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/MultiSVTag.h
@@ -88,8 +88,6 @@ namespace Analysis
       float m_mx12_DR   ;
       float m_mx12_Angle;
       //...
-      std::map<std::string, MVAUtils::BDT*> m_egammaBDTs;
-      std::list<std::string> m_undefinedReaders;
       std::string m_sv0_infosource;
       std::string m_sv1_infosource;
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SharedHitMapper.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SharedHitMapper.h
index 248d76df10406b954acdbc9ee85c3ecfbf8ddb5a..d77c3dae0b828096729dcef82cf0d5f2db968c47 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SharedHitMapper.h
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SharedHitMapper.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRACKINGTOOLS_SHAREDHITMAPPER_H
@@ -75,9 +75,6 @@ class SharedHitTrackAssoc {
   private:
     Assoc m_assocs;
 };
-#ifndef TOOLS_CLASSID_TRAITS_H
-#include "SGTools/ClassID_traits.h"
-#endif
-// call me !
+#include "AthenaKernel/ClassID_traits.h"
 CLASS_DEF(SharedHitTrackAssoc, 491827624, 0)
 #endif // TRACKINGTOOLS_SHAREDHITMAPPER_H
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h
index 2b8f7d980b99cb32267f843e9fb096ae72ffdf09..739828e72e86202b08e4db121e5cbaf8fe13cf8a 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/SoftMuonTag.h
@@ -81,7 +81,6 @@ namespace Analysis
     std::string m_MV2cXX;
     std::string m_xAODBaseName;
 
-    std::map<std::string, MVAUtils::BDT*> m_egammaBDTs;
     std::list<std::string> m_undefinedReaders; // keep track of undefined readers to prevent too many warnings.
 
     float deltaR(float eta1, float eta2, float phi1, float phi2); 
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagFullLinearizedTrackFactoryConfig.py b/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagFullLinearizedTrackFactoryConfig.py
index b309b0760f798486888f7a111f8916bb47989a18..359fde7e35ec192ebdbc40c7d996f450c24012f4 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagFullLinearizedTrackFactoryConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagFullLinearizedTrackFactoryConfig.py
@@ -3,7 +3,7 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from TrkExTools.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
 
-# importi the FullLinearizedTrackFactory configurable
+# import the FullLinearizedTrackFactory configurable
 from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
 
 def BTagFullLinearizedTrackFactoryCfg(flags, name = 'FullLinearizedTrackFactory', useBTagFlagsDefaults = True, **options ):
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagTrackToVertexIPEstimatorConfig.py b/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagTrackToVertexIPEstimatorConfig.py
index 30b850e5713b9b4a09003d0e381ae29a6a8d45c9..65d4a618e3257176e58c9ec133ba0f19cdfe8be2 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagTrackToVertexIPEstimatorConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/python/BTagTrackToVertexIPEstimatorConfig.py
@@ -18,13 +18,8 @@ def BTagTrackToVertexIPEstimatorCfg( flags, name = 'TrkToVxIPEstimator', useBTag
     output: The actual tool."""
     acc = ComponentAccumulator()
     if useBTagFlagsDefaults:
-        #btagFullLinearizedTrackFactory = BTagFullLinearizedTrackFactoryCfg(flags, 'FullLinearizedTrackFactory')
-        accFullLinearizedTrackFactory = BTagFullLinearizedTrackFactoryCfg(flags, 'FullLinearizedTrackFactory')
-        btagFullLinearizedTrackFactory = accFullLinearizedTrackFactory.popPrivateTools()
-        acc.merge(accFullLinearizedTrackFactory)
-        accExtrapolator = AtlasExtrapolatorCfg(flags, 'AtlasExtrapolator')
-        atlasExtrapolator = accExtrapolator.popPrivateTools()
-        acc.merge(accExtrapolator)
+        btagFullLinearizedTrackFactory = acc.popToolsAndMerge(BTagFullLinearizedTrackFactoryCfg(flags, 'FullLinearizedTrkFactory'))
+        atlasExtrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags, 'AtlasExtrapolator'))
         defaults = { 'Extrapolator' : atlasExtrapolator,
                      'LinearizedTrackFactory' : btagFullLinearizedTrackFactory, }
         for option in defaults:
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/python/IP3DTagConfig.py b/PhysicsAnalysis/JetTagging/JetTagTools/python/IP3DTagConfig.py
index fce8607929cff9a9f22c33ce5d3817ebc97350bd..db9e16f6beeecef8bbb0ba7cd30e1404fb596dc7 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/python/IP3DTagConfig.py
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/python/IP3DTagConfig.py
@@ -46,15 +46,11 @@ def IP3DTagCfg( flags, name = 'IP3DTag', scheme = '', useBTagFlagsDefaults = Tru
                   "InANDNInShared", "PixShared", "SctShared",
                   "InANDNInSplit", "PixSplit",
                   "Good"]
-            accBTagTrackToVertexIPEstimator = BTagTrackToVertexIPEstimatorCfg(flags, 'TrkToVxIPEstimator')
-            trackToVertexIPEstimator = accBTagTrackToVertexIPEstimator.popPrivateTools()
-            acc.merge(accBTagTrackToVertexIPEstimator)
+            trackToVertexIPEstimator = acc.popToolsAndMerge(BTagTrackToVertexIPEstimatorCfg(flags, 'TrkToVxIPEstimator'))
             svForIPTool = acc.popToolsAndMerge(SVForIPToolCfg('SVForIPTool'))
             trackGradeFactory = acc.popToolsAndMerge(IPDetailedTrackGradeFactoryCfg('IP3DDetailedTrackGradeFactory'))
             trackSelectorTool = acc.popToolsAndMerge(IPTrackSelectorCfg(flags, 'IP3DTrackSelector'))
-            accLikelihood = NewLikelihoodToolCfg('IP3DNewLikelihoodTool', 'IP3D')
-            likelihood = accLikelihood.popPrivateTools()
-            acc.merge(accLikelihood)
+            likelihood = acc.popToolsAndMerge(NewLikelihoodToolCfg('IP3DNewLikelihoodTool', 'IP3D'))
             inDetTrackSelectionTool = acc.popToolsAndMerge(InDetTrackSelectorCfg('InDetTrackSelector'))
             trackVertexAssociationTool = acc.popToolsAndMerge(SpecialTrackAssociatorCfg('SpecialTrackAssociator'))
 
@@ -71,7 +67,7 @@ def IP3DTagCfg( flags, name = 'IP3DTag', scheme = '', useBTagFlagsDefaults = Tru
                      'SecVxFinderName'                  : 'SV1',
                      'storeTrackParticles': True,
                      'storeTrackParameters': True,
-                     'storeIpValues': False,
+                     'storeIpValues': True,
                      'LikelihoodTool'                   : likelihood,
                      'trackSelectorTool'                : trackSelectorTool,
                      'SVForIPTool'                      : svForIPTool,
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx
index daf271da48c9cf39ee5583ad4ef2e721dc0411be..768b3b1651d5bccb50f37f8683207c8e693046fd 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "GaudiKernel/IToolSvc.h"
@@ -90,14 +90,13 @@ namespace Analysis {
     // prepare readKey for calibration data:
     ATH_CHECK(m_readKey.initialize());
 
-    m_egammaBDTs.clear();
+    //m_egammaBDTs.clear();
     return StatusCode::SUCCESS;
   }
 
 
   StatusCode MV2Tag::finalize() {
     ATH_MSG_DEBUG("#BTAG# Finalizing MV2.");
-    for( auto temp: m_egammaBDTs ) if(temp.second) delete temp.second;
     for (auto& iter: m_local_inputvals) {
         delete iter.second;
     }
@@ -132,17 +131,23 @@ namespace Analysis {
     if (m_forceMV2CalibrationAlias) {
       author = m_MV2CalibAlias;
     }
-    std::unique_ptr<MVAUtils::BDT> bdt(nullptr); std::map<std::string, const MVAUtils::BDT*>::iterator it_egammaBDT;
 
     //Retrieval of Calibration Condition Data objects
     SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey);
-    //readCdo->printHistosStatus();
 
     std::string alias = readCdo->getChannelAlias(author);
 
+    //Retrieve BDT from cond object
+    MVAUtils::BDT *bdt(nullptr);
+    ATH_MSG_DEBUG("#BTAG# Getting MVAUtils::BDT for "<<m_taggerNameBase);
+    bdt = readCdo->retrieveBdt(m_taggerNameBase,author);
+    if (!bdt) {
+      ATH_MSG_WARNING("#BTAG# No BDT for " << m_taggerNameBase<<" exists in the condition object.. Disabling algorithm.");
+      m_disableAlgo=true;
+      return;
+    }
 
     TObjArray* toa=readCdo->retrieveTObject<TObjArray>(m_taggerNameBase,author, m_taggerNameBase+"Calib/"+m_varStrName);
-    TTree *tree = readCdo->retrieveTObject<TTree>(m_taggerNameBase,author, m_taggerNameBase+"Calib/"+m_treeName);
     std::string commaSepVars="";
     if (toa) {
       TObjString *tos= nullptr;
@@ -162,21 +167,9 @@ namespace Analysis {
     }
     inputVars.push_back(commaSepVars.substr(0,-1));
 
-    ATH_MSG_DEBUG("#BTAG# tree name= "<< tree->GetName() <<" inputVars.size()= "<< inputVars.size());// <<" toa->GetEntries()= "<< toa->GetEntries() <<"commaSepVars= "<< commaSepVars);
+    ATH_MSG_DEBUG("#BTAG# inputVars.size()= "<< inputVars.size() <<" toa->GetEntries()= "<< toa->GetEntries() <<"commaSepVars= "<< commaSepVars);
     for (unsigned int asv=0; asv<inputVars.size(); asv++) ATH_MSG_DEBUG("#BTAG# inputVar= "<< inputVars.at(asv));
 
-    ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase);
-  
-    if (tree) {
-      ATH_MSG_DEBUG("#BTAG# TTree with name: "<<m_treeName<<" exists in the calibration file."); 
-      bdt = std::make_unique<MVAUtils::BDT>(tree);
-    }
-    else {
-      ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm.");
-      m_disableAlgo=true;
-      return;
-    }
-
     CreateLocalVariables( inputs );
 
     std::vector<float*>  inputPointers; inputPointers.clear();
@@ -190,7 +183,6 @@ namespace Analysis {
       m_disableAlgo=true;
       return;
     }
- 
     bdt->SetPointers(inputPointers);
 
     // #2 fill inputs
@@ -198,13 +190,13 @@ namespace Analysis {
     //currently default values are hard coded in the definition of ReplaceNaN_andAssign()
     ReplaceNaN_andAssign(inputs);
 
-    // #3: Calcuation of MVA output variable(s)
+    // #3: Calculation of MVA output variable(s)
     /* compute MV2: */
     double mv2 = -10.;  double mv2m_pb=-10., mv2m_pu=-10., mv2m_pc=-10.;
 
-    if (m_taggerNameBase.find("MV2c")!=std::string::npos) mv2= GetClassResponse(bdt.get());//this gives back double
+    if (m_taggerNameBase.find("MV2c")!=std::string::npos) mv2= GetClassResponse(bdt);//this gives back double
       else { //if it is MV2m
-        std::vector<float> outputs= GetMulticlassResponse(bdt.get());//this gives back float
+        std::vector<float> outputs= GetMulticlassResponse(bdt);//this gives back float
       	//vector size is checked in the function above
       	mv2m_pb=outputs[0]; mv2m_pu=outputs[1]; mv2m_pc=outputs[2] ;
       }
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx
index a2fd28e40aac04a55c2ef54f389065c1273be492..6e8623e4dd401654a6ed946bea2b3ecee4a75923 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx
@@ -74,12 +74,10 @@ namespace Analysis
 
     // prepare readKey for calibration data:
     ATH_CHECK(m_readKey.initialize());
-    m_egammaBDTs.clear();
     return StatusCode::SUCCESS;
   }
 
   StatusCode MultiSVTag::finalize(){
-    for( auto temp: m_egammaBDTs ) if(temp.second) delete temp.second;
     return StatusCode::SUCCESS;
   }
 
@@ -94,9 +92,18 @@ namespace Analysis
     ATH_MSG_DEBUG("#BTAG# MSV Using jet type " << author << " for calibrations.");
     //....
     std::string alias = readCdo->getChannelAlias(author);
-
-    MVAUtils::BDT *bdt=0; std::map<std::string, MVAUtils::BDT*>::iterator it_egammaBDT;
     ATH_MSG_DEBUG("#BTAG# Jet author for MultiSVTag: " << author << ", alias: " << alias );
+
+    //Retrieve BDT from cond object
+    MVAUtils::BDT *bdt(nullptr);
+    ATH_MSG_DEBUG("#BTAG# Getting MVAUtils::BDT for "<<m_taggerNameBase);
+    bdt = readCdo->retrieveBdt(m_taggerNameBase,author);
+    if (!bdt) {
+      ATH_MSG_WARNING("#BTAG# No BDT for " << m_taggerNameBase<<" exists in the condition object.. Disabling algorithm.");
+      m_disableAlgo=true;
+      return StatusCode::SUCCESS;
+    }
+
     /* check if calibration (neural net structure or weights) has to be updated: */
     TObject* calib=readCdo->retrieveTObject<TObject>(m_taggerNameBase,author,m_taggerNameBase+"Calib");
 
@@ -109,18 +116,6 @@ namespace Analysis
     std::vector<std::string> inputVars; inputVars.clear();
     unsigned nConfgVar=0,calibNvars=0; bool badVariableFound=false;
 
-    ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase);
-
-    TTree *tree = readCdo->retrieveTObject<TTree>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_treeName);
-    if (tree) {
-      bdt = new MVAUtils:: BDT(tree); 
-    }
-    else {
-      ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm.");
-      m_disableAlgo=true;
-      return StatusCode::SUCCESS;
-    }
-
     TObjArray* toa= readCdo->retrieveTObject<TObjArray>(m_taggerNameBase,author,m_taggerNameBase+"Calib/"+m_varStrName);
     std::string commaSepVars="";
     if (toa) {
@@ -142,19 +137,11 @@ namespace Analysis
     if ( calibNvars!=nConfgVar or badVariableFound ) {
 	  ATH_MSG_WARNING( "#BTAG# Number of expected variables for MVA: "<< nConfgVar << "  does not match the number of variables found in the calibration file: " << calibNvars << " ... the algorithm will be 'disabled' "<<alias<<" "<<author);
       m_disableAlgo=true;
-      delete bdt;
       return StatusCode::SUCCESS;
     }
 
     bdt->SetPointers(inputPointers);
 
-    it_egammaBDT = m_egammaBDTs.find(alias);
-    if(it_egammaBDT!=m_egammaBDTs.end()) {
-      delete it_egammaBDT->second;
-      m_egammaBDTs.erase(it_egammaBDT);
-    }
-    m_egammaBDTs.insert( std::make_pair( alias, bdt ) );
-
     //the jet
     double jeteta = jetToTag->eta(), jetphi = jetToTag->phi(), jetpt = jetToTag->pt();
     m_jetpt = jetpt;
@@ -359,20 +346,7 @@ namespace Analysis
     //compute BDT weight
     double msvW = -9.;
     if( nvtx2trk>1 ){
-	it_egammaBDT = m_egammaBDTs.find(alias);
-	if(it_egammaBDT==m_egammaBDTs.end()) {
-	  int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),alias);
-	  if(0==alreadyWarned) {
-	    ATH_MSG_WARNING("#BTAG# no egammaBDT defined for jet collection alias, author: "<<alias<<" "<<author);
-	    m_undefinedReaders.push_back(alias);
-	  }
-	}
-	else{
-	  if(it_egammaBDT->second !=0) {
-	    msvW = GetClassResponse(it_egammaBDT->second);
-	    ATH_MSG_DEBUG("#BTAG# BB weight: "<<m_taggerNameBase<<" "<< msvW);
-	  }else ATH_MSG_WARNING("#BTAG# egamma BDT is 0 for alias, author: "<<alias<<" "<<author);
-	}
+      msvW = GetClassResponse(bdt);
     }
 
     if(m_runModus=="analysis") {
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx
index 8647b5c6583c74dc44f3b4999e56f740155c16a0..f7bcee30c3dcea2b85b250fa0adea92201315fc6 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/SoftMuonTag.cxx
@@ -166,7 +166,6 @@ namespace Analysis
     // prepare readKey for calibration data:
     ATH_CHECK(m_readKey.initialize());
     
-    m_egammaBDTs.clear();
     /** ANDREA **/
 
     /** retrieving ToolSvc: */
@@ -273,7 +272,6 @@ namespace Analysis
   {
     /** ANDREA **/
     ATH_MSG_DEBUG("#BTAG# Finalizing SoftMuonTag.");
-    for( auto temp: m_egammaBDTs ) if(temp.second) delete temp.second;
     /** ANDREA **/
     return StatusCode::SUCCESS;
   }
@@ -312,16 +310,24 @@ namespace Analysis
       }
     }
 
-    // #1: Preparation of MVA instance using egammaBDT
+    // #1: Preparation of MVA instance using BDT
     ATH_MSG_DEBUG("#BTAG# Jet author for SoftMuon: " << author );
 
-    MVAUtils::BDT *bdt=nullptr; std::map<std::string, MVAUtils::BDT*>::iterator it_egammaBDT;
-
     //Retrieval of Calibration Condition Data objects
     SG::ReadCondHandle<JetTagCalibCondData> readCdo(m_readKey);
 
+    ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase);
+    //Retrieve BDT from cond object
+    MVAUtils::BDT *bdt(nullptr);
+    ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase);
+    bdt = readCdo->retrieveBdt("SoftMu",author);
+    if (!bdt) {
+      ATH_MSG_WARNING("#BTAG# No BDT for " << m_taggerNameBase<<" exists in the condition object.. Disabling algorithm.");
+      m_disableAlgo=true;
+      return StatusCode::SUCCESS;
+    }
+
     TObjArray* toa=readCdo->retrieveTObject<TObjArray>("SoftMu",author, m_taggerNameBase+"Calib/"+m_varStrName);
-    TTree *tree = readCdo->retrieveTObject<TTree>("SoftMu",author, m_taggerNameBase+"Calib/"+m_treeName);
     std::string commaSepVars="";
     if (toa) {
       TObjString *tos= nullptr;
@@ -341,22 +347,9 @@ namespace Analysis
     }
     inputVars.push_back(commaSepVars.substr(0,-1));
 
-    ATH_MSG_DEBUG("#BTAG# tree name= "<< tree->GetName() <<" inputVars.size()= "<< inputVars.size());// <<" toa->GetEntries()= "<< toa->GetEntries() <<"commaSepVars= "<< commaSepVars);
+    ATH_MSG_DEBUG("#BTAG# inputVars.size()= "<< inputVars.size() <<" toa->GetEntries()= "<< toa->GetEntries() <<"commaSepVars= "<< commaSepVars);
     for (unsigned int asv=0; asv<inputVars.size(); asv++) ATH_MSG_DEBUG("#BTAG# inputVar= "<< inputVars.at(asv));
 
-    ATH_MSG_DEBUG("#BTAG# Booking MVAUtils::BDT for "<<m_taggerNameBase);
-  
-    if (tree) {
-      ATH_MSG_DEBUG("#BTAG# TTree with name: "<<m_treeName<<" exists in the calibration file."); 
-      bdt = new MVAUtils:: BDT(tree);
-    }
-    else {
-      ATH_MSG_WARNING("#BTAG# No TTree with name: "<<m_treeName<<" exists in the calibration file.. Disabling algorithm.");
-      m_disableAlgo=true;
-      delete bdt;
-      return StatusCode::SUCCESS;
-    }
-
     std::string alias = readCdo->getChannelAlias(author);
     std::vector<float*>  inputPointers; inputPointers.clear();
     unsigned nConfgVar=0; bool badVariableFound=false;
@@ -368,18 +361,11 @@ namespace Analysis
     if ( inputVars.size()!=nConfgVar or badVariableFound ) {
       ATH_MSG_WARNING("#BTAG# Number of expected variables for SoftMu: "<< nConfgVar << "  does not match the number of variables found in the calibration file: " << inputVars.size() << " ... the algorithm will be 'disabled' "<<alias<<" "<<author);
       m_disableAlgo=true;
-      delete bdt;
       return StatusCode::SUCCESS;
     }
  
     bdt->SetPointers(inputPointers);
 
-    it_egammaBDT = m_egammaBDTs.find(alias);
-    if(it_egammaBDT!=m_egammaBDTs.end()) {
-      delete it_egammaBDT->second;
-      m_egammaBDTs.erase(it_egammaBDT);
-    }
-    m_egammaBDTs.insert( std::make_pair( alias, bdt ) );  
 
     // Reference only: Fill control histograms and get jet label
     std::string pref = "";
@@ -589,20 +575,9 @@ namespace Analysis
     // #3: Computation of MVA output variable(s)
     /* compute SMT: */
     double smt = -1.1;
-    it_egammaBDT = m_egammaBDTs.find(alias);
-    if(it_egammaBDT==m_egammaBDTs.end()) {
-      int alreadyWarned = std::count(m_undefinedReaders.begin(),m_undefinedReaders.end(),alias);
-      if(0==alreadyWarned) {
-	ATH_MSG_WARNING("#BTAG# no egammaBDT defined for jet collection alias, author: "<<alias<<" "<<author);
-	m_undefinedReaders.push_back(alias);
-      }
-    }
-    else {
-      if(it_egammaBDT->second) {
-	smt = GetClassResponse(it_egammaBDT->second);//this gives back double
-      }
-      else ATH_MSG_WARNING("#BTAG# egamma BDT is 0 for alias, author: "<<alias<<" "<<author);
-    } 
+
+    smt = GetClassResponse(bdt);//this gives back double
+
     if (m_sm_dR==10.) smt=-1.1;
     ATH_MSG_DEBUG("#BTAG# SMT weight: " << smt <<", "<<alias<<", "<<author);
 
@@ -616,9 +591,6 @@ namespace Analysis
 
     /** ANDREA **/
 
-
-
-
     return  StatusCode::SUCCESS;
   }
 
diff --git a/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..be18d7a31b839ebc82480c24c4e13404b31d7e37
--- /dev/null
+++ b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+PhysicsAnalysis/JpsiUpsilonTools
diff --git a/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiExample.h b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiExample.h
index e6d553ba6d4c2f3de8dd123d5948222fb1974c8c..f9132125f92e083734166d0482f376b404f6a909 100644
--- a/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiExample.h
+++ b/PhysicsAnalysis/JpsiUpsilonTools/JpsiUpsilonTools/JpsiExample.h
@@ -7,12 +7,11 @@
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "HepPDT/ParticleDataTable.hh"
 
 #include "xAODTracking/TrackParticle.h"
 #include "xAODTracking/VertexContainer.h"
 #include "xAODTracking/VertexAuxContainer.h"
-
+#include "StoreGate/ReadDecorHandleKey.h"
 
 class TFile;
 class TTree;
@@ -85,7 +84,9 @@ private:
   TTree* m_auxTree; // Tree for auxilliary n-tuple
 
   SG::ReadHandleKey<xAOD::VertexContainer> m_JpsiCandidatesKey; //!< Name of J/psi container
-
+  SG::ReadDecorHandleKey<xAOD::Vertex> m_refPX;
+  SG::ReadDecorHandleKey<xAOD::Vertex> m_refPY;
+  SG::ReadDecorHandleKey<xAOD::Vertex> m_refPZ;
 
 };
  
diff --git a/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiExample.cxx b/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiExample.cxx
index 526e846647815e84c8c921164ca89a9279f6c8b3..dba1b90ab1964814d3905e6c53d5ba353debbade 100644
--- a/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiExample.cxx
+++ b/PhysicsAnalysis/JpsiUpsilonTools/src/JpsiExample.cxx
@@ -19,6 +19,7 @@
 #include "TFile.h"
 #include "TTree.h"
 #include "TVector3.h"
+#include "StoreGate/ReadDecorHandle.h"
 
 //////////////////////////////////////////////////////////////
 
@@ -32,6 +33,10 @@ JpsiExample::JpsiExample(const std::string& name, ISvcLocator* pSvcLocator) :
   declareProperty("outputNTupleName", m_userFName);
   declareProperty("JpsiCandidates"  ,m_JpsiCandidatesKey = "JpsiCandidates");
 
+  declareProperty("RefTrackPx", m_refPX);
+  declareProperty("RefTrackPy", m_refPY);
+  declareProperty("RefTrackPz", m_refPZ);
+
   // Global Counters; for truth statistics
   m_eventCntr = 0;
   m_jpsiCntr = 0;
@@ -110,7 +115,7 @@ StatusCode JpsiExample::initialize(){
   m_auxTree->Branch("trkOrigPz2", &m_trkOrigPz2);
 
 //  m_auxTree->Branch("rxyError", &m_rxyError);
-
+  ATH_CHECK(m_JpsiCandidatesKey.initialize());
   return StatusCode::SUCCESS;
   
 }
@@ -317,12 +322,13 @@ TVector3 JpsiExample::trackMomentum(const xAOD::Vertex * vxCandidate, uint trkIn
 //    pz = aPerigee->momentum()[Trk::pz];
 //  }
   
-  static SG::AuxElement::Accessor< std::vector<float> > refTrackPxAcc("RefTrackPx");
-  static SG::AuxElement::Accessor< std::vector<float> > refTrackPyAcc("RefTrackPy");
-  static SG::AuxElement::Accessor< std::vector<float> > refTrackPzAcc("RefTrackPz");
-  const std::vector<float>& refTrackPx = refTrackPxAcc(*vxCandidate);
-  const std::vector<float>& refTrackPy = refTrackPyAcc(*vxCandidate);
-  const std::vector<float>& refTrackPz = refTrackPzAcc(*vxCandidate);
+  SG::ReadDecorHandle<xAOD::Vertex, std::vector<float>> hx (m_refPX);
+  SG::ReadDecorHandle<xAOD::Vertex, std::vector<float>> hy (m_refPY);
+  SG::ReadDecorHandle<xAOD::Vertex, std::vector<float>> hz (m_refPZ);
+
+  const std::vector<float>& refTrackPx = hx(*vxCandidate);
+  const std::vector<float>& refTrackPy = hy(*vxCandidate);
+  const std::vector<float>& refTrackPz = hz(*vxCandidate);
 
   if(trkIndex < refTrackPx.size() && refTrackPx.size() == refTrackPy.size() && refTrackPz.size()) {
     px = refTrackPx[trkIndex];
diff --git a/PhysicsAnalysis/MCTruthClassifier/python/MCTruthClassifierBase.py b/PhysicsAnalysis/MCTruthClassifier/python/MCTruthClassifierBase.py
index ad81000bad7aa2b803c029092623573c3bc240a7..5f52cea53f2ce480c5810f16c4663505c29fe06f 100644
--- a/PhysicsAnalysis/MCTruthClassifier/python/MCTruthClassifierBase.py
+++ b/PhysicsAnalysis/MCTruthClassifier/python/MCTruthClassifierBase.py
@@ -47,7 +47,6 @@ MySubUpdators += [NoElossMaterialEffectsUpdator.name()] # for muon
 	           
 theAtlasExtrapolator.MaterialEffectsUpdators = MyUpdators
 theAtlasExtrapolator.SubMEUpdators = MySubUpdators
-ToolSvc+=theAtlasExtrapolator
 	           
 from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
 ClassifierParticleCaloExtensionTool= Trk__ParticleCaloExtensionTool(name="ClassifierParticleCaloExtensionTool",
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/CMakeLists.txt b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..18d56ccb9b00572eddffeb9ab813f1a0c9eebdb1
--- /dev/null
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/CMakeLists.txt
@@ -0,0 +1,43 @@
+# The name of the package:
+atlas_subdir( VKalVrtValidation )
+
+# Extra dependencies, based on the build environment:
+set( extra_deps )
+if( NOT XAOD_STANDALONE )
+   set( extra_deps Control/AthenaBaseComps Control/AthAnalysisBaseComps GaudiKernel )
+endif()
+
+# The dependencies of the package:
+atlas_depends_on_subdirs(
+   PUBLIC 
+   PRIVATE
+   Event/xAOD/xAODEventInfo
+   PhysicsAnalysis/JpsiUpsilonTools
+   Tracking/TrkVertexFitter/TrkVKalVrtFitter
+   ${extra_deps} )
+
+# Externals used by the package:
+find_package( ROOT COMPONENTS Core  )
+
+find_package( HepPDT )
+
+# Libraries in the package:
+atlas_add_library( VKalVrtValidationLib
+   VKalVrtValidation/*.h src/*.cxx
+   PUBLIC_HEADERS VKalVrtValidation
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} 
+   INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} xAODBase AthenaBaseComps AthAnalysisBaseCompsLib xAODTracking JpsiUpsilonToolsLib
+   )
+
+if( NOT XAOD_STANDALONE )
+   atlas_add_component( VKalVrtValidation
+   src/components/*.cxx
+   LINK_LIBRARIES VKalVrtValidationLib )
+endif()
+
+
+# Install files from the package:
+atlas_install_joboptions( share/*.py )
+
+
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/AnalysisMasterCascade.py b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/AnalysisMasterCascade.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3f69b3d5da332cf87f5a15e8ad280436c6cfc6a
--- /dev/null
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/AnalysisMasterCascade.py
@@ -0,0 +1,57 @@
+############################################################
+# AnalysisMasterAuto.py
+# These are the master job options for running your analysis
+# Include your own job options as shown below ensuring you
+# do not overwrite things set here
+# RUNS AUTOCONFIG - no need to set tags
+############################################################
+
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+import glob
+athenaCommonFlags.FilesInput = glob.glob("DAOD_BPHY5.pool.root")
+
+#athenaCommonFlags.PoolInputQuery.set_Value_and_Lock("") # Needed for TAG jobs (as is)
+from RecExConfig.RecFlags import rec
+
+rec.doTrigger.set_Value_and_Lock(False) # leave false; nothing to do with trigger analysis  
+
+# include your algorithm job options here
+rec.UserAlgs.set_Value_and_Lock("RunCascadeExample.py")
+
+# Output log setting; this is for the framework in general
+# You may over-ride this in your job options for your algorithm
+rec.OutputLevel.set_Value_and_Lock(INFO);
+
+# Write settings; keep all of these to false.
+# Control the writing of your own n-tuple in the alg's job options
+rec.doCBNT.set_Value_and_Lock(False)
+rec.doWriteAOD.set_Value_and_Lock (False)
+rec.doWriteTAG.set_Value_and_Lock (False)
+rec.doHist.set_Value_and_Lock (False)
+
+# These 2 lines are needed for the AODFix mechanism
+rec.readRDO=False
+rec.doESD=False
+
+# main jobOption - must always be included
+#include("RecJobTransforms/UseOracle.py") # DB access
+include ("RecExCommon/RecExCommon_topOptions.py")
+# Following 3 lines needed for TAG jobs (as is)
+#svcMgr.EventSelector.RefName= "StreamAOD"
+#svcMgr.EventSelector.CollectionType="ExplicitROOT"
+#svcMgr.EventSelector.Query = "" 
+
+theApp.EvtMax = 500 # number of event to process
+
+# Stops writing of monitoring ntuples (big files)
+#from PerfMonComps.PerfMonFlags import jobproperties as jp
+#jp.PerfMonFlags.doMonitoring = True
+#jp.PerfMonFlags.doFastMon = False
+enableperfmon = False;
+from RecExConfig.RecFlags import rec
+rec.doPerfMon.set_Value_and_Lock( False )
+rec.doDetailedPerfMon.set_Value_and_Lock( enableperfmon )
+rec.doSemiDetailedPerfMon.set_Value_and_Lock( False )
+from PerfMonComps.PerfMonFlags import jobproperties
+jobproperties.PerfMonFlags.doMonitoring.set_Value_and_Lock( enableperfmon )
+
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/Run4VertexExample.py b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/Run4VertexExample.py
new file mode 100644
index 0000000000000000000000000000000000000000..6ee689a198b53e5f1eca4067d577b6a08f9d5aec
--- /dev/null
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/Run4VertexExample.py
@@ -0,0 +1,171 @@
+# ------------------------
+# SET UP FITTER 
+# ------------------------
+
+# User's analysis requirements here:
+# ----------------------------------
+
+from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+InDetExtrapolator = AtlasExtrapolator(name     = "AtlasExtrapolator")
+ToolSvc += InDetExtrapolator
+print      InDetExtrapolator
+
+from TrkV0Fitter.TrkV0FitterConf import Trk__TrkV0VertexFitter
+TrkV0Fitter = Trk__TrkV0VertexFitter(name              = "TrkV0FitterName",
+                                         MaxIterations     = 10,
+                                         Use_deltaR        = False,
+                                         Extrapolator      = InDetExtrapolator
+        )
+ToolSvc += TrkV0Fitter
+print TrkV0Fitter
+
+from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
+TrkVKalVrtFitter = Trk__TrkVKalVrtFitter(  name                = "VKalVrtFitter",
+                                           Extrapolator        = InDetExtrapolator,
+                                           FirstMeasuredPoint  = False,
+                                           MakeExtendedVertex  = True)
+ToolSvc += TrkVKalVrtFitter
+print TrkVKalVrtFitter
+
+
+
+
+from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
+VtxPointEstimator = InDet__VertexPointEstimator(name             = "VtxPointEstimator",
+                                                    MinDeltaR              = [-10000.,-10000.,-10000.],
+                                                    MaxDeltaR              = [10000.,10000.,10000.],
+                                                    MaxPhi                 = [10000., 10000., 10000.],
+                                                    MaxChi2OfVtxEstimation = 2000.)
+ToolSvc += VtxPointEstimator
+print VtxPointEstimator
+
+from InDetRecExample.InDetKeys import InDetKeys
+
+from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
+InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(name  = "CascadeInDetPrdAssociationTool", 
+ PixelClusterAmbiguitiesMapName = InDetKeys.GangedPixelMap())
+ToolSvc += InDetPrdAssociationTool
+print InDetPrdAssociationTool
+
+
+from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
+InDetTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(name         = "CascInDetSummaryHelper",
+                                      AssoTool     = InDetPrdAssociationTool,
+                                     DoSharedHits = False,
+                                     HoleSearch   = InDetHoleSearchTool,
+                                     usePixel      = DetFlags.haveRIO.pixel_on(),
+                                     useSCT        = DetFlags.haveRIO.SCT_on(),
+                                     useTRT        = DetFlags.haveRIO.TRT_on())
+ToolSvc += InDetTrackSummaryHelperTool
+print InDetTrackSummaryHelperTool
+
+from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
+InDetTrackSummaryTool = Trk__TrackSummaryTool(name = "CascadeInDetTrackSummaryTool",
+                                                  InDetSummaryHelperTool = InDetTrackSummaryHelperTool,
+                                                  doSharedHits           = False,
+                                                  InDetHoleSearchTool    = InDetHoleSearchTool)
+
+ToolSvc += InDetTrackSummaryTool
+print InDetTrackSummaryTool
+
+
+
+from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool
+InDetTrackSelectorTool = InDet__InDetDetailedTrackSelectorTool(name = "cascade_InDetDetailedTrackSelectorTool",
+                                                                       pTMin                = 400.0,
+                                                                       IPd0Max              = 10000.0,
+                                                                       IPz0Max              = 10000.0,
+                                                                       z0Max                = 10000.0,
+                                                                       sigIPd0Max           = 10000.0,
+                                                                       sigIPz0Max           = 10000.0,
+                                                                       d0significanceMax    = -1.,
+                                                                       z0significanceMax    = -1.,
+                                                                       etaMax               = 9999.,
+                                                                       useTrackSummaryInfo  = True,
+                                                                       nHitBLayer           = 0,
+                                                                       nHitPix              = 1,
+                                                                       nHitBLayerPlusPix    = 1,
+                                                                       nHitSct              = 2,
+                                                                       nHitSi               = 3,
+                                                                       nHitTrt              = 0,
+                                                                       nHitTrtHighEFractionMax = 10000.0,
+                                                                       useSharedHitInfo     = False,
+                                                                       useTrackQualityInfo  = True,
+                                                                       fitChi2OnNdfMax      = 10000.0,
+                                                                       TrtMaxEtaAcceptance  = 1.9,
+                                                                       TrackSummaryTool     = InDetTrackSummaryTool,
+                                                                       Extrapolator         = InDetExtrapolator
+                                                                      )
+        
+ToolSvc += InDetTrackSelectorTool
+print InDetTrackSelectorTool
+
+
+
+from JpsiUpsilonTools.JpsiUpsilonToolsConf import Analysis__JpsiFinder
+myJpsiFinder = Analysis__JpsiFinder(name                         = "JpsiFinder",
+                                        OutputLevel                 = INFO,
+                                        muAndMu                     = True,
+                                        muAndTrack                  = False,
+                                        TrackAndTrack               = False,
+                                        assumeDiMuons               = True, 
+                                        invMassUpper                = 3600.0,
+                                        invMassLower                = 2600.0,
+                                        Chi2Cut                     = 30.,
+                                        oppChargesOnly	            = True,
+                                        combOnly		    = True,
+                                        atLeastOneComb              = False,
+                                        useCombinedMeasurement      = False, # Only takes effect if combOnly=True	
+                                        muonCollectionKey           = "Muons",
+                                        TrackParticleCollection     = "InDetTrackParticles",
+                                        V0VertexFitterTool          = TrkV0Fitter,             # V0 vertex fitter
+                                        useV0Fitter                 = False,                   # if False a TrkVertexFitterTool will be used
+                                        TrkVertexFitterTool         = TrkVKalVrtFitter,        # VKalVrt vertex fitter
+                                        TrackSelectorTool           = InDetTrackSelectorTool,
+                                        VertexPointEstimator        = VtxPointEstimator,
+                                        useMCPCuts                  = False)
+ToolSvc += myJpsiFinder
+print      myJpsiFinder
+
+from JpsiUpsilonTools.JpsiUpsilonToolsConf import Analysis__JpsiPlus2Tracks
+BPHY5BsJpsiKK = Analysis__JpsiPlus2Tracks(name = "BPHY5BsJpsiKK",
+                                        OutputLevel = INFO,
+kaonkaonHypothesis			= True,
+pionpionHypothesis                      = False,
+kaonpionHypothesis                      = False,
+trkThresholdPt			        = 800.0,
+trkMaxEta				    = 3.0,
+BMassUpper				    = 5800.0,
+BMassLower				    = 5000.0,
+#DiTrackMassUpper = 1019.445 + 100.,
+#DiTrackMassLower = 1019.445 - 100.,
+Chi2Cut                     = 8.0,
+TrkQuadrupletMassUpper      = 6000.0,
+TrkQuadrupletMassLower      = 4800.0,
+JpsiContainerKey		    = "JpsiCandidates",
+TrackParticleCollection     = "InDetTrackParticles",
+MuonsUsedInJpsi			    = "Muons",
+TrkVertexFitterTool		    = TrkVKalVrtFitter,
+TrackSelectorTool		    = InDetTrackSelectorTool,
+UseMassConstraint		    = True)
+        
+ToolSvc += BPHY5BsJpsiKK
+print      BPHY5BsJpsiKK    
+
+
+from JpsiUpsilonTools.JpsiUpsilonToolsConf import JpsiAlg
+
+JpsiA = JpsiAlg(name = "JpsiA", JpsiCandidatesOutputName = "JpsiCandidates",
+                       JpsiFinderName           = myJpsiFinder)
+
+TwoTracksA = JpsiAlg(name = "TwoTracksA"  , JpsiCandidatesOutputName = "TwoTracks",
+                       JpsiFinderName           = BPHY5BsJpsiKK)
+#-------------------------------------------------------------
+# User analysis steering algorithm
+#-------------------------------------------------------------
+from AthenaCommon.AlgSequence import AlgSequence, AthSequencer
+job = AlgSequence()
+job += AthSequencer("ModSequence1")
+job.ModSequence1 += JpsiA
+job.ModSequence1 += TwoTracksA
+
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/RunCascadeExample.py b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/RunCascadeExample.py
new file mode 100644
index 0000000000000000000000000000000000000000..a86a6eba67468353caddafaff5264c11931cbf6f
--- /dev/null
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/share/RunCascadeExample.py
@@ -0,0 +1,147 @@
+# ------------------------
+# SET UP FITTER 
+# ------------------------
+
+# User's analysis requirements here:
+# ----------------------------------
+
+from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+InDetExtrapolator = AtlasExtrapolator(name     = "AtlasExtrapolator")
+ToolSvc += InDetExtrapolator
+print      InDetExtrapolator
+
+from TrkV0Fitter.TrkV0FitterConf import Trk__TrkV0VertexFitter
+TrkV0Fitter = Trk__TrkV0VertexFitter(name              = "TrkV0FitterName",
+                                         MaxIterations     = 10,
+                                         Use_deltaR        = False,
+                                         Extrapolator      = InDetExtrapolator
+        )
+ToolSvc += TrkV0Fitter
+print TrkV0Fitter
+
+from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
+TrkVKalVrtFitter = Trk__TrkVKalVrtFitter(  name                = "VKalVrtFitter",
+                                           Extrapolator        = InDetExtrapolator,
+                                           FirstMeasuredPoint  = False,
+                                           MakeExtendedVertex  = True)
+ToolSvc += TrkVKalVrtFitter
+print TrkVKalVrtFitter
+
+
+
+
+from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
+VtxPointEstimator = InDet__VertexPointEstimator(name             = "VtxPointEstimator",
+                                                    MinDeltaR              = [-10000.,-10000.,-10000.],
+                                                    MaxDeltaR              = [10000.,10000.,10000.],
+                                                    MaxPhi                 = [10000., 10000., 10000.],
+                                                    MaxChi2OfVtxEstimation = 2000.)
+ToolSvc += VtxPointEstimator
+print VtxPointEstimator
+
+from InDetRecExample.InDetKeys import InDetKeys
+
+from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
+InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(name  = "CascadeInDetPrdAssociationTool", 
+ PixelClusterAmbiguitiesMapName = InDetKeys.GangedPixelMap())
+ToolSvc += InDetPrdAssociationTool
+print InDetPrdAssociationTool
+
+
+from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
+InDetTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(name         = "CascInDetSummaryHelper",
+                                      AssoTool     = InDetPrdAssociationTool,
+                                     DoSharedHits = False,
+                                     HoleSearch   = InDetHoleSearchTool,
+                                     usePixel      = DetFlags.haveRIO.pixel_on(),
+                                     useSCT        = DetFlags.haveRIO.SCT_on(),
+                                     useTRT        = DetFlags.haveRIO.TRT_on())
+ToolSvc += InDetTrackSummaryHelperTool
+print InDetTrackSummaryHelperTool
+
+from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
+InDetTrackSummaryTool = Trk__TrackSummaryTool(name = "CascadeInDetTrackSummaryTool",
+                                                  InDetSummaryHelperTool = InDetTrackSummaryHelperTool,
+                                                  doSharedHits           = False,
+                                                  InDetHoleSearchTool    = InDetHoleSearchTool)
+
+ToolSvc += InDetTrackSummaryTool
+print InDetTrackSummaryTool
+
+
+
+from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool
+InDetTrackSelectorTool = InDet__InDetDetailedTrackSelectorTool(name = "cascade_InDetDetailedTrackSelectorTool",
+                                                                       pTMin                = 400.0,
+                                                                       IPd0Max              = 10000.0,
+                                                                       IPz0Max              = 10000.0,
+                                                                       z0Max                = 10000.0,
+                                                                       sigIPd0Max           = 10000.0,
+                                                                       sigIPz0Max           = 10000.0,
+                                                                       d0significanceMax    = -1.,
+                                                                       z0significanceMax    = -1.,
+                                                                       etaMax               = 9999.,
+                                                                       useTrackSummaryInfo  = True,
+                                                                       nHitBLayer           = 0,
+                                                                       nHitPix              = 1,
+                                                                       nHitBLayerPlusPix    = 1,
+                                                                       nHitSct              = 2,
+                                                                       nHitSi               = 3,
+                                                                       nHitTrt              = 0,
+                                                                       nHitTrtHighEFractionMax = 10000.0,
+                                                                       useSharedHitInfo     = False,
+                                                                       useTrackQualityInfo  = True,
+                                                                       fitChi2OnNdfMax      = 10000.0,
+                                                                       TrtMaxEtaAcceptance  = 1.9,
+                                                                       TrackSummaryTool     = InDetTrackSummaryTool,
+                                                                       Extrapolator         = InDetExtrapolator
+                                                                      )
+        
+ToolSvc += InDetTrackSelectorTool
+print InDetTrackSelectorTool
+
+
+
+from JpsiUpsilonTools.JpsiUpsilonToolsConf import Analysis__JpsiFinder
+myJpsiFinder = Analysis__JpsiFinder(name                         = "JpsiFinder",
+                                        OutputLevel                 = INFO,
+                                        muAndMu                     = True,
+                                        muAndTrack                  = False,
+                                        TrackAndTrack               = False,
+                                        assumeDiMuons               = True, 
+                                        invMassUpper                = 3600.0,
+                                        invMassLower                = 2600.0,
+                                        Chi2Cut                     = 30.,
+                                        oppChargesOnly	            = True,
+                                        combOnly		    = True,
+                                        atLeastOneComb              = False,
+                                        useCombinedMeasurement      = False, # Only takes effect if combOnly=True	
+                                        muonCollectionKey           = "Muons",
+                                        TrackParticleCollection     = "InDetTrackParticles",
+                                        V0VertexFitterTool          = TrkV0Fitter,             # V0 vertex fitter
+                                        useV0Fitter                 = False,                   # if False a TrkVertexFitterTool will be used
+                                        TrkVertexFitterTool         = TrkVKalVrtFitter,        # VKalVrt vertex fitter
+                                        TrackSelectorTool           = InDetTrackSelectorTool,
+                                        VertexPointEstimator        = VtxPointEstimator,
+                                        useMCPCuts                  = False)
+ToolSvc += myJpsiFinder
+print      myJpsiFinder
+
+
+
+from VKalVrtValidation.VKalVrtValidationConf import TestCascadeAlg
+Vertex = TestCascadeAlg ( name = "Vertex", 
+                        TrkVertexFitterTool = TrkVKalVrtFitter,
+                        JpsiFinder          = myJpsiFinder,
+                        OutputLevel = INFO,
+                        PerEventLimit = 100
+                      )
+
+#-------------------------------------------------------------
+# User analysis steering algorithm
+#-------------------------------------------------------------
+from AthenaCommon.AlgSequence import AlgSequence, AthSequencer
+job = AlgSequence()
+job += AthSequencer("ModSequence1")
+job.ModSequence1 += Vertex
+
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.cxx b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..686ca4a3dea702a60f2ebb210e22956cc6654142
--- /dev/null
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.cxx
@@ -0,0 +1,113 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+#include "TestCascadeAlg.h"
+
+
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTracking/VertexAuxContainer.h"
+#include "TLorentzVector.h"
+
+
+TestCascadeAlg::TestCascadeAlg( const std::string& name, ISvcLocator* svcLoc ) :
+AthAlgorithm(name, svcLoc), m_iVertexFitter("Trk::TrkVKalVrtFitter"),
+m_jpsiFinder("Analysis::JpsiFinder")
+{
+    declareProperty("JpsiFinder"    , m_jpsiFinder);
+    declareProperty("ConstrainV0", m_constrV0);
+    declareProperty("ConstrainJpsi", m_constrJpsi);
+    declareProperty("TrkVertexFitterTool", m_iVertexFitter);
+    declareProperty("PerEventLimit", m_perELimit);
+}
+
+StatusCode TestCascadeAlg::initialize() {
+   ATH_CHECK(m_iVertexFitter.retrieve());
+   ATH_CHECK(m_jpsiFinder.retrieve());
+   return StatusCode::SUCCESS;
+}
+
+StatusCode TestCascadeAlg::execute() {
+    xAOD::VertexContainer*    jpsiContainer = nullptr;
+    xAOD::VertexAuxContainer* jpsiauxContainer = nullptr;
+    
+    // call Jpsi+2track tool
+    if( !m_jpsiFinder->performSearch(jpsiContainer, jpsiauxContainer).isSuccess() ) {
+      ATH_MSG_FATAL("Jpsi+2 track tool (" << m_jpsiFinder << ") failed.");
+      return StatusCode::FAILURE;
+    }
+    if(jpsiContainer->size() ==0) { delete jpsiContainer; return StatusCode::SUCCESS; }
+    std::vector<const xAOD::TrackParticle*> tracksJpsi;
+    std::vector<std::vector<const xAOD::TrackParticle*>> tracksV0;
+    double mass_muon = 105.658;
+    double mass_pion = 139.570;
+    double mass_ks   = 497.61;
+    std::vector<double> massesJpsi(2, mass_muon);
+    std::vector<double> massesV0;
+    std::vector<double> Masses(2, mass_muon);
+
+    massesV0.push_back(mass_pion);
+    massesV0.push_back(mass_pion);
+    Masses.push_back(mass_ks);
+
+    const xAOD::TrackParticleContainer  *trackContainer(nullptr);
+    CHECK(evtStore()->retrieve(trackContainer   , "InDetTrackParticles"      ));
+    for(auto track1itr = trackContainer->begin(); track1itr != trackContainer->end(); ++track1itr){
+       for(auto track2itr = trackContainer->begin() + 1; track2itr != trackContainer->end(); ++track2itr){
+            if((*track2itr)->qOverP() * (*track1itr)->qOverP() >= 0.) continue;
+            std::vector<const xAOD::TrackParticle*> l = {*track1itr, *track2itr};
+            tracksV0.push_back(std::move(l));
+       }
+    }
+
+    double mass_v0 = mass_ks;
+    double mass_jpsi = 3.0969 * 1000;
+    int pereventcount = 0;
+    for(auto jpsi : *jpsiContainer) { //Iterate over Jpsi vertices
+
+       size_t jpsiTrkNum = jpsi->nTrackParticles();
+       tracksJpsi.clear();
+       for( unsigned int it=0; it<jpsiTrkNum; it++) tracksJpsi.push_back(jpsi->trackParticle(it));
+
+       for(auto &v0 : tracksV0) {
+
+          m_iVertexFitter->setDefault();
+          // Robustness
+          int robustness = 0;
+          m_iVertexFitter->setRobustness(robustness);
+          // Build up the topology
+          // Vertex list
+          std::vector<Trk::VertexID> vrtList;
+          // V0 vertex
+          Trk::VertexID vID;
+          if (m_constrV0) {
+            vID = m_iVertexFitter->startVertex(v0,massesV0,mass_v0);
+          } else {
+            vID = m_iVertexFitter->startVertex(v0,massesV0);
+          }
+          vrtList.push_back(vID);
+          // B vertex including Jpsi
+          Trk::VertexID vID2 = m_iVertexFitter->nextVertex(tracksJpsi,massesJpsi,vrtList);
+          if (m_constrJpsi) {
+            std::vector<Trk::VertexID> cnstV;
+            cnstV.clear();
+            if ( !m_iVertexFitter->addMassConstraint(vID2,tracksJpsi,cnstV,mass_jpsi).isSuccess() ) {
+              ATH_MSG_WARNING("addMassConstraint failed");
+            }
+          }
+          std::unique_ptr<Trk::VxCascadeInfo> result(m_iVertexFitter->fitCascade());
+          if(result) {
+          	result->getSVOwnership(true);
+          	const std::vector< std::vector<TLorentzVector> > &moms = result->getParticleMoms();
+          	for(auto& p :moms) { ATH_MSG_DEBUG("new part"); for(auto &l : p) ATH_MSG_DEBUG("vect " << l.M()); }
+           pereventcount++;
+           if(pereventcount>=m_perELimit) goto exitEvent;
+          }
+       }
+    }
+
+exitEvent:
+    delete jpsiContainer;
+    return StatusCode::SUCCESS;
+}
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.h b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..e68d5c683409f05c0de5af6ab3d95106e71e839f
--- /dev/null
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.h
@@ -0,0 +1,29 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TESTCASCADEALG_H
+#define TESTCASCADEALG_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
+#include "JpsiUpsilonTools/JpsiFinder.h"
+#include "TH1D.h"
+class TestCascadeAlg : public AthAlgorithm{
+
+
+public:
+    TestCascadeAlg( const std::string& name, ISvcLocator* svcLoc );
+    StatusCode initialize() override;
+    StatusCode execute() override;
+
+
+private:
+    ToolHandle < Trk::TrkVKalVrtFitter > m_iVertexFitter;
+    ToolHandle<Analysis::JpsiFinder>      m_jpsiFinder;
+    bool m_constrV0 = true;
+    bool m_constrJpsi = true;
+    int m_perELimit =10;
+};
+
+#endif
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/components/CascadeVertexValidation_entries.cxx b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/components/CascadeVertexValidation_entries.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..e469ad2db6c64590a9eb67f7b0f11a524c8a9119
--- /dev/null
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/components/CascadeVertexValidation_entries.cxx
@@ -0,0 +1,3 @@
+#include "../TestCascadeAlg.h"
+
+DECLARE_COMPONENT(TestCascadeAlg)
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index d8b89abe8f5ff0be644d2d5f74a906e0b4e5f1a1..06f1ef0591cd8e34d0f27a5a1a9850b57e780062 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -9,4 +9,4 @@
 AthSimulationExternalsVersion = 2.0.28
 
 # The version of atlas/Gaudi to use:
-GaudiVersion = v31r0.003
+GaudiVersion = v31r0.004
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index 80c04e50e589dd40768597872d206a2cf846f6f6..426abe2585bb23014e3ee9e3be0abeb1f8080c99 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -9,4 +9,4 @@
 AthenaExternalsVersion = 2.0.28
 
 # The version of atlas/Gaudi to use:
-GaudiVersion = v31r0.003
+GaudiVersion = v31r0.004
diff --git a/Reconstruction/Jet/JetRec/Root/MuonSegmentPseudoJetGetter.cxx b/Reconstruction/Jet/JetRec/Root/MuonSegmentPseudoJetGetter.cxx
index 69ace221032391853b1cbccf24f41dfa419f366c..9b2960c589a925be79db9ac38c7012d558015368 100644
--- a/Reconstruction/Jet/JetRec/Root/MuonSegmentPseudoJetGetter.cxx
+++ b/Reconstruction/Jet/JetRec/Root/MuonSegmentPseudoJetGetter.cxx
@@ -86,8 +86,8 @@ const PseudoJetContainer* MuonSegmentPseudoJetGetter::getC() const {
   
   // record
   SG::WriteHandle<PseudoJetContainer> handle_out(m_outcoll);
-  ATH_MSG_DEBUG("New PseudoJetContainer in event store with extractor: " 
-                << extractor->toString(0));
+  //ATH_MSG_DEBUG("New PseudoJetContainer in event store with extractor: " 
+  //              << extractor->toString(0));
 
   // notify
   if ( ! handle_out.put(std::move(pjcont_ptr))) {
diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/TrackPseudoJetGetter.h b/Reconstruction/Jet/JetRecTools/JetRecTools/TrackPseudoJetGetter.h
index 7fe5a598eff474620634866acb42ae30a554cde2..17d882095157410509d0ac06864f94fb89dbef87 100644
--- a/Reconstruction/Jet/JetRecTools/JetRecTools/TrackPseudoJetGetter.h
+++ b/Reconstruction/Jet/JetRecTools/JetRecTools/TrackPseudoJetGetter.h
@@ -34,7 +34,9 @@ public:
   virtual StatusCode createAndRecord() const override;
 
 protected:
-  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_incolltrk;        /// Input collection name.
+  /// This will identify the input tracks (and so is templated on TrackParticleContainer).
+  /// We do not declare it as a property to avoid duplication with the base PseudoJetGetter::m_incoll. Instead we'll copy the key from PseudoJetGetter::m_incoll during initialize() (See this function)
+  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_incolltrk;
 
   SG::ReadHandleKey<jet::TrackVertexAssociation> m_inTVA;
 
diff --git a/Reconstruction/Jet/JetRecTools/Root/TrackPseudoJetGetter.cxx b/Reconstruction/Jet/JetRecTools/Root/TrackPseudoJetGetter.cxx
index a6d622e4bc7db4cbd28fa4225cf5db72d7195d92..968ac534c5159966568f4fd94b2e06c07a45cf7b 100644
--- a/Reconstruction/Jet/JetRecTools/Root/TrackPseudoJetGetter.cxx
+++ b/Reconstruction/Jet/JetRecTools/Root/TrackPseudoJetGetter.cxx
@@ -21,19 +21,18 @@ using fastjet::PseudoJet;
 TrackPseudoJetGetter::TrackPseudoJetGetter(const std::string &name) 
   : PseudoJetGetter(name) , m_inTVA("JetTrackVtxAssoc") {
   declareProperty("TrackVertexAssociation", m_inTVA, "SG key for the TrackVertexAssociation object");
-  declareProperty("InputContainer", m_incolltrk);
 }
 
 //**********************************************************************
 StatusCode TrackPseudoJetGetter::initialize() {
   ATH_MSG_DEBUG("Initializing...");
-  print();
 
+  ATH_CHECK( PseudoJetGetter::initialize() );
+  ATH_CHECK( m_inTVA.initialize() );
   m_incolltrk = m_incoll.key();
   ATH_CHECK( m_incolltrk.initialize() );
-  ATH_CHECK( m_outcoll.initialize() );
-  ATH_CHECK( m_inTVA.initialize() );
-
+  print();
+  
   return StatusCode::SUCCESS;
 }
 
@@ -93,9 +92,9 @@ const PseudoJetContainer* TrackPseudoJetGetter::getC() const {
     ATH_MSG_DEBUG("Error storing PseudoJetContainer in event "
                   << " at key " << m_outcoll.key());
   } else {
-    ATH_MSG_DEBUG("PseudoJetContainer in event store with extractor: " 
-                  << extractor->toString(0)
-                  << " at key " << m_outcoll.key());
+    //ATH_MSG_DEBUG("PseudoJetContainer in event store with extractor: " 
+    //               << extractor->toString(0)
+    //             << " at key " << m_outcoll.key());
   }
 
   return pjcont;
diff --git a/Reconstruction/MET/METReconstruction/python/METAssocConfig.py b/Reconstruction/MET/METReconstruction/python/METAssocConfig.py
index cf254701a6ff31b25bcb0cf1c49febeace4ee81c..d4b7364f06ed82b1f68993f96de7e73949fdf7a9 100644
--- a/Reconstruction/MET/METReconstruction/python/METAssocConfig.py
+++ b/Reconstruction/MET/METReconstruction/python/METAssocConfig.py
@@ -182,9 +182,15 @@ class METAssocConfig:
         if not hasattr(ToolSvc,self.trkisotool.name()):
             ToolSvc += self.trkisotool
 
+        from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool		
+	from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+	CaloExtensionTool= Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+	CaloCellAssocTool =  Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = CaloExtensionTool)
         self.caloisotool = CfgMgr.xAOD__CaloIsolationTool("CaloIsolationTool_MET",
                                                           saveOnlyRequestedCorrections=True,
-                                                          addCaloExtensionDecoration=False)
+                                                          addCaloExtensionDecoration=False,
+                                                          ParticleCaloExtensionTool = CaloExtensionTool,
+                                                          ParticleCaloCellAssociationTool = CaloCellAssocTool)
         if not hasattr(ToolSvc,self.caloisotool.name()):
             ToolSvc += self.caloisotool
 
diff --git a/Reconstruction/MET/METReconstruction/python/METRecoConfig.py b/Reconstruction/MET/METReconstruction/python/METRecoConfig.py
index 73c5cece643fd27a849ff5bbfecfeffae33dc181..bfcca2708c0c96d40860e7eccb70e15d4c16cfa1 100644
--- a/Reconstruction/MET/METReconstruction/python/METRecoConfig.py
+++ b/Reconstruction/MET/METReconstruction/python/METRecoConfig.py
@@ -277,9 +277,15 @@ class METConfig:
         if not hasattr(ToolSvc,self.trkisotool.name()):
             ToolSvc += self.trkisotool
         #
+        from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool		
+	from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+	CaloExtensionTool= Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+	CaloCellAssocTool =  Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = CaloExtensionTool)
         self.caloisotool = CfgMgr.xAOD__CaloIsolationTool("CaloIsolationTool_MET",
                                                           saveOnlyRequestedCorrections=True,
-                                                          addCaloExtensionDecoration=False)
+                                                          addCaloExtensionDecoration=False,
+                                                          ParticleCaloExtensionTool = CaloExtensionTool,
+                                                          ParticleCaloCellAssociationTool = CaloCellAssocTool)
         if not hasattr(ToolSvc,self.caloisotool.name()):
             ToolSvc += self.caloisotool
 
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
index 8a0279d7de93896ec8ee4e38986a1a1e2f08d472..1e3cc9775293b9a7d28a0b49565ec2d58bb4d17a 100755
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
@@ -163,12 +163,12 @@ class TrackDepositInCaloTool: public AthAlgTool, virtual public ITrackDepositInC
 
     // Services & Tools
     ITHistSvc*                          m_histSvc{};                             //!< Pointer to THistSvc
-    ToolHandle<Trk::IExtrapolator>      m_extrapolator;                        //!< Extrapolator tool
+     ToolHandle<Trk::IExtrapolator>     m_extrapolator{this, "ExtrapolatorHandle", ""};     //!< Extrapolator tool
     const CaloDetDescrManager*          m_caloDDM{};                             //!< Calorimeter detector description manager
     const TileDetDescrManager*          m_tileDDM{};
     
-    ToolHandle <Trk::IParticleCaloExtensionTool> m_caloExtensionTool; //!< Tool to make the step-wise extrapolation
-    ToolHandle <Rec::IParticleCaloCellAssociationTool> m_caloCellAssociationTool; //!< Tool to make the step-wise extrapolation
+    ToolHandle <Trk::IParticleCaloExtensionTool> m_caloExtensionTool{this, "ParticleCaloExtensionTool", ""}; //!< Tool to make the step-wise extrapolation
+    ToolHandle <Rec::IParticleCaloCellAssociationTool> m_caloCellAssociationTool{this, "ParticleCaloCellAssociationTool", ""}; //!< Tool to make the step-wise extrapolation
     
     // Members
     const CaloCellContainer*    m_cellContainer;                       //!< CaloCell container.
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
index 94f8f33d00cfb7d6b3615ddcfcc8ac34de0949d9..4941c46b2db717cc43fff6533b6c7ca3490f9918 100755
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
@@ -40,15 +40,11 @@
 ///////////////////////////////////////////////////////////////////////////////
 TrackDepositInCaloTool::TrackDepositInCaloTool( const std::string& type, const std::string& name, const IInterface* pInterface ) :
   AthAlgTool(type,name,pInterface),
-  m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
-  m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
-  m_caloCellAssociationTool("Rec::ParticleCaloCellAssociationTool/ParticleCaloCellAssociationTool"),
   m_cellContainer(0),
   m_solenoidRadius(1280)
   //m_solenoidHalfLength(2900)
 {
   declareInterface<ITrackDepositInCaloTool>(this);
-  declareProperty("ExtrapolatorHandle", m_extrapolator );   
   declareProperty("doExtrapolation",m_doExtr = true);
   declareProperty("doEDeposHist",m_doHist = false);
   declareProperty("DebugMode", m_debugMode = false);
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
index a537cd1ae8be1256d864b6bd2884e4176371fb28..5507fdcfac4c08d7e5b86de2968933df3e80ef41 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetCandidateAlg.cxx
@@ -16,7 +16,7 @@ MuonCombinedInDetCandidateAlg::MuonCombinedInDetCandidateAlg(const std::string&
   AthAlgorithm(name,pSvcLocator),
   m_doSiliconForwardMuons(false),
   m_trackSelector("InDet::InDetDetailedTrackSelectorTool/MuonCombinedInDetDetailedTrackSelectorTool"),
-  m_muonSystemExtensionTool("Muon::MuonSystemExtensionTool/MuonSystemExtensionTool")
+  m_muonSystemExtensionTool("Muon::MuonSystemExtensionTool/MuonSystemExtensionTool", this)
 {  
   declareProperty("TrackSelector", m_trackSelector);
   declareProperty("InDetForwardTrackSelector", m_forwardTrackSelector);
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
index 6652eff0866c67537566f2447b3bf2dd6e14647c..52248d913b37c89d48aff87a1c62df93ebb9c152 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
@@ -87,7 +87,7 @@ namespace MuonCombined {
     m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"),
     m_edmHelper("Muon::MuonEDMHelperTool/MuonEDMHelperTool"),
     m_muonPrinter("Rec::MuonPrintingTool/MuonPrintingTool"),
-    m_caloExtTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
+    m_caloExtTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this),
     m_particleCreator("Trk::TrackParticleCreatorTool/MuonCombinedTrackParticleCreator"),
     m_ambiguityProcessor("Trk::TrackSelectionProcessorTool/MuonSimpleAmbiProcessorTool"),
     m_propagator("Trk::RungeKuttaPropagator/AtlasRungeKuttaPropagator"),
@@ -98,7 +98,7 @@ namespace MuonCombined {
     m_muonSegmentConverterTool("Muon::MuonSegmentConverterTool/MuonSegmentConverterTool"),
     m_meanMDTdADCTool("Rec::MuonMeanMDTdADCFillerTool/MuonMeanMDTdADCFillerTool"),
     m_caloNoiseTool(""),
-    m_caloMaterialProvider("Trk::TrkMaterialProviderTool/TrkMaterialProviderTool"),
+    m_caloMaterialProvider("Trk::TrkMaterialProviderTool/TrkMaterialProviderTool", this),
     m_trackSegmentAssociationTool("Muon::TrackSegmentAssociationTool/TrackSegmentAssociationTool"),
     m_trackQuery("Rec::MuonTrackQuery/MuonTrackQuery")
 
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx
index 2667ce853bc9502a952ff78cf9dc0b6dd46d6c70..2f156d07246852caf03506a333906e37b5233101 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx
@@ -65,7 +65,7 @@ namespace MuonCombined {
 	m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"),
 	p_MuTagMatchingTool               ( "MuTagMatchingTool/MuTagMatchingTool"                          ) ,
 	p_MuTagAmbiguitySolverTool        ( "MuTagAmbiguitySolverTool/MuTagAmbiguitySolverTool"             ) ,
-        m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
+        m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this),
 	m_idHelper("Muon::MuonIdHelperTool/MuonIdHelperTool"),
 	m_edmHelper("Muon::MuonEDMHelperTool/MuonEDMHelperTool"),
 	m_segmentSelector("Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool"),
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
index bd7a9aacde6b7942122ca476a2bb9b397b862af4..122c50317c3d4ea62afe780d8211f45e2fde721a 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedAlgs.py
@@ -63,6 +63,17 @@ def MuonCombinedInDetCandidateAlg( name="MuonCombinedInDetCandidateAlg",**kwargs
     if muonCombinedRecFlags.doSiAssocForwardMuons() and InDetFlags.doForwardTracks():
         kwargs.setdefault("DoSiliconAssocForwardMuons", True )
         kwargs.setdefault("InDetForwardTrackSelector", getPublicTool("MuonCombinedInDetDetailedForwardTrackSelectorTool") )
+    
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+
+    from MuonTGRecTools.MuonTGRecToolsConf import Muon__MuonSystemExtensionTool
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+
+    muonExtTool = Muon__MuonSystemExtensionTool(Extrapolator = AtlasExtrapolator(),
+                                                ParticleCaloExtensionTool = pcExtensionTool)
+    kwargs.setdefault("MuonSystemExtensionTool", muonExtTool)
+
     return CfgMgr.MuonCombinedInDetCandidateAlg(name,**kwargs)
 
 def MuonCombinedMuonCandidateAlg( name="MuonCombinedMuonCandidateAlg", **kwargs ):
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py
index 9b7c160298bef7692bba76f8587a39cf4ba99854..79863eff8b0deaa99062008a216c3accaa89544b 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py
@@ -182,10 +182,23 @@ def MuidSegmentRegionRecoveryTool( name ='MuidSegmentRegionRecoveryTool', **kwar
     kwargs.setdefault("Fitter",  getPublicTool("CombinedMuonTrackBuilderFit") )
     return CfgMgr.Muon__MuonSegmentRegionRecoveryTool(name,**kwargs)
 
+from AthenaCommon.AppMgr import ToolSvc
         
 def CombinedMuonTrackBuilderFit( name='CombinedMuonTrackBuilderFit', **kwargs ):
     import MuonCombinedRecExample.CombinedMuonTrackSummary
     from AthenaCommon.AppMgr    import ToolSvc
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__MuonCaloEnergyTool, Rec__ParticleCaloCellAssociationTool
+    from TrkMaterialProvider.TrkMaterialProviderConf import Trk__TrkMaterialProviderTool
+
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+    caloCellAssociationTool = Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = pcExtensionTool)
+    muonCaloEnergyTool = Rec__MuonCaloEnergyTool(ParticleCaloExtensionTool = pcExtensionTool,
+                                                 ParticleCaloCellAssociationTool = caloCellAssociationTool)
+
+    materialProviderTool = Trk__TrkMaterialProviderTool(MuonCaloEnergyTool = muonCaloEnergyTool);
+    ToolSvc += materialProviderTool
+
     kwargs.setdefault("CaloEnergyParam"               , getPublicTool("MuidCaloEnergyToolParam") )
     kwargs.setdefault("CaloTSOS"                      , getPublicTool("MuidCaloTrackStateOnSurface") )
     kwargs.setdefault("CscRotCreator"                 , getPublicTool("CscClusterOnTrackCreator") )
@@ -209,6 +222,7 @@ def CombinedMuonTrackBuilderFit( name='CombinedMuonTrackBuilderFit', **kwargs ):
     kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
     kwargs.setdefault("TrackSummaryTool"              , ToolSvc.CombinedMuonTrackSummary )
     kwargs.setdefault("UseCaloTG"                     , False )
+    kwargs.setdefault("CaloMaterialProvider"          , materialProviderTool)
 
     if beamFlags.beamType() == 'cosmics':
         kwargs.setdefault("MdtRotCreator" ,  "" )
@@ -227,6 +241,18 @@ def CombinedMuonTrackBuilderFit( name='CombinedMuonTrackBuilderFit', **kwargs ):
 def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ):
     import MuonCombinedRecExample.CombinedMuonTrackSummary
     from AthenaCommon.AppMgr    import ToolSvc
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__MuonCaloEnergyTool, Rec__ParticleCaloCellAssociationTool
+    from TrkMaterialProvider.TrkMaterialProviderConf import Trk__TrkMaterialProviderTool
+
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+    caloCellAssociationTool = Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = pcExtensionTool)
+    muonCaloEnergyTool = Rec__MuonCaloEnergyTool(ParticleCaloExtensionTool = pcExtensionTool,
+                                                 ParticleCaloCellAssociationTool = caloCellAssociationTool)
+
+    materialProviderTool = Trk__TrkMaterialProviderTool(MuonCaloEnergyTool = muonCaloEnergyTool);
+    ToolSvc += materialProviderTool
+
     kwargs.setdefault("CaloEnergyParam"               , getPublicTool("MuidCaloEnergyToolParam") )
     kwargs.setdefault("CaloTSOS"                      , getPublicTool("MuidCaloTrackStateOnSurface") )
     kwargs.setdefault("CscRotCreator"                 , getPublicTool("CscClusterOnTrackCreator") )
@@ -251,6 +277,7 @@ def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ):
     kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
     kwargs.setdefault("TrackSummaryTool"              , ToolSvc.CombinedMuonTrackSummary )
     kwargs.setdefault("UseCaloTG"                     , True ) #
+    kwargs.setdefault("CaloMaterialProvider"          , materialProviderTool)
     
     if beamFlags.beamType() == 'cosmics':
         kwargs.setdefault("MdtRotCreator" ,  "" )
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
index 75800824a6d8f05727dcfb27d6681f0b8bc99b91..1166244b13cc154ba4ef0491bfd5eddd3032715b 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
@@ -33,8 +33,13 @@ addTool("MuonCombinedRecExample.MuGirlTagTool.MuonStauInsideOutRecoTool","MuonSt
 addTool("MuonCombinedRecExample.MuGirlTagTool.MuonStauRecoTool","MuonStauRecoTool")
 
 
+from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool
 
-addTool("MuonCombined::MuonCombinedStacoTagTool","MuonCombinedStacoTagTool")
+pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+caloCellAssociationTool = Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = pcExtensionTool)
+
+addTool("MuonCombined::MuonCombinedStacoTagTool","MuonCombinedStacoTagTool", ParticleCaloExtensionTool = pcExtensionTool)
 addTool("MuonCombinedRecExample.MuonCombinedTools.MuonCombinedFitTagTool","MuonCombinedFitTagTool")
 addTool("Trk::TrackParticleCreatorTool","TrackParticleCreatorTool")
 addTool("MuonCombinedRecExample.MuonCaloTagTool.MuonCaloTagTool","MuonCaloTagTool")
@@ -82,7 +87,10 @@ addTool("MuonCombinedRecExample.MuonCombinedFitTools.OutwardsSegmentRegionRecove
 ####### calo tag
 addTool("MuonCombinedRecExample.MuonCaloTagTool.CaloTrkMuIdAlgTrackSelectorTool","CaloTrkMuIdAlgTrackSelectorTool")
 addTool("MuonCombinedRecExample.MuonCaloTagTool.TrackEnergyInCaloTool","TrackEnergyInCaloTool")
-addTool("MuonCombinedRecExample.MuonCaloTagTool.TrackDepositInCaloTool","TrackDepositInCaloTool")
+addTool("MuonCombinedRecExample.MuonCaloTagTool.TrackDepositInCaloTool","TrackDepositInCaloTool", 
+        ExtrapolatorHandle=AtlasExtrapolator(), 
+        ParticleCaloExtensionTool=pcExtensionTool,
+        ParticleCaloCellAssociationTool=caloCellAssociationTool)
 addTool("MuonCombinedRecExample.MuonCaloTagTool.CaloMuonTagLoose","CaloMuonTagLoose")
 addTool("MuonCombinedRecExample.MuonCaloTagTool.CaloMuonTag","CaloMuonTag")
 addTool("MuonCombinedRecExample.MuonCaloTagTool.CaloMuonLikelihoodTool","CaloMuonLikelihoodTool")
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
index e37ffae71ab2fb8d05f69f48fb0ce10ba6598eca..83c177b13dc8133e64f8e94786e9a9906f893cb1 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
@@ -76,6 +76,20 @@ def InDetCandidateTool(name="InDetCandidateTool",**kwargs ):
     return CfgMgr.MuonCombined__InDetCandidateTool(name,**kwargs)
 
 def MuonCreatorTool(name="MuonCreatorTool",**kwargs):
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__MuonCaloEnergyTool, Rec__ParticleCaloCellAssociationTool
+    from TrkMaterialProvider.TrkMaterialProviderConf import Trk__TrkMaterialProviderTool
+
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+    kwargs.setdefault("ParticleCaloExtensionTool", pcExtensionTool)
+
+    caloCellAssociationTool = Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = pcExtensionTool)
+    muonCaloEnergyTool = Rec__MuonCaloEnergyTool(ParticleCaloExtensionTool = pcExtensionTool,
+                                                 ParticleCaloCellAssociationTool = caloCellAssociationTool)
+
+    materialProviderTool = Trk__TrkMaterialProviderTool(MuonCaloEnergyTool = muonCaloEnergyTool);
+    kwargs.setdefault("CaloMaterialProvider", materialProviderTool)
+
     getPublicTool("MuonMomentumBalanceSignificanceTool")
     getPublicTool("MuonScatteringAngleSignificanceTool")
     getPublicTool("MuonCaloParticleCreator")
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonSegmentTaggerTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonSegmentTaggerTools.py
index 81b59752d282fc35483da72e88d8094840c77cf0..57ba53d26a2d8dd4cbc697be3269c47dff8bbc2a 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonSegmentTaggerTools.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonSegmentTaggerTools.py
@@ -31,6 +31,10 @@ def MuTagAmbiguitySolverTool(name='MuTagAmbiguitySolverTool', **kwargs ):
 
 
 def MuonSegmentTagTool( name="MuonSegmentTagTool", **kwargs ):
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+    kwargs.setdefault("ParticleCaloExtensionTool", pcExtensionTool)
     kwargs.setdefault("MuTagMatchingTool", getPublicTool("MuTagMatchingTool") )
     kwargs.setdefault("MuTagAmbiguitySolverTool", getPublicTool("MuTagAmbiguitySolverTool") )
     return CfgMgr.MuonCombined__MuonSegmentTagTool(name,**kwargs)
diff --git a/Reconstruction/RecBackground/RecBackgroundAlgs/RecBackgroundAlgs/BackgroundWordFiller.h b/Reconstruction/RecBackground/RecBackgroundAlgs/RecBackgroundAlgs/BackgroundWordFiller.h
index 3cacd73aa260b4f37e0a87a53e94ed8080471ba2..fa61a22807f7e278dbc8d078e195518796606cc7 100644
--- a/Reconstruction/RecBackground/RecBackgroundAlgs/RecBackgroundAlgs/BackgroundWordFiller.h
+++ b/Reconstruction/RecBackground/RecBackgroundAlgs/RecBackgroundAlgs/BackgroundWordFiller.h
@@ -50,13 +50,15 @@ class BackgroundWordFiller : public AthAlgorithm
   SG::ReadHandleKey<BcmCollisionTime> m_bcmCollisionTimeKey{this,"BcmCollisionTimeKey","BcmCollisionTime","Key for BcmCollisionTime"};
 
   /** ReadHandleKey for RawInfoSummaryForTag */
-  SG::ReadHandleKey<RawInfoSummaryForTag> m_rawIngoSummaryForTagKey{this,"RawInfoSummaryForTagKey","RawInfoSummaryForTag","Key for RawInfoSummaryForTag"};
+  SG::ReadHandleKey<RawInfoSummaryForTag> m_rawInfoSummaryForTagKey{this,"RawInfoSummaryForTagKey","RawInfoSummaryForTag","Key for RawInfoSummaryForTag"};
 
   /** ReadHandleKey for TileCellContainer */
   SG::ReadHandleKey<TileCellContainer> m_tileCellContainerKey{this,"TileCellContainerKey","MBTSContainer","Key for TileCellContainer"};
 
   /** ReadHandleKey for LArCollisionTime */
   SG::ReadHandleKey<LArCollisionTime> m_lArCollisionTimeKey{this,"LArCollisionTimeKey","LArCollisionTime","Key for LArCollisionTime"};
+
+  Gaudi::Property<bool> m_isMC{this, "IsMC", false, "Sets whether we should expect MC objects"};
   
   int m_HaloNumSegment_Cut;
   int m_HaloNumClusterShape_Cut;
@@ -75,7 +77,6 @@ class BackgroundWordFiller : public AthAlgorithm
   int m_MBTSBeamVeto_TimeCut;
   float m_MBTSBeamVeto_ThresholdCut;
   const uint8_t m_MBTSmask, m_MBTSpattern;
-  std::string m_mbtsContainerName;
 
   int m_LArEC_SideCut;
   float m_LArECTimeDiffCol_Cut;
diff --git a/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py b/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py
index 20fe61ea8bbc57e15db9fa888c3b9797940aacd0..729239e02413b0c83b4b8ae256d3cf6ed404523b 100644
--- a/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py
+++ b/Reconstruction/RecBackground/RecBackgroundAlgs/share/RecBackground_jobOptions.py
@@ -15,3 +15,4 @@ if rec.doInDet() and rec.doMuon() and rec.doCalo() and \
   from RecBackgroundAlgs.RecBackgroundAlgsConf import BackgroundWordFiller
   BackgroundWordFiller=BackgroundWordFiller()
   topSequence+=BackgroundWordFiller
+  BackgroundWordFiller.IsMC = (globalflags.DataSource.get_Value() != 'data')
diff --git a/Reconstruction/RecBackground/RecBackgroundAlgs/src/BackgroundWordFiller.cxx b/Reconstruction/RecBackground/RecBackgroundAlgs/src/BackgroundWordFiller.cxx
index 5591e3fcb9952380a7e89976b0c27a38df56942b..52e545b4d2d3ac04fbdfc10f931e7f1242df323b 100644
--- a/Reconstruction/RecBackground/RecBackgroundAlgs/src/BackgroundWordFiller.cxx
+++ b/Reconstruction/RecBackground/RecBackgroundAlgs/src/BackgroundWordFiller.cxx
@@ -133,12 +133,12 @@ StatusCode BackgroundWordFiller::initialize() {
 
   //initialise the read handle keys 
   ATH_CHECK(m_eventInfoKey.initialize());
-  ATH_CHECK(m_beamBackgroundDataKey.initialize());
-  ATH_CHECK(m_LUCID_rawDataContainerKey.initialize());
+  ATH_CHECK(m_beamBackgroundDataKey.initialize(!m_isMC));
+  ATH_CHECK(m_LUCID_rawDataContainerKey.initialize(!m_isMC));
   ATH_CHECK(m_bcmCollisionTimeKey.initialize());
-  ATH_CHECK(m_rawIngoSummaryForTagKey.initialize());
+  ATH_CHECK(m_rawInfoSummaryForTagKey.initialize(!m_isMC));
   ATH_CHECK(m_tileCellContainerKey.initialize());
-  ATH_CHECK(m_lArCollisionTimeKey.initialize());
+  ATH_CHECK(m_lArCollisionTimeKey.initialize(!m_isMC));
   
   return StatusCode::SUCCESS;  
 }
@@ -162,52 +162,55 @@ StatusCode BackgroundWordFiller::execute() {
   ///////////////////////////////////////////////////
   // Halo Identification
   //////////////////////////////////////////////////  
-
-  SG::ReadHandle<BeamBackgroundData> beamBackgroundDataReadHandle(m_beamBackgroundDataKey);
-
-  if(!beamBackgroundDataReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to BeamBackgoundData with name: " << m_beamBackgroundDataKey.key());
-  else{
-    if( beamBackgroundDataReadHandle->GetNumSegment() > m_HaloNumSegment_Cut ){
-      if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloMuonSegment)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloMuonSegment]);
-      else m_bitcntvec[EventInfo::HaloMuonSegment]++;
-    }
-    if( beamBackgroundDataReadHandle->GetNumClusterShape() > m_HaloNumClusterShape_Cut ){
-      if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloClusterShape)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloClusterShape]);
-      else m_bitcntvec[EventInfo::HaloClusterShape]++; 
-    }
-    if( beamBackgroundDataReadHandle->GetNumNoTimeLoose() > m_HaloNumOneSidedLoose_Cut ){
-      if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloMuonOneSided)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloMuonOneSided]);
-      else m_bitcntvec[EventInfo::HaloMuonOneSided]++;
-    }
-    if( beamBackgroundDataReadHandle->GetNumTwoSidedNoTime() > m_HaloNumTwoSided_Cut ){
-      if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloMuonTwoSided)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloMuonTwoSided]);
-      else m_bitcntvec[EventInfo::HaloMuonTwoSided]++;
+  if (!m_isMC) { // do not request in MC
+    SG::ReadHandle<BeamBackgroundData> beamBackgroundDataReadHandle(m_beamBackgroundDataKey);
+    
+    if(!beamBackgroundDataReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to BeamBackgoundData with name: " << m_beamBackgroundDataKey.key());
+    else{
+      if( beamBackgroundDataReadHandle->GetNumSegment() > m_HaloNumSegment_Cut ){
+	if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloMuonSegment)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloMuonSegment]);
+	else m_bitcntvec[EventInfo::HaloMuonSegment]++;
+      }
+      if( beamBackgroundDataReadHandle->GetNumClusterShape() > m_HaloNumClusterShape_Cut ){
+	if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloClusterShape)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloClusterShape]);
+	else m_bitcntvec[EventInfo::HaloClusterShape]++; 
+      }
+      if( beamBackgroundDataReadHandle->GetNumNoTimeLoose() > m_HaloNumOneSidedLoose_Cut ){
+	if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloMuonOneSided)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloMuonOneSided]);
+	else m_bitcntvec[EventInfo::HaloMuonOneSided]++;
+      }
+      if( beamBackgroundDataReadHandle->GetNumTwoSidedNoTime() > m_HaloNumTwoSided_Cut ){
+	if( eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::HaloMuonTwoSided)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::HaloMuonTwoSided]);
+	else m_bitcntvec[EventInfo::HaloMuonTwoSided]++;
+      }
     }
   }
-
+    
   ///////////////////////////////////////////////////
   // LUCID: LUCIDBeamVeto
   //////////////////////////////////////////////////
 
-  SG::ReadHandle<LUCID_RawDataContainer> LUCID_rawDataContainerReadHandle(m_LUCID_rawDataContainerKey);
-
-  if (!LUCID_rawDataContainerReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to LUCID_RawDataContainer with name: " << m_LUCID_rawDataContainerKey.key());
-  else{
-    int LUCIDcounter(0);
-    for (auto LUCID_rawData : *LUCID_rawDataContainerReadHandle){
-       LUCIDcounter+=LUCID_rawData->getNhitsPMTsideA();
-       LUCIDcounter+=LUCID_rawData->getNhitsPMTsideC();
-    }
-    if ( LUCIDcounter>m_LUCIDBeamVeto_Cut ){
-      if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::LUCIDBeamVeto)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::LUCIDBeamVeto]);
-      else m_bitcntvec[EventInfo::LUCIDBeamVeto]++;
+  if (!m_isMC) { // do not request in MC
+    SG::ReadHandle<LUCID_RawDataContainer> LUCID_rawDataContainerReadHandle(m_LUCID_rawDataContainerKey);
+    
+    if (!LUCID_rawDataContainerReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to LUCID_RawDataContainer with name: " << m_LUCID_rawDataContainerKey.key());
+    else{
+      int LUCIDcounter(0);
+      for (auto LUCID_rawData : *LUCID_rawDataContainerReadHandle){
+	LUCIDcounter+=LUCID_rawData->getNhitsPMTsideA();
+	LUCIDcounter+=LUCID_rawData->getNhitsPMTsideC();
+      }
+      if ( LUCIDcounter>m_LUCIDBeamVeto_Cut ){
+	if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::LUCIDBeamVeto)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::LUCIDBeamVeto]);
+	else m_bitcntvec[EventInfo::LUCIDBeamVeto]++;
+      }
     }
   }
     
   ///////////////////////////////////////////////////
   // BCM: BCMTimeDiffHalo, BCMTimeDiffCol, BCMBeamVeto
   //////////////////////////////////////////////////
-
+  
   SG::ReadHandle<BcmCollisionTime> bcmCollisionTimeReadHandle(m_bcmCollisionTimeKey);
 
   if (!bcmCollisionTimeReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to BcmCollisionTime with name: " << m_bcmCollisionTimeKey.key());
@@ -243,35 +246,36 @@ StatusCode BackgroundWordFiller::execute() {
   ////////////////////////////////////////////////////////////////////////////////
   // ID SP multiplicities from Raw for filling:  IDMultiplicityHuge, IDSPNonEmpty
   ///////////////////////////////////////////////////////////////////////////////
-
-  SG::ReadHandle<RawInfoSummaryForTag> rawInfoSummaryForTagReadHandle(m_rawIngoSummaryForTagKey);
-
-  if (!rawInfoSummaryForTagReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to RawInfoSummaryForTag: " << m_rawIngoSummaryForTagKey.key());
-  else{
-    int NSCTsps = rawInfoSummaryForTagReadHandle->getNsctSPs();
-    int NPIXsps = rawInfoSummaryForTagReadHandle->getNpixSPs();
-
-    // set IDMultiplicityHuge
-    if ( (NPIXsps)>m_PixMultiplicityHuge_Cut){
-      if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::PixMultiplicityHuge)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::PixMultiplicityHuge]);
-      else m_bitcntvec[EventInfo::PixMultiplicityHuge]++;
-    }
-
-    // set PixSPNonEmpty
-    if ( (NPIXsps)>m_PixSPNonEmpty_Cut ){
-      if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::PixSPNonEmpty)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::PixSPNonEmpty]);
-      else m_bitcntvec[EventInfo::PixSPNonEmpty]++;
-    }
-
-    if ( (NSCTsps)>m_SCTMultiplicityHuge_Cut){
-      if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::SCTMultiplicityHuge)==false)	ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::SCTMultiplicityHuge]);
-      else m_bitcntvec[EventInfo::SCTMultiplicityHuge]++;
-    }
-
-    // set SCTSPNonEmpty
-    if ( (NSCTsps)>m_SCTSPNonEmpty_Cut ){
-      if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::SCTSPNonEmpty)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::SCTSPNonEmpty]);
-      else m_bitcntvec[EventInfo::SCTSPNonEmpty]++;
+  if (!m_isMC) { // do not request in MC
+    SG::ReadHandle<RawInfoSummaryForTag> rawInfoSummaryForTagReadHandle(m_rawInfoSummaryForTagKey);
+    
+    if (!rawInfoSummaryForTagReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to RawInfoSummaryForTag: " << m_rawInfoSummaryForTagKey.key());
+    else{
+      int NSCTsps = rawInfoSummaryForTagReadHandle->getNsctSPs();
+      int NPIXsps = rawInfoSummaryForTagReadHandle->getNpixSPs();
+      
+      // set IDMultiplicityHuge
+      if ( (NPIXsps)>m_PixMultiplicityHuge_Cut){
+	if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::PixMultiplicityHuge)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::PixMultiplicityHuge]);
+	else m_bitcntvec[EventInfo::PixMultiplicityHuge]++;
+      }
+      
+      // set PixSPNonEmpty
+      if ( (NPIXsps)>m_PixSPNonEmpty_Cut ){
+	if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::PixSPNonEmpty)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::PixSPNonEmpty]);
+	else m_bitcntvec[EventInfo::PixSPNonEmpty]++;
+      }
+      
+      if ( (NSCTsps)>m_SCTMultiplicityHuge_Cut){
+	if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::SCTMultiplicityHuge)==false)	ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::SCTMultiplicityHuge]);
+	else m_bitcntvec[EventInfo::SCTMultiplicityHuge]++;
+      }
+      
+      // set SCTSPNonEmpty
+      if ( (NSCTsps)>m_SCTSPNonEmpty_Cut ){
+	if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::SCTSPNonEmpty)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::SCTSPNonEmpty]);
+	else m_bitcntvec[EventInfo::SCTSPNonEmpty]++;
+      }
     }
   }
   
@@ -306,21 +310,23 @@ StatusCode BackgroundWordFiller::execute() {
   // LAr EC collision timing stuff (from Guillaume...) - for filling:      LArECTimeDiffHalo, LArECTimeDiffCol
   ////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-  SG::ReadHandle<LArCollisionTime> lArCollisionTimeReadHandle(m_lArCollisionTimeKey);
-
-  if (!lArCollisionTimeReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to LArCollisionTime: " << m_lArCollisionTimeKey.key());
-  else{
-    if (lArCollisionTimeReadHandle->ncellA() > m_LArEC_SideCut && lArCollisionTimeReadHandle->ncellC() > m_LArEC_SideCut) {
-      float LArECtimeDiff =   lArCollisionTimeReadHandle->timeA()-lArCollisionTimeReadHandle->timeC();
-      if (fabs(LArECtimeDiff)<m_LArECTimeDiffCol_Cut){
-	if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::LArECTimeDiffCol)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " <<  m_bitnamevec[EventInfo::LArECTimeDiffCol]);
-	else m_bitcntvec[EventInfo::LArECTimeDiffCol]++;
-      }
-      if (fabs(LArECtimeDiff)>m_LArECTimeDiffHalo_CutLo && fabs(LArECtimeDiff)<m_LArECTimeDiffHalo_CutHi){ 
-	if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::LArECTimeDiffHalo)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::LArECTimeDiffHalo]);
-	else m_bitcntvec[EventInfo::LArECTimeDiffHalo]++;
-      }// halo timing
-    } // enough hits per side
+  if (!m_isMC) { // do not request in MC
+    SG::ReadHandle<LArCollisionTime> lArCollisionTimeReadHandle(m_lArCollisionTimeKey);
+    
+    if (!lArCollisionTimeReadHandle.isValid()) ATH_MSG_WARNING("Invalid ReadHandle to LArCollisionTime: " << m_lArCollisionTimeKey.key());
+    else{
+      if (lArCollisionTimeReadHandle->ncellA() > m_LArEC_SideCut && lArCollisionTimeReadHandle->ncellC() > m_LArEC_SideCut) {
+	float LArECtimeDiff =   lArCollisionTimeReadHandle->timeA()-lArCollisionTimeReadHandle->timeC();
+	if (fabs(LArECtimeDiff)<m_LArECTimeDiffCol_Cut){
+	  if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::LArECTimeDiffCol)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " <<  m_bitnamevec[EventInfo::LArECTimeDiffCol]);
+	  else m_bitcntvec[EventInfo::LArECTimeDiffCol]++;
+	}
+	if (fabs(LArECtimeDiff)>m_LArECTimeDiffHalo_CutLo && fabs(LArECtimeDiff)<m_LArECTimeDiffHalo_CutHi){ 
+	  if (eventInfoReadHandle->updateEventFlagBit(EventInfo::Background,EventInfo::LArECTimeDiffHalo)==false) ATH_MSG_WARNING("Failed to set EventInfo Background word bit " << m_bitnamevec[EventInfo::LArECTimeDiffHalo]);
+	  else m_bitcntvec[EventInfo::LArECTimeDiffHalo]++;
+	}// halo timing
+      } // enough hits per side
+    }
   }
   
   ////////////////////////////////////////
diff --git a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
index fc166ad01c7a4758843fa5e5f2c77e94709da685..36779212565123795ffcacb6e9ba2e22b76a9a26 100755
--- a/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
+++ b/Reconstruction/RecExample/RecExCommon/share/CombinedRec_config.py
@@ -48,7 +48,13 @@ if rec.doMuonCombined() and DetFlags.Muon_on() and DetFlags.ID_on():
 if rec.doESD() and recAlgs.doTrackParticleCellAssociation() and DetFlags.ID_on():
     from AthenaCommon.CfgGetter import getPublicTool
     getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool")
-    topSequence += CfgMgr.TrackParticleCellAssociationAlg("TrackParticleCellAssociationAlg")
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+    caloCellAssociationTool = Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = pcExtensionTool)
+
+    topSequence += CfgMgr.TrackParticleCellAssociationAlg("TrackParticleCellAssociationAlg", 
+                                                          ParticleCaloCellAssociationTool=caloCellAssociationTool)
 
 #
 # functionality : energy flow
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index dce9d64962033d38e6824f17d32bfaf09439732e..e6a6414826b3e8af708cb83c33cd2f234597f193 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -96,6 +96,10 @@ excludeTracePattern.append("*AthFile/impl.py")
 
 include ( "RecExCond/RecExCommon_flags.py" )
 
+if (jobproperties.ConcurrencyFlags.NumThreads() > 0):
+    logRecExCommon_topOptions.info("MT mode: Not scheduling RecoTiming")    
+    rec.doRecoTiming.set_Value_and_Lock(False)
+
 if (rec.doRecoTiming() and rec.OutputFileNameForRecoStep() in ('RAWtoESD','ESDtoAOD','RAWtoALL')):
 
     from RecAlgs.RecAlgsConf import TimingAlg
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_oneThread.sh
index a3d3a24fe3f8e8aa37e6869e0663a2510fac5eda..21e6efe8532f4e58c28dcaae6fa767ebab0a1825 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_oneThread.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_oneThread.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=1 RecExRecoTest/RecExRecoTest_ART_caloTopoClustering_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_twoThreads.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_twoThreads.sh
index 90c8ed39933c1fc727ec70c68590367ece7bfb4c..4a1da4466c8a4397b9f6ad2b1f86acc02050d2a6 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_twoThreads.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_MT_twoThreads.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=2 RecExRecoTest/RecExRecoTest_ART_caloTopoClustering_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_oneThread.sh
index 0c1d3769b3ec7c1b6692d9514ed154bc1270720f..260a146d6a09b79c8a4dfe5601dc5d251fd59d1f 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_oneThread.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_oneThread.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=1 RecExRecoTest/RecExRecoTest_ART_egamma_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_twoThreads.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_twoThreads.sh
index b150e70666bd39f49a9241a088d445dc168a19e8..349cfd6e955927490f6beed84075b4c6949aa2e1 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_twoThreads.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_MT_twoThreads.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=2 RecExRecoTest/RecExRecoTest_ART_egamma_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh
index 38a1a7c6d9cb28d1cd094916efa5ac0e6af580d0..24c8459ce2cb41e8adad66ac602ea20550066707 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=1 RecExRecoTest/RecExRecoTest_ART_muons_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_twoThreads.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_twoThreads.sh
index 4c259f9da6c881fbc8bbeeb1bb0a61d093e55a99..178290f5a4f3f34f402b125823baf9479f88f614 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_twoThreads.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_twoThreads.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=2 RecExRecoTest/RecExRecoTest_ART_muons_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_oneThread.sh
index 577a0f8242ac57ebe91ddb729069b939e8db220f..343b0eaee15f3527ef51008d30bdd0f9b938cda2 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_oneThread.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_oneThread.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=1 RecExRecoTest/RecExRecoTest_ART_noAlgs_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_twoThreads.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_twoThreads.sh
index 16e5f48a962c9dad65a2c89a8eecbc7f0cbd48d5..333167b40053084fbacaed100212e19383554fd3 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_twoThreads.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_MT_twoThreads.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=2 RecExRecoTest/RecExRecoTest_ART_noAlgs_fromESD.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_oneThread.sh
index 73562107f614a4fa5641aab0a1d327627de3fc99..ad162dcd55e7735d57acbd4f874373e4fdb2ef15 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_oneThread.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_oneThread.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=1 eflowRec/run_ESDStandardReco.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_twoThreads.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_twoThreads.sh
index e597e30f96e4f3d9abed4b95a83ff72942a750ed..6c22c48b59c7654b069ecfb6a113cf017d48e166 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_twoThreads.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_pflow_and_jets_fromesd_MT_twoThreads.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=2 eflowRec/run_ESDStandardReco.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_oneThread.sh
index 70c89fe1b5fbde143046f8d34e6af9da1953d1f3..b09c070281986f653363164163dffacc5d202ec6 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_oneThread.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_oneThread.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=1 tauRec/run_tau_standalone.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_twoThreads.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_twoThreads.sh
index 609f1354361fca62e86b1dfb26e22f819ed9d94d..9e932f51c392010db46893425979e926316e2141 100755
--- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_twoThreads.sh
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_twoThreads.sh
@@ -3,6 +3,9 @@
 # art-description: Athena runs topoclustering from an ESD file
 # art-type: grid
 # art-include: master/Athena
+# art-athena-mt: 4
+
+art.py createpoolfile
 
 athena --threads=2 tauRec/run_tau_standalone.py
 echo "art-result: $?"
diff --git a/Reconstruction/RecJobTransforms/python/recoTransforms.py b/Reconstruction/RecJobTransforms/python/recoTransforms.py
index e1c8fce8be43cba6b0c6fcaa29e0aaca9a435bd8..b0f3f60035d3f25312f1cf558c8058f954d4d272 100644
--- a/Reconstruction/RecJobTransforms/python/recoTransforms.py
+++ b/Reconstruction/RecJobTransforms/python/recoTransforms.py
@@ -25,7 +25,7 @@ class skimRawExecutor(scriptExecutor):
         # in the RAW file we are going to skim. This is because the HI workflow
         # will provide millions of events in their filter file, more than acmd.py
         # can cope with.
-        listEvtCommand = ['AtlListBSEvents.exe', '-l']
+        listEvtCommand = ['AtlListBSEvents', '-l']
         listEvtCommand.extend(self.conf.argdict['inputBSFile'].value)
         # For best lookup speed, we store the runnumber/eventnumber in a dictionary (set would also
         # be fast)
@@ -50,7 +50,7 @@ class skimRawExecutor(scriptExecutor):
                     except ValueError, e:
                         msg.warning("Failed to understand this line from AtlListBSEvents: {0}".format(line))
         except subprocess.CalledProcessError, e:
-            errMsg = "Call to AtlListBSEvents.exe failed: {0}".format(e)
+            errMsg = "Call to AtlListBSEvents failed: {0}".format(e)
             msg.error(erMsg)
             raise trfExceptions.TransformExecutionException(trfExit.nameToCode("TRF_EXEC_SETUP_FAIL"), errMsg)
         msg.info("Found {0} events as skim candidates in RAW inputs".format(len(rawEventList)))
diff --git a/Reconstruction/RecoAlgs/CaloRingerAlgs/CMakeLists.txt b/Reconstruction/RecoAlgs/CaloRingerAlgs/CMakeLists.txt
index a1c239e646df84324b47cdc8288ebcbaeed18a84..b06f0ea51e948cdd236719f408d81baab3bf93b4 100644
--- a/Reconstruction/RecoAlgs/CaloRingerAlgs/CMakeLists.txt
+++ b/Reconstruction/RecoAlgs/CaloRingerAlgs/CMakeLists.txt
@@ -13,7 +13,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthContainers
                           Control/AthenaBaseComps
                           Control/AthenaKernel
-                          Control/SGTools
                           Control/StoreGate
                           Event/xAOD/xAODBase
                           Event/xAOD/xAODCaloRings
@@ -25,7 +24,7 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_component( CaloRingerAlgs
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES GaudiKernel CaloEvent AthContainers AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests xAODBase xAODCaloRings xAODCore )
+                     LINK_LIBRARIES GaudiKernel CaloEvent AthContainers AthenaBaseComps AthenaKernel StoreGateLib SGtests xAODBase xAODCaloRings xAODCore )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Reconstruction/RecoAlgs/CaloRingerAlgs/src/xAODRingSetConfWriter.h b/Reconstruction/RecoAlgs/CaloRingerAlgs/src/xAODRingSetConfWriter.h
index cb0d38bfe1ac39401a5db2546cfc83bd75da40e7..68bbd2a16e3bb9f8ac98facd4cb9f440fdc72fcb 100644
--- a/Reconstruction/RecoAlgs/CaloRingerAlgs/src/xAODRingSetConfWriter.h
+++ b/Reconstruction/RecoAlgs/CaloRingerAlgs/src/xAODRingSetConfWriter.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id: xAODRingSetConfWriter.h 713521 2015-12-09 08:53:41Z wsfreund $
@@ -15,7 +15,7 @@ extern "C" {
 
 // Gaudi/Athena include(s):
 #include "AthenaBaseComps/AthAlgorithm.h"
-#include "SGTools/ClassID_traits.h"
+#include "AthenaKernel/ClassID_traits.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "StoreGate/StoreGateSvc.h"
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
index 541f6067a3a931d5d30408c8d45120a1f2d5014f..5db6afbdfe31a1979ad5c842c2a77a9c62fdc81d 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
@@ -62,12 +62,15 @@ CaloClustersInConeTool = ToolFactory(xAOD__CaloClustersInConeTool,
                                      CaloClusterLocation = "CaloCalTopoClusters")
 
 # tool to extrapolate to the calo
-import AthenaCommon.CfgMgr as CfgMgr
+from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool
 #this is just regular extrapolator, but in ToolFactory form
 from egammaTools.InDetTools import egammaExtrapolator
-CaloExtensionTool =  ToolFactory (CfgMgr.Trk__ParticleCaloExtensionTool,
+CaloExtensionTool =  ToolFactory (Trk__ParticleCaloExtensionTool,
                                   Extrapolator = egammaExtrapolator)
 
+CaloCellAssocTool =  ToolFactory (Rec__ParticleCaloCellAssociationTool,
+                                  ParticleCaloExtensionTool = CaloExtensionTool)
+
 
 # configuration for ED computation
 # For the time being, it uses all pflow objects (neutral@EM + charged) for pflow
@@ -188,12 +191,13 @@ CaloIsolationTool = ToolFactory(xAOD__CaloIsolationTool,name = "CaloIsolationToo
                                 PFlowObjectsInConeTool          = PFlowObjectsInConeTool,
                                 ParticleCaloExtensionTool       = CaloExtensionTool,
                                 IsoLeakCorrectionTool           = IsoCorrectionTool,
+                                ParticleCaloCellAssociationTool = CaloCellAssocTool,
                                 EMCaloNums                      = [SUBCALO.LAREM],
                                 HadCaloNums                     = [SUBCALO.LARHEC, SUBCALO.TILE],
                                 UseEMScale                      = True)
 
 TrackIsolationTool = ToolFactory(xAOD__TrackIsolationTool, name = 'TrackIsolationTool')
-#from AthenaCommon import CfgMgr
+from AthenaCommon import CfgMgr
 tit = CfgMgr.xAOD__TrackIsolationTool('TrackIsolationTool')
 tit.TrackSelectionTool.maxZ0SinTheta = 3
 tit.TrackSelectionTool.minPt         = 1000
diff --git a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleCellAssociationAlg.cxx b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleCellAssociationAlg.cxx
index 30ee8124622a75e3cabd0a3b08a5a027458987c8..b70085cde1db41b9c52518938c444db5a05a9542 100644
--- a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleCellAssociationAlg.cxx
+++ b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleCellAssociationAlg.cxx
@@ -11,7 +11,7 @@
 
 TrackParticleCellAssociationAlg::TrackParticleCellAssociationAlg(const std::string& name, ISvcLocator* pSvcLocator):
   AthAlgorithm(name,pSvcLocator),
-  m_caloCellAssociationTool("Rec::ParticleCaloCellAssociationTool/ParticleCaloCellAssociationTool") {
+  m_caloCellAssociationTool("Rec::ParticleCaloCellAssociationTool/ParticleCaloCellAssociationTool", this) {
 
   declareProperty("ParticleCaloCellAssociationTool",m_caloCellAssociationTool);
   declareProperty("PtCut", m_ptCut = 25000. );
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx
index 493367ce8c3575b22c1f12e432145c210c63dcaf..f2a6d0342a694f0214956b5b494c8386e745c34d 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx
@@ -25,8 +25,8 @@ namespace Rec {
 
   MuonCaloEnergyTool::MuonCaloEnergyTool(const std::string& t, const std::string& n, const IInterface*  p )
     : AthAlgTool(t,n,p),
-    m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
-    m_caloCellAssociationTool("Rec::ParticleCaloCellAssociationTool/ParticleCaloCellAssociationTool"),
+    m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this),
+    m_caloCellAssociationTool("Rec::ParticleCaloCellAssociationTool/ParticleCaloCellAssociationTool", this),
     m_particleCreator("Trk::TrackParticleCreatorTool/MuonCaloParticleCreator"),
     m_caloNoiseTool("CaloNoiseToolDefault"),
     m_sigmasAboveNoise(4.),
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx
index 31e1e18299dff89fd58d187f764690930d161d76..fbbea328ebf9b2cdf83be60acd33034ce6a63315 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx
@@ -25,19 +25,10 @@ namespace Rec {
 
   ParticleCaloCellAssociationTool::ParticleCaloCellAssociationTool(const std::string& t, const std::string& n, const IInterface*  p )
     : AthAlgTool(t,n,p),
-      m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
       m_defaultSelector(0.4)
   {
 
     declareInterface<IParticleCaloCellAssociationTool>(this);
-    declareProperty("ParticleCaloExtensionTool",   m_caloExtensionTool );
-
-    //Default data source for the calocells
-    declareProperty("CaloCellContainer", m_cellContainerName="AllCalo");
-
-    //coneSize for including calo cells around track below 0.2 we will loose cells energy in e.g. Tile HEC etc.
-    declareProperty("ConeSize", m_coneSize = 0.2);
-
   }
 
   ParticleCaloCellAssociationTool::~ParticleCaloCellAssociationTool() {}
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h
index 1f569b4bd812c36ed738bd383b8aa197deac96b5..ad22d2778fb047e13da9f96d2d6d626cac039818 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h
@@ -68,12 +68,17 @@ namespace Rec {
     void associateCells( const CaloCellContainer& container, const Trk::CaloExtension& caloExtension, float dr,
                          std::vector<const CaloCell*>& cells ) const;
 
-    ToolHandle< Trk::IParticleCaloExtensionTool >  m_caloExtensionTool;
-    SG::ReadHandleKey<CaloCellContainer> m_cellContainerName;
-    double      m_coneSize;
-    mutable Trk::CaloCellSelectorLayerdR m_defaultSelector;
+    ToolHandle< Trk::IParticleCaloExtensionTool >  m_caloExtensionTool {this,
+	"ParticleCaloExtensionTool", ""};
 
-    mutable PathLengthUtils m_pathLenUtil;
+    SG::ReadHandleKey<CaloCellContainer> m_cellContainerName {this, 
+	"CaloCellContainer", "AllCalo"};
+
+    Gaudi::Property<double> m_coneSize {this, "ConeSize", 0.2};
+
+    Trk::CaloCellSelectorLayerdR m_defaultSelector;
+
+    PathLengthUtils m_pathLenUtil;
 
 
   };
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h
index e50446ed8e80d8a46e2cc43530e5f52a458211ec..0adfc7756337b07056079a3710f6422540d3deaa 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h
@@ -72,7 +72,7 @@ private:
   std::unique_ptr<Trk::CaloExtension> caloExtension( const xAOD::NeutralParticle& particle ) const;
   std::unique_ptr<Trk::CaloExtension>  caloExtension( const xAOD::TrackParticle& particle ) const;
 
-  PublicToolHandle<Trk::IExtrapolator> m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};
+  ToolHandle<Trk::IExtrapolator> m_extrapolator {this, "Extrapolator", ""};
   Gaudi::Property<std::string>  m_particleTypeName{this,"ParticleType","muon","The particle type : muon, pion, electron,nonInteracting"};
   Gaudi::Property<bool>  m_startFromPerigee{this,"StartFromPerigee",false, "Start from Perigee"};
   const AtlasDetectorID* m_detID;
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.cxx b/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.cxx
index 11302bc6beb3fd54985da473a51056e72d213c21..c16e32816f543f5fd4da6a0464a82538f64dadb9 100755
--- a/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.cxx
@@ -19,7 +19,7 @@ PathLengthUtils::~PathLengthUtils(){
 }
 
 //=========================================================================================================================
-double PathLengthUtils::get3DPathLength(const CaloCell& cell, const Amg::Vector3D& entrance, const Amg::Vector3D& exit, double drFix, double dzFix){
+double PathLengthUtils::get3DPathLength(const CaloCell& cell, const Amg::Vector3D& entrance, const Amg::Vector3D& exit, double drFix, double dzFix) const{
 //=========================================================================================================================
 
     int debugLevel = 0;
@@ -483,7 +483,7 @@ double PathLengthUtils::get3DPathLength(const CaloCell& cell, const Amg::Vector3
     return path; 
  
 }
-bool PathLengthUtils::crossingMatrix(Amg::MatrixX Matrix ,Amg::Vector3D entry, Amg::Vector3D& path) {
+bool PathLengthUtils::crossingMatrix(Amg::MatrixX Matrix ,Amg::Vector3D entry, Amg::Vector3D& path) const {
 
 //    std::cout << " Matrix determinant " << Matrix.determinant() << std::endl;
 //    std::cout << " Matrix " << std::endl; 
@@ -509,7 +509,7 @@ bool PathLengthUtils::crossingMatrix(Amg::MatrixX Matrix ,Amg::Vector3D entry, A
     return crossing;
 }
 
-double PathLengthUtils::getPathLengthInTile(const CaloCell& cell, const Amg::Vector3D& entrance, const Amg::Vector3D& exit){
+double PathLengthUtils::getPathLengthInTile(const CaloCell& cell, const Amg::Vector3D& entrance, const Amg::Vector3D& exit) const {
 //=========================================================================================================================
     // OBTAIN LAYER INDICES FOR LINEAR INTERPOLATION
     unsigned int SampleID = cell.caloDDE()->getSampling();
@@ -733,7 +733,7 @@ double PathLengthUtils::getPathLengthInTile(const CaloCell& cell, const Amg::Vec
 
 
 
-CaloSampling::CaloSample PathLengthUtils::tileEntrance(CaloSampling::CaloSample sample){
+CaloSampling::CaloSample PathLengthUtils::tileEntrance(CaloSampling::CaloSample sample) const {
     if(sample==CaloSampling::TileBar0||sample==CaloSampling::TileBar1||sample==CaloSampling::TileBar2||sample==CaloSampling::TileGap2) return CaloSampling::TileBar0;
     if(sample==CaloSampling::TileGap1)                                                       return CaloSampling::TileBar1;
     if(sample==CaloSampling::TileGap3||sample==CaloSampling::TileExt0||sample==CaloSampling::TileExt1||sample==CaloSampling::TileExt2) return CaloSampling::TileExt0;
@@ -741,7 +741,7 @@ CaloSampling::CaloSample PathLengthUtils::tileEntrance(CaloSampling::CaloSample
     //return sample;
 } // PathLengthUtils::entrance 
 
-CaloSampling::CaloSample PathLengthUtils::tileExit(CaloSampling::CaloSample sample){
+CaloSampling::CaloSample PathLengthUtils::tileExit(CaloSampling::CaloSample sample) const {
     if(sample==CaloSampling::TileBar0||sample==CaloSampling::TileBar1||sample==CaloSampling::TileBar2||sample==CaloSampling::TileGap1) return CaloSampling::TileBar2;
     if(sample==CaloSampling::TileGap2)                                                       return CaloSampling::TileBar1;
     if(sample==CaloSampling::TileGap3)                                                       return CaloSampling::TileExt1;
@@ -751,7 +751,7 @@ CaloSampling::CaloSample PathLengthUtils::tileExit(CaloSampling::CaloSample samp
 } // PathLengthUtils::exit 
 
 /** Return the length(mm) of the path crossed inside the cell, given the parameters for the extrapolation at entrance and exit of the layer **/
-double PathLengthUtils::pathInsideCell(const CaloCell& cell, const CaloExtensionHelpers::EntryExitLayerMap&  entryExitLayerMap) {
+double PathLengthUtils::pathInsideCell(const CaloCell& cell, const CaloExtensionHelpers::EntryExitLayerMap&  entryExitLayerMap) const {
   
   CaloSampling::CaloSample sample = cell.caloDDE()->getSampling();
 
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.h b/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.h
index 17de47b05a3e1be4715ce8103fa6888791caa63b..d7d6c63997356c0555cb4a59ceb2cb2680514647 100755
--- a/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/PathLengthUtils.h
@@ -34,33 +34,33 @@
       ~PathLengthUtils();
 
 
-      double pathInsideCell(const CaloCell& cell, const CaloExtensionHelpers::EntryExitLayerMap&  entryExitLayerMap);
-      double get3DPathLength(const CaloCell& cell, const Amg::Vector3D& entry, const Amg::Vector3D& exit, double drFix, double dzFix );
+      double pathInsideCell(const CaloCell& cell, const CaloExtensionHelpers::EntryExitLayerMap&  entryExitLayerMap) const;
+      double get3DPathLength(const CaloCell& cell, const Amg::Vector3D& entry, const Amg::Vector3D& exit, double drFix, double dzFix ) const;
 
-      double getPathLengthInTile(const CaloCell& cell, const Amg::Vector3D& entry, const Amg::Vector3D& exit );
+      double getPathLengthInTile(const CaloCell& cell, const Amg::Vector3D& entry, const Amg::Vector3D& exit ) const;
       //double path(xAOD::TrackParticle& trackParticle, const CaloCell* cell);
       //double path(xAOD::TrackParticle& trackParticle, const CaloCell_ID::CaloSample sample); 
       
   private:
-      CaloSampling::CaloSample tileEntrance(CaloSampling::CaloSample sample);
-      CaloSampling::CaloSample tileExit(CaloSampling::CaloSample sample);
-
-      double phiMean(double a, double b);
-      bool   crossedPhi(const CaloCell& cell, double phi_entrance, double phi_exit);
-      double getPathLengthInEta(const CaloCell& cell, double eta_entrance, double eta_exit);
-      double getPathLengthInZ(double zMin, double zMax, double z_entrance, double z_exit);
-      double getPathLengthInZ(const CaloCell& cell, double z_entrance, double z_exit);
-      bool   crossingMatrix(Amg::MatrixX Matrix ,Amg::Vector3D entry, Amg::Vector3D& path);
+      CaloSampling::CaloSample tileEntrance(CaloSampling::CaloSample sample) const;
+      CaloSampling::CaloSample tileExit(CaloSampling::CaloSample sample) const;
+
+      double phiMean(double a, double b) const;
+      bool   crossedPhi(const CaloCell& cell, double phi_entrance, double phi_exit) const;
+      double getPathLengthInEta(const CaloCell& cell, double eta_entrance, double eta_exit) const;
+      double getPathLengthInZ(double zMin, double zMax, double z_entrance, double z_exit) const;
+      double getPathLengthInZ(const CaloCell& cell, double z_entrance, double z_exit) const;
+      bool   crossingMatrix(Amg::MatrixX Matrix ,Amg::Vector3D entry, Amg::Vector3D& path) const;
       //static double CellZB[9];
       //static double CellDZB[9];
       //static double CellZC[9];
       //static double CellDZC[9];
   }; 
 
-inline double PathLengthUtils::phiMean(double a, double b) { return 0.5*(a+b) + (a*b < 0)*M_PI; }
+inline double PathLengthUtils::phiMean(double a, double b) const { return 0.5*(a+b) + (a*b < 0)*M_PI; }
 
 /** Return true if the cell crossed was crossed by the track in phi **/
-inline bool PathLengthUtils::crossedPhi(const CaloCell& cell, double phi_entrance, double phi_exit) {
+inline bool PathLengthUtils::crossedPhi(const CaloCell& cell, double phi_entrance, double phi_exit) const {
   double mean_phi = phiMean(phi_entrance, phi_exit);
   double dphi = fabs( CaloPhiRange::diff(phi_entrance, phi_exit) );
   double phi_min = mean_phi - dphi, phi_max = mean_phi + dphi;
@@ -70,7 +70,7 @@ inline bool PathLengthUtils::crossedPhi(const CaloCell& cell, double phi_entranc
 }
 
 /** Return the % of path length crossed by the track inside a cell in eta **/
-inline double PathLengthUtils::getPathLengthInEta(const CaloCell& cell, double eta_entrance, double eta_exit) {
+inline double PathLengthUtils::getPathLengthInEta(const CaloCell& cell, double eta_entrance, double eta_exit) const {
   double etaMin = cell.eta() - 0.5*cell.caloDDE()->deta();
   double etaMax = cell.eta() + 0.5*cell.caloDDE()->deta();
   if ( fabs(eta_entrance  - eta_exit) < 1e-6 ) // to avoid FPE
@@ -82,7 +82,7 @@ inline double PathLengthUtils::getPathLengthInEta(const CaloCell& cell, double e
 }
 
 /** Return the % of path length crossed by the track inside a cell in Z **/
-inline double PathLengthUtils::getPathLengthInZ(double zMin, double zMax, double z_entrance, double z_exit) {
+inline double PathLengthUtils::getPathLengthInZ(double zMin, double zMax, double z_entrance, double z_exit) const {
   if ( fabs(z_entrance  - z_exit) < 1e-6 ) // to avoid FPE
     return z_entrance > zMin && z_entrance < zMax;
  
@@ -92,7 +92,7 @@ inline double PathLengthUtils::getPathLengthInZ(double zMin, double zMax, double
 }
 
 /** Return the % of path length crossed by the track inside a cell in Z **/
-inline double PathLengthUtils::getPathLengthInZ(const CaloCell& cell, double z_entrance, double z_exit) {
+inline double PathLengthUtils::getPathLengthInZ(const CaloCell& cell, double z_entrance, double z_exit) const {
   return getPathLengthInZ(cell.z() - 0.5*cell.caloDDE()->dz(), cell.z() + 0.5*cell.caloDDE()->dz(), z_entrance, z_exit);
 }
 
diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/ATLAS_CHECK_THREAD_SAFETY b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..47f7f2b5c9098e6b4b5ea2023aa3464fe8879492
--- /dev/null
+++ b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Reconstruction/VKalVrt/VrtSecInclusive
diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/NtupleVars.h b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/NtupleVars.h
index da45f1da83632650d2c00bebada83e6e014a07d5..2156444048d16053b14f74379961fd4853f59519 100644
--- a/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/NtupleVars.h
+++ b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/NtupleVars.h
@@ -185,7 +185,7 @@ namespace VKalVrtAthena {
         
       }
 
-      exit(1);
+      std::abort();
     }
 
     void clear();
diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/src/TruthAlgs.cxx b/Reconstruction/VKalVrt/VrtSecInclusive/src/TruthAlgs.cxx
index 376753c339f68b6cb3bb60ce2f9c2e40d52de888..fa1c3d3e51f4de7dc0b6111a277c7a00b3ea20da 100644
--- a/Reconstruction/VKalVrt/VrtSecInclusive/src/TruthAlgs.cxx
+++ b/Reconstruction/VKalVrt/VrtSecInclusive/src/TruthAlgs.cxx
@@ -610,7 +610,7 @@ namespace VKalVrtAthena {
   const xAOD::TruthParticle*  VrtSecInclusive::getTrkGenParticle ( const xAOD::TrackParticle *trkPart ) const 
   {
     typedef ElementLink< xAOD::TruthParticleContainer > Link_t;
-    static const char* NAME = "truthParticleLink";
+    constexpr const char* NAME = "truthParticleLink";
     if(  ! trkPart->isAvailable< Link_t >( NAME ) ) {
       return 0;
     }
diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx b/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx
index d22b7ebc5c0c36d5a0bec341b905c55a20edc0b1..40d2b61e9ee5d68a9df00a09084dda3341b6926a 100644
--- a/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx
+++ b/Reconstruction/VKalVrt/VrtSecInclusive/src/VertexingAlgs.cxx
@@ -16,17 +16,12 @@
 #include "TLorentzVector.h"
 
 #include <iostream>
-
+#include "TrkVKalVrtCore/PGraph.h"
 //-------------------------------------------------
 
 using namespace std;
 
-namespace Trk {
-  extern 
-    int  pgraphm_(
-        long int *weit, long int *edges, long int *nodes,
-        long int *set, long int *nptr,  long int *nth);
-}
+
 
 namespace VKalVrtAthena {
 
@@ -231,7 +226,7 @@ namespace VKalVrtAthena {
     vector<const xAOD::NeutralParticle*>  dummyNeutrals(0);
 
     m_fitSvc->setDefault();
-
+    auto pgraph = std::make_unique<Trk::PGraph>();
     // Main iteration
     while(true) {
 
@@ -239,7 +234,7 @@ namespace VKalVrtAthena {
       WrkVrt newvrt;
 
       // Find a solution from the given set of incompatible tracks (==weit)
-      Trk::pgraphm_( weit, &edges, &NTracks, Solution, &NPTR, &nth);
+      pgraph->pgraphm_( weit, &edges, &NTracks, Solution, &NPTR, &nth);
 
       ATH_MSG_VERBOSE(" > reconstruct2TrackVertices(): Trk::pgraphm_() output: NPTR = " << NPTR );
 
diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/src/VrtSecInclusive.cxx b/Reconstruction/VKalVrt/VrtSecInclusive/src/VrtSecInclusive.cxx
index cf8de422fd5183df705bec9934e49a56c248ce5d..197021397bc411b1eee22b98b839888db09edcdf 100755
--- a/Reconstruction/VKalVrt/VrtSecInclusive/src/VrtSecInclusive.cxx
+++ b/Reconstruction/VKalVrt/VrtSecInclusive/src/VrtSecInclusive.cxx
@@ -38,12 +38,6 @@
 
 using namespace std;
 
-namespace Trk {
-  extern 
-  int  pgraphm_(
-		long int *weit, long int *edges, long int *nodes,
-		long int *set, long int *nptr,  long int *nth);
-}
 
 namespace VKalVrtAthena {
   
diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index 3570418c6ef582d90b65b7e70aa4a01df91de9d0..ad532981481d0338cab6382c8d0663314b952c0c 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -5,8 +5,12 @@ topSequence += PFLeptonSelector
 from eflowRec.eflowRecConf import PFTrackSelector
 PFTrackSelector=PFTrackSelector("PFTrackSelector")
 
+from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+
 from eflowRec.eflowRecConf import eflowTrackCaloExtensionTool
-TrackCaloExtensionTool=eflowTrackCaloExtensionTool()
+TrackCaloExtensionTool=eflowTrackCaloExtensionTool(TrackCaloExtensionTool=pcExtensionTool)
 
 PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool
 
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h b/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h
index 74312d5d3d8a0ae102c31fee360960c0022a7679..8fdcb8952a958e7f63e7c34a022d30a959e5c494 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSelectedTrackCopy.h
@@ -103,12 +103,7 @@ private:
 
   // For P->T converters of ID tracks with SCT
   SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
-
-  /* counters. For now use mutable atomic
-   * the methods will increment a local variable
-   * inside the loops.
-   * At the end they will add_fetch to these ones
-   */
+  
   mutable Gaudi::Accumulators::Counter<unsigned long> m_AllClusters;
   mutable Gaudi::Accumulators::Counter<unsigned long> m_SelectedClusters;
   mutable Gaudi::Accumulators::Counter<unsigned long> m_AllTracks;
diff --git a/Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py b/Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py
index b8907c1516245667dd9575da92c0643988d36880..f7418e3d0d565b6f51f3ef855701505d0f1dcda1 100644
--- a/Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py
+++ b/Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py
@@ -11,7 +11,7 @@ def CaloFillRectangularClusterCfg(flags):
     from CaloClusterCorrection.CaloClusterCorrectionConf import CaloFillRectangularCluster
     caloFillRectangularCluster = CaloFillRectangularCluster(eta_size = 5,
                                                             phi_size = 7,
-                                                            cells_name = flags.Egamma.Keys.Input.Cells)
+                                                            cells_name = flags.Egamma.Keys.Input.CaloCells)
 
     result.setPrivateTools(caloFillRectangularCluster)
     return result
diff --git a/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py b/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py
index a91c9ea861218cd7806e4aa1e86684f9b3ea1125..181704430540424174c445b9747e98e4d142446a 100644
--- a/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py
+++ b/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py
@@ -37,7 +37,18 @@ def createEgammaConfigFlags():
     # one idea is to make the keys have tuples with type, name, etc
     ##################################################
 
-    egcf.addFlag("Egamma.Keys.Input.Cells","AllCalo") #should make a lambda
+    def _cellContainer(prevFlags):
+        if "AllCalo" in prevFlags.Input.Collections:
+            # if have all the cells in input file, return it
+            return "AllCalo"
+        elif "AODCellContainer" in prevFlags.Input.Collections:
+            # do we have the AOD cells?
+            return "AODCellContainer"
+        else:
+            # assume they will be created
+            return "AllCalo"
+
+    egcf.addFlag("Egamma.Keys.Input.CaloCells", lambda prevFlags: _cellContainer(prevFlags))
     egcf.addFlag("Egamma.Keys.Input.TopoClusters",'CaloTopoCluster') #input topoclusters
     egcf.addFlag("Egamma.Keys.Input.TruthParticles", 'TruthParticles')
     egcf.addFlag("Egamma.Keys.Input.TruthEvents", 'TruthEvents')
diff --git a/Reconstruction/egamma/egammaMVACalib/python/TrigEgammaMVACalibConfig.py b/Reconstruction/egamma/egammaMVACalib/python/TrigEgammaMVACalibConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..0f5f13fece99bd41aea18abf68b408c7c6b8d27b
--- /dev/null
+++ b/Reconstruction/egamma/egammaMVACalib/python/TrigEgammaMVACalibConfig.py
@@ -0,0 +1,40 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+import logging
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from egammaMVACalib.egammaMVACalibConf import egammaMVACalibTool, egammaMVASvc
+from ROOT import xAOD
+import cppyy
+cppyy.loadDictionary('xAODEgammaDict')
+
+
+def TrigEgammaMVACalibCfg(flags, name="TrigEgammaMVASvc"):
+
+    acc = ComponentAccumulator()
+
+    mlog = logging.getLogger('TrigEgammaMVACalibConfig')
+
+    if flags.Trigger.egamma.calibMVAVersion is not None:
+        folder = flags.Trigger.egamma.calibMVAVersion
+        mlog.debug('MVA version: %s', folder)
+    else:
+        mlog.error("Trigger.egamma.calibMVAVersion not set")
+
+    mlog.debug('Cluster Correction version: %s', flags.Trigger.egamma.clusterCorrectionVersion)
+
+    TrigElectronMVATool = egammaMVACalibTool(name="TrigElectronMVATool",
+                                             ParticleType=xAOD.EgammaParameters.electron,
+                                             folder=folder,
+                                             use_layer_corrected=False)
+
+    TrigPhotonMVATool = egammaMVACalibTool(name="TrigPhotonMVATool",
+                                           ParticleType=xAOD.EgammaParameters.unconvertedPhoton,
+                                           folder=folder,
+                                           use_layer_corrected=False)
+
+    TrigEgammaMVASvc = egammaMVASvc(name=name,
+                                    ElectronTool=TrigElectronMVATool,
+                                    UnconvertedPhotonTool=TrigPhotonMVATool)
+
+    acc.addService(TrigEgammaMVASvc)
+    return acc
diff --git a/Reconstruction/egamma/egammaMVACalib/python/egammaMVACalibConfig.py b/Reconstruction/egamma/egammaMVACalib/python/egammaMVACalibConfig.py
index ca4e18672478dfcf9ffb5f3d88a4236438038fff..360a01f020d05b272f8472c23ffeac76512478d8 100644
--- a/Reconstruction/egamma/egammaMVACalib/python/egammaMVACalibConfig.py
+++ b/Reconstruction/egamma/egammaMVACalib/python/egammaMVACalibConfig.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
-
+import logging
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from egammaMVACalib.egammaMVACalibConf import egammaMVACalibTool, egammaMVASvc
 from ROOT import xAOD
@@ -8,11 +8,17 @@ import cppyy
 cppyy.loadDictionary('xAODEgammaDict')
 
 
-def egammaMVASvcCfg(flags):
+def egammaMVASvcCfg(flags, name="egammaMVASvc"):
 
     acc = ComponentAccumulator()
 
-    folder = flags.Egamma.Calib.MVAVersion
+    mlog = logging.getLogger('egammaMVACalibConfig')
+
+    if flags.Egamma.Calib.MVAVersion is not None:
+        folder = flags.Egamma.Calib.MVAVersion
+        mlog.debug('MVA version: %s', folder)
+    else:
+        mlog.error("Egamma.Calib.MVAVersion is not set")
 
     electronMVATool = egammaMVACalibTool(name="electronMVATool",
                                          ParticleType=xAOD.EgammaParameters.electron,
@@ -24,7 +30,8 @@ def egammaMVASvcCfg(flags):
                                                 ParticleType=xAOD.EgammaParameters.convertedPhoton,
                                                 folder=folder)
 
-    egMVASvc = egammaMVASvc(ElectronTool=electronMVATool,
+    egMVASvc = egammaMVASvc(name=name,
+                            ElectronTool=electronMVATool,
                             UnconvertedPhotonTool=unconvertedPhotonMVATool,
                             ConvertedPhotonTool=convertedPhotonMVATool)
 
@@ -42,7 +49,7 @@ if __name__ == "__main__":
     log.setLevel(DEBUG)
 
     ConfigFlags.Input.isMC = True
-    ConfigFlags.Input.Files = ["valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r6699_10evt.pool.root"]
+    ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q221/21.0/myRDO.pool.root"]
     ConfigFlags.lock()
 
     cfg = ComponentAccumulator()
diff --git a/Reconstruction/egamma/egammaTools/python/InDetTools.py b/Reconstruction/egamma/egammaTools/python/InDetTools.py
index 399093bcbf6b9bd22b0c245e55835eb0a8265efa..a6787090f1cc846fc6127ec613e2d0a007ac85a3 100644
--- a/Reconstruction/egamma/egammaTools/python/InDetTools.py
+++ b/Reconstruction/egamma/egammaTools/python/InDetTools.py
@@ -8,8 +8,8 @@ from egammaRec.Factories import FcnWrapper, ToolFactory, PublicToolFactory
 ###############
 #egammaExtrapolator: just use the AtlasExtrapolator, making a tool factory
 from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
-egammaExtrapolator = PublicToolFactory(AtlasExtrapolator,
-                                       name = 'AtlasExtrapolator')
+egammaExtrapolator = ToolFactory(AtlasExtrapolator,
+                                 name = 'AtlasExtrapolator')
 
 #egammaInDetTrackSummaryTool: just use the AtlasTrackSummaryTool, making a tool factory
 from TrkTrackSummaryTool.AtlasTrackSummaryTool import AtlasTrackSummaryTool
diff --git a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
index 2065161c81f2eb36253ca5cb01f9e12b4e600858..0acf043b24e3bcc86d50d888aacbb7f042e6124c 100644
--- a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
+++ b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx
@@ -10,7 +10,6 @@
 
 #include "tauRecTools/TauIDVarCalculator.h"
 #include "xAODTracking/VertexContainer.h"  
-#include "xAODEventInfo/EventInfo.h"
 #include "CaloGeoHelpers/CaloSampling.h"
 #include "FourMomUtils/xAODP4Helpers.h"
 #include "TLorentzVector.h"
@@ -26,8 +25,8 @@ TauIDVarCalculator::TauIDVarCalculator(const std::string& name):
 
 StatusCode TauIDVarCalculator::eventInitialize()
 {
-  const xAOD::EventInfo* xEventInfo = nullptr;
-  ATH_CHECK( evtStore()->retrieve(xEventInfo,"EventInfo") );
+
+  SG::ReadHandle<xAOD::EventInfo> xEventInfo(m_eventInfoKey);
   m_mu = xEventInfo->averageInteractionsPerCrossing();
 
   if(!inTrigger()){
@@ -61,6 +60,7 @@ StatusCode TauIDVarCalculator::eventInitialize()
 StatusCode TauIDVarCalculator::initialize()
 {
   ATH_CHECK( m_vertexInputContainer.initialize() );
+  ATH_CHECK( m_eventInfoKey.initialize() );
   return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
index 4e5e0dc99742921820f7cfe5da80521d0a4b16b2..a9e55cbd1f36f35596ce68a2d6fd0d3a4c8774d3 100644
--- a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
+++ b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx
@@ -18,7 +18,7 @@
 
 TauTrackFinder::TauTrackFinder(const std::string& name ) :
         TauRecToolBase(name),
-        m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
+        m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this),
         m_trackSelectorTool_tau(""),
         m_trackToVertexTool("Reco::TrackToVertex"),
         m_z0maxDelta(1000),
diff --git a/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
index cda4b0b2ffc349bbbea0f00bafaed1006ffdb953..cede9f0e6a0ed1f768209e8c22adab508ec57868 100644
--- a/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
+++ b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h
@@ -14,6 +14,7 @@
 
 #include "tauRecTools/TauRecToolBase.h"
 #include "xAODTau/TauJet.h"
+#include "xAODEventInfo/EventInfo.h"
 #include <string>
 
 class TauIDVarCalculator: public TauRecToolBase
@@ -48,6 +49,7 @@ class TauIDVarCalculator: public TauRecToolBase
   int m_nVtx;
   float m_mu;
 
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"Key_eventInfo","EventInfo","SG key of xAOD::EventInfo object"};
   SG::ReadHandleKey<xAOD::VertexContainer> m_vertexInputContainer{this,"Key_vertexInputContainer", "PrimaryVertices", "input vertex container key"};
 };
 
diff --git a/Simulation/Digitization/test/DigitizationConfigNew_test.py b/Simulation/Digitization/test/DigitizationConfigNew_test.py
index 2621454b09fa360385a9e4992591b4287202f393..aa8471b16240e2d0e400ff342aad86ed12b00bb6 100755
--- a/Simulation/Digitization/test/DigitizationConfigNew_test.py
+++ b/Simulation/Digitization/test/DigitizationConfigNew_test.py
@@ -12,8 +12,6 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
-from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
 from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags
 from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags
diff --git a/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx b/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx
index 54f906e33504807f0cd1175ec67b2898584cfb7b..f54464d6ac29c77a5816c14d627ce9d652eb44ba 100644
--- a/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MMHitsTestTool.h"
@@ -16,8 +16,8 @@
 #include "MuonIdHelpers/MmIdHelper.h"
 #include "MuonSimEvent/MicromegasHitIdHelper.h"
 
-#include "MuonSimEvent/GenericMuonSimHitCollection.h"
-#include "MuonSimEvent/GenericMuonSimHit.h"
+#include "MuonSimEvent/MMSimHitCollection.h"
+#include "MuonSimEvent/MMSimHit.h"
 
 #include "GeneratorObjects/McEventCollection.h"
 #include "CLHEP/Vector/LorentzVector.h"
@@ -44,15 +44,15 @@ StatusCode MMHitsTestTool::processEvent() {
   CHECK(executeCheckEventInfo());
 
   if (m_DoMMTest) {
-    const DataHandle<GenericMuonSimHitCollection> p_collection;
+    const DataHandle<MMSimHitCollection> p_collection;
     CHECK(evtStore()->retrieve(p_collection,"MicromegasSensitiveDetector"));
-    for (GenericMuonSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit) {
+    for (MMSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit) {
       Amg::Vector3D u = (*i_hit).globalPosition();
       CHECK(executeFillHistos(u));
       //Useful link on how to retrieve variables: http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx
       //Get station names and make plots for each wedge
-      MicromegasHitIdHelper* hitHelper = MicromegasHitIdHelper::GetHelper();
-      int simId = (*i_hit).GenericId();
+      MicromegasHitIdHelper* hitHelper = MicromegasHitIdHelper::GetHelper();	
+      int simId = (*i_hit).MMId();
       std::string sim_stationName = hitHelper->GetStationName(simId);
       //Declare station name strings
       static std::string s_m1s1("M1S1");
diff --git a/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx b/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx
index f474fdc1de42f62c85f92181407da7062e5d8115..f7f2b4d6529219f15f84ec18eb24d5f9d29db439 100644
--- a/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "sTGCHitsTestTool.h"
@@ -16,8 +16,8 @@
 #include "MuonIdHelpers/sTgcIdHelper.h"
 #include "MuonSimEvent/sTgcHitIdHelper.h"
 
-#include "MuonSimEvent/GenericMuonSimHitCollection.h"
-#include "MuonSimEvent/GenericMuonSimHit.h"
+#include "MuonSimEvent/sTGCSimHitCollection.h"
+#include "MuonSimEvent/sTGCSimHit.h"
 
 #include "GeneratorObjects/McEventCollection.h"
 #include "CLHEP/Vector/LorentzVector.h"
@@ -43,16 +43,16 @@ using namespace std;
 StatusCode sTGCHitsTestTool::processEvent() {
   CHECK(executeCheckEventInfo());
 
-  if (m_DosTGCTest) {
-    const DataHandle<GenericMuonSimHitCollection> p_collection;
+   if (m_DosTGCTest) {
+    const DataHandle<sTGCSimHitCollection> p_collection;
     CHECK(evtStore()->retrieve(p_collection,"sTGCSensitiveDetector"));
-    for (GenericMuonSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit) {
+    for (sTGCSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit) { 
       Amg::Vector3D u = (*i_hit).globalPosition();
       CHECK(executeFillHistos(u));
-
-
-      sTgcHitIdHelper* hitHelper = sTgcHitIdHelper::GetHelper();
-      int simId = (*i_hit).GenericId();
+      
+      
+      sTgcHitIdHelper* hitHelper = sTgcHitIdHelper::GetHelper();	
+      int simId = (*i_hit).sTGCId();
       std::string sim_stationName = hitHelper->GetStationName(simId);
 
       static std::string TS11("TS11");
diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h
index 34dfd248d8b47391143ed5ee3d6c8254572fe98a..f5e266af515b43a3c06b823c37246da7b4079d45 100644
--- a/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h
+++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h
@@ -51,6 +51,16 @@ namespace G4UA
 	
 	double phiMinZoom = -180.; // degrees
 	double phiMaxZoom =  180.; // degrees
+
+	// neutron spectra
+	int nBinslogEn  =  90;   
+	double logEMinn = -11.; // min log10(E_kin/MeV) 
+	double logEMaxn =   7.; // max log10(E_kin/MeV) 
+
+	// particle spectra for gamma,e^+/-,mu^+/-,pi^+/-,p,rest
+	int nBinslogEo  = 45;   
+	double logEMino = -2.; // min log10(E_kin/MeV) 
+	double logEMaxo =  7.; // max log10(E_kin/MeV) 
       };
 
 
@@ -117,6 +127,57 @@ namespace G4UA
         /// vector to normalize the volume fraction in 3d
 	std::vector<double> m_3d_norm;
 
+	// particle spectra
+
+	// neutrons
+	
+        /// vector of neutron spectra in log10(E/MeV) bins and the zoom 2d grid
+	std::vector<double> m_rz_neut_spec;
+        /// vector of neutron spectra in log10(E/MeV) bins and the full 2d grid
+	std::vector<double> m_full_rz_neut_spec;
+
+	// gamma
+	
+        /// vector of gamma spectra in log10(E/MeV) bins and the zoom 2d grid
+	std::vector<double> m_rz_gamm_spec;
+        /// vector of e^+/- spectra in log10(E/MeV) bins and the full 2d grid
+	std::vector<double> m_full_rz_gamm_spec;
+
+	// e^+/-
+	
+        /// vector of e^+/- spectra in log10(E/MeV) bins and the zoom 2d grid
+	std::vector<double> m_rz_elec_spec;
+        /// vector of e^+/- spectra in log10(E/MeV) bins and the full 2d grid
+	std::vector<double> m_full_rz_elec_spec;
+
+	// mu^+/-
+	
+        /// vector of mu^+/- spectra in log10(E/MeV) bins and the zoom 2d grid
+	std::vector<double> m_rz_muon_spec;
+        /// vector of mu^+/- spectra in log10(E/MeV) bins and the full 2d grid
+	std::vector<double> m_full_rz_muon_spec;
+
+	// pi^+/-
+	
+        /// vector of pi^+/- spectra in log10(E/MeV) bins and the zoom 2d grid
+	std::vector<double> m_rz_pion_spec;
+        /// vector of pi^+/- spectra in log10(E/MeV) bins and the full 2d grid
+	std::vector<double> m_full_rz_pion_spec;
+
+	// proton
+	
+        /// vector of proton spectra in log10(E/MeV) bins and the zoom 2d grid
+	std::vector<double> m_rz_prot_spec;
+        /// vector of proton spectra in log10(E/MeV) bins and the full 2d grid
+	std::vector<double> m_full_rz_prot_spec;
+
+	// rest
+	
+        /// vector of other particle spectra in log10(E/MeV) bins and the zoom 2d grid
+	std::vector<double> m_rz_rest_spec;
+        /// vector of e^+/- spectra in log10(E/MeV) bins and the full 2d grid
+	std::vector<double> m_full_rz_rest_spec;
+	
 	void merge(const Report& maps);
       };
 
diff --git a/Simulation/G4Utilities/G4UserActions/share/jobOptions.RadiationMapsMaker.py b/Simulation/G4Utilities/G4UserActions/share/jobOptions.RadiationMapsMaker.py
index dcc4ffcae05e3f97e830f7d0dc8bc083c66a6811..8636a2680dafb712ffc7df1d6381f272401cfa77 100644
--- a/Simulation/G4Utilities/G4UserActions/share/jobOptions.RadiationMapsMaker.py
+++ b/Simulation/G4Utilities/G4UserActions/share/jobOptions.RadiationMapsMaker.py
@@ -8,6 +8,8 @@ from G4UserActions.G4UserActionsConf import G4UA__RadiationMapsMakerTool
 # radmaptool.Material        = "" # if left empty all materials are used (default)
 # radmaptool.NBinsR          =   120
 # radmaptool.NBinsZ          =   240
+# radmaptool.NBinsLogEn      =    90
+# radmaptool.NBinsLogEo      =    45
 # radmaptool.NBinsR3D        =    30
 # radmaptool.NBinsZ3D        =    60
 # radmaptool.NBinsPhi3D      =    32
@@ -21,6 +23,10 @@ from G4UserActions.G4UserActionsConf import G4UA__RadiationMapsMakerTool
 # radmaptool.ZMaxFull        =  2400.0 # in cm 
 # radmaptool.PhiMinZoom      =  -180.0 # in degrees
 # radmaptool.PhiMaxZoom      =   180.0 # in degrees
+# radmaptool.LogEMinn        =  -11.0  # in log10(E/MeV)
+# radmaptool.LogEMaxn        =    7.0  # in log10(E/MeV)
+# radmaptool.LogEMino        =   -2.0  # in log10(E/MeV)
+# radmaptool.LogEMaxo        =    7.0  # in log10(E/MeV)
 #
 simFlags.OptionalUserActionList.addAction('G4UA::RadiationMapsMakerTool')
 
diff --git a/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx b/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx
index c9a9098de627632801b02e1f237c79254b9f15be..82243316a522922760b8c19571bcc8351d6113af 100644
--- a/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
@@ -16,7 +16,8 @@
 #include "MuonSimEvent/RPCSimHitCollection.h"
 #include "MuonSimEvent/TGCSimHitCollection.h"
 /** for nSW */
-#include "MuonSimEvent/GenericMuonSimHitCollection.h"
+#include "MuonSimEvent/sTGCSimHitCollection.h"
+#include "MuonSimEvent/MMSimHitCollection.h"
 
 #include "InDetSimEvent/TRTUncompressedHitCollection.h"
 #include "InDetSimEvent/SiHitCollection.h"
@@ -43,8 +44,8 @@ namespace G4UA
     SG::WriteHandle<TGCSimHitCollection> tgc("TGC_Hits");
     SG::WriteHandle<RPCSimHitCollection> rpc("RPC_Hits");
     /** for nSW */
-    SG::WriteHandle<GenericMuonSimHitCollection> mmhits("MicromegasSensitiveDetector");
-    SG::WriteHandle<GenericMuonSimHitCollection> stgc("sTGCSensitiveDetector");
+    SG::WriteHandle<MMSimHitCollection> mmhits("MicromegasSensitiveDetector");
+    SG::WriteHandle<sTGCSimHitCollection> stgc("sTGCSensitiveDetector");
 
     if (!csc.isValid() ) ATH_MSG_WARNING( " HitWrapper could not access csc hit collection" );
     else {
@@ -93,7 +94,7 @@ namespace G4UA
     else {
       //      std::cout << "Working on a collection of size " << nswC->size() << std::endl;
       //GenericMuonSimHitCollection *mm = const_cast< GenericMuonSimHitCollection * > (&(*mmC));
-      for (GenericMuonSimHitCollection::iterator hit=mmhits->begin();hit!=mmhits->end();++hit){
+      for (MMSimHitCollection::iterator hit=mmhits->begin();hit!=mmhits->end();++hit){
 	//std::cout << "Wrapping GenericMuon hit with time " << (*hit).globalTime() << std::endl;
 	(*hit).setGlobalTime( fmod( (*hit).globalTime() , m_config.time ) );
       }
@@ -103,7 +104,7 @@ namespace G4UA
     else {
       //      std::cout << "Working on a collection of size " << nswC->size() << std::endl;
       //GenericMuonSimHitCollection *stgc = const_cast< GenericMuonSimHitCollection * > (&(*stgcC));
-      for (GenericMuonSimHitCollection::iterator hit=stgc->begin();hit!=stgc->end();++hit){
+      for (sTGCSimHitCollection::iterator hit=stgc->begin();hit!=stgc->end();++hit){
 	//std::cout << "Wrapping GenericMuon hit with time " << (*hit).globalTime() << std::endl;
 	(*hit).setGlobalTime( fmod( (*hit).globalTime() , m_config.time ) );
       }
diff --git a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx
index b58aeb2b8fca8e83e0ee5353c9714a2c31a3254c..4e791a49b6e7bc4b4e4ba61a7b554f2a41379ccb 100644
--- a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx
@@ -110,6 +110,27 @@ namespace G4UA{
       m_3d_vol [i] += maps.m_3d_vol [i];
       m_3d_norm[i] += maps.m_3d_norm[i];
     }
+
+    // neutron spectra have different size from all other particle's spectra
+    for(unsigned int i=0;i<maps.m_rz_neut_spec.size();i++) {
+      m_rz_neut_spec     [i] += maps.m_rz_neut_spec     [i];
+      m_full_rz_neut_spec[i] += maps.m_full_rz_neut_spec[i];
+    }
+    // all other particle's spectra have same size
+    for(unsigned int i=0;i<maps.m_rz_gamm_spec.size();i++) {
+      m_rz_gamm_spec     [i] += maps.m_rz_gamm_spec     [i];
+      m_full_rz_gamm_spec[i] += maps.m_full_rz_gamm_spec[i];
+      m_rz_elec_spec     [i] += maps.m_rz_elec_spec     [i];
+      m_full_rz_elec_spec[i] += maps.m_full_rz_elec_spec[i];
+      m_rz_muon_spec     [i] += maps.m_rz_muon_spec     [i];
+      m_full_rz_muon_spec[i] += maps.m_full_rz_muon_spec[i];
+      m_rz_pion_spec     [i] += maps.m_rz_pion_spec     [i];
+      m_full_rz_pion_spec[i] += maps.m_full_rz_pion_spec[i];
+      m_rz_prot_spec     [i] += maps.m_rz_prot_spec     [i];
+      m_full_rz_prot_spec[i] += maps.m_full_rz_prot_spec[i];
+      m_rz_rest_spec     [i] += maps.m_rz_rest_spec     [i];
+      m_full_rz_rest_spec[i] += maps.m_full_rz_rest_spec[i];
+    }
   }
 
   void RadiationMapsMaker::BeginOfRunAction(const G4Run*){
@@ -137,6 +158,21 @@ namespace G4UA{
     m_maps.m_3d_neut.resize(0);
     m_maps.m_3d_chad.resize(0);
 
+    m_maps.m_rz_neut_spec     .resize(0);
+    m_maps.m_full_rz_neut_spec.resize(0);
+    m_maps.m_rz_gamm_spec     .resize(0);
+    m_maps.m_full_rz_gamm_spec.resize(0);
+    m_maps.m_rz_elec_spec     .resize(0);
+    m_maps.m_full_rz_elec_spec.resize(0);
+    m_maps.m_rz_muon_spec     .resize(0);
+    m_maps.m_full_rz_muon_spec.resize(0);
+    m_maps.m_rz_pion_spec     .resize(0);
+    m_maps.m_full_rz_pion_spec.resize(0);
+    m_maps.m_rz_prot_spec     .resize(0);
+    m_maps.m_full_rz_prot_spec.resize(0);
+    m_maps.m_rz_rest_spec     .resize(0);
+    m_maps.m_full_rz_rest_spec.resize(0);
+    
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
       m_maps.m_rz_vol .resize(0);
@@ -170,6 +206,21 @@ namespace G4UA{
     m_maps.m_3d_neut.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     m_maps.m_3d_chad.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
 
+    m_maps.m_rz_neut_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEn,0.0);
+    m_maps.m_full_rz_neut_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEn,0.0);
+    m_maps.m_rz_gamm_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_full_rz_gamm_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_rz_elec_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_full_rz_elec_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_rz_muon_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_full_rz_muon_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_rz_pion_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_full_rz_pion_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_rz_prot_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_full_rz_prot_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_rz_rest_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    m_maps.m_full_rz_rest_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
       // 2d zoom
@@ -276,14 +327,15 @@ namespace G4UA{
 	pdgid = 9;
       }
     }
-    // process NIEL, h20, Edep, NEUT and CHAD particles only
 
-    if ( pdgid == 1 || pdgid == 2 || pdgid == 4 || pdgid == 5 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9 || /* NIEL & h20*/
+    // process spectra, NIEL, h20, Edep, NEUT and CHAD particles only
+
+    if ( pdgid == 0 || pdgid == 3 || /* spectra */ 
+	 pdgid == 1 || pdgid == 2 || pdgid == 4 || pdgid == 5 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9 || /* NIEL & h20*/
 	 aStep->GetTotalEnergyDeposit() > 0 || pdgid == 999) {
       
-    
       double absq = fabs(aStep->GetTrack()->GetDefinition()->GetPDGCharge());
-
+    
       double rho = aStep->GetTrack()->GetMaterial()->GetDensity()/CLHEP::g*CLHEP::cm3; 
 
       bool goodMaterial(false);
@@ -318,6 +370,8 @@ namespace G4UA{
       
       double weight = 0; // weight for NIEL
       double eKin = aStep->GetTrack()->GetKineticEnergy();
+      double logEKin = (eKin > 0?log10(eKin):(m_config.logEMinn<m_config.logEMino?m_config.logEMinn:m_config.logEMino)-1);
+
       if ( pdgid == 1 || pdgid == 9 ) {
 	if ( eKin < 15 ) {
 	  if ( eKin > 10 ) {
@@ -346,195 +400,271 @@ namespace G4UA{
 	  weight = m_tgeSi->Eval(eKin);
 	}
       }
-
       
       double dE_TOT = aStep->GetTotalEnergyDeposit()/nStep;
       double dE_NIEL = aStep->GetNonIonizingEnergyDeposit()/nStep;
       double dE_ION = dE_TOT-dE_NIEL;
-      
-      //   NIEL          SEE          TID           NEUT                                          CHAD                                                    geantino  
-      if ( weight > 0 || eKin > 20 || dE_TOT > 0 || ((pdgid == 6 || pdgid == 7) && eKin > 0.1) || (absq>0 && (pdgid == 1 || pdgid == 2 || pdgid == 8 || pdgid == 9)) || pdgid == 999 ) {
-
-	for(unsigned int i=0;i<nStep;i++) {
-	  double absz = fabs(z0+dz*(i+0.5));
-	  double rr = sqrt(pow(x0+dx*(i+0.5),2)+
-			   pow(y0+dy*(i+0.5),2));
-	  double pphi = atan2(y0+dy*(i+0.5),x0+dx*(i+0.5))*180/M_PI;
-
-	  int vBinZoom = -1;
-	  int vBinFull = -1;
-	  int vBin3d   = -1;
-
-	  // zoom 2d
-	  if ( m_config.zMinZoom < absz && 
-	       m_config.zMaxZoom > absz ) {
-	    int iz = (absz-m_config.zMinZoom)/(m_config.zMaxZoom-m_config.zMinZoom)*m_config.nBinsz;
-	    if ( m_config.rMinZoom < rr && 
-		 m_config.rMaxZoom > rr ) {
-	      int ir = (rr-m_config.rMinZoom)/(m_config.rMaxZoom-m_config.rMinZoom)*m_config.nBinsr;
-	      vBinZoom = m_config.nBinsr*iz+ir;
+
+      for(unsigned int i=0;i<nStep;i++) {
+	double absz = fabs(z0+dz*(i+0.5));
+	double rr = sqrt(pow(x0+dx*(i+0.5),2)+
+			 pow(y0+dy*(i+0.5),2));
+	double pphi = atan2(y0+dy*(i+0.5),x0+dx*(i+0.5))*180/M_PI;
+
+	int vBinZoom      = -1;
+	int vBinFull      = -1;
+	int vBin3d        = -1;
+	int vBinZoomSpecn = -1;
+	int vBinFullSpecn = -1;
+	int vBinZoomSpeco = -1;
+	int vBinFullSpeco = -1;
+	
+	// zoom 2d
+	if ( m_config.zMinZoom < absz && 
+	     m_config.zMaxZoom > absz ) {
+	  int iz = (absz-m_config.zMinZoom)/(m_config.zMaxZoom-m_config.zMinZoom)*m_config.nBinsz;
+	  if ( m_config.rMinZoom < rr && 
+	       m_config.rMaxZoom > rr ) {
+	    int ir = (rr-m_config.rMinZoom)/(m_config.rMaxZoom-m_config.rMinZoom)*m_config.nBinsr;
+	    vBinZoom = m_config.nBinsr*iz+ir;
+	    if ( m_config.logEMinn < logEKin && 
+		 m_config.logEMaxn > logEKin &&
+		 (pdgid == 6 || pdgid == 7)) {
+	      int ile = (logEKin-m_config.logEMinn)/(m_config.logEMaxn-m_config.logEMinn)*m_config.nBinslogEn;
+	      vBinZoomSpecn = m_config.nBinsr*m_config.nBinslogEn*iz+ir*m_config.nBinslogEn+ile;
+	    }
+	    if ( m_config.logEMino < logEKin && 
+		 m_config.logEMaxo > logEKin &&
+		 pdgid != 6 && pdgid != 7) {
+	      int ile = (logEKin-m_config.logEMino)/(m_config.logEMaxo-m_config.logEMino)*m_config.nBinslogEo;
+	      vBinZoomSpeco = m_config.nBinsr*m_config.nBinslogEo*iz+ir*m_config.nBinslogEo+ile;
 	    }
 	  }
-
-	  // full 2d
-	  if ( m_config.zMinFull < absz && 
-	       m_config.zMaxFull > absz ) {
-	    int iz = (absz-m_config.zMinFull)/(m_config.zMaxFull-m_config.zMinFull)*m_config.nBinsz;
-	    if ( m_config.rMinFull < rr && 
-		 m_config.rMaxFull > rr ) {
-	      int ir = (rr-m_config.rMinFull)/(m_config.rMaxFull-m_config.rMinFull)*m_config.nBinsr;
-	      vBinFull = m_config.nBinsr*iz+ir;
+	}
+	
+	// full 2d
+	if ( m_config.zMinFull < absz && 
+	     m_config.zMaxFull > absz ) {
+	  int iz = (absz-m_config.zMinFull)/(m_config.zMaxFull-m_config.zMinFull)*m_config.nBinsz;
+	  if ( m_config.rMinFull < rr && 
+	       m_config.rMaxFull > rr ) {
+	    int ir = (rr-m_config.rMinFull)/(m_config.rMaxFull-m_config.rMinFull)*m_config.nBinsr;
+	    vBinFull = m_config.nBinsr*iz+ir;
+	    if ( m_config.logEMinn < logEKin && 
+		 m_config.logEMaxn > logEKin &&
+		 (pdgid == 6 || pdgid == 7)) {
+	      int ile = (logEKin-m_config.logEMinn)/(m_config.logEMaxn-m_config.logEMinn)*m_config.nBinslogEn;
+	      vBinFullSpecn = m_config.nBinsr*m_config.nBinslogEn*iz+ir*m_config.nBinslogEn+ile;
+	    }
+	    if ( m_config.logEMino < logEKin && 
+		 m_config.logEMaxo > logEKin &&
+		 pdgid != 6 && pdgid != 7) {
+	      int ile = (logEKin-m_config.logEMino)/(m_config.logEMaxo-m_config.logEMino)*m_config.nBinslogEo;
+	      vBinFullSpeco = m_config.nBinsr*m_config.nBinslogEo*iz+ir*m_config.nBinslogEo+ile;
 	    }
 	  }
-
-	  // zoom 3d
-	  if ( m_config.zMinZoom < absz && 
-	       m_config.zMaxZoom > absz ) {
-	    int iz = (absz-m_config.zMinZoom)/(m_config.zMaxZoom-m_config.zMinZoom)*m_config.nBinsz3d;
-	    if ( m_config.rMinZoom < rr && 
-		 m_config.rMaxZoom > rr ) {
-	      int ir = (rr-m_config.rMinZoom)/(m_config.rMaxZoom-m_config.rMinZoom)*m_config.nBinsr3d;
-	      if ( m_config.phiMinZoom == 0) {
-		// assume that all phi should be mapped to the selected phi range
-		double phi_mapped = pphi;
-		// first use phi range from 0 - 360 degrees
-		if (phi_mapped < 0) {
-		  phi_mapped = 360 + phi_mapped;
-		}
-		// then map to selected phi-range
-		int iphi = phi_mapped/m_config.phiMaxZoom;
-		phi_mapped -= iphi*m_config.phiMaxZoom;
-		iphi = phi_mapped/m_config.phiMaxZoom*m_config.nBinsphi3d;
-		vBin3d = m_config.nBinsr3d*m_config.nBinsphi3d*iz+m_config.nBinsphi3d*ir+iphi;
-	      }
-	      else if ( m_config.phiMinZoom < pphi && 
-			m_config.phiMaxZoom > pphi ) {
-		int iphi = (pphi-m_config.phiMinZoom)/(m_config.phiMaxZoom-m_config.phiMinZoom)*m_config.nBinsphi3d;
-		vBin3d = m_config.nBinsr3d*m_config.nBinsphi3d*iz+m_config.nBinsphi3d*ir+iphi;
+	}
+	
+	// zoom 3d
+	if ( m_config.zMinZoom < absz && 
+	     m_config.zMaxZoom > absz ) {
+	  int iz = (absz-m_config.zMinZoom)/(m_config.zMaxZoom-m_config.zMinZoom)*m_config.nBinsz3d;
+	  if ( m_config.rMinZoom < rr && 
+	       m_config.rMaxZoom > rr ) {
+	    int ir = (rr-m_config.rMinZoom)/(m_config.rMaxZoom-m_config.rMinZoom)*m_config.nBinsr3d;
+	    if ( m_config.phiMinZoom == 0) {
+	      // assume that all phi should be mapped to the selected phi range
+	      double phi_mapped = pphi;
+	      // first use phi range from 0 - 360 degrees
+	      if (phi_mapped < 0) {
+		phi_mapped = 360 + phi_mapped;
 	      }
+	      // then map to selected phi-range
+	      int iphi = phi_mapped/m_config.phiMaxZoom;
+	      phi_mapped -= iphi*m_config.phiMaxZoom;
+	      iphi = phi_mapped/m_config.phiMaxZoom*m_config.nBinsphi3d;
+	      vBin3d = m_config.nBinsr3d*m_config.nBinsphi3d*iz+m_config.nBinsphi3d*ir+iphi;
+	    }
+	    else if ( m_config.phiMinZoom < pphi && 
+		      m_config.phiMaxZoom > pphi ) {
+	      int iphi = (pphi-m_config.phiMinZoom)/(m_config.phiMaxZoom-m_config.phiMinZoom)*m_config.nBinsphi3d;
+	      vBin3d = m_config.nBinsr3d*m_config.nBinsphi3d*iz+m_config.nBinsphi3d*ir+iphi;
 	    }
 	  }
-	  
-	  // TID & EION
-	  if ( goodMaterial && vBinZoom >=0 ) {
-	    if ( pdgid == 999 ) {
-	      m_maps.m_rz_tid [vBinZoom] += dl;
-	      m_maps.m_rz_eion[vBinZoom] += rho*dl;
+	}
+	// TID & EION
+	if ( goodMaterial && vBinZoom >=0 ) {
+	  if ( pdgid == 999 ) {
+	    m_maps.m_rz_tid [vBinZoom] += dl;
+	    m_maps.m_rz_eion[vBinZoom] += rho*dl;
+	  }
+	  else {
+	    m_maps.m_rz_tid [vBinZoom] += dE_ION/rho;
+	    m_maps.m_rz_eion[vBinZoom] += dE_ION;
+	  }
+	}
+	if ( goodMaterial && vBinFull >=0 ) {
+	  if ( pdgid == 999 ) {
+	    m_maps.m_full_rz_tid [vBinFull] += dl;
+	    m_maps.m_full_rz_eion[vBinFull] += rho*dl;
+	  }
+	  else {
+	    m_maps.m_full_rz_tid [vBinFull] += dE_ION/rho;
+	    m_maps.m_full_rz_eion[vBinFull] += dE_ION;
+	  }
+	}
+	if ( goodMaterial && vBin3d >=0 ) {
+	  if ( pdgid == 999 ) {
+	    m_maps.m_3d_tid [vBin3d] += dl;
+	    m_maps.m_3d_eion[vBin3d] += rho*dl;
+	  }
+	  else {
+	    m_maps.m_3d_tid [vBin3d] += dE_ION/rho;
+	    m_maps.m_3d_eion[vBin3d] += dE_ION;
+	  }
+	}
+	
+	if ( goodMaterial && (pdgid == 1 || pdgid == 2 || pdgid == 4 || pdgid == 5 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9 )) {
+	  // NIEL
+	  if ( weight > 0 ) {
+	    if ( vBinZoom >=0 ) {
+	      m_maps.m_rz_niel [vBinZoom] += weight*dl;
 	    }
-	    else {
-	      m_maps.m_rz_tid [vBinZoom] += dE_ION/rho;
-	      m_maps.m_rz_eion[vBinZoom] += dE_ION;
+	    if ( vBinFull >=0 ) {
+	      m_maps.m_full_rz_niel [vBinFull] += weight*dl;
+	    }
+	    if ( vBin3d >=0 ) {
+	      m_maps.m_3d_niel [vBin3d] += weight*dl;
 	    }
 	  }
-	  if ( goodMaterial && vBinFull >=0 ) {
-	    if ( pdgid == 999 ) {
-	      m_maps.m_full_rz_tid [vBinFull] += dl;
-	      m_maps.m_full_rz_eion[vBinFull] += rho*dl;
+	  // SEE
+	  if ( eKin > 20 && (pdgid == 1 || pdgid == 2 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9) ) {
+	    if ( vBinZoom >=0 ) {
+	      m_maps.m_rz_h20 [vBinZoom] += dl;
 	    }
-	    else {
-	      m_maps.m_full_rz_tid [vBinFull] += dE_ION/rho;
-	      m_maps.m_full_rz_eion[vBinFull] += dE_ION;
+	    if ( vBinFull >=0 ) {
+	      m_maps.m_full_rz_h20 [vBinFull] += dl;
+	    }
+	    if ( vBin3d >=0 ) {
+	      m_maps.m_3d_h20 [vBin3d] += dl;
+	    }
+	  }
+	  // NEUT
+	  if ( eKin > 0.1 && (pdgid == 6 || pdgid == 7 ) ) {
+	    if ( vBinZoom >=0 ) {
+	      m_maps.m_rz_neut [vBinZoom] += dl;
+	    }
+	    if ( vBinFull >=0 ) {
+	      m_maps.m_full_rz_neut [vBinFull] += dl;
+	    }
+	    if ( vBin3d >=0 ) {
+	      m_maps.m_3d_neut [vBin3d] += dl;
+	    }
+	  }
+	  // CHAD
+	  if ( absq > 0 && (pdgid == 1 || pdgid == 2 || pdgid == 8 || pdgid == 9 ) ) {
+	    if ( vBinZoom >=0 ) {
+	      m_maps.m_rz_chad [vBinZoom] += dl;
+	    }
+	    if ( vBinFull >=0 ) {
+	      m_maps.m_full_rz_chad [vBinFull] += dl;
+	    }
+	    if ( vBin3d >=0 ) {
+	      m_maps.m_3d_chad [vBin3d] += dl;
+	    }
+	  }
+	  // Neutron Energy Spectra
+	  if ( pdgid == 6 || pdgid == 7 ) {
+	    if ( vBinZoomSpecn >=0 ) {
+	      m_maps.m_rz_neut_spec [vBinZoomSpecn] += dl;
+	    }
+	    if ( vBinFullSpecn >=0 ) {
+	      m_maps.m_full_rz_neut_spec [vBinFullSpecn] += dl;
 	    }
 	  }
-	  if ( goodMaterial && vBin3d >=0 ) {
-	    if ( pdgid == 999 ) {
-	      m_maps.m_3d_tid [vBin3d] += dl;
-	      m_maps.m_3d_eion[vBin3d] += rho*dl;
+	}
+	
+	if ( goodMaterial && (pdgid < 6 || pdgid > 7 )){
+	  // Other particle Energy Spectra
+	  if ( vBinZoomSpeco >=0 ) {
+	    if ( pdgid == 0 ) {
+	      m_maps.m_rz_gamm_spec [vBinZoomSpeco] += dl;
+	    }
+	    else if ( pdgid == 1 ) {
+	      m_maps.m_rz_prot_spec [vBinZoomSpeco] += dl;
+	    }
+	    else if ( pdgid == 2 ) {
+	      m_maps.m_rz_pion_spec [vBinZoomSpeco] += dl;
+	    }
+	    else if ( pdgid == 3 ) {
+	      m_maps.m_rz_muon_spec [vBinZoomSpeco] += dl;
+	    }
+	    else if ( pdgid == 4 || pdgid == 5 ) {
+	      m_maps.m_rz_elec_spec [vBinZoomSpeco] += dl;
 	    }
 	    else {
-	      m_maps.m_3d_tid [vBin3d] += dE_ION/rho;
-	      m_maps.m_3d_eion[vBin3d] += dE_ION;
+	      m_maps.m_rz_rest_spec [vBinZoomSpeco] += dl;
 	    }
 	  }
-
-	  if ( goodMaterial && (pdgid == 1 || pdgid == 2 || pdgid == 4 || pdgid == 5 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9 )) {
-	    // NIEL
-	    if ( weight > 0 ) {
-	      if ( vBinZoom >=0 ) {
-		m_maps.m_rz_niel [vBinZoom] += weight*dl;
-	      }
-	      if ( vBinFull >=0 ) {
-		m_maps.m_full_rz_niel [vBinFull] += weight*dl;
-	      }
-	      if ( vBin3d >=0 ) {
-		m_maps.m_3d_niel [vBin3d] += weight*dl;
-	      }
+	  if ( vBinFullSpeco >=0 ) {
+	    if ( pdgid == 0 ) {
+	      m_maps.m_full_rz_gamm_spec [vBinFullSpeco] += dl;
 	    }
-	    // SEE
-	    if ( eKin > 20 && (pdgid == 1 || pdgid == 2 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9) ) {
-	      if ( vBinZoom >=0 ) {
-		m_maps.m_rz_h20 [vBinZoom] += dl;
-	      }
-	      if ( vBinFull >=0 ) {
-		m_maps.m_full_rz_h20 [vBinFull] += dl;
-	      }
-	      if ( vBin3d >=0 ) {
-		m_maps.m_3d_h20 [vBin3d] += dl;
-	      }
+	    else if ( pdgid == 1 ) {
+	      m_maps.m_full_rz_prot_spec [vBinFullSpeco] += dl;
 	    }
-	    // NEUT
-	    if ( eKin > 0.1 && (pdgid == 6 || pdgid == 7 ) ) {
-	      if ( vBinZoom >=0 ) {
-		m_maps.m_rz_neut [vBinZoom] += dl;
-	      }
-	      if ( vBinFull >=0 ) {
-		m_maps.m_full_rz_neut [vBinFull] += dl;
-	      }
-	      if ( vBin3d >=0 ) {
-		m_maps.m_3d_neut [vBin3d] += dl;
-	      }
+	    else if ( pdgid == 2 ) {
+	      m_maps.m_full_rz_pion_spec [vBinFullSpeco] += dl;
 	    }
-	    // CHAD
-	    if ( absq > 0 && (pdgid == 1 || pdgid == 2 || pdgid == 8 || pdgid == 9 ) ) {
-	      if ( vBinZoom >=0 ) {
-		m_maps.m_rz_chad [vBinZoom] += dl;
-	      }
-	      if ( vBinFull >=0 ) {
-		m_maps.m_full_rz_chad [vBinFull] += dl;
-	      }
-	      if ( vBin3d >=0 ) {
-		m_maps.m_3d_chad [vBin3d] += dl;
-	      }
+	    else if ( pdgid == 3 ) {
+	      m_maps.m_full_rz_muon_spec [vBinFullSpeco] += dl;
+	    }
+	    else if ( pdgid == 4 || pdgid == 5 ) {
+	      m_maps.m_full_rz_elec_spec [vBinFullSpeco] += dl;
+	    }
+	    else {
+	      m_maps.m_full_rz_rest_spec [vBinFullSpeco] += dl;
 	    }
 	  }
-	  if (!m_config.material.empty()) {
-	    // need volume fraction only if particular material is selected
-	    if ( (eKin > 1 && (pdgid == 6 || pdgid == 7)) || pdgid == 999) {
-	      // count all neutron > 1 MeV track lengths weighted by r
-	      // to get norm for volume per bin. High energetic
-	      // neutrons are used because they travel far enough to
-	      // map entire bins and are not bent by magnetic fields.
-	      // dl is a measure of length inside the current bin.
-	      // The multiplication by r accounts for the larger
-	      // volume corresponding to larger r assuming that the
-	      // neutron flux is locally mainly from inside to
-	      // outside. In regions where the neutron flux differs
-	      // substantially from this cylindrical assumption a
-	      // cylindrical Geantino scan (vertex: flat in z, x=y=0;
-	      // momentum: pz=0, flat in phi) should be used to get
-	      // the correct volume fraction.
+	}
+	
+	if (!m_config.material.empty()) {
+	  // need volume fraction only if particular material is selected
+	  if ( (eKin > 1 && (pdgid == 6 || pdgid == 7)) || pdgid == 999) {
+	    // count all neutron > 1 MeV track lengths weighted by r
+	    // to get norm for volume per bin. High energetic
+	    // neutrons are used because they travel far enough to
+	    // map entire bins and are not bent by magnetic fields.
+	    // dl is a measure of length inside the current bin.
+	    // The multiplication by r accounts for the larger
+	    // volume corresponding to larger r assuming that the
+	    // neutron flux is locally mainly from inside to
+	    // outside. In regions where the neutron flux differs
+	    // substantially from this cylindrical assumption a
+	    // cylindrical Geantino scan (vertex: flat in z, x=y=0;
+	    // momentum: pz=0, flat in phi) should be used to get
+	    // the correct volume fraction.
+	    if ( vBinZoom >=0 ) {
+	      m_maps.m_rz_norm[vBinZoom] += rr*dl;
+	    }
+	    if ( vBinFull >=0 ) {
+	      m_maps.m_full_rz_norm[vBinFull] += rr*dl;
+	    }
+	    if ( vBin3d >=0 ) {
+	      m_maps.m_3d_norm[vBin3d] += rr*dl;
+	    }
+	    if ( goodMaterial ) {
+	      // same but only inside the material of interest. 
+	      // The ratio vol/norm gives the volume fraction of the desired
+	      // material inside the current bin
 	      if ( vBinZoom >=0 ) {
-		m_maps.m_rz_norm[vBinZoom] += rr*dl;
+		m_maps.m_rz_vol [vBinZoom] += rr*dl;
 	      }
 	      if ( vBinFull >=0 ) {
-		m_maps.m_full_rz_norm[vBinFull] += rr*dl;
+		m_maps.m_full_rz_vol [vBinFull] += rr*dl;
 	      }
 	      if ( vBin3d >=0 ) {
-		m_maps.m_3d_norm[vBin3d] += rr*dl;
-	      }
-	      if ( goodMaterial ) {
-		// same but only inside the material of interest. 
-		// The ratio vol/norm gives the volume fraction of the desired
-		// material inside the current bin
-		if ( vBinZoom >=0 ) {
-		  m_maps.m_rz_vol [vBinZoom] += rr*dl;
-		}
-		if ( vBinFull >=0 ) {
-		  m_maps.m_full_rz_vol [vBinFull] += rr*dl;
-		}
-		if ( vBin3d >=0 ) {
-		  m_maps.m_3d_vol [vBin3d] += rr*dl;
-		}
+		m_maps.m_3d_vol [vBin3d] += rr*dl;
 	      }
 	    }
 	  }
diff --git a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx
index de6c9f17a0fab0ed75757f9b4dd34cdc5a0670b7..9015b2f8c1fe18b386603c97c39fa7644201e55e 100644
--- a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx
@@ -22,6 +22,10 @@ namespace G4UA{
     /// number of bins in r and z for all 2D maps
     declareProperty("NBinsR"    , m_config.nBinsr);
     declareProperty("NBinsZ"    , m_config.nBinsz);
+    /// number of bins in logE for energy spectra of neutrons in 2D grids
+    declareProperty("NBinsLogEn", m_config.nBinslogEn);
+    /// number of bins in logE for energy spectra of other particles in 2D grids
+    declareProperty("NBinsLogEo", m_config.nBinslogEo);
     /// number of bins in r, z and phi for all 3D maps
     declareProperty("NBinsR3D"  , m_config.nBinsr3d);
     declareProperty("NBinsZ3D"  , m_config.nBinsz3d);
@@ -40,6 +44,12 @@ namespace G4UA{
     /// for Zoomed area in 3D 
     declareProperty("PhiMinZoom", m_config.phiMinZoom);
     declareProperty("PhiMaxZoom", m_config.phiMaxZoom);
+    /// for logE of neutrons in 2D spectra
+    declareProperty("LogEMinn"  , m_config.logEMinn);
+    declareProperty("LogEMaxn"  , m_config.logEMaxn);
+    /// for logE of other particles in 2D spectra
+    declareProperty("LogEMino"  , m_config.logEMino);
+    declareProperty("LogEMaxo"  , m_config.logEMaxo);
   }
 
   //---------------------------------------------------------------------------
@@ -47,21 +57,25 @@ namespace G4UA{
   //---------------------------------------------------------------------------
   StatusCode RadiationMapsMakerTool::initialize()
   {
-    ATH_MSG_INFO( "Initializing  " << name() << "\n" <<
-                  "OutputFile:   " << m_radMapsFileName   << "\n"                << 
-                  "Material:     " << m_config.material   << "\n"                << 
-                  "2D Maps:      " << m_config.nBinsz     << " |z|-bins, "       << 
-                                      m_config.nBinsr     << " r-bins"           << "\n"                << 
-                  "Zoom:         " << m_config.zMinZoom   << " < |z|/cm < "      << m_config.zMaxZoom   << ", " << 
-                                      m_config.rMinZoom   << " < r/cm < "        << m_config.rMaxZoom   << "\n" << 
-                  "Full:         " << m_config.zMinFull   << " < |z|/cm < "      << m_config.zMaxFull   << ", " << 
-                                      m_config.rMinFull   << " < r/cm < "        << m_config.rMaxFull   << "\n" << 
-                  "3D Maps:      " << m_config.nBinsz3d   << " |z|-bins, "       << 
-                                      m_config.nBinsr3d   << " r-bins, "         << 
-                                      m_config.nBinsphi3d << " phi-bins"         << "\n"                << 
-                  "Zoom:         " << m_config.zMinZoom   << " < |z|/cm < "      << m_config.zMaxZoom   << ", " << 
-                                      m_config.rMinZoom   << " < r/cm < "        << m_config.rMaxZoom   << ", " <<
-                                      m_config.phiMinZoom << " < phi/degrees < " << m_config.phiMaxZoom );
+    ATH_MSG_INFO( "Initializing     " << name() << "\n" <<
+                  "OutputFile:      " << m_radMapsFileName   << "\n"                 << 
+                  "Material:        " << m_config.material   << "\n"                 << 
+                  "2D Maps:         " << m_config.nBinsz     << " |z|-bins, "        << 
+		                         m_config.nBinsr     << " r-bins"            << "\n"                << 
+		  "Zoom:            " << m_config.zMinZoom   << " < |z|/cm < "       << m_config.zMaxZoom   << ", " << 
+                                         m_config.rMinZoom   << " < r/cm < "         << m_config.rMaxZoom   << "\n" << 
+                  "Full:            " << m_config.zMinFull   << " < |z|/cm < "       << m_config.zMaxFull   << ", " << 
+                                         m_config.rMinFull   << " < r/cm < "         << m_config.rMaxFull   << "\n" << 
+                  "Neutron Spectra: " << m_config.nBinslogEn << " log10E-bins"       << ", "                <<
+                                         m_config.logEMinn   << " < log10(E/MeV) < " << m_config.logEMaxn   << "\n" << 
+                  "Other Spectra:   " << m_config.nBinslogEo << " log10E-bins"       << ", "                <<
+                                         m_config.logEMino   << " < log10(E/MeV) < " << m_config.logEMaxo   << "\n" << 
+                  "3D Maps:         " << m_config.nBinsz3d   << " |z|-bins, "       << 
+                                         m_config.nBinsr3d   << " r-bins, "         << 
+                                         m_config.nBinsphi3d << " phi-bins"         << "\n"                << 
+                  "Zoom:            " << m_config.zMinZoom   << " < |z|/cm < "      << m_config.zMaxZoom   << ", " << 
+                                         m_config.rMinZoom   << " < r/cm < "        << m_config.rMaxZoom   << ", " <<
+                                         m_config.phiMinZoom << " < phi/degrees < " << m_config.phiMaxZoom );
       
     return StatusCode::SUCCESS;
   }
@@ -98,6 +112,21 @@ namespace G4UA{
     maps.m_3d_neut.resize(0);
     maps.m_3d_chad.resize(0);
 
+    maps.m_rz_neut_spec     .resize(0);
+    maps.m_full_rz_neut_spec.resize(0);
+    maps.m_rz_gamm_spec     .resize(0);
+    maps.m_full_rz_gamm_spec.resize(0);
+    maps.m_rz_elec_spec     .resize(0);
+    maps.m_full_rz_elec_spec.resize(0);
+    maps.m_rz_muon_spec     .resize(0);
+    maps.m_full_rz_muon_spec.resize(0);
+    maps.m_rz_pion_spec     .resize(0);
+    maps.m_full_rz_pion_spec.resize(0);
+    maps.m_rz_prot_spec     .resize(0);
+    maps.m_full_rz_prot_spec.resize(0);
+    maps.m_rz_rest_spec     .resize(0);
+    maps.m_full_rz_rest_spec.resize(0);
+
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
       // 2d zoom
@@ -134,6 +163,20 @@ namespace G4UA{
     maps.m_3d_neut.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     maps.m_3d_chad.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
 
+    maps.m_rz_neut_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEn,0.0);
+    maps.m_full_rz_neut_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEn,0.0);
+    maps.m_rz_gamm_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_full_rz_gamm_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_rz_elec_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_full_rz_elec_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_rz_muon_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_full_rz_muon_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_rz_pion_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_full_rz_pion_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_rz_prot_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_full_rz_prot_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_rz_rest_spec     .resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
+    maps.m_full_rz_rest_spec.resize(m_config.nBinsz*m_config.nBinsr*m_config.nBinslogEo,0.0);
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
       // 2d zoom
@@ -245,6 +288,104 @@ namespace G4UA{
     h_3d_neut ->SetTitle("FLUX [n_{>100 keV}/cm^{2}]");
     h_3d_chad ->SetTitle("FLUX [h_{charged}/cm^{2}]");
 
+    // neutron spectra
+    TH3D *h_full_rz_neut_spec = new TH3D("full_rz_neut_spec","full_rz_neut_spec",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull,m_config.nBinslogEn,m_config.logEMinn,m_config.logEMaxn);
+    TH3D *h_rz_neut_spec      = new TH3D("rz_neut_spec","rz_neut_spec",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinslogEn,m_config.logEMinn,m_config.logEMaxn);
+
+    h_rz_neut_spec      ->SetXTitle("|z| [cm]");
+    h_rz_neut_spec      ->SetYTitle("r [cm]");
+    h_rz_neut_spec      ->SetZTitle("log_{10}(E/MeV)");
+    h_rz_neut_spec      ->SetTitle("FLUX [n(log_{10}(E/MeV))/cm^{2}]");
+
+    h_full_rz_neut_spec ->SetXTitle("|z| [cm]");
+    h_full_rz_neut_spec ->SetYTitle("r [cm]");
+    h_full_rz_neut_spec ->SetZTitle("log_{10}(E/MeV)");
+    h_full_rz_neut_spec ->SetTitle("FLUX [n(log_{10}(E/MeV))/cm^{2}]");
+
+    // gamma spectra
+    TH3D *h_full_rz_gamm_spec = new TH3D("full_rz_gamm_spec","full_rz_gamm_spec",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+    TH3D *h_rz_gamm_spec      = new TH3D("rz_gamm_spec","rz_gamm_spec",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+
+    h_rz_gamm_spec      ->SetXTitle("|z| [cm]");
+    h_rz_gamm_spec      ->SetYTitle("r [cm]");
+    h_rz_gamm_spec      ->SetZTitle("log_{10}(E/MeV)");
+    h_rz_gamm_spec      ->SetTitle("FLUX [#gamma(log_{10}(E/MeV))/cm^{2}]");
+
+    h_full_rz_gamm_spec ->SetXTitle("|z| [cm]");
+    h_full_rz_gamm_spec ->SetYTitle("r [cm]");
+    h_full_rz_gamm_spec ->SetZTitle("log_{10}(E/MeV)");
+    h_full_rz_gamm_spec ->SetTitle("FLUX [#gamma(log_{10}(E/MeV))/cm^{2}]");
+
+    // e^+/- spectra
+    TH3D *h_full_rz_elec_spec = new TH3D("full_rz_elec_spec","full_rz_elec_spec",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+    TH3D *h_rz_elec_spec      = new TH3D("rz_elec_spec","rz_elec_spec",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+
+    h_rz_elec_spec      ->SetXTitle("|z| [cm]");
+    h_rz_elec_spec      ->SetYTitle("r [cm]");
+    h_rz_elec_spec      ->SetZTitle("log_{10}(E/MeV)");
+    h_rz_elec_spec      ->SetTitle("FLUX [e^{#pm}(log_{10}(E/MeV))/cm^{2}]");
+
+    h_full_rz_elec_spec ->SetXTitle("|z| [cm]");
+    h_full_rz_elec_spec ->SetYTitle("r [cm]");
+    h_full_rz_elec_spec ->SetZTitle("log_{10}(E/MeV)");
+    h_full_rz_elec_spec ->SetTitle("FLUX [e^{#pm}(log_{10}(E/MeV))/cm^{2}]");
+
+    // mu^+/- spectra
+    TH3D *h_full_rz_muon_spec = new TH3D("full_rz_muon_spec","full_rz_muon_spec",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+    TH3D *h_rz_muon_spec      = new TH3D("rz_muon_spec","rz_muon_spec",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+
+    h_rz_muon_spec      ->SetXTitle("|z| [cm]");
+    h_rz_muon_spec      ->SetYTitle("r [cm]");
+    h_rz_muon_spec      ->SetZTitle("log_{10}(E/MeV)");
+    h_rz_muon_spec      ->SetTitle("FLUX [#mu^{#pm}(log_{10}(E/MeV))/cm^{2}]");
+
+    h_full_rz_muon_spec ->SetXTitle("|z| [cm]");
+    h_full_rz_muon_spec ->SetYTitle("r [cm]");
+    h_full_rz_muon_spec ->SetZTitle("log_{10}(E/MeV)");
+    h_full_rz_muon_spec ->SetTitle("FLUX [#mu^{#pm}(log_{10}(E/MeV))/cm^{2}]");
+
+    // pi^+/- spectra
+    TH3D *h_full_rz_pion_spec = new TH3D("full_rz_pion_spec","full_rz_pion_spec",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+    TH3D *h_rz_pion_spec      = new TH3D("rz_pion_spec","rz_pion_spec",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+
+    h_rz_pion_spec      ->SetXTitle("|z| [cm]");
+    h_rz_pion_spec      ->SetYTitle("r [cm]");
+    h_rz_pion_spec      ->SetZTitle("log_{10}(E/MeV)");
+    h_rz_pion_spec      ->SetTitle("FLUX [#pi^{#pm}(log_{10}(E/MeV))/cm^{2}]");
+
+    h_full_rz_pion_spec ->SetXTitle("|z| [cm]");
+    h_full_rz_pion_spec ->SetYTitle("r [cm]");
+    h_full_rz_pion_spec ->SetZTitle("log_{10}(E/MeV)");
+    h_full_rz_pion_spec ->SetTitle("FLUX [#pi^{#pm}(log_{10}(E/MeV))/cm^{2}]");
+
+    // proton spectra
+    TH3D *h_full_rz_prot_spec = new TH3D("full_rz_prot_spec","full_rz_prot_spec",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+    TH3D *h_rz_prot_spec      = new TH3D("rz_prot_spec","rz_prot_spec",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+
+    h_rz_prot_spec      ->SetXTitle("|z| [cm]");
+    h_rz_prot_spec      ->SetYTitle("r [cm]");
+    h_rz_prot_spec      ->SetZTitle("log_{10}(E/MeV)");
+    h_rz_prot_spec      ->SetTitle("FLUX [p(log_{10}(E/MeV))/cm^{2}]");
+
+    h_full_rz_prot_spec ->SetXTitle("|z| [cm]");
+    h_full_rz_prot_spec ->SetYTitle("r [cm]");
+    h_full_rz_prot_spec ->SetZTitle("log_{10}(E/MeV)");
+    h_full_rz_prot_spec ->SetTitle("FLUX [p(log_{10}(E/MeV))/cm^{2}]");
+
+    // rest spectra
+    TH3D *h_full_rz_rest_spec = new TH3D("full_rz_rest_spec","full_rz_rest_spec",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+    TH3D *h_rz_rest_spec      = new TH3D("rz_rest_spec","rz_rest_spec",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinslogEo,m_config.logEMino,m_config.logEMaxo);
+
+    h_rz_rest_spec      ->SetXTitle("|z| [cm]");
+    h_rz_rest_spec      ->SetYTitle("r [cm]");
+    h_rz_rest_spec      ->SetZTitle("log_{10}(E/MeV)");
+    h_rz_rest_spec      ->SetTitle("FLUX [rest(log_{10}(E/MeV))/cm^{2}]");
+
+    h_full_rz_rest_spec ->SetXTitle("|z| [cm]");
+    h_full_rz_rest_spec ->SetYTitle("r [cm]");
+    h_full_rz_rest_spec ->SetZTitle("log_{10}(E/MeV)");
+    h_full_rz_rest_spec ->SetTitle("FLUX [rest(log_{10}(E/MeV))/cm^{2}]");
+
     TH2D * h_rz_vol  = 0;
     TH2D * h_rz_norm = 0;
     TH2D * h_full_rz_vol  = 0;
@@ -322,6 +463,30 @@ namespace G4UA{
 	// CHAD
 	val =maps.m_rz_chad[vBin];
 	h_rz_chad->SetBinContent(iBin,val/vol);
+	// Neutron Energy Spectra
+	for(int k=0;k<h_rz_neut_spec->GetNbinsZ();k++) { 
+	  int kBin = h_rz_neut_spec->GetBin(i+1,j+1,k+1); 
+	  int vBinE = m_config.nBinsr*m_config.nBinslogEn*i+j*m_config.nBinslogEn+k;
+	  val =maps.m_rz_neut_spec[vBinE];
+	  h_rz_neut_spec->SetBinContent(kBin,val/vol);
+	}
+	// All other particle's Energy Spectra
+	for(int k=0;k<h_rz_gamm_spec->GetNbinsZ();k++) { 
+	  int kBin = h_rz_gamm_spec->GetBin(i+1,j+1,k+1); 
+	  int vBinE = m_config.nBinsr*m_config.nBinslogEo*i+j*m_config.nBinslogEo+k;
+	  val =maps.m_rz_gamm_spec[vBinE];
+	  h_rz_gamm_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_rz_elec_spec[vBinE];
+	  h_rz_elec_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_rz_muon_spec[vBinE];
+	  h_rz_muon_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_rz_pion_spec[vBinE];
+	  h_rz_pion_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_rz_prot_spec[vBinE];
+	  h_rz_prot_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_rz_rest_spec[vBinE];
+	  h_rz_rest_spec->SetBinContent(kBin,val/vol);
+	}
 	if (!m_config.material.empty()) {
 	  // need volume fraction only if particular material is selected
 	  // VOL
@@ -339,7 +504,14 @@ namespace G4UA{
     h_rz_h20->Write();
     h_rz_neut->Write();
     h_rz_chad->Write();
-
+    h_rz_neut_spec->Write();
+    h_rz_gamm_spec->Write();
+    h_rz_elec_spec->Write();
+    h_rz_muon_spec->Write();
+    h_rz_pion_spec->Write();
+    h_rz_prot_spec->Write();
+    h_rz_rest_spec->Write();
+    
     // normalize to volume element per bin
     for(int i=0;i<h_full_rz_tid->GetNbinsX();i++) { 
       for(int j=0;j<h_full_rz_tid->GetNbinsY();j++) { 
@@ -369,6 +541,30 @@ namespace G4UA{
 	// CHAD
 	val =maps.m_full_rz_chad[vBin];
 	h_full_rz_chad->SetBinContent(iBin,val/vol);
+	// Neutron Energy Spectra
+	for(int k=0;k<h_full_rz_neut_spec->GetNbinsZ();k++) { 
+	  int kBin = h_full_rz_neut_spec->GetBin(i+1,j+1,k+1); 
+	  int vBinE = m_config.nBinsr*m_config.nBinslogEn*i+j*m_config.nBinslogEn+k;
+	  val =maps.m_full_rz_neut_spec[vBinE];
+	  h_full_rz_neut_spec->SetBinContent(kBin,val/vol);
+	}
+	// All other particle's Energy Spectra
+	for(int k=0;k<h_full_rz_gamm_spec->GetNbinsZ();k++) { 
+	  int kBin = h_full_rz_gamm_spec->GetBin(i+1,j+1,k+1); 
+	  int vBinE = m_config.nBinsr*m_config.nBinslogEo*i+j*m_config.nBinslogEo+k;
+	  val =maps.m_full_rz_gamm_spec[vBinE];
+	  h_full_rz_gamm_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_full_rz_elec_spec[vBinE];
+	  h_full_rz_elec_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_full_rz_muon_spec[vBinE];
+	  h_full_rz_muon_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_full_rz_pion_spec[vBinE];
+	  h_full_rz_pion_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_full_rz_prot_spec[vBinE];
+	  h_full_rz_prot_spec->SetBinContent(kBin,val/vol);
+	  val =maps.m_full_rz_rest_spec[vBinE];
+	  h_full_rz_rest_spec->SetBinContent(kBin,val/vol);
+	}
 	if (!m_config.material.empty()) {
 	  // need volume fraction only if particular material is selected
 	  // VOL
@@ -386,6 +582,13 @@ namespace G4UA{
     h_full_rz_h20->Write();
     h_full_rz_neut->Write();
     h_full_rz_chad->Write();
+    h_full_rz_neut_spec->Write();
+    h_full_rz_gamm_spec->Write();
+    h_full_rz_elec_spec->Write();
+    h_full_rz_muon_spec->Write();
+    h_full_rz_pion_spec->Write();
+    h_full_rz_prot_spec->Write();
+    h_full_rz_rest_spec->Write();
 
     // normalize to volume element per bin
     for(int i=0;i<h_3d_tid->GetNbinsX();i++) { /* |z| */
diff --git a/Simulation/ISF/ISF_Config/python/FlagSetters.py b/Simulation/ISF/ISF_Config/python/FlagSetters.py
index 5273430f51f7ef9fc11c98829d7c853adc88ad31..3c26b0a1a4ba882829a4fdade27461b728a0672f 100644
--- a/Simulation/ISF/ISF_Config/python/FlagSetters.py
+++ b/Simulation/ISF/ISF_Config/python/FlagSetters.py
@@ -126,10 +126,29 @@ def configureFlagsATLFASTIIMT():
     return configureFlagsATLFASTII()
 
 def configureFlagsATLFASTII_PileUp():
+    configureFlagsATLFASTII()
     from G4AtlasApps.SimFlags import simFlags
     simFlags.SimulationFlavour = "ATLFASTII_PileUp"
-    from ISF_Config.ISF_jobProperties import ISF_Flags
-    ISF_Flags.UsingGeant4 = True
+    return
+
+## methods for simulators which use G4 + FastCaloSim V2
+
+def configureFlagsG4FastCalo():
+    configureFlagsATLFASTII()
+    from G4AtlasApps.SimFlags import simFlags
+    simFlags.SimulationFlavour = "G4FastCalo"
+    return
+
+def configureFlagsG4FastCaloTest():
+    configureFlagsATLFASTII()
+    from G4AtlasApps.SimFlags import simFlags
+    simFlags.SimulationFlavour = "G4FastCaloTest"
+    return
+
+def configureFlagsG4FastCaloDNN():
+    configureFlagsATLFASTII()
+    from G4AtlasApps.SimFlags import simFlags
+    simFlags.SimulationFlavour = "G4FastCaloDNN"
     return
 
 ## methods for simulators which use Fatras + FastCaloSim
diff --git a/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py b/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py
index 35bfc91687c3f0ee641ae74fc4f5a2e7c4d1e5a6..e41f456db9652a00ceda7284d2b034cefc4ea321 100644
--- a/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py
+++ b/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py
@@ -46,6 +46,7 @@ addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4HS_FastPileup",     "ISF_Ker
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_ATLFASTIIF_IDOnly",   "ISF_Kernel_ATLFASTIIF_IDOnly")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_ATLFASTIIF_IDCalo",   "ISF_Kernel_ATLFASTIIF_IDCalo")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCalo",          "ISF_Kernel_G4FastCalo")
+addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCaloTest",      "ISF_Kernel_G4FastCaloTest")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCaloDNN",          "ISF_Kernel_G4FastCaloDNN")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCaloMT",         "ISF_Kernel_G4FastCaloMT")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_Fatras_newExtrapolation","ISF_Kernel_Fatras_newExtrapolation")
diff --git a/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py b/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py
index 89d863bd3d1a5d23c5fa0c1bf776fdb5e87ef992..e3e8ecfe014c233e11e73ab0ca3feb8ad2ae8180 100644
--- a/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py
+++ b/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py
@@ -365,6 +365,24 @@ def getKernel_G4FastCalo(name="ISF_Kernel_G4FastCalo", **kwargs):
     simFlags.SimulationFlavour = "G4FastCalo"
     return getKernel_GenericSimulator(name, **kwargs)
 
+############## Simulator: G4FastCaloTest ###############
+def getKernel_G4FastCaloTest(name="ISF_Kernel_G4FastCaloTest", **kwargs):
+    kwargs.setdefault("ParticleBroker"             , 'ISF_AFIIParticleBrokerSvc')
+
+    kwargs.setdefault("BeamPipeSimulationSelectors", [ 'ISF_DefaultAFIIGeant4Selector' ]            )
+    kwargs.setdefault("IDSimulationSelectors"      , [ 'ISF_DefaultAFIIGeant4Selector' ]            )
+    kwargs.setdefault("CaloSimulationSelectors"    , [ 'ISF_MuonAFIIGeant4Selector',
+                                                       'ISF_EtaGreater5ParticleKillerSimSelector',
+                                                       'ISF_PionAFIIGeant4Selector',
+                                                       'ISF_ProtonAFIIGeant4Selector',
+                                                       'ISF_ChargedKaonAFIIGeant4Selector',
+                                                       'ISF_KLongAFIIGeant4Selector',
+                                                       'ISF_DefaultFastCaloSimV2Selector' ] )
+    kwargs.setdefault("MSSimulationSelectors"      , [ 'ISF_DefaultAFIIGeant4Selector' ]            )
+    kwargs.setdefault("CavernSimulationSelectors"  , [ 'ISF_DefaultParticleKillerSelector' ]        )
+    from G4AtlasApps.SimFlags import simFlags
+    simFlags.SimulationFlavour = "G4FastCaloTest"
+    return getKernel_G4FastCalo(name, **kwargs)
 
 ############## Simulator: G4FastCaloDNN ###############
 # like G4FastCalo, replacing FastCaloSimV2 by DNNCaloSim
@@ -379,7 +397,7 @@ def getKernel_G4FastCaloDNN(name="ISF_Kernel_G4FastCaloDNN", **kwargs):
     kwargs.setdefault("MSSimulationSelectors"      , [ 'ISF_DefaultAFIIGeant4Selector' ]            )
     kwargs.setdefault("CavernSimulationSelectors"  , [ 'ISF_DefaultParticleKillerSelector' ]        )
     from G4AtlasApps.SimFlags import simFlags
-    simFlags.SimulationFlavour = "G4FastCalo"
+    simFlags.SimulationFlavour = "G4FastCaloDNN"
     return getKernel_GenericSimulator(name, **kwargs)
 ############## Simulator: G4FastCaloMT ###############
 def getKernel_G4FastCaloMT(name="ISF_Kernel_G4FastCaloMT", **kwargs):
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
index 3d864c3c9a2134ce497996fe62ef65dd7ff20bd8..af01d49c6cfbb9a8c5f9e03d11148288673306db 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py
@@ -1,7 +1,7 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 """
-Tools configurations for ISF
+Service configurations for ISF
 KG Tan, 17/06/2012
 """
 
@@ -60,11 +60,6 @@ def getAFIIGeoIDSvc(name="ISF_AFIIGeoIDSvc", **kwargs):
     return getGeoIDSvc(name, **kwargs)
 
 
-def getParticleKillerSvc(name="ISF_ParticleKillerSvc", **kwargs):
-    kwargs.setdefault('Identifier',           "ParticleKiller")
-    kwargs.setdefault('SimulatorTool',        "ISF_ParticleKillerTool")
-    return CfgMgr.ISF__ParticleKillerSimSvc(name, **kwargs)
-
 def getGenParticleFilters():
     genParticleFilterList = []
     genParticleFilterList = ['ISF_ParticleFinalStateFilter'] # not used for Quasi-stable particle simulation
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py
index d3880a13766f214ac58716e1e8a8d0e310d2dde7..7581e116c82050266ba89989d2badb6d3625860d 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 """
 Configuration database for ISF_Services
@@ -30,4 +30,4 @@ addService("ISF_Services.ISF_ServicesConfig.getMC16LLPTruthService", "ISF_MC16LL
 addService("ISF_Services.ISF_ServicesConfig.getMC18TruthService", "ISF_MC18TruthService")
 addService("ISF_Services.ISF_ServicesConfig.getMC18LLPTruthService", "ISF_MC18LLPTruthService")
 addService("ISF_Services.ISF_ServicesConfig.getValidationTruthService", "ISF_ValidationTruthService")
-addService("ISF_Services.ISF_ServicesConfig.getParticleKillerSvc", "ISF_ParticleKillerSvc")
+addService("ISF_Services.LegacySimServicesConfig.getParticleKillerSvc", "ISF_ParticleKillerSvc")
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/LegacySimServicesConfig.py b/Simulation/ISF/ISF_Core/ISF_Services/python/LegacySimServicesConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..63af5e485275160d9ccec05e7826863d3da8f196
--- /dev/null
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/LegacySimServicesConfig.py
@@ -0,0 +1,16 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+"""
+Configurations for (potentially) thread-unsafe ISF Sim Services
+"""
+
+from AthenaCommon import CfgMgr
+
+from AthenaCommon.Constants import *  # FATAL,ERROR etc.
+from AthenaCommon.SystemOfUnits import *
+
+def getParticleKillerSvc(name="ISF_ParticleKillerSvc", **kwargs):
+    kwargs.setdefault('Identifier',           "ParticleKiller")
+    kwargs.setdefault('SimulatorTool',        "ISF_ParticleKillerTool")
+    return CfgMgr.ISF__LegacySimSvc(name, **kwargs )
+
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvc.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/LegacySimSvc.cxx
similarity index 55%
rename from Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvc.cxx
rename to Simulation/ISF/ISF_Core/ISF_Services/src/LegacySimSvc.cxx
index bff289b31c7437e1693282f55998fcc70a17a343..34b0179788242925e45ac537e1b2832325f8218e 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvc.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/LegacySimSvc.cxx
@@ -1,42 +1,36 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // class header include
-#include "FastCaloSimSvc.h"
+#include "LegacySimSvc.h"
 #include "ISF_Interfaces/IParticleBroker.h"
 
 /** Constructor **/
-ISF::FastCaloSimSvc::FastCaloSimSvc(const std::string& name,ISvcLocator* svc) :
+ISF::LegacySimSvc::LegacySimSvc(const std::string& name,ISvcLocator* svc) :
   BaseSimulationSvc(name, svc)
 {
 }
 
-ISF::FastCaloSimSvc::~FastCaloSimSvc()
-{}
-
 /** framework methods */
-StatusCode ISF::FastCaloSimSvc::initialize()
+StatusCode ISF::LegacySimSvc::initialize()
 {
-  ATH_MSG_INFO ( m_screenOutputPrefix << "Initializing ...");
-
   ATH_CHECK ( m_simulatorTool.retrieve() );
-
   return StatusCode::SUCCESS;
 }
 
-StatusCode ISF::FastCaloSimSvc::setupEvent()
+StatusCode ISF::LegacySimSvc::setupEvent()
 {
   return m_simulatorTool->setupEventST();
 }
 
-StatusCode ISF::FastCaloSimSvc::releaseEvent()
+StatusCode ISF::LegacySimSvc::releaseEvent()
 {
   return m_simulatorTool->releaseEventST();
 }
 
 /** Simulation Call */
-StatusCode ISF::FastCaloSimSvc::simulate(const ISF::ISFParticle& isfp, McEventCollection* mcEventCollection)
+StatusCode ISF::LegacySimSvc::simulate(const ISF::ISFParticle& isfp, McEventCollection* mcEventCollection)
 {
   ISF::ISFParticleContainer secondaries;
   ATH_CHECK(m_simulatorTool->simulate(isfp, secondaries, mcEventCollection));
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvc.h b/Simulation/ISF/ISF_Core/ISF_Services/src/LegacySimSvc.h
similarity index 64%
rename from Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvc.h
rename to Simulation/ISF/ISF_Core/ISF_Services/src/LegacySimSvc.h
index a641ed7bd2e10bb3fe4a9f753629ad27598210cf..9f4277bb75f5d3a3e05b25d6f74a7f5227aa3f83 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvc.h
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/LegacySimSvc.h
@@ -1,16 +1,14 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef ISF_FASTCALOSIMSVC_H
-#define ISF_FASTCALOSIMSVC_H 1
+#ifndef ISF_SERVICES_ISF_LEGACYSIMSVC_H
+#define ISF_SERVICES_ISF_LEGACYSIMSVC_H 1
 
 // STL includes
 #include <string>
-// #include <set>
 
 // Gaudi
-#include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
 
 // ISF includes
@@ -19,17 +17,16 @@
 
 namespace ISF {
 
-  /** @class FastCaloSimSvc
-      @author Michael.Duehrssen -at- cern.ch
+  /** @class LegacySimSvc
   */
-  class FastCaloSimSvc : public BaseSimulationSvc {
+  class LegacySimSvc : public BaseSimulationSvc {
   public:
 
     //** Constructor with parameters */
-    FastCaloSimSvc( const std::string& name, ISvcLocator* pSvcLocator );
+    LegacySimSvc( const std::string& name, ISvcLocator* pSvcLocator );
 
     /** Destructor */
-    virtual ~FastCaloSimSvc();
+    virtual ~LegacySimSvc() = default;
 
     /** Athena algorithm's interface methods */
     virtual StatusCode  initialize() override;
@@ -44,12 +41,9 @@ namespace ISF {
     virtual StatusCode releaseEvent() override;
 
   private:
-    /** Default constructor */
-    FastCaloSimSvc();
-
     PublicToolHandle<ISimulatorTool> m_simulatorTool{this, "SimulatorTool", "", ""};
 
   };
 }
 
-#endif //> !ISF_FASTCALOSIMSVC_H
+#endif //> !ISF_SERVICES_ISF_LEGACYSIMSVC_H
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/ParticleKillerSimSvc.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/ParticleKillerSimSvc.cxx
deleted file mode 100644
index 6c96c3fcdc1987ebcbb3e24d3e715fdfeec8a024..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/ParticleKillerSimSvc.cxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// class header include
-#include "ParticleKillerSimSvc.h"
-
-// ISF includes
-#include "ISF_Event/ISFParticle.h"
-
-/** Constructor **/
-ISF::ParticleKillerSimSvc::ParticleKillerSimSvc(const std::string& name, ISvcLocator* svc) :
-  BaseSimulationSvc(name, svc)
-{
-}
-
-ISF::ParticleKillerSimSvc::~ParticleKillerSimSvc()
-{}
-
-/** framework methods */
-StatusCode ISF::ParticleKillerSimSvc::initialize()
-{
-  ATH_CHECK (m_simulatorTool.retrieve());
-  return StatusCode::SUCCESS;
-}
-
-/** Simulation Call */
-StatusCode ISF::ParticleKillerSimSvc::simulate(const ISF::ISFParticle& particle, McEventCollection* mcEventCollection)
-{
-  ATH_MSG_VERBOSE( m_screenOutputPrefix << " simulate" );
-  ISFParticleContainer secondaries;
-  ATH_CHECK(m_simulatorTool->simulate( particle,  secondaries, mcEventCollection));
-  ATH_MSG_VERBOSE( "Returned "<< secondaries.size() << " secondaries.");
-  return StatusCode::SUCCESS;
-}
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/ParticleKillerSimSvc.h b/Simulation/ISF/ISF_Core/ISF_Services/src/ParticleKillerSimSvc.h
deleted file mode 100644
index 3e8f7ebea7bb1ec571427b956ca6a5e940826ed3..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/ParticleKillerSimSvc.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ISF_PARTICLEKILLERSIMSVC_H
-#define ISF_PARTICLEKILLERSIMSVC_H 1
-
-// STL includes
-#include <string>
-
-// ISF includes
-#include "ISF_Interfaces/BaseSimulationSvc.h"
-#include "ISF_Interfaces/ISimulatorTool.h"
-#include "ISF_Event/ISFParticleContainer.h"
-
-namespace ISF {
-
-  /** @class ParticleKillerSimSvc
-
-      This ISF SimulationService does literally nothing with the particles
-      handed over in the simulate(...) call. Thus those particles will be
-      removed from further simulation in ISF.
-
-      @author Elmar.Ritsch -at- cern.ch
-  */
-  class ParticleKillerSimSvc : public ISF::BaseSimulationSvc {
-
-  public:
-    //** Constructor with parameters */
-    ParticleKillerSimSvc( const std::string& name, ISvcLocator* pSvcLocator );
-
-    /** Destructor */
-    virtual ~ParticleKillerSimSvc();
-
-    /** Athena algorithm's interface methods */
-    virtual StatusCode  initialize() override;
-
-    /** Simulation Call  */
-    virtual StatusCode simulate(const ISF::ISFParticle& isp, McEventCollection* mcEventCollection) override;
-
-  private:
-    PublicToolHandle<ISF::ISimulatorTool> m_simulatorTool{this, "SimulatorTool", "ISF__ParticleKillerSimTool", ""};
-
-  };
-}
-
-
-#endif //> !ISF_PARTICLEKILLERSIMSV_H
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/components/ISF_Services_entries.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/components/ISF_Services_entries.cxx
index 2bca1e2af4e4cce4ff415101447399587148f8f0..ec420fdd1e7a7b35530f365629c6ea1b13fffbb2 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/components/ISF_Services_entries.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/components/ISF_Services_entries.cxx
@@ -2,15 +2,15 @@
 #include "../GeoIDSvc.h"
 #include "../InputConverter.h"
 #include "../ISFEnvelopeDefSvc.h"
+#include "../LegacySimSvc.h"
 #include "../ParticleBrokerDynamicOnReadIn.h"
-#include "../ParticleKillerSimSvc.h"
 #include "../TruthSvc.h"
 
 DECLARE_COMPONENT( ISF::AFIIEnvelopeDefSvc )
 DECLARE_COMPONENT( ISF::GeoIDSvc )
 DECLARE_COMPONENT( ISF::InputConverter )
 DECLARE_COMPONENT( ISF::ISFEnvelopeDefSvc )
+DECLARE_COMPONENT( ISF::LegacySimSvc )
 DECLARE_COMPONENT( ISF::ParticleBrokerDynamicOnReadIn )
-DECLARE_COMPONENT( ISF::ParticleKillerSimSvc )
 DECLARE_COMPONENT( ISF::TruthSvc )
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py
index 2cfc640f05f499f1d3961aa8759a748d1673d3e4..6e199c1d8967a53915ddb761b6751ffd1f3589d3 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py
@@ -12,7 +12,7 @@ from FastChainPileup.FastChain_jobProperties import FastChain_Flags
 def getFastCaloSimSvc(name="ISF_FastCaloSimSvc", **kwargs):
     kwargs.setdefault("SimulatorTool",  'ISF_FastCaloTool')
     kwargs.setdefault("Identifier",     'FastCaloSim')
-    return CfgMgr.ISF__FastCaloSimSvc(name, **kwargs )
+    return CfgMgr.ISF__LegacySimSvc(name, **kwargs )
 
 #### Pileup FastCaloSim
 def getFastCaloSimPileupSvc(name="ISF_FastCaloSimPileupSvc", **kwargs):
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/components/ISF_FastCaloSimServices_entries.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/components/ISF_FastCaloSimServices_entries.cxx
index 8c8150c4f6f7a790d7a6782eb153fc7ed3d5784f..f90786060f68266ce40037cb8738f05cd09e5662 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/components/ISF_FastCaloSimServices_entries.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/components/ISF_FastCaloSimServices_entries.cxx
@@ -1,11 +1,9 @@
 #include "../DNNCaloSimSvc.h"
-#include "../FastCaloSimSvc.h"
 #include "../FastCaloSimSvcV2.h"
 #include "../FastCaloSimSvcPU.h"
 #include "../FastCaloTool.h"
 
 DECLARE_COMPONENT( ISF::DNNCaloSimSvc )
-DECLARE_COMPONENT( ISF::FastCaloSimSvc )
 DECLARE_COMPONENT( ISF::FastCaloSimSvcV2 )
 DECLARE_COMPONENT( ISF::FastCaloSimSvcPU )
 DECLARE_COMPONENT( ISF::FastCaloTool )
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
index 72c6577ec31bb1b88032912efc75f68936e3cba0..84696b7e8495733c753e061a284e49d3b481f24b 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
@@ -1,7 +1,7 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 """
-Tools configurations for ISF for ISF_FatrasServicesConfig
+Serivce and Tool configurations for ISF for ISF_FatrasServicesConfig
 KG Tan, 04/12/2012
 """
 
@@ -715,8 +715,8 @@ def getFatrasPileupSimTool(name="ISF_FatrasPileupSimTool", **kwargs):
 def getFatrasSimServiceID(name="ISF_FatrasSimSvc", **kwargs):
     kwargs.setdefault("Identifier"      , "Fatras")
     kwargs.setdefault("SimulatorTool"  , "ISF_FatrasSimulatorToolST")
-    from ISF_FatrasServices.ISF_FatrasServicesConf import iFatras__FatrasSimSvc
-    return iFatras__FatrasSimSvc(name, **kwargs )
+    from AthenaCommon import CfgMgr
+    return CfgMgr.ISF__LegacySimSvc(name, **kwargs )
 
 
 def getFatrasNewExtrapolationSimServiceID(name="ISF_FatrasNewExtrapolationSimSvc", **kwargs):
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/FatrasSimSvc.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/FatrasSimSvc.cxx
deleted file mode 100644
index 51d0dc84aee0363a2f0e40b66195dfc7f9beb70b..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/FatrasSimSvc.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// class header include
-#include "FatrasSimSvc.h"
-#include "ISF_Interfaces/IParticleBroker.h"
-
-/** Constructor **/
-iFatras::FatrasSimSvc::FatrasSimSvc(const std::string& name, ISvcLocator* svc) :
-  BaseSimulationSvc(name, svc)
-{
-}
-
-iFatras::FatrasSimSvc::~FatrasSimSvc()
-{}
-
-/** framework methods */
-StatusCode iFatras::FatrasSimSvc::initialize()
-{
-  ATH_CHECK (m_simulatorTool.retrieve());
-  return StatusCode::SUCCESS;
-}
-
-/** framework methods */
-StatusCode iFatras::FatrasSimSvc::finalize()
-{
-  return StatusCode::SUCCESS;
-}
-
-StatusCode iFatras::FatrasSimSvc::setupEvent()
-{
-  return m_simulatorTool->setupEventST(); // empty method
-}
-
-StatusCode iFatras::FatrasSimSvc::releaseEvent()
-{
-  return m_simulatorTool->releaseEventST(); // empty method
-}
-
-/** Simulation Call */
-StatusCode iFatras::FatrasSimSvc::simulate(const ISF::ISFParticle& isfp, McEventCollection* mcEventCollection)
-{
-  ISF::ISFParticleContainer secondaries;
-  ATH_CHECK(m_simulatorTool->simulate(isfp, secondaries, mcEventCollection));
-  if (not secondaries.empty()) {
-    for (auto particle : secondaries) {
-      m_particleBroker->push( particle, &isfp);
-    }
-  }
-
-  // Fatras call done
-  return StatusCode::SUCCESS;
-}
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/FatrasSimSvc.h b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/FatrasSimSvc.h
deleted file mode 100644
index b9e087659822288a65936d53c7a096105e8bc507..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/FatrasSimSvc.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ISF_FATRASSIMSVC_H
-#define ISF_FATRASSIMSVC_H 1
-
-// STL includes
-#include <string>
-
-// FrameWork includes
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
-
-// ISF includes
-#include "ISF_Interfaces/BaseSimulationSvc.h"
-#include "ISF_Interfaces/ISimulatorTool.h"
-
-namespace iFatras {
-
-  /** @class FatrasSimSvc
-
-      @author Andreas.Salzburger -at- cern.ch
-     */
-  class FatrasSimSvc : public ISF::BaseSimulationSvc {
-
-    public:
-      //** Constructor with parameters */
-      FatrasSimSvc( const std::string& name, ISvcLocator* pSvcLocator );
-
-      /** Destructor */
-      virtual ~FatrasSimSvc();
-
-      /** Athena algorithm's interface methods */
-      virtual StatusCode initialize() override;
-      virtual StatusCode  finalize() override;
-
-      /** Simulation Call  */
-      virtual StatusCode simulate(const ISF::ISFParticle& isp, McEventCollection* mcEventCollection) override;
-
-      /** Setup Event chain - in case of a begin-of event action is needed */
-      virtual StatusCode setupEvent() override;
-
-      /** Release Event chain - in case of an end-of event action is needed */
-      virtual StatusCode releaseEvent() override;
-
-    private:
-      /** Default constructor */
-      FatrasSimSvc();
-
-      PublicToolHandle<ISF::ISimulatorTool> m_simulatorTool{this, "SimulatorTool", "", ""};
-  };
-}
-
-
-#endif //> !ISF_FatrasSimSvc_H
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/components/ISF_FatrasServices_entries.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/components/ISF_FatrasServices_entries.cxx
index 070de08a974aac3b90843944e38c670c9b7ae50f..7c616e61818bf45e78d2a6f82ff8970c45c2c8a3 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/components/ISF_FatrasServices_entries.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/src/components/ISF_FatrasServices_entries.cxx
@@ -1,6 +1,4 @@
-#include "../FatrasSimSvc.h"
 #include "../FatrasSimTool.h"
 
-DECLARE_COMPONENT( iFatras::FatrasSimSvc )
 DECLARE_COMPONENT( ISF::FatrasSimTool )
 
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx
index ebaf8b73d09492ae04ebdf8781b23758f38881a3..7e758c316017cde356e0b9397c88a10dd2993110 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -221,25 +221,25 @@ void iFatras::SimHitCreatorMS::handle( const Incident& inc ) {
              delete m_cscSimHitCollection; m_cscSimHitCollection=0;
         }
       }
-      if ( evtStore()->contains<GenericMuonSimHitCollection>(m_mmCollectionName) ){
+      if ( evtStore()->contains<MMSimHitCollection>(m_mmCollectionName) ){
 	if ( (evtStore()->retrieve(m_mmSimHitCollection , m_mmCollectionName)).isFailure() )
-	  ATH_MSG_ERROR( "[ --- ] Unable to retrieve GenericMuonSimHitCollection " << m_mmCollectionName);
+	  ATH_MSG_ERROR( "[ --- ] Unable to retrieve MMSimHitCollection " << m_mmCollectionName);
 	// (b)     if no ... try to create it      
       } else {
-	m_mmSimHitCollection = new GenericMuonSimHitCollection( m_mmCollectionName);
+	m_mmSimHitCollection = new MMSimHitCollection( m_mmCollectionName);
 	if ( (evtStore()->record(m_mmSimHitCollection, m_mmCollectionName, true)).isFailure() ) {
-             ATH_MSG_ERROR( "[ --- ] Unable to record GenericMuonSimHitCollection " << m_mmCollectionName);
+             ATH_MSG_ERROR( "[ --- ] Unable to record MMSimHitCollection " << m_mmCollectionName);
              delete m_mmSimHitCollection; m_mmSimHitCollection=0;
         }
       }
-      if ( evtStore()->contains<GenericMuonSimHitCollection>(m_stgcCollectionName) ){
+      if ( evtStore()->contains<sTGCSimHitCollection>(m_stgcCollectionName) ){
 	if ( (evtStore()->retrieve(m_stgcSimHitCollection , m_stgcCollectionName)).isFailure() )
-	  ATH_MSG_ERROR( "[ --- ] Unable to retrieve GenericMuonSimHitCollection " << m_stgcCollectionName);
+	  ATH_MSG_ERROR( "[ --- ] Unable to retrieve sTGCSimHitCollection " << m_stgcCollectionName);
 	// (b)     if no ... try to create it      
       } else {
-	m_stgcSimHitCollection = new GenericMuonSimHitCollection( m_stgcCollectionName);
+	m_stgcSimHitCollection = new sTGCSimHitCollection( m_stgcCollectionName);
 	if ( (evtStore()->record(m_stgcSimHitCollection, m_stgcCollectionName, true)).isFailure() ) {
-             ATH_MSG_ERROR( "[ --- ] Unable to record GenericMuonSimHitCollection " << m_stgcCollectionName);
+             ATH_MSG_ERROR( "[ --- ] Unable to record sTGCSimHitCollection " << m_stgcCollectionName);
              delete m_stgcSimHitCollection; m_stgcSimHitCollection=0;
         }
       }
@@ -274,24 +274,26 @@ void iFatras::SimHitCreatorMS::createHits(const ISF::ISFParticle& isp,
       // hit ID
       int simID = offIdToSimId(id);
       // local position : at MTG layer ( corresponds to the middle of the gas gap ) 
-      const Amg::Vector3D locPos= currLay->surfaceRepresentation().transform().inverse()*parm->position();
       //Trk::GlobalPosition locPosRot = HepGeom::RotateY3D(M_PI)*HepGeom::RotateZ3D(+M_PI/2.)*currLay->surfaceRepresentation().transform().inverse()*parm->position();
-      //std::cout << "local,local rotated:" << locPos<<"," << locPosRot << std::endl;
+      //std::cout << "local rotated:" << locPosRot << std::endl;
       // generating particle info
       double mom  = parm->momentum().mag();
       double mass = isp.mass();
       double eKin = sqrt( mom*mom+mass*mass) - mass;
       // the rest of information needs adjustment once full sim hits available
       double energyDeposit = 1.;
-      double stepLength = 1.;
       const Amg::Vector3D pos=parm->position();
       const Amg::Vector3D unitMom=parm->momentum().normalized();
-      GenericMuonSimHit nswHit = GenericMuonSimHit(simID,timeInfo,timeInfo, pos, locPos, pos, locPos, 
-						   isp.pdgCode(),eKin,unitMom, 
-						   energyDeposit,stepLength, isp.barcode()) ;
+
+      MMSimHit nswMMHit = MMSimHit(simID,timeInfo, pos, 
+				 isp.pdgCode(),eKin,unitMom, 
+				 energyDeposit, isp.barcode()) ;
+      sTGCSimHit nswsTGCHit = sTGCSimHit(simID,timeInfo, pos, 
+				     isp.pdgCode(), unitMom, 
+				     energyDeposit, isp.barcode()) ;
       
-      if ( m_muonMgr->mmIdHelper()->is_mm(id) )  m_mmSimHitCollection->Insert(nswHit); 
-      else  m_stgcSimHitCollection->Insert(nswHit); 
+      if ( m_muonMgr->mmIdHelper()->is_mm(id) )  m_mmSimHitCollection->Insert(nswMMHit); 
+      else  m_stgcSimHitCollection->Insert(nswsTGCHit); 
 
       ATH_MSG_VERBOSE("[ muhit ] NSW hit created.");           
          
@@ -302,7 +304,6 @@ void iFatras::SimHitCreatorMS::createHits(const ISF::ISFParticle& isp,
         const MuonGM::MMReadoutElement* mm=m_muonMgr->getMMReadoutElement(id);
         if (mm) {
           Trk::GlobalPosition g2re = mm->transform(id).inverse()*(*plIter)->position();
-	  std::cout <<"MM local position:MTG,MRG:"<< locPos <<","<<g2re<<std::endl;
 	  std::cout <<currLay->surfaceRepresentation().center()<< ","<<mm->center(id)<< std::endl;
 	  Trk::LocalPosition lp(g2re.x(),g2re.y());         
 	  int nCh = mm->stripNumber(lp,id);
@@ -314,7 +315,6 @@ void iFatras::SimHitCreatorMS::createHits(const ISF::ISFParticle& isp,
         const MuonGM::sTgcReadoutElement* stgc=m_muonMgr->getsTgcReadoutElement(id);
 	if (stgc) {
 	  Trk::GlobalPosition g2re = stgc->transform(id).inverse()*(*plIter)->position();
-	  std::cout <<"STGC local position:MTG,MRG:"<< locPos<<","<<g2re<<std::endl;
 	  Trk::LocalPosition lp(g2re.x(),g2re.y());         
 	  std::cout <<currLay->surfaceRepresentation().center()<< ","<<stgc->center(id)<<"," <<m_muonMgr->stgcIdHelper()->channelType(id)<<  std::endl;
 	  int nCh = stgc->stripNumber(lp,id);
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.h b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.h
index 32d71a4330bfeea6dd6a04bd74611f4612f857e5..416dd1c31ad4e01a89ec88eb831e1b98ad78cc8f 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.h
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -24,7 +24,8 @@
 #include "MuonSimEvent/RPCSimHitCollection.h"
 #include "MuonSimEvent/TGCSimHitCollection.h"
 #include "MuonSimEvent/CSCSimHitCollection.h"
-#include "MuonSimEvent/GenericMuonSimHitCollection.h"
+#include "MuonSimEvent/MMSimHitCollection.h"
+#include "MuonSimEvent/sTGCSimHitCollection.h"
 
 // Identifier
 #include "Identifier/Identifier.h"
@@ -107,8 +108,8 @@ namespace iFatras
       RPCSimHitCollection                  *m_rpcSimHitCollection;
       TGCSimHitCollection                  *m_tgcSimHitCollection;
       CSCSimHitCollection                  *m_cscSimHitCollection;
-      GenericMuonSimHitCollection          *m_mmSimHitCollection;
-      GenericMuonSimHitCollection          *m_stgcSimHitCollection;
+      MMSimHitCollection          	   *m_mmSimHitCollection;
+      sTGCSimHitCollection          	   *m_stgcSimHitCollection;
       std::string                          m_mdtCollectionName;
       std::string                          m_rpcCollectionName;
       std::string                          m_tgcCollectionName;
diff --git a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
index c693e176a3ee0ff360ac12eade6437f73fb1772b..32d425c98a8b4ab274740290eaef09c967d0f41a 100644
--- a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
+++ b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
@@ -141,6 +141,50 @@ def getNeutralGeant4Selector(name="ISF_NeutralGeant4Selector", **kwargs):
     kwargs.setdefault('SimulationFlavor', SimulationFlavor.Geant4)
     return CfgMgr.ISF__KinematicSimSelector(name, **kwargs)
 
+def getProtonAFIIGeant4Selector(name="ISF_ProtonAFIIGeant4Selector", **kwargs):
+    kwargs.setdefault('MaxMom'          , 750)
+    kwargs.setdefault('ParticlePDG'     , 2112)
+    kwargs.setdefault('Simulator'       , 'ISF_AFIIGeant4SimSvc')
+    kwargs.setdefault('SimulationFlavor', SimulationFlavor.Geant4)
+    return CfgMgr.ISF__KinematicSimSelector(name, **kwargs)
+
+def getProtonAFII_QS_Geant4Selector(name="ISF_ProtonAFII_QS_Geant4Selector", **kwargs):
+    kwargs.setdefault('Simulator'       , 'ISF_AFII_QS_Geant4SimSvc')
+    return getProtonAFIIGeant4Selector(name, **kwargs)
+
+def getPionAFIIGeant4Selector(name="ISF_PionAFIIGeant4Selector", **kwargs):
+    kwargs.setdefault('MaxMom'          , 200)
+    kwargs.setdefault('ParticlePDG'     , 211)
+    kwargs.setdefault('Simulator'       , 'ISF_AFIIGeant4SimSvc')
+    kwargs.setdefault('SimulationFlavor', SimulationFlavor.Geant4)
+    return CfgMgr.ISF__KinematicSimSelector(name, **kwargs)
+
+def getPionAFII_QS_Geant4Selector(name="ISF_PionAFII_QS_Geant4Selector", **kwargs):
+    kwargs.setdefault('Simulator'       , 'ISF_AFII_QS_Geant4SimSvc')
+    return getPionAFIIGeant4Selector(name, **kwargs)
+
+def getChargedKaonAFIIGeant4Selector(name="ISF_ChargedKaonAFIIGeant4Selector", **kwargs):
+    kwargs.setdefault('MaxMom'          , 750)
+    kwargs.setdefault('ParticlePDG'     , 321)
+    kwargs.setdefault('Simulator'       , 'ISF_AFIIGeant4SimSvc')
+    kwargs.setdefault('SimulationFlavor', SimulationFlavor.Geant4)
+    return CfgMgr.ISF__KinematicSimSelector(name, **kwargs)
+
+def getChargedKaonAFII_QS_Geant4Selector(name="ISF_ChargedKaonAFII_QS_Geant4Selector", **kwargs):
+    kwargs.setdefault('Simulator'       , 'ISF_AFII_QS_Geant4SimSvc')
+    return getChargedKaonAFIIGeant4Selector(name, **kwargs)
+
+def getKLongAFIIGeant4Selector(name="ISF_KLongAFIIGeant4Selector", **kwargs):
+    kwargs.setdefault('MaxMom'          , 750)
+    kwargs.setdefault('ParticlePDG'     , 130)
+    kwargs.setdefault('Simulator'       , 'ISF_AFIIGeant4SimSvc')
+    kwargs.setdefault('SimulationFlavor', SimulationFlavor.Geant4)
+    return CfgMgr.ISF__KinematicSimSelector(name, **kwargs)
+
+def getKLongAFII_QS_Geant4Selector(name="ISF_KLongAFII_QS_Geant4Selector", **kwargs):
+    kwargs.setdefault('Simulator'       , 'ISF_AFII_QS_Geant4SimSvc')
+    return getKLongAFIIGeant4Selector(name, **kwargs)
+
 def getMuonSelector(name="ISF_MuonSelector", **kwargs):
     kwargs.setdefault('ParticlePDG'     , 13)
     return CfgMgr.ISF__KinematicSimSelector(name, **kwargs)
diff --git a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigDb.py b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigDb.py
index 0ec511625c46eadcb1ec9af284f865e4ef77c3d0..07f87b876cdb2e41df8ed34f19aba18834ec7f45 100644
--- a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigDb.py
+++ b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigDb.py
@@ -9,6 +9,14 @@ from AthenaCommon.CfgGetter import addTool
 addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getElectronGeant4Selector"               , "ISF_ElectronGeant4Selector"              )
 addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getNeutralGeant4Selector"                , "ISF_NeutralGeant4Selector"               )
 addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getMuonGeant4Selector"                   , "ISF_MuonGeant4Selector"                  )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getProtonAFIIGeant4Selector"             , "ISF_ProtonAFIIGeant4Selector"            )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getProtonAFII_QS_Geant4Selector"         , "ISF_ProtonAFII_QS_Geant4Selector"        )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getPionAFIIGeant4Selector"               , "ISF_PionAFIIGeant4Selector"              )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getPionAFII_QS_Geant4Selector"           , "ISF_PionAFII_QS_Geant4Selector"          )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getChargedKaonAFIIGeant4Selector"        , "ISF_ChargedKaonAFIIGeant4Selector"       )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getChargedKaonAFII_QS_Geant4Selector"    , "ISF_ChargedKaonAFII_QS_Geant4Selector"   )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getKLongAFIIGeant4Selector"              , "ISF_KLongAFIIGeant4Selector"             )
+addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getKLongAFII_QS_Geant4Selector"          , "ISF_KLongAFII_QS_Geant4Selector"         )
 addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getMuonAFIIGeant4Selector"               , "ISF_MuonAFIIGeant4Selector"              )
 addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getMuonAFII_QS_Geant4Selector"           , "ISF_MuonAFII_QS_Geant4Selector"          )
 addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getMuonFatrasSelector"                   , "ISF_MuonFatrasSelector"                  )
diff --git a/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx
index 5436cd778db6da4f9169ab86864a5f10527ecbd6..2f7e875917dc191b704ad6afa946bf1dec3c5f05 100755
--- a/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx
+++ b/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MMHitAnalysis.h"
@@ -11,8 +11,8 @@
 #include "MuonReadoutGeometry/MMReadoutElement.h"
 #include "MuonIdHelpers/MmIdHelper.h"
 #include "MuonSimEvent/MicromegasHitIdHelper.h"
-#include "MuonSimEvent/GenericMuonSimHitCollection.h"
-#include "MuonSimEvent/GenericMuonSimHit.h"
+#include "MuonSimEvent/MMSimHitCollection.h"
+#include "MuonSimEvent/MMSimHit.h"
 #include "CLHEP/Vector/LorentzVector.h"
 
 #include "TH1.h"
@@ -264,14 +264,14 @@ StatusCode MMHitAnalysis::execute() {
 
   m_hits_x->clear();
 
-  const DataHandle<GenericMuonSimHitCollection> p_collection;
+  const DataHandle<MMSimHitCollection> p_collection;;
   if ((evtStore()->retrieve(p_collection,"MicromegasSensitiveDetector"))==StatusCode::SUCCESS) {
-    for (GenericMuonSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit){
+    for (MMSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit){
       
       Amg::Vector3D p = (*i_hit).globalPosition();
       //Get station names and make plots for each sector
       MicromegasHitIdHelper* hitHelper = MicromegasHitIdHelper::GetHelper(); 
-      int simId = (*i_hit).GenericId();
+      int simId = (*i_hit).MMId();
       std::string sim_stationName = hitHelper->GetStationName(simId);
       int sim_side = hitHelper->GetSide(simId);
       //Declare station name strings
diff --git a/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx
index 1bcf471c54632ddfc8a8bf0715c9a8c2dcc1a080..79220a81a07177c767aa393836366cdc628122a3 100755
--- a/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx
+++ b/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "sTGCHitAnalysis.h"
@@ -11,8 +11,8 @@
 #include "MuonReadoutGeometry/sTgcReadoutElement.h"
 #include "MuonIdHelpers/sTgcIdHelper.h"
 #include "MuonSimEvent/sTgcHitIdHelper.h"
-#include "MuonSimEvent/GenericMuonSimHitCollection.h"
-#include "MuonSimEvent/GenericMuonSimHit.h"
+#include "MuonSimEvent/sTGCSimHitCollection.h"
+#include "MuonSimEvent/sTGCSimHit.h"
 #include "CLHEP/Vector/LorentzVector.h"
 
 #include "TH1.h"
@@ -125,14 +125,14 @@ StatusCode sTGCHitAnalysis::initialize() {
 StatusCode sTGCHitAnalysis::execute() {
   ATH_MSG_DEBUG( "In sTGCHitAnalysis::execute()" );
 
-  const DataHandle<GenericMuonSimHitCollection> p_collection;
+  const DataHandle<sTGCSimHitCollection> p_collection;;
   if ((evtStore()->retrieve(p_collection,"sTGCSensitiveDetector"))==StatusCode::SUCCESS) {
-    for (GenericMuonSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit){
+    for (sTGCSimHitCollection::const_iterator i_hit = p_collection->begin(); i_hit != p_collection->end(); ++i_hit){
 
       Amg::Vector3D p = (*i_hit).globalPosition();
       //Get station names and make plots for each wedge
       sTgcHitIdHelper* hitHelper = sTgcHitIdHelper::GetHelper();
-      int simId = (*i_hit).GenericId();
+      int simId = (*i_hit).sTGCId();
       std::string sim_stationName = hitHelper->GetStationName(simId);
 
       static std::string TS11("TS11");
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx
index 37c72be5a3ee44fd16e34ee2dd69edbf5853100c..baf2c8822266941f2d35e8a86da8b955b0c7ec33 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx
@@ -903,10 +903,10 @@ void TileRawChNoiseCalibAlg::fillCell(TileRawChannelUnit::UNIT RChUnit, const Ti
     amp = m_tileToolEmscale->channelCalib(drawerIdx, channel, gain, amp, RChUnit, TileRawChannelUnit::MegaElectronVolts);
     int nch = 1;
     
-    if (m_cabling->isRun2Cabling() && (ros > 2)) { // Ext.barrel modules
+    if (m_cabling->isRun2PlusCabling() && (ros > 2)) { // Ext.barrel modules
         
       if (channel == E1_CHANNEL) { // Raw channel -> E1 cell.
-        int drawer2 = m_cabling->E1_merged_with_run2(ros, drawer);
+        int drawer2 = m_cabling->E1_merged_with_run2plus(ros, drawer);
         if (drawer2 != 0) { // Raw channel splitted into two E1 cells for Run 2.
           amp /= 2.0F;
           m_ecell_ene[side][drawer2][sample][tower][gg / 3] += amp;
diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h b/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h
index 6ae2cb00afde992ac87d18c3625291386aafa5f2..eb785cf28ad1f31e17690893be6fa5e1d8fdb63b 100644
--- a/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h
+++ b/TileCalorimeter/TileConditions/TileConditions/TileCablingService.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TILECONDITIONS_TILECABLINGSERVICE_H
@@ -92,13 +92,14 @@ public:
                            CrackAndMBTS = 3,
                            RUN2Cabling = 4,
                            RUN2aCabling = 5,
+                           RUN3Cabling = 6,
                            UpgradeA = 10,
                            UpgradeBC = 11,
                            UpgradeABC = 12,
                            UnknownCabling };
 
-    bool is_MBTS_merged_run2(int module) const;
-    int E1_merged_with_run2(int ros, int module) const;
+    bool is_MBTS_merged_run2plus(int module) const;
+    int E1_merged_with_run2plus(int ros, int module) const;
 
     int getMaxChannels(void) const { return m_maxChannels; };
     int getMaxGains(void) const { return m_maxGains; };
@@ -160,12 +161,12 @@ private:
            int          hwid2MBTSeta_real       ( int ros, int drawer, int channel) const;
            int          MBTS2drawer_real        ( int side, int phi, int eta) const;
 
-           bool         hwid2MBTSconnected_run2 (int ros, int drawer, int channel) const;
-           bool         hwid2MBTSconnected_run2 (int ros, int drawer) const;
-           int          hwid2MBTSphi_run2       (int ros, int drawer) const;
-           int          hwid2MBTSeta_run2       (int ros, int drawer) const;
-           int          MBTS2drawer_run2        (int side, int phi, int eta) const;
-           int          MBTS2channel_run2       (int eta) const;
+           bool         hwid2MBTSconnected_run2plus (int ros, int drawer, int channel) const;
+           bool         hwid2MBTSconnected_run2plus (int ros, int drawer) const;
+           int          hwid2MBTSphi_run2plus       (int ros, int drawer) const;
+           int          hwid2MBTSeta_run2plus       (int ros, int drawer) const;
+           int          MBTS2drawer_run2plus        (int side, int phi, int eta) const;
+           int          MBTS2channel_run2plus       (int eta) const;
 
            bool         hwid2E4prconnected_run2 (int ros, int drawer, int channel) const;
            bool         hwid2E4prconnected_run2 (int ros, int drawer) const;
@@ -177,7 +178,7 @@ private:
            int          hwid2module_gapscin     ( int ros,  int drawer, int channel) const;
            int          hwid2tower_gapscin      ( int ros,  int drawer, int channel) const;
 
-           int          swid2drawer_gapscin_run2( int side, int module, int tower) const;
+           int          swid2drawer_gapscin_run2plus( int side, int module, int tower) const;
 
     inline bool         isTileITCGapCrack       (int channel) const {return (channel < 6 || channel == 12 || channel == 13);}
     inline bool         isTileGapCrack          (int channel) const {return (channel < 2 || channel == 12 || channel == 13);}
@@ -204,6 +205,7 @@ private:
     void setConnected(int ros, int draMin, int draMax);
     void setRun2Merged();
     void setRun2aMerged();
+    void setRun3Merged();
 
     enum Partition { Ancillary = 0,
                      LBA = 1,
@@ -260,14 +262,15 @@ private:
 
    bool isChannelFromOppositeSide(int channel) const {return channel == m_maxChannels;};
 
-   std::vector<bool> m_MBTSmergedRun2;
-   std::vector<int> m_E1mergedRun2;
+   std::vector<bool> m_MBTSmergedRun2Plus;
+   std::vector<int> m_E1mergedRun2Plus;
 
    std::vector<int> m_ch2pmtUpgradeABC;
    std::vector<int> m_ch2sampleUpgradeABC;
    std::vector<int> m_ch2towerUpgradeABC;
 
    bool m_run2;
+   bool m_run2plus;
 
    int m_maxChannels;
    int m_maxGains;
@@ -284,6 +287,7 @@ public:
     inline bool  connected (int ros, int drawer)   const { return m_connected[ros][drawer]; }
     inline int                 getCablingType()    const { return m_cablingType; }
     inline bool                isRun2Cabling()     const { return m_run2; }
+    inline bool                isRun2PlusCabling() const { return m_run2plus; }
 
 };
 
diff --git a/TileCalorimeter/TileConditions/src/TileCablingService.cxx b/TileCalorimeter/TileConditions/src/TileCablingService.cxx
index e83cf055b8e083d5bfa24c4a24ab315e5e2ce780..65fe672f0652cb3492d2ac2767b87f7191ca9a97 100644
--- a/TileCalorimeter/TileConditions/src/TileCablingService.cxx
+++ b/TileCalorimeter/TileConditions/src/TileCablingService.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TileConditions/TileCablingService.h"
@@ -34,9 +34,10 @@ TileCablingService::TileCablingService()
   , m_tileTBID(0)
   , m_cablingType(TileCablingService::OldSim)
   , m_isCacheFilled(false)
-  , m_MBTSmergedRun2(64, 0)
-  , m_E1mergedRun2(128, 0)
+  , m_MBTSmergedRun2Plus(64, 0)
+  , m_E1mergedRun2Plus(128, 0)
   , m_run2(false)
+  , m_run2plus(false)
   , m_maxChannels(TileCalibUtils::MAX_CHAN)
   , m_maxGains(TileCalibUtils::MAX_GAIN)
   , m_msg("TileCablingService")
@@ -72,75 +73,112 @@ TileCablingService::TileCablingService()
 void
 TileCablingService::setRun2Merged()
 {
-  m_E1mergedRun2.clear();
-  m_E1mergedRun2.resize(128,0);
+  m_E1mergedRun2Plus.clear();
+  m_E1mergedRun2Plus.resize(128,0);
 
   // Merged E1 and MBTS for run2
   // EBA
-  m_E1mergedRun2[6]  =  7;
-  m_E1mergedRun2[24] = 23;
-  m_E1mergedRun2[43] = 42;
-  m_E1mergedRun2[52] = 53;
+  m_E1mergedRun2Plus[6]  =  7;
+  m_E1mergedRun2Plus[24] = 23;
+  m_E1mergedRun2Plus[43] = 42;
+  m_E1mergedRun2Plus[52] = 53;
   // EBC
-  m_E1mergedRun2[64+6]  =  7;
-  m_E1mergedRun2[64+24] = 23;
-  m_E1mergedRun2[64+43] = 42;
-  m_E1mergedRun2[64+52] = 53;
+  m_E1mergedRun2Plus[64+6]  =  7;
+  m_E1mergedRun2Plus[64+24] = 23;
+  m_E1mergedRun2Plus[64+43] = 42;
+  m_E1mergedRun2Plus[64+52] = 53;
   // additional E4' in EBC
-  m_E1mergedRun2[64+27] = 28;
-  m_E1mergedRun2[64+30] = 31;
-  m_E1mergedRun2[64+34] = 33;
-  m_E1mergedRun2[64+37] = 36;
+  m_E1mergedRun2Plus[64+27] = 28;
+  m_E1mergedRun2Plus[64+30] = 31;
+  m_E1mergedRun2Plus[64+34] = 33;
+  m_E1mergedRun2Plus[64+37] = 36;
 
-  m_MBTSmergedRun2.clear();
-  m_MBTSmergedRun2.resize(64,false);
+  m_MBTSmergedRun2Plus.clear();
+  m_MBTSmergedRun2Plus.resize(64,false);
 
-  m_MBTSmergedRun2[7] = true;
-  m_MBTSmergedRun2[23] = true;
-  m_MBTSmergedRun2[42] = true;
-  m_MBTSmergedRun2[53] = true;
+  m_MBTSmergedRun2Plus[7] = true;
+  m_MBTSmergedRun2Plus[23] = true;
+  m_MBTSmergedRun2Plus[42] = true;
+  m_MBTSmergedRun2Plus[53] = true;
 }
 
 void
 TileCablingService::setRun2aMerged()
 {
-  m_E1mergedRun2.clear();
-  m_E1mergedRun2.resize(128,0);
-  m_MBTSmergedRun2.clear();
-  m_MBTSmergedRun2.resize(64,false);
+  m_E1mergedRun2Plus.clear();
+  m_E1mergedRun2Plus.resize(128,0);
+  m_MBTSmergedRun2Plus.clear();
+  m_MBTSmergedRun2Plus.resize(64,false);
 
   // Merged E1 and MBTS for run2
   // EBA
-  m_E1mergedRun2[6]  =  7;
-  m_E1mergedRun2[24] = 23;
-  m_E1mergedRun2[43] = 42;
-  m_E1mergedRun2[52] = 53;
+  m_E1mergedRun2Plus[6]  =  7;
+  m_E1mergedRun2Plus[24] = 23;
+  m_E1mergedRun2Plus[43] = 42;
+  m_E1mergedRun2Plus[52] = 53;
   // EBC
-  m_E1mergedRun2[64+6]  =  7;
-  m_E1mergedRun2[64+24] = 23;
-  m_E1mergedRun2[64+43] = 42;
-  m_E1mergedRun2[64+52] = 53;
+  m_E1mergedRun2Plus[64+6]  =  7;
+  m_E1mergedRun2Plus[64+24] = 23;
+  m_E1mergedRun2Plus[64+43] = 42;
+  m_E1mergedRun2Plus[64+52] = 53;
   // additional E4' in EBC
-  m_E1mergedRun2[64+27] = 28;
-  m_E1mergedRun2[64+30] = 31;
-  m_E1mergedRun2[64+34] = 33;
-  m_E1mergedRun2[64+37] = 36;
+  m_E1mergedRun2Plus[64+27] = 28;
+  m_E1mergedRun2Plus[64+30] = 31;
+  m_E1mergedRun2Plus[64+34] = 33;
+  m_E1mergedRun2Plus[64+37] = 36;
 
   // Additional merged E1 in 2018
   // EBA
-  m_E1mergedRun2[3]  =  2;
-  m_E1mergedRun2[20] = 19;
-  m_E1mergedRun2[46] = 45;
-  m_E1mergedRun2[59] = 58;
+  m_E1mergedRun2Plus[3]  =  2;
+  m_E1mergedRun2Plus[20] = 19;
+  m_E1mergedRun2Plus[46] = 45;
+  m_E1mergedRun2Plus[59] = 58;
   // EBC
-  m_E1mergedRun2[64+3]  =  2;
-  m_E1mergedRun2[64+17] = 18;
-  m_E1mergedRun2[64+46] = 45;
-  m_E1mergedRun2[64+59] = 58;
+  m_E1mergedRun2Plus[64+3]  =  2;
+  m_E1mergedRun2Plus[64+17] = 18;
+  m_E1mergedRun2Plus[64+46] = 45;
+  m_E1mergedRun2Plus[64+59] = 58;
 
   // no merged MBTS in 2018
-  m_MBTSmergedRun2.clear();
-  m_MBTSmergedRun2.resize(64,false);
+  m_MBTSmergedRun2Plus.clear();
+  m_MBTSmergedRun2Plus.resize(64,false);
+}
+
+void
+TileCablingService::setRun3Merged()
+{
+  m_E1mergedRun2Plus.clear();
+  m_E1mergedRun2Plus.resize(128, 0);
+  m_MBTSmergedRun2Plus.clear();
+  m_MBTSmergedRun2Plus.resize(64, false);
+
+  // Merged E1 and MBTS for run2
+  // EBA
+  m_E1mergedRun2Plus[6]  =  7;
+  m_E1mergedRun2Plus[24] = 23;
+  m_E1mergedRun2Plus[43] = 42;
+  m_E1mergedRun2Plus[52] = 53;
+  // EBC
+  m_E1mergedRun2Plus[64 + 6]  =  7;
+  m_E1mergedRun2Plus[64 + 24] = 23;
+  m_E1mergedRun2Plus[64 + 43] = 42;
+  m_E1mergedRun2Plus[64 + 52] = 53;
+
+  // Additional merged E1 since 2018
+  // EBA
+  m_E1mergedRun2Plus[3]  =  2;
+  m_E1mergedRun2Plus[20] = 19;
+  m_E1mergedRun2Plus[46] = 45;
+  m_E1mergedRun2Plus[59] = 58;
+  // EBC
+  m_E1mergedRun2Plus[64 + 3]  =  2;
+  m_E1mergedRun2Plus[64 + 17] = 18;
+  m_E1mergedRun2Plus[64 + 46] = 45;
+  m_E1mergedRun2Plus[64 + 59] = 58;
+
+  // no merged MBTS since 2018
+  m_MBTSmergedRun2Plus.clear();
+  m_MBTSmergedRun2Plus.resize(64, false);
 }
 
 // destructor
@@ -217,15 +255,23 @@ TileCablingService::setCablingType(TileCablingService::TileCablingType type)
     m_E3special = 18;
     m_E4special = 19;
 
-    m_run2 = (type == TileCablingService::RUN2Cabling || type == TileCablingService::RUN2aCabling || type == TileCablingService::UpgradeABC);
-    if (type == TileCablingService::RUN2aCabling)
+    m_run2 = (type == TileCablingService::RUN2Cabling
+              || type == TileCablingService::RUN2aCabling
+              || type == TileCablingService::UpgradeABC);
+
+    m_run2plus = (m_run2 || type == TileCablingService::RUN3Cabling);
+
+    if (type == TileCablingService::RUN3Cabling) {
+      setRun3Merged();
+    } else if (type == TileCablingService::RUN2aCabling) {
       setRun2aMerged();
-    else
+    } else {
       setRun2Merged();
+    }
 
-    if (m_run2)
+    if (m_run2plus)
       m_MBTSchan = -1; // should use function MBTS2channel_run2(int eta)
-    if (TileCablingService::MBTSOnly == type || m_run2)
+    if (TileCablingService::MBTSOnly == type || m_run2plus)
       m_MBTSchan = 0;
     else // Crack and MBTS in spare channel
       m_MBTSchan = 47;
@@ -451,13 +497,13 @@ TileCablingService::drawer2MBTS_id ( const HWIdentifier & hwid ) const
 
     return m_invalid_id;
   
-  } else if ( m_run2) {
+  } else if ( m_run2plus) {
 
-    if (hwid2MBTSconnected_run2(ros,drawer)) {
+    if (hwid2MBTSconnected_run2plus(ros,drawer)) {
 
       int side = hwid2side(ros,channel);
-      int phi  = hwid2MBTSphi_run2(ros,drawer);
-      int eta  = hwid2MBTSeta_run2(ros,drawer);
+      int phi  = hwid2MBTSphi_run2plus(ros,drawer);
+      int eta  = hwid2MBTSeta_run2plus(ros,drawer);
 
       return m_tileTBID->channel_id(side, phi, eta);
 
@@ -529,15 +575,15 @@ TileCablingService::h2s_cell_id ( const HWIdentifier & hwid ) const
   if (sample < 0)
     return m_invalid_id; // for any kind of cabling can't have negagive sample
 
-  if (m_run2) {
+  if (m_run2plus) {
 
-    if ((ros > 2) && hwid2MBTSconnected_run2(ros,drawer,channel)) {
+    if ((ros > 2) && hwid2MBTSconnected_run2plus(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
-      int phi  = hwid2MBTSphi_run2(ros,drawer);
-      int eta  = hwid2MBTSeta_run2(ros,drawer);
+      int phi  = hwid2MBTSphi_run2plus(ros,drawer);
+      int eta  = hwid2MBTSeta_run2plus(ros,drawer);
       return m_tileTBID->channel_id(side, phi, eta);
 
-    } else if ((ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
+    } else if (m_run2 && (ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
       int phi  = hwid2E4prphi_run2(drawer);
       int eta  = hwid2E4preta_run2(drawer);
@@ -626,18 +672,18 @@ TileCablingService::h2s_cell_id_index_find ( int ros, int drawer, int channel, i
     return m_invalid_id; // for any kind of cabling can't have negagive sample
   }
   
-  if (m_run2) {
+  if (m_run2plus) {
 
-    if ((ros > 2) && hwid2MBTSconnected_run2(ros,drawer,channel)) {
+    if ((ros > 2) && hwid2MBTSconnected_run2plus(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
-      int phi  = hwid2MBTSphi_run2(ros,drawer);
-      int eta  = hwid2MBTSeta_run2(ros,drawer);
+      int phi  = hwid2MBTSphi_run2plus(ros,drawer);
+      int eta  = hwid2MBTSeta_run2plus(ros,drawer);
 
       pmt = 0;
       index = -2;
       return m_tileTBID->channel_id(side, phi, eta);
 
-    } else if ((ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
+    } else if (m_run2 && (ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
       int phi  = hwid2E4prphi_run2(drawer);
       int eta  = hwid2E4preta_run2(drawer);
@@ -758,15 +804,15 @@ TileCablingService::h2s_pmt_id ( const HWIdentifier & hwid ) const
   if (sample < 0)
     return m_invalid_id; // for any kind of cabling can't have negagive sample
 
-  if (m_run2) {
+  if (m_run2plus) {
 
-    if ((ros > 2) && hwid2MBTSconnected_run2(ros,drawer,channel)) {
+    if ((ros > 2) && hwid2MBTSconnected_run2plus(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
-      int phi  = hwid2MBTSphi_run2(ros,drawer);
-      int eta  = hwid2MBTSeta_run2(ros,drawer);
+      int phi  = hwid2MBTSphi_run2plus(ros,drawer);
+      int eta  = hwid2MBTSeta_run2plus(ros,drawer);
       return m_tileTBID->channel_id(side, phi, eta);
 
-    } else if ((ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
+    } else if (m_run2 && (ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
       int phi  = hwid2E4prphi_run2(drawer);
       int eta  = hwid2E4preta_run2(drawer);
@@ -865,15 +911,15 @@ TileCablingService::h2s_adc_id ( const HWIdentifier & hwid ) const
   if (sample < 0)
     return m_invalid_id;
 
-  if (m_run2) {
+  if (m_run2plus) {
 
-    if ((ros > 2) && hwid2MBTSconnected_run2(ros,drawer,channel)) {
+    if ((ros > 2) && hwid2MBTSconnected_run2plus(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
-      int phi  = hwid2MBTSphi_run2(ros,drawer);
-      int eta  = hwid2MBTSeta_run2(ros,drawer);
+      int phi  = hwid2MBTSphi_run2plus(ros,drawer);
+      int eta  = hwid2MBTSeta_run2plus(ros,drawer);
       return m_tileTBID->channel_id(side, phi, eta);
 
-    } else if ((ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
+    } else if (m_run2 && (ros > 3) && hwid2E4prconnected_run2(ros,drawer,channel)) {
       int side = hwid2side(ros,channel);
       int phi  = hwid2E4prphi_run2(drawer);
       int eta  = hwid2E4preta_run2(drawer);
@@ -968,8 +1014,8 @@ TileCablingService::s2h_drawer_id ( const Identifier & swid ) const
 
       ros = swid2ros(TileID::EXTBAR,tbtype);
 
-      if (m_run2) {
-        drawer = MBTS2drawer_run2(tbtype,tbmodule,tbchannel);
+      if (m_run2plus) {
+        drawer = MBTS2drawer_run2plus(tbtype,tbmodule,tbchannel);
       } else if (m_cablingType == MBTSOnly) {
         drawer = MBTS2drawer_real(ros, tbmodule,tbchannel);
       } else {
@@ -1005,8 +1051,8 @@ TileCablingService::s2h_drawer_id ( const Identifier & swid ) const
     
   ros = swid2ros (section,side);
 
-  if (sample == TileID::SAMP_E && (m_run2)) {
-    drawer = swid2drawer_gapscin_run2(side, module,tower); // E1 might go to another module
+  if (sample == TileID::SAMP_E && (m_run2plus)) {
+    drawer = swid2drawer_gapscin_run2plus(side, module,tower); // E1 might go to another module
   } else if (sample == TileID::SAMP_E && m_cablingType == MBTSOnly) {
     drawer   = swid2drawer_gapscin  (side,module,tower);
     if (drawer < 0) drawer = module; // special trick for disconnected E3 and E4
@@ -1033,9 +1079,9 @@ TileCablingService::s2h_channel_id ( const Identifier & swid ) const
 
       ros = swid2ros(TileID::EXTBAR,tbtype);
 
-      if (m_run2) {
-        drawer = MBTS2drawer_run2(tbtype,tbmodule,tbchannel);
-        return m_tileHWID->channel_id(ros, drawer, MBTS2channel_run2(tbchannel));
+      if (m_run2plus) {
+        drawer = MBTS2drawer_run2plus(tbtype,tbmodule,tbchannel);
+        return m_tileHWID->channel_id(ros, drawer, MBTS2channel_run2plus(tbchannel));
       } else if (m_cablingType == MBTSOnly) {
         drawer = MBTS2drawer_real(ros, tbmodule,tbchannel);
       } else {
@@ -1057,8 +1103,8 @@ TileCablingService::s2h_channel_id ( const Identifier & swid ) const
   int sample   = m_tileID->sample   (swid);
   int pmt      = m_tileID->pmt      (swid);
 
-  if (sample == TileID::SAMP_E && (m_run2)) {
-    drawer   = swid2drawer_gapscin_run2  (side, module,tower);  // E1 might go to another module
+  if (sample == TileID::SAMP_E && (m_run2plus)) {
+    drawer   = swid2drawer_gapscin_run2plus  (side, module,tower);  // E1 might go to another module
 
     channel = (m_cablingType != UpgradeABC) 
       ? swid2channel(section,side,tower,sample,pmt)
@@ -1115,9 +1161,9 @@ TileCablingService::s2h_adc_id ( const Identifier & swid ) const
 
       ros = swid2ros(TileID::EXTBAR,tbtype);
 
-      if (m_run2) {
-        drawer = MBTS2drawer_run2(tbtype,tbmodule,tbchannel);
-        return m_tileHWID->adc_id(ros, drawer, MBTS2channel_run2(tbchannel), TileHWID::HIGHGAIN);
+      if (m_run2plus) {
+        drawer = MBTS2drawer_run2plus(tbtype,tbmodule,tbchannel);
+        return m_tileHWID->adc_id(ros, drawer, MBTS2channel_run2plus(tbchannel), TileHWID::HIGHGAIN);
       } else if (m_cablingType == MBTSOnly) {
         drawer = MBTS2drawer_real(ros, tbmodule,tbchannel);
       } else {
@@ -1140,8 +1186,8 @@ TileCablingService::s2h_adc_id ( const Identifier & swid ) const
   int pmt      = m_tileID->pmt      (swid);
   int adc      = m_tileID->adc      (swid);
 
-  if (sample == TileID::SAMP_E && (m_run2)) {
-    drawer   = swid2drawer_gapscin_run2  (side, module,tower); // E1 might go to another module
+  if (sample == TileID::SAMP_E && (m_run2plus)) {
+    drawer   = swid2drawer_gapscin_run2plus  (side, module,tower); // E1 might go to another module
 
     channel = ((m_cablingType != UpgradeABC) ? swid2channel(section,side,tower,sample,pmt)
                                              : swid2channel_upgradeABC(section,side,tower,sample,pmt));
@@ -1199,8 +1245,8 @@ TileCablingService::frag ( const Identifier & swid ) const
 
       ros = swid2ros(TileID::EXTBAR,tbtype);
 
-      if (m_run2) {
-        drawer = MBTS2drawer_run2(tbtype,tbmodule,tbchannel);
+      if (m_run2plus) {
+        drawer = MBTS2drawer_run2plus(tbtype,tbmodule,tbchannel);
       } else if (m_cablingType == MBTSOnly) {
         drawer = MBTS2drawer_real(ros, tbmodule,tbchannel);
       } else {
@@ -1235,8 +1281,8 @@ TileCablingService::frag ( const Identifier & swid ) const
     
   ros = swid2ros (section, side);
 
-  if (sample == TileID::SAMP_E && (m_run2)) {
-    drawer = swid2drawer_gapscin_run2  (side, module,tower); // E1 might go to another module
+  if (sample == TileID::SAMP_E && (m_run2plus)) {
+    drawer = swid2drawer_gapscin_run2plus  (side, module,tower); // E1 might go to another module
   } else if (sample == TileID::SAMP_E && m_cablingType == MBTSOnly) {
     drawer = swid2drawer_gapscin(side,module,tower);
     if (drawer < 0) drawer = module; // special trick for disconnected E3 and E4
@@ -1573,7 +1619,7 @@ TileCablingService::fillConnectionTables()
 // E4:  cell = 3,  tower = 15,  channel =  1
 
 int
-TileCablingService::swid2drawer_gapscin_run2 (int side, int module, int tower) const
+TileCablingService::swid2drawer_gapscin_run2plus (int side, int module, int tower) const
 {
   // merged E1 cells in EBA and EBC
   // module 07,08 -> 07 (i.e. drawer 07 to drawer 06) --
@@ -1607,12 +1653,13 @@ TileCablingService::swid2drawer_gapscin_run2 (int side, int module, int tower) c
   if (tower == towerE1) {
     if (drawer == 7 || drawer == 53) --drawer;
     else if (drawer == 42 || drawer == 23) ++drawer;
-    else if (side < 0) {
+    else if (m_run2 && side < 0) {
       if (drawer == 28 || drawer == 31) --drawer;
       else if (drawer == 33 || drawer == 36) ++drawer;
     }
 
-    if (m_cablingType == TileCablingService::RUN2aCabling) {
+    if (m_cablingType == TileCablingService::RUN3Cabling
+        || m_cablingType == TileCablingService::RUN2aCabling) {
       if (drawer == 2 || drawer == 45 || drawer == 58 ) ++drawer;
       else {
         if (side > 0) {
@@ -1709,7 +1756,7 @@ TileCablingService::TileGap_connected(const Identifier & id) const
         return !(EB_special(((m_tileID->side(id)>0)?EBA:EBC),m_tileID->module(id)));
 
       case TileID::SAMP_E: // E1-E4 - gap/crack scin
-        return (m_run2 || swid2channel_gapscin(m_tileID->side(id),
+        return (m_run2plus || swid2channel_gapscin(m_tileID->side(id),
                                                m_tileID->module(id),
                                                m_tileID->tower(id)) != -1);
       default:
@@ -2101,24 +2148,23 @@ TileCablingService::MBTS2drawer_real(int ros, int phi, int eta) const
 // used for reconstruction of real data
 //
 bool
-TileCablingService::hwid2MBTSconnected_run2(int ros, int drawer, int channel) const
+TileCablingService::hwid2MBTSconnected_run2plus(int ros, int drawer, int channel) const
 {
   return ( (ros > 2) && 
-           ( (channel ==  4 && hwid2MBTSeta_run2(ros,drawer) == 0) ||
-             (channel == 12 && hwid2MBTSeta_run2(ros,drawer) == 1) ) );
+           ( (channel ==  4 && hwid2MBTSeta_run2plus(ros,drawer) == 0) ||
+             (channel == 12 && hwid2MBTSeta_run2plus(ros,drawer) == 1) ) );
 }
 
 bool
-TileCablingService::hwid2MBTSconnected_run2(int ros, int drawer) const
+TileCablingService::hwid2MBTSconnected_run2plus(int ros, int drawer) const
 {
-  return ((ros > 2) && hwid2MBTSeta_run2(ros,drawer) != -1);
+  return ((ros > 2) && hwid2MBTSeta_run2plus(ros,drawer) != -1);
 }
 
 bool
 TileCablingService::hwid2E4prconnected_run2(int ros, int drawer, int channel) const
 {
-  return ( (ros > 3) && 
-           (channel == 12 && hwid2E4preta_run2(drawer) != -1) ); 
+  return ((ros > 3) && (channel == 12) && hwid2E4preta_run2(drawer) != -1);
 }
 
 bool
@@ -2180,7 +2226,7 @@ Outer MBTS (eta=1) in 2018
 */
 
 int
-TileCablingService::hwid2MBTSphi_run2(int ros, int drawer) const
+TileCablingService::hwid2MBTSphi_run2plus(int ros, int drawer) const
 {
   int phi[64] = {
     -1, -1, -1, -1, -1, -1, -1,  0,
@@ -2215,7 +2261,8 @@ TileCablingService::hwid2MBTSphi_run2(int ros, int drawer) const
      0,  1,  7, -1, -1, -1, -1, -1
   };
 
-  if (m_cablingType == TileCablingService::RUN2aCabling) {
+  if (m_cablingType == TileCablingService::RUN3Cabling
+      || m_cablingType == TileCablingService::RUN2aCabling) {
     return (ros<4)?phiA[drawer]:phiC[drawer];
   } else {
     return phi[drawer];
@@ -2223,7 +2270,7 @@ TileCablingService::hwid2MBTSphi_run2(int ros, int drawer) const
 }
 
 int
-TileCablingService::hwid2MBTSeta_run2(int ros, int drawer) const
+TileCablingService::hwid2MBTSeta_run2plus(int ros, int drawer) const
 { 
   int eta[64] = {
     -1, -1, -1, -1, -1, -1, -1,  1,
@@ -2258,7 +2305,8 @@ TileCablingService::hwid2MBTSeta_run2(int ros, int drawer) const
      0,  0,  1, -1, -1, -1, -1, -1
   };
 
-  if (m_cablingType == TileCablingService::RUN2aCabling) {
+  if (m_cablingType == TileCablingService::RUN3Cabling
+      || m_cablingType == TileCablingService::RUN2aCabling) {
     return (ros<4)?etaA[drawer]:etaC[drawer];
   } else {
     return eta[drawer];
@@ -2300,7 +2348,7 @@ TileCablingService::hwid2E4preta_run2(int drawer) const
 }
 
 int
-TileCablingService::MBTS2drawer_run2(int side, int phi, int eta) const
+TileCablingService::MBTS2drawer_run2plus(int side, int phi, int eta) const
 {
   int drawer[24] = {
        56, 57, 38, 39, 40, 41, 54, 55,  //E6 (inner)
@@ -2310,7 +2358,8 @@ TileCablingService::MBTS2drawer_run2(int side, int phi, int eta) const
   int drawerE5A[8] = {2,  7, 19, 23, 42, 45, 53, 58};  //E5 (outer) in EBA in 2018
   int drawerE5C[8] = {2,  7, 18, 23, 42, 45, 53, 58};  //E5 (outer) in EBA in 2018
 
-  if (m_cablingType == TileCablingService::RUN2aCabling && eta == 1) {
+  if ((m_cablingType == TileCablingService::RUN3Cabling || m_cablingType == TileCablingService::RUN2aCabling)
+      && eta == 1) {
     return (side>0)?drawerE5A[phi]:drawerE5C[phi];
   } else {
     return (drawer[(eta<<3)|phi]);
@@ -2318,7 +2367,7 @@ TileCablingService::MBTS2drawer_run2(int side, int phi, int eta) const
 }
 
 int
-TileCablingService::MBTS2channel_run2(int eta) const
+TileCablingService::MBTS2channel_run2plus(int eta) const
 {
   return ((eta==0)?4:12); // both MBTS and E4'
 }
@@ -2392,10 +2441,10 @@ TileCablingService::h2s_cell_id_index_from_cache (int ros, int drawer, int chann
   return m_ch2cell[ind];  
 }
 
-bool TileCablingService::is_MBTS_merged_run2(int module) const {
-  return m_MBTSmergedRun2[module];
+bool TileCablingService::is_MBTS_merged_run2plus(int module) const {
+  return m_MBTSmergedRun2Plus[module];
 }
 
-int TileCablingService::E1_merged_with_run2(int ros, int module) const {
-  return m_E1mergedRun2[(ros-3)*64+module];
+int TileCablingService::E1_merged_with_run2plus(int ros, int module) const {
+  return m_E1mergedRun2Plus[(ros - 3) * 64 + module];
 }
diff --git a/TileCalorimeter/TileConditions/test/TileCablingService_UpgradeABC_test.cxx b/TileCalorimeter/TileConditions/test/TileCablingService_UpgradeABC_test.cxx
index 0dfcf5d3541b6a2f69019076149bfcf4a71295c7..c97ee715d5b2ccd8a5cf4adae9b149d87387ca5a 100644
--- a/TileCalorimeter/TileConditions/test/TileCablingService_UpgradeABC_test.cxx
+++ b/TileCalorimeter/TileConditions/test/TileCablingService_UpgradeABC_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #undef NDEBUG
@@ -55,8 +55,8 @@ void test1() {
           // Skip merged E1 cells
           if (tileID->sample(swid) == TileID::SAMP_E
               && tileID->tower(swid) == 42 // E1 tower
-              && cabling->E1_merged_with_run2(ros, drawer) 
-              && cabling->E1_merged_with_run2(ros, drawer) == tileID->module(swid)) {
+              && cabling->E1_merged_with_run2plus(ros, drawer)
+              && cabling->E1_merged_with_run2plus(ros, drawer) == tileID->module(swid)) {
 
             Identifier swid2 = cabling->h2s_adc_id(hwid);
             assert(tileID->system(swid) == tileID->system(swid2));
diff --git a/TileCalorimeter/TileConditions/test/TileCablingService_test.cxx b/TileCalorimeter/TileConditions/test/TileCablingService_test.cxx
index 51feb5f74161cdef53a8b9ea3f4cc70642fbc95c..b363b8835ec417c31894a94badc40a854819561d 100644
--- a/TileCalorimeter/TileConditions/test/TileCablingService_test.cxx
+++ b/TileCalorimeter/TileConditions/test/TileCablingService_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #undef NDEBUG
@@ -54,8 +54,8 @@ void test1() {
           // Skip merged E1 cells
           if (tileID->sample(swid) == TileID::SAMP_E
               && tileID->tower(swid) == 10 // E1 tower
-              && cabling->E1_merged_with_run2(ros, drawer) 
-              && cabling->E1_merged_with_run2(ros, drawer) == tileID->module(swid)) continue;
+              && cabling->E1_merged_with_run2plus(ros, drawer)
+              && cabling->E1_merged_with_run2plus(ros, drawer) == tileID->module(swid)) continue;
 
           // Skip not connected C10 and D4
           if (!cabling->TileGap_connected(swid)) continue;
diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h
index 1b7f8aafbfb2433eb2c8d01b8385630239226479..3faec5a0d7c0b6f8c92504bd926c49595b7ede77 100644
--- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h
+++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h
@@ -370,6 +370,7 @@ private:
     int m_towerE1 = E1_TOWER;
     bool m_notUpgradeCabling;
     bool m_run2;
+    bool m_run2plus;
 };
 
 #endif
diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h
index c07a79b066c588dd2f9b4fbd92ad7e4dc040dc58..78ae5c0e77cd61b3be9811f24b96d926dbbda10c 100644
--- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h
+++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h
@@ -192,7 +192,8 @@ class TileCellBuilderFromHit
                         int ros, int drawer, bool count_over, bool good_time, bool good_ener,
         bool overflow, bool underflow, bool good_overflowfit) const; //!< method to compute the cell quality bits
 
-    int m_RUN2;
+    bool m_RUN2;
+    bool m_RUN2plus;
     int m_E1_TOWER;
 
     static const int NSIDE = 2;
diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx
index bb910cc45b10ed0d3c743cdad290593886ca3eff..0df8145aa2d9ac5eb9e6dfd62cacd8e9268ece78 100644
--- a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx
+++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx
@@ -71,6 +71,7 @@ TileCellBuilder::TileCellBuilder(const std::string& type, const std::string& nam
   , m_mbtsMgr(0)
   , m_notUpgradeCabling(true)
   , m_run2(false)
+  , m_run2plus(false)
 {
   declareInterface<TileCellBuilder>( this );
 
@@ -203,7 +204,8 @@ StatusCode TileCellBuilder::initialize() {
 
   reset(true, false);
 
-  m_run2 = (m_cabling->isRun2Cabling() || m_cabling->getCablingType() == TileCablingService::UpgradeABC);
+  m_run2 = m_cabling->isRun2Cabling();
+  m_run2plus = m_cabling->isRun2PlusCabling();
 
   if (m_run2 && !m_E4prContainerKey.key().empty()) {
     ATH_CHECK( m_E4prContainerKey.initialize() );
@@ -895,12 +897,12 @@ bool TileCellBuilder::maskBadChannels (TileDrawerEvtStatusArray& drawerEvtStatus
         << drawer2+1 << " status " << chan1 << "/" << chan2 << " "
         << (chStatus1.isBad()?"bad":"good") << "/"
         << (chStatus2.isBad()?"bad":"good") << "/"
-        << ((m_run2)?" RUN2 cabling": "RUN1 cabling")
+        << ((m_run2plus)?" RUN2+ cabling": "RUN1 cabling")
         << std::endl;
       }
 #endif
       if (chan1 == 4) {
-        if (m_run2 || !chStatus1.isBad()) {
+        if (m_run2plus || !chStatus1.isBad()) {
 #ifdef ALLOW_DEBUG_COUT
           if (cnt < 17) {
             std::cout << "Ene of chan1 was " << pCell->ene1() << " changing to half of " << pCell->ene2()
@@ -913,7 +915,7 @@ bool TileCellBuilder::maskBadChannels (TileDrawerEvtStatusArray& drawerEvtStatus
           --drawerEvtStatus[ros1][drawer1].nMaskedChannels; // since it's fake masking, decrease counter by 1 in advance
         }
       } else {
-        if (m_run2 || !chStatus2.isBad()) {
+        if (m_run2plus || !chStatus2.isBad()) {
 #ifdef ALLOW_DEBUG_COUT
           if (cnt < 17) {
             std::cout << "Ene of chan2 was " << pCell->ene2() << " changing to half of " << pCell->ene1()
@@ -1228,8 +1230,9 @@ void TileCellBuilder::build (const EventContext& ctx,
         unsigned char iqual = iquality(qual);
         // for MBTS qbit use AND of good_time and non_zero_time and check that energy is above MBTS energy threshold in pC
         unsigned char qbit = qbits(drawerEvtStatus, params.m_RChType,
-                                   ros, drawer, false, (good_time && non_zero_time)
-           , (fabs(ener) > m_eneForTimeCutMBTS), overflow, underflow, overfit);
+                                   ros, drawer, false, (good_time && non_zero_time),
+                                   (fabs(ener) > m_eneForTimeCutMBTS), overflow, underflow, overfit);
+
         CaloGain::CaloGain cgain = (gain == TileID::HIGHGAIN)
                                    ? CaloGain::TILEONEHIGH
                                    : CaloGain::TILEONELOW;
@@ -1283,9 +1286,9 @@ void TileCellBuilder::build (const EventContext& ctx,
           , overflow, underflow, overfit);
 
 
-      if (m_run2 && channel == E1_CHANNEL && ros > 2) { // Raw channel -> E1 cell.
+      if (m_run2plus && channel == E1_CHANNEL && ros > 2) { // Raw channel -> E1 cell.
 
-       int drawer2 = (TileCablingService::getInstance())->E1_merged_with_run2(ros,drawer);
+       int drawer2 = (TileCablingService::getInstance())->E1_merged_with_run2plus(ros,drawer);
        if (drawer2 != 0) { // Raw channel splitted into two E1 cells for Run 2.
          int side = (ros == 3) ? 1 : -1;
          Identifier cell_id2 = m_tileID->cell_id(TileID::GAPDET, side, drawer2, m_towerE1, TileID::SAMP_E);
diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx
index f9e659bfd78485fda19a243c71c1f0eb12a710c5..b13782bc94cb25a53b07c061812994989c3a4c27 100644
--- a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx
+++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx
@@ -90,6 +90,9 @@ TileCellBuilderFromHit::TileCellBuilderFromHit(const std::string& type, const st
   , m_tileMgr(0)
   , m_mbtsMgr(0)
   , m_RChType(TileFragHash::Default)
+  , m_RUN2(false)
+  , m_RUN2plus(false)
+  , m_E1_TOWER(10)
 {
   declareInterface<TileCellBuilderFromHit>( this );
 
@@ -188,6 +191,7 @@ StatusCode TileCellBuilderFromHit::initialize() {
 
   m_cabling = TileCablingService::getInstance();
   m_RUN2 = (m_cabling->getCablingType() == TileCablingService::RUN2Cabling);
+  m_RUN2plus = m_cabling->isRun2PlusCabling();
 
   if (m_RUN2 && !m_E4prContainerKey.key().empty()) {
     ATH_CHECK( m_E4prContainerKey.initialize() );
@@ -611,12 +615,12 @@ TileCellBuilderFromHit::maskBadChannels (TileDrawerEvtStatusArray& drawerEvtStat
         << drawer2+1 << " status " << chan1 << "/" << chan2 << " "
         << (chStatus1.isBad()?"bad":"good") << "/"
         << (chStatus2.isBad()?"bad":"good") << "/"
-        << ((m_RUN2)?" RUN2 cabling": "RUN1 cabling")
+        << ((m_RUN2plus)?" RUN2+ cabling": "RUN1 cabling")
         << std::endl;
       }
 #endif
       if (chan1 == 4) {
-        if (m_RUN2 || !chStatus1.isBad()) {
+        if (m_RUN2plus || !chStatus1.isBad()) {
 #ifdef ALLOW_DEBUG_COUT
           if (cnt < 17) {
             std::cout << "Ene of chan1 was " << pCell->ene1() << " changing to half of " << pCell->ene2()
@@ -629,7 +633,7 @@ TileCellBuilderFromHit::maskBadChannels (TileDrawerEvtStatusArray& drawerEvtStat
           --drawerEvtStatus[ros1][drawer1].nMaskedChannels; // since it's fake masking, decrease counter by 1 in advance
         }
       } else {
-        if (m_RUN2 || !chStatus2.isBad()) {
+        if (m_RUN2plus || !chStatus2.isBad()) {
 #ifdef ALLOW_DEBUG_COUT
           if (cnt < 17) {
             std::cout << "Ene of chan2 was " << pCell->ene2() << " changing to half of " << pCell->ene1()
@@ -965,9 +969,9 @@ void TileCellBuilderFromHit::build(TileDrawerEvtStatusArray& drawerEvtStatus,
                                 ros, drawer, true, non_zero_time, (fabs(ener) > m_eneForTimeCut)
           , overflow, underflow, overfit);
 
-      if (E1_CELL && m_RUN2) {
+      if (E1_CELL && m_RUN2plus) {
 
-        int drawer2 = m_cabling->E1_merged_with_run2(ros,drawer);
+        int drawer2 = m_cabling->E1_merged_with_run2plus(ros,drawer);
         if (drawer2 != 0) { // Raw channel split into two E1 cells for Run 2.
           Identifier cell_id2 = m_tileID->cell_id(TileID::GAPDET, side, drawer2, m_E1_TOWER, TileID::SAMP_E);
           int index2 = m_tileID->cell_hash(cell_id2);
diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
index a8a7ed378dae47b0427f4d299aa044eb8d677fd6..c2d2086b54f7d594e12eb5e850d9ed9c6439a78d 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
@@ -111,6 +111,7 @@ class TileHitVecToCntTool: public PileUpToolBase {
 
     std::string m_infoName;                     //!< name of TileInfo object in TES
     bool m_run2;                                //!< if true => RUN2 geometry with E4' and merged E1
+    bool m_run2plus;                            //!< if true => RUN2+ geometry with merged E1 (and E4' in RUN2)
     bool m_pileUp;                              //!< if true => pileup mode is activated
     double m_deltaT;                            //!< minimal time granularity for TileHit
     int m_timeFlag;                             //!< specail options to deal with times of hits for cosmics and TB
diff --git a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
index 3ec21273efb0abf08fa410f2ff2f1c003c199a29..9eaf670ee10690b18ab9be1806e0e344c94c43ec 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
@@ -55,6 +55,7 @@ TileHitVecToCntTool::TileHitVecToCntTool(const std::string& type,
     : PileUpToolBase(type,name,parent)
     , m_infoName("TileInfo")
     , m_run2(false)
+    , m_run2plus(false)
     , m_pileUp(false)
     , m_deltaT(1.0 * Gaudi::Units::nanosecond)
     , m_timeFlag(0)
@@ -119,6 +120,7 @@ StatusCode TileHitVecToCntTool::initialize() {
   m_cabling = m_cablingSvc->cablingService();
 
   m_run2 = m_cabling->isRun2Cabling();
+  m_run2plus = m_cabling->isRun2PlusCabling();
 
   for (int i = 0; i < 7; ++i) {
     Identifier pmt_id;
@@ -200,8 +202,7 @@ StatusCode TileHitVecToCntTool::initialize() {
       if (m_run2){
         m_allHits.resize(m_mbtsOffset + N_MBTS_CELLS + N_E4PRIME_CELLS);
         m_allHits_DigiHSTruth.resize(m_mbtsOffset + N_MBTS_CELLS + N_E4PRIME_CELLS);
-      }
-      else{
+      } else {
         m_allHits.resize(m_mbtsOffset + N_MBTS_CELLS);
         m_allHits_DigiHSTruth.resize(m_mbtsOffset + N_MBTS_CELLS);
       }
@@ -296,7 +297,7 @@ StatusCode TileHitVecToCntTool::initialize() {
     }
   }
 
-  if (m_run2) {
+  if (m_run2plus) {
     const TileHWID* tileHWID;
     CHECK(detStore()->retrieve(tileHWID));
 
@@ -309,8 +310,8 @@ StatusCode TileHitVecToCntTool::initialize() {
       for (int drawer = 0; drawer < 64; ++drawer) {
         int frag_id = tileHWID->frag(ros, drawer);
         IdentifierHash frag_hash = m_fragHashFunc(frag_id);
-        m_E1merged[frag_hash] = (m_cabling->E1_merged_with_run2(ros, drawer) != 0);
-        m_MBTSmerged[frag_hash] = (m_cabling->is_MBTS_merged_run2(drawer));
+        m_E1merged[frag_hash] = (m_cabling->E1_merged_with_run2plus(ros, drawer) != 0);
+        m_MBTSmerged[frag_hash] = (m_cabling->is_MBTS_merged_run2plus(drawer));
       }
     }
     ATH_MSG_INFO("Number of E1 cell to be merged: " << std::count (m_E1merged.begin(), m_E1merged.end(), true));
@@ -941,7 +942,7 @@ StatusCode TileHitVecToCntTool::mergeEvent() {
     //                    << " eHitTot=" << eHitTot );
   }
 
-  if (m_run2) {
+  if (m_run2plus) {
     // Merge MBTS and E1 where it is needed.
 
     for (std::unique_ptr<TileHitCollection>& coll : *m_hits ) {
diff --git a/Tools/PyJobTransforms/python/trfArgClasses.py b/Tools/PyJobTransforms/python/trfArgClasses.py
index 49637b8f401cda44f77638b4eb15bb0b796ddb6e..bf3ecf545d2bb77649b75b3ecd3b09613002f762 100644
--- a/Tools/PyJobTransforms/python/trfArgClasses.py
+++ b/Tools/PyJobTransforms/python/trfArgClasses.py
@@ -1228,7 +1228,7 @@ class argBSFile(argAthenaFile):
     def _getIntegrity(self, files):
         for fname in files:
             try:
-                rc=call(["AtlListBSEvents.exe", "-c", fname], logger=msg, message="Report by AtlListBSEvents.exe: ", timeout=600)
+                rc=call(["AtlListBSEvents", "-c", fname], logger=msg, message="Report by AtlListBSEvents: ", timeout=600)
             except trfExceptions.TransformTimeoutException:
                 return False
             if rc==0:
diff --git a/Tools/PyJobTransforms/python/trfFileValidationFunctions.py b/Tools/PyJobTransforms/python/trfFileValidationFunctions.py
index 163e3ee5a87b7c1d4cc894484a0374faf6329d71..1e9626a0bc030c797ece7472374edee31684c362 100644
--- a/Tools/PyJobTransforms/python/trfFileValidationFunctions.py
+++ b/Tools/PyJobTransforms/python/trfFileValidationFunctions.py
@@ -32,9 +32,9 @@ def returnIntegrityOfNTUPFile(fname):
 def returnIntegrityOfBSFile(fname):
     try:
         from PyJobTransforms.trfUtils import call
-        rc = call(["AtlListBSEvents.exe", "-c", fname],
+        rc = call(["AtlListBSEvents", "-c", fname],
             logger = msg,
-            message = "Report by AtlListBSEvents.exe: ",
+            message = "Report by AtlListBSEvents: ",
             timeout = None
         )
     except trfExceptions.TransformTimeoutException:
diff --git a/Tools/PyJobTransforms/python/trfValidation.py b/Tools/PyJobTransforms/python/trfValidation.py
index e30f108abb9912e61a657c5de811ecc7f1d0dcff..33bce379a54b846b9e0101295c7c9cb127949d35 100644
--- a/Tools/PyJobTransforms/python/trfValidation.py
+++ b/Tools/PyJobTransforms/python/trfValidation.py
@@ -87,13 +87,13 @@ def corruptionTestPool(filename, verbose=False):
 
 # @brief Check BS file for corruption
 def corruptionTestBS(filename):
-    # First try AtlListBSEvents.exe -c %filename:
-    cmd = ['AtlListBSEvents.exe', '-c', filename]
+    # First try AtlListBSEvents -c %filename:
+    cmd = ['AtlListBSEvents', '-c', filename]
     p = Popen(cmd, shell=False, stdout=PIPE, stderr=STDOUT, close_fds=True)
     while p.poll() is None:
         line = p.stdout.readline()
         if line:
-            msg.info("AtlListBSEvents.exe Report: %s" % line.strip())
+            msg.info("AtlListBSEvents Report: %s" % line.strip())
     rc = p.returncode
     return rc
 
diff --git a/Tools/PyJobTransformsCore/python/trfutil.py b/Tools/PyJobTransformsCore/python/trfutil.py
index 6b2a773e5a3051a5aabb99719dc1f1b79062e990..7166888818a7b76e995a6e05b822a170d82c92a7 100755
--- a/Tools/PyJobTransformsCore/python/trfutil.py
+++ b/Tools/PyJobTransformsCore/python/trfutil.py
@@ -1046,19 +1046,19 @@ def corruptionTestROOT( filename, file_type ):
 
 
 def corruptionTestBS( filename, file_type,logger):
-    #First try AtlListBSEvents.exe -c %filename:
-    cmd = 'AtlListBSEvents.exe -c %s ' % filename
+    #First try AtlListBSEvents -c %filename:
+    cmd = 'AtlListBSEvents -c %s ' % filename
     p = Popen(cmd,shell=True,stdout=PIPE,stderr=PIPE,close_fds=True)
     while p.poll() is None:
       line = p.stdout.readline()
       if line:
-        logger.info("AtlListBSEvents.exe Report: %s" % line.strip())
+        logger.info("AtlListBSEvents Report: %s" % line.strip())
     rc = p.returncode
     if rc == 0:
       return rc
     #AltListBSEvents.exe failed, fall back to PyDumper
     else:
-      logger.info("AtlListBSEvents.exe failed to validate %s, Using the (slower) PyDumper method " %filename)
+      logger.info("AtlListBSEvents failed to validate %s, Using the (slower) PyDumper method " %filename)
       cmdSnippet = os.linesep.join( [
           "from sys import exit",
           "import os",
diff --git a/Tracking/TrkEvent/TrkCaloClusterROI/TrkCaloClusterROI/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkCaloClusterROI/TrkCaloClusterROI/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..84894ea550789096bc32cf9b247f1e6734f81ee7
--- /dev/null
+++ b/Tracking/TrkEvent/TrkCaloClusterROI/TrkCaloClusterROI/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkEvent/TrkCaloClusterROI
diff --git a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..0e5538127e02f79b05b8b3ac87aa748c7a3177b0
--- /dev/null
+++ b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkEvent/TrkEventUtils
diff --git a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h
index d1b42b7266998218f794958d21f7181901d5550f..aeaf9f2c02ef957e56cbb8d34ab1c1fc75e02d5d 100755
--- a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h
+++ b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -50,10 +50,9 @@ namespace Trk {
         Trk::Perigee* createNewPerigee(Amg::Vector3D& gp, double phi, double theta, double qOverP) const;
 
       private:
-         double m_field;                  //!< magnetic field in tesla, can be set through constructor
-      
-         static double s_unitConversion;   //!< unit conversion factor
-         static double s_magField;         //!< default magnetic field value
+         double m_field;                  //!< magnetic field in tesla, can be set through constructor      
+         static const double s_unitConversion;   //!< unit conversion factor
+         static const double s_magField;         //!< default magnetic field value
                           
 
      };
diff --git a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h
index 7a46036f6effe09a4d8a923ca03aff7038e112d4..a47e3ac218fb9d366e7e79c9759da210c29513e2 100755
--- a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h
+++ b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -8,11 +8,11 @@
  * This file provides @ref TruthFilters that can be used with the
  * @ref TruthInverters.
  */
-
-
 #ifndef TRUTHCOLLECTIONFILTER_H
 #define TRUTHCOLLECTIONFILTER_H
 
+#include <atomic>
+
 namespace Trk {
 
   /**
@@ -86,9 +86,9 @@ namespace Trk {
   private:
     BasicTruthCollectionFilter<TruthCollection> m_basicFilter;
     double m_probabilityCut;
-    mutable unsigned m_numTruthTotal;
-    mutable unsigned m_numTruthInvalid;
-    mutable unsigned m_numTruthNoVtx;
+    std::atomic_ulong m_numTruthTotal;
+    std::atomic_ulong m_numTruthInvalid;
+    std::atomic_ulong m_numTruthNoVtx;
   };
 
   template<class OStream, class TruthCollection>
diff --git a/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx b/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx
index be037c6386b36b009cfbeb2f71cd9be66a1b73ba..7ce915e9acf09cf58596718374371dc0b38fa09b 100755
--- a/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx
+++ b/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx
@@ -9,8 +9,8 @@
 #include "TrkEventUtils/PerigeeFromVertexCreator.h"
 #include <cmath>
 
-double Trk::PerigeeFromVertexCreator::s_unitConversion = -0.3;
-double Trk::PerigeeFromVertexCreator::s_magField       = 2.083;
+const double Trk::PerigeeFromVertexCreator::s_unitConversion = -0.3;
+const double Trk::PerigeeFromVertexCreator::s_magField       = 2.083;
               
 Trk::Perigee Trk::PerigeeFromVertexCreator::createPerigee(Amg::Vector3D& vertex, 
                                                           Amg::Vector3D& momentum, 
diff --git a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..dcada01d90ced603cfc3313b67909b890418106d
--- /dev/null
+++ b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkEvent/TrkMaterialOnTrack
diff --git a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h
index b69903e4d9750dbdaecab20e70f3f77b4907e060..348b84614fd1884b9ea1c63ce6f65239414f6f50 100755
--- a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h
+++ b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -87,13 +87,13 @@ class EnergyLoss {
   double length() const;
 
   //update from mean values
-  void update(double ioni, double sigi, double rad, double sigr, bool mpv=false) const; 
+  void update(double ioni, double sigi, double rad, double sigr, bool mpv=false) ; 
   
   //update 
-  void update( EnergyLoss&, bool mpv=false ) const; 
+  void update( EnergyLoss&, bool mpv=false ) ; 
   
   //set
-  void set(double eLoss, double sigde, double ioni, double sigi, double rad, double sigr) const; 
+  void set(double eLoss, double sigde, double ioni, double sigi, double rad, double sigr) ; 
   
   //! Interface method for output, can be overloaded by child classes
   virtual MsgStream&    dump( MsgStream& sl ) const;
@@ -103,19 +103,19 @@ class EnergyLoss {
 
  private:
   //! @f$ \Delta E @f$        - the estimated or measured energy loss
-  mutable double  m_deltaE;           
+  double  m_deltaE;           
   //!< @f$ \sigma(\Delta E) @f$ - error on the energy loss
-  mutable double  m_sigmaDeltaE;
+  double  m_sigmaDeltaE;
   //!< @f$ \sigma(\Delta E) @f$ - negative error on the energy loss
-  double  m_sigmaMinusDeltaE;
+  double m_sigmaMinusDeltaE;
   //!< @f$ \sigma(\Delta E) @f$ - positive error on the energy loss
-  double  m_sigmaPlusDeltaE;
+  double m_sigmaPlusDeltaE;
   // additional information about components (cache only, not persistified)
-  mutable double  m_mean_ioni;          // mean value for ionization 
-  mutable double  m_sig_ioni;          // sigma for ionization 
-  mutable double  m_mean_rad;          // mean value for radiation 
-  mutable double  m_sig_rad;           // sigma for radiation 
-  mutable double  m_length;           // 3D length of material 
+  double  m_mean_ioni;          // mean value for ionization 
+  double  m_sig_ioni;          // sigma for ionization 
+  double  m_mean_rad;          // mean value for radiation 
+  double  m_sig_rad;           // sigma for radiation 
+  double  m_length;           // 3D length of material 
 
 };
 
@@ -149,7 +149,7 @@ class EnergyLoss {
  inline double EnergyLoss::length() const
  { return m_length;  } // length can be positive and negative like Eloss depending on (back)tracking
  
- inline void EnergyLoss::update(double ioni, double sigi, double rad, double sigr, bool mpv) const
+ inline void EnergyLoss::update(double ioni, double sigi, double rad, double sigr, bool mpv) 
  { m_mean_ioni += ioni;
    m_mean_rad += rad;
    m_sig_ioni += sigi; 
@@ -158,7 +158,7 @@ class EnergyLoss {
    m_sigmaDeltaE = sqrt( m_sig_ioni*m_sig_ioni + m_sig_rad*m_sig_rad);  
  }
 
- inline void EnergyLoss::update(EnergyLoss& eloss, bool mpv) const
+ inline void EnergyLoss::update(EnergyLoss& eloss, bool mpv) 
  { m_mean_ioni += eloss.meanIoni();
    m_mean_rad += eloss.meanRad();
    m_sig_ioni += eloss.sigmaIoni(); 
@@ -167,7 +167,7 @@ class EnergyLoss {
    m_sigmaDeltaE = sqrt( m_sig_ioni*m_sig_ioni + m_sig_rad*m_sig_rad);  
  }
 
- inline void EnergyLoss::set(double eloss, double sigde, double ioni, double sigi, double rad, double sigr) const
+ inline void EnergyLoss::set(double eloss, double sigde, double ioni, double sigi, double rad, double sigr) 
  { m_mean_ioni = ioni;
    m_mean_rad = rad;
    m_sig_ioni = sigi; 
diff --git a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h
index b49077a1137a5ed88356b9de7a710f22bff88eac..d30dac430c5ccf0ac5682125b361fe6ab13fbc48 100755
--- a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h
+++ b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -122,7 +122,7 @@ class MaterialEffectsBase
       two cases are distinguished by the presence of a pointer from
       the Trk::Surface to a Trk::DetectorElement, if not present it is
       a custom-made surface. */
-  mutable const Surface* m_associatedSurface;
+  const Surface* m_associatedSurface;
   
   //! the flags (bits) telling what information this ME are based on
   long m_typeFlags;
diff --git a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..f0d748847ea8a02bf2561fa8e7687696c460ea3d
--- /dev/null
+++ b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkEvent/TrkTrackSummary
diff --git a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
index a6566b02a90fb52ad15a1ceee25fcb5d8914fc02..154036e9b931c313f4ab19d84ecd85d0a68f48a9 100755
--- a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
+++ b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
@@ -15,6 +15,7 @@ email                : edward.moyse@cern.ch
 #include <vector>
 #include <iostream>
 #include <bitset>
+#include <atomic>
 
 class MsgStream;
 class TrackSummaryCnv_p1;
@@ -45,14 +46,14 @@ enum SummaryType {
         numberOfBLayerOutliers          =31,  //!< number of blayer outliers  
         numberOfBLayerSharedHits        =16,  //!< number of Pixel b-layer hits shared by several tracks.
         numberOfBLayerSplitHits         =43,  //!< number of Pixel b-layer hits split by cluster splitting 
-	expectBLayerHit                 =42,  //!< Do we expect a b-layer hit for this track?
+        expectBLayerHit                 =42,  //!< Do we expect a b-layer hit for this track?
         expectInnermostPixelLayerHit                 =52,  //!< Do we expect a 0th-layer hit for this track?
-	numberOfInnermostPixelLayerHits              =53,  //!< these are the hits in the 0th pixel layer?
+        numberOfInnermostPixelLayerHits              =53,  //!< these are the hits in the 0th pixel layer?
         numberOfInnermostPixelLayerOutliers          =54,  //!< number of 0th layer outliers  
         numberOfInnermostPixelLayerSharedHits        =55,  //!< number of Pixel 0th layer hits shared by several tracks.
         numberOfInnermostLayerSplitHits         =56,  //!< number of Pixel 0th layer hits split by cluster splitting 
-	expectNextToInnermostPixelLayerHit                 =57,  //!< Do we expect a 1st-layer hit for this track?
-	numberOfNextToInnermostPixelLayerHits              = 58,  //!< these are the hits in the 1st pixel layer
+        expectNextToInnermostPixelLayerHit                 =57,  //!< Do we expect a 1st-layer hit for this track?
+        numberOfNextToInnermostPixelLayerHits              = 58,  //!< these are the hits in the 1st pixel layer
         numberOfNextToInnermostPixelLayerOutliers          =59,  //!< number of 1st pixel layer outliers  
         numberOfNextToInnermostPixelLayerSharedHits        =60,  //!< number of Pixel 1st layer hits shared by several tracks.
         numberOfNextToInnermostLayerSplitHits         =61,  //!< number of Pixel 1st layer hits split by cluster splitting 
@@ -65,7 +66,7 @@ enum SummaryType {
         numberOfGangedFlaggedFakes      =32,  //!< number of Ganged Pixels flagged as fakes
         numberOfPixelDeadSensors        =33,  //!< number of dead pixel sensors crossed
         numberOfPixelSpoiltHits         =35,  //!< number of pixel hits with broad errors (width/sqrt(12))
-	numberOfDBMHits                 =63,  //!< number of DBM Hits
+        numberOfDBMHits                 =63,  //!< number of DBM Hits
         numberOfSCTHits                 = 3,  //!< number of hits in SCT
         numberOfSCTOutliers             =39,  //!< number of SCT outliers
         numberOfSCTHoles                = 4,  //!< number of SCT holes
@@ -83,7 +84,7 @@ enum SummaryType {
         numberOfTRTDeadStraws           =37,  //!< number of dead TRT straws crossed
         numberOfTRTTubeHits             =38,  //!< number of TRT tube hits
         numberOfTRTXenonHits            =46,  //!< number of TRT hits on track in straws with xenon
-	numberOfTRTSharedHits           =62,  //!< number of TRT hits used by more than one track
+        numberOfTRTSharedHits           =62,  //!< number of TRT hits used by more than one track
          
     // --- Muon Spectrometer
         numberOfMdtHits                 = 7,       //!< number of mdt hits
@@ -109,19 +110,19 @@ enum SummaryType {
         numberOfStgcPhiHoles            =71,       //! number of TGC Phi measurements missing from the track
         numberOfMmHoles              =72,       //! number of TGC Eta measurements missing from the track
 
-        numberOfCscUnspoiltEtaHits      =45,       //! number of unspoilt CSC eta measurements (all CSC phi measurements are by definition spoilt). See Muon::CscClusterStatus for definitions of 'spoiled' hits.
-	numberOfGoodMdtHits             =66,       //!number of non-deweighted MDT hits.  Only here as a placeholder, will be filled only on xAOD::Muon
+        numberOfCscUnspoiltEtaHits      =45,  //! number of unspoilt CSC eta measurements (all CSC phi measurements are by definition spoilt). See Muon::CscClusterStatus for definitions of 'spoiled' hits.
+        numberOfGoodMdtHits             =66,       //!number of non-deweighted MDT hits.  Only here as a placeholder, will be filled only on xAOD::Muon
     // --- all
         numberOfOutliersOnTrack =15,       //!< number of measurements flaged as outliers in TSOS
         standardDeviationOfChi2OS = 30,    //!< 100 times the standard deviation of the chi2 from the surfaces
 	
 	//reserved: added to keep synchronisation with xAOD::TrackSummary in anticipation of the two being merged
  
-	eProbabilityComb_res                = 47, //!< Electron probability from combining the below probabilities [float].
-	eProbabilityHT_res                  = 48, //!< Electron probability from  High Threshold (HT) information [float].   
-	eProbabilityToT_res                 = 49, //!< Electron probability from Time-Over-Threshold (ToT) information [float].   
-	eProbabilityBrem_res                = 50, //!< Electron probability from Brem fitting (DNA) [float]. 
-	pixeldEdx_res                       = 51, //!< the dE/dx estimate, calculated using the pixel clusters [?]
+        eProbabilityComb_res                = 47, //!< Electron probability from combining the below probabilities [float].
+        eProbabilityHT_res                  = 48, //!< Electron probability from  High Threshold (HT) information [float].   
+        eProbabilityToT_res                 = 49, //!< Electron probability from Time-Over-Threshold (ToT) information [float].   
+        eProbabilityBrem_res                = 50, //!< Electron probability from Brem fitting (DNA) [float]. 
+        pixeldEdx_res                       = 51, //!< the dE/dx estimate, calculated using the pixel clusters [?]
 
  // -- numbers...
         numberOfTrackSummaryTypes = 73
@@ -130,11 +131,11 @@ enum SummaryType {
 // Troels.Petersen@cern.ch:
     enum eProbabilityType {
         eProbabilityComb            = 0,       //!< Electron probability from combining the below probabilities.
-            eProbabilityHT              = 1,       //!< Electron probability from High Threshold (HT) information.
-            eProbabilityToT             = 2,       //!< Electron probability from Time-Over-Threshold (ToT) information.
-            eProbabilityBrem            = 3,       //!< Electron probability from Brem fitting (DNA).
-            numberOfeProbabilityTypes   = 4        
-        }; 
+        eProbabilityHT              = 1,       //!< Electron probability from High Threshold (HT) information.
+        eProbabilityToT             = 2,       //!< Electron probability from Time-Over-Threshold (ToT) information.
+        eProbabilityBrem            = 3,       //!< Electron probability from Brem fitting (DNA).
+        numberOfeProbabilityTypes   = 4        
+    }; 
   // the eProbability vector is abused to store : 
   // [4] TRT local occupancy
   // [5] TRT dE/dx
@@ -145,7 +146,7 @@ enum DetectorType {
         pixelBarrel0 = 0, //!< there are three or four pixel barrel layers (R1/R2)
         pixelBarrel1 = 1,
         pixelBarrel2 = 2,
-	pixelBarrel3 = 3,
+        pixelBarrel3 = 3,
 
         pixelEndCap0 = 4, //!< three pixel discs (on each side)
         pixelEndCap1 = 5,
@@ -169,9 +170,9 @@ enum DetectorType {
         trtBarrel    = 20,
         trtEndCap    = 21,
 
-	DBM0 = 22,
-	DBM1 = 23,
-	DBM2 = 24,
+        DBM0 = 22,
+        DBM1 = 23,
+        DBM2 = 24,
 
         numberOfDetectorTypes = 25
 
@@ -217,7 +218,7 @@ public:
         std::bitset<numberOfDetectorTypes>& hitPattern,
         float dedx=-1,
         int nhitsuseddedx=-1,
-	int nhitsoverflowdedx=-1
+        int nhitsoverflowdedx=-1
     );
 
     /** copy ctor*/
@@ -299,8 +300,8 @@ private: // data members
     unsigned long m_idHitPattern;
 
     /** number of objects of this type in memory */
-    static unsigned int s_numberOfInstantiations;
-
+    static std::atomic<unsigned int> s_numberOfInstantiations;
+ 
     /** pointer to the InDetTrackSummary */
     const InDetTrackSummary* m_indetTrackSummary;
 
diff --git a/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx b/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx
index 4771af6108a197095aa653d5cdd94ea38b1f0647..b3a5e29e68934c9de2b3a243175bf70ea6782f2f 100755
--- a/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx
+++ b/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 /***************************************************************************
                           Summary.cxx  -  description
@@ -13,7 +13,7 @@
 #include "TrkTrackSummary/MuonTrackSummary.h"
 #include "GaudiKernel/MsgStream.h"
 
-unsigned int Trk::TrackSummary::s_numberOfInstantiations=0;
+std::atomic<unsigned int> Trk::TrackSummary::s_numberOfInstantiations{0};
 const int    Trk::TrackSummary::SummaryTypeNotSet=-1;
 
 Trk::TrackSummary::TrackSummary()
diff --git a/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h b/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h
index ea3ce11ddf84c29d9d5a788b744d5a4fe731be8f..d40603df04f90ce4c402bbcb6ef8663a9643ef1c 100755
--- a/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h
+++ b/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h
@@ -48,7 +48,7 @@ namespace Trk {
     /* constructor with list of VxCandidate. The VxSecVertexInfo takes 
        care of the ownership of the VxCandidate*. Don't delete them 
        afterwards */
-    VxSecVertexInfo(const std::vector<xAOD::Vertex*> &);
+    VxSecVertexInfo(std::vector<xAOD::Vertex*> );
 
     /* clone method */
     virtual VxSecVertexInfo* clone() const;
diff --git a/Tracking/TrkEvent/VxSecVertex/src/VxSecVertexInfo.cxx b/Tracking/TrkEvent/VxSecVertex/src/VxSecVertexInfo.cxx
index 346ee36a1eaac1574143b26b901075c7b6182646..1a98fdaf9488fd34ca218869643635c6ce77c610 100755
--- a/Tracking/TrkEvent/VxSecVertex/src/VxSecVertexInfo.cxx
+++ b/Tracking/TrkEvent/VxSecVertex/src/VxSecVertexInfo.cxx
@@ -23,8 +23,8 @@ namespace Trk {
   
   VxSecVertexInfo::VxSecVertexInfo(): m_SVOwnership(false) {}
 
-  VxSecVertexInfo::VxSecVertexInfo(const std::vector<xAOD::Vertex*> & vertices): m_SVOwnership(false) {
-    m_vertices=vertices;//ownership is taken over by the VxSecVertexInfo class!
+  VxSecVertexInfo::VxSecVertexInfo(std::vector<xAOD::Vertex*> vertices): m_vertices(std::move(vertices)), m_SVOwnership(false) {
+
   }
   
   VxSecVertexInfo::~VxSecVertexInfo() {
diff --git a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx
index e8445ef286ceeb5ce04637b19a5abad5dcdf0598..d0edb19fd935b11c8551c050c6a8ddd010bed4dd 100755
--- a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx
@@ -2520,12 +2520,14 @@ const Trk::TrackParameters* Trk::STEP_Propagator::createStraightLine( const Trk:
 
   //  ATH_MSG_VERBOSE("STEP propagator detects invalid input parameters (q/p=0 ), resetting momentum to 1.e10");
 
-  if (dynamic_cast<const Trk::CurvilinearParameters*>(inputTrackParameters)) {
-    return new Trk::CurvilinearParameters(  inputTrackParameters->position(), lp[2], lp[3], lp[4], 
-                                            (inputTrackParameters->covariance() ? new AmgSymMatrix(5)(*inputTrackParameters->covariance()) : 0 ) );
-  } else 
-    return inputTrackParameters->associatedSurface().createTrackParameters(lp[0], lp[1], lp[2], lp[3], lp[4],
-                                                                           (inputTrackParameters->covariance() ? new AmgSymMatrix(5)(*inputTrackParameters->covariance()) : 0 ) );
+  if (inputTrackParameters->type()==Trk::Curvilinear) {
+    return new Trk::CurvilinearParameters(inputTrackParameters->position(), lp[2], lp[3], lp[4], 
+                                          (inputTrackParameters->covariance() ? 
+                                           new AmgSymMatrix(5)(*inputTrackParameters->covariance()) : 0 ) );
+  }  
+  return inputTrackParameters->associatedSurface().createTrackParameters(lp[0], lp[1], lp[2], lp[3], lp[4],
+                                                                         (inputTrackParameters->covariance() ? 
+                                                                          new AmgSymMatrix(5)(*inputTrackParameters->covariance()) : 0 ) );
 
 }
 
diff --git a/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h b/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
index 2e2207dbb793c6a6fa5833490da1142d94c805e8..09adaf16516f8f66e5edcd386845d0529db744ba 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
+++ b/Tracking/TrkTools/TrkMaterialProvider/TrkMaterialProvider/TrkMaterialProviderTool.h
@@ -30,6 +30,8 @@
 #include "TrkGeometry/TrackingVolume.h"
 #include "TrkGeometry/MagneticFieldProperties.h"
 
+#include "RecoToolInterfaces/IMuonCaloEnergyTool.h"
+
 namespace MagField {
   class IMagFieldSvc;
 }
@@ -43,7 +45,6 @@ namespace Rec {
   class IMuidCaloEnergyMeas;
   class IMuidCaloEnergyParam;
   class IMuidTrackIsolation;
-  class IMuonCaloEnergyTool;
 }
 
 class AtlasDetectorID;
@@ -186,7 +187,8 @@ namespace Trk{
     ToolHandle<Rec::IMuidCaloEnergyMeas>  m_caloMeasTool;
     ToolHandle<Rec::IMuidCaloEnergyParam> m_caloParamTool;
     ToolHandle<Rec::IMuidTrackIsolation>  m_trackIsolationTool;
-    ToolHandle<Rec::IMuonCaloEnergyTool>  m_muonCaloEnergyTool;
+    ToolHandle<Rec::IMuonCaloEnergyTool>  m_muonCaloEnergyTool {this, 
+	"MuonCaloEnergyTool", ""};
 
     const AtlasDetectorID *m_DetID;
     const Trk::Volume* m_calorimeterVolume;
diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
index 8b4616f2af1b5567e6b2f55202d5808f1fc13439..83a5f82ca51c52fce310d6a9f189e416b22f2cad 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
+++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
@@ -28,7 +28,6 @@
 #include "MuidInterfaces/IMuidCaloEnergyMeas.h"
 #include "MuidInterfaces/IMuidCaloEnergyParam.h"
 #include "MuidInterfaces/IMuidTrackIsolation.h"
-#include "RecoToolInterfaces/IMuonCaloEnergyTool.h"
 
 //#define DEBUGON //To activate printout for TSOS lists at various stages
 // for line-by-line debugging
@@ -65,7 +64,6 @@ Trk::TrkMaterialProviderTool::TrkMaterialProviderTool(const std::string& t, cons
 	m_caloMeasTool		("Rec::MuidCaloEnergyMeas/MuidCaloEnergyMeas"),
 	m_caloParamTool		("Rec::MuidCaloEnergyParam/MuidCaloEnergyParam"),
 	m_trackIsolationTool	("Rec::MuidTrackIsolation/MuidTrackIsolation"),
-	m_muonCaloEnergyTool    ("Rec::MuonCaloEnergyTool/MuonCaloEnergyTool"),	
 	m_DetID(0),
 	m_calorimeterVolume(0),
 	m_indetVolume(0),
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVKalVrtCore/CMakeLists.txt
index df971d8b433f9f8c23142a0ace7cc5dbd1bffda5..a3c71af94b072a5794bba038f657a490de855848 100644
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/CMakeLists.txt
@@ -5,6 +5,8 @@
 # Declare the package name:
 atlas_subdir( TrkVKalVrtCore )
 
+atlas_depends_on_subdirs( PUBLIC Control/CxxUtils )
+
 # Component(s) in the package:
 atlas_add_library( TrkVKalVrtCore
                    src/*.cxx
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..805ad8b5deb8ab28081883aafc9d01300ef051fd
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVKalVrtCore
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h
index 3c66c409ad85a364abd7901aea64c01ed9351b9b..27960d2e165b403cb25c12c7bde16c308c683e27 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h
@@ -19,7 +19,7 @@
 #ifndef _TrkVKalVrtCore_CommonPars_H
 #define _TrkVKalVrtCore_CommonPars_H
 
-#define vkalNTrkM  300
+#define vkalNTrkM  200
 #define vkalMagCnvCst 0.29979246
 #define vkalInternalStepLimit   20.
 #define vkalAllowedPtChange      3.
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h
index 6fda086aec0d987f95837db7eb8ace79e0989dde..abcac6ebe07fd0c5ae1d1854377056eb835985a2 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #ifndef _TrkVKalVrtCore_Derivt_H
 #define _TrkVKalVrtCore_Derivt_H
 
@@ -19,18 +19,25 @@ namespace Trk {
 //
   
   class VKVertex;
-   
+  enum class VKContraintType { Mass, Phi, Theta, Point, Plane  };
   class VKConstraintBase
   {
     public:
-      VKConstraintBase(const int, int);
+      VKConstraintBase(const int, int, VKContraintType, VKVertex*);
       virtual ~VKConstraintBase();
     public:
+      const VKVertex * getOriginVertex() const { return m_originVertex;}
+      VKContraintType getType() const { return m_type; }
+      virtual VKConstraintBase* clone() const = 0;
+      virtual void applyConstraint() = 0;
       int NCDim;                                // constraint dimension
       int NTrk;                                 // number of tracks
       std::vector<double> aa;                     // Constraint values
       std::vector< std::vector< Vect3DF > > f0t;  // Constraint momentum derivatives 
       std::vector< Vect3DF > h0t;	          // Constraint space derivatives
+    protected:
+      VKVertex * m_originVertex;
+      const VKContraintType m_type;
    };
 //
 //  Mass constraint
@@ -42,16 +49,15 @@ namespace Trk {
         VKMassConstraint(int,double, const std::vector<int>&, VKVertex*); 
         ~VKMassConstraint(); 
         friend std::ostream& operator<<( std::ostream& out, const VKMassConstraint& );
-   
+        virtual VKConstraintBase* clone() const override;
       public:
-        VKVertex * getOriginVertex() const { return m_originVertex;}
-        void setTargetMass(double M) { m_targetMass=M; };
-        double getTargetMass() const { return m_targetMass; };
-        std::vector<int> getUsedParticles() const { return m_usedParticles; };
+        void setTargetMass(double M) { m_targetMass=M; };
+        virtual void applyConstraint() override;
+        double getTargetMass() const { return m_targetMass; };
+        const std::vector<int>& getUsedParticles() const { return m_usedParticles; };
 
       private:
 	std::vector<int> m_usedParticles;
-        VKVertex * m_originVertex;
         double m_targetMass;
  
    };
@@ -63,22 +69,18 @@ namespace Trk {
       public:
         VKPhiConstraint(int,VKVertex*); 
         ~VKPhiConstraint(); 
+        virtual VKConstraintBase* clone() const override;
+        virtual void applyConstraint() override;
         friend std::ostream& operator<<( std::ostream& out, const VKPhiConstraint& );
-        VKVertex * getOriginVertex() const { return m_originVertex;}
-   
-      private:
-        VKVertex * m_originVertex;
    };
    class VKThetaConstraint : public VKConstraintBase
    {
       public:
         VKThetaConstraint(int,VKVertex*); 
         ~VKThetaConstraint(); 
+        virtual VKConstraintBase* clone() const override;
+        virtual void applyConstraint() override;
         friend std::ostream& operator<<( std::ostream& out, const VKThetaConstraint& );
-        VKVertex * getOriginVertex() const { return m_originVertex;}
-  
-      private:
-        VKVertex * m_originVertex;
    };
 
 //
@@ -90,15 +92,14 @@ namespace Trk {
         VKPointConstraint(int,double[3], VKVertex*, bool ); 
         ~VKPointConstraint(); 
         friend std::ostream& operator<<( std::ostream& out, const VKPointConstraint& );
-        VKVertex * getOriginVertex() const { return m_originVertex; };
-        bool onlyZ() const {return m_onlyZ; };
-        void setTargetVertex(double VRT[3]){ m_targetVertex[0]=VRT[0]; m_targetVertex[1]=VRT[1]; m_targetVertex[2]=VRT[2]; };
-        const double * getTargetVertex() const { return m_targetVertex;};
-
+        bool onlyZ() const {return m_onlyZ; };
+        void setTargetVertex(double VRT[3]){ m_targetVertex[0]=VRT[0]; m_targetVertex[1]=VRT[1]; m_targetVertex[2]=VRT[2]; };
+        const double * getTargetVertex() const { return m_targetVertex;};
+        virtual VKConstraintBase* clone() const override;
+        virtual void applyConstraint() override;
       private:
         bool m_onlyZ; 
         double m_targetVertex[3];   //Target vertex is in global reference system
-        VKVertex * m_originVertex;
    };
 //
 //  Vertex in plane constraint
@@ -109,15 +110,14 @@ namespace Trk {
         VKPlaneConstraint(int, double, double, double, double, VKVertex*); 
         ~VKPlaneConstraint(); 
         friend std::ostream& operator<<( std::ostream& out, const VKPlaneConstraint& );
-        VKVertex * getOriginVertex() const { return m_originVertex;}
         double getA() const { return m_A;}
         double getB() const { return m_B;}
         double getC() const { return m_C;}
         double getD() const { return m_D;}
-   
+        virtual void applyConstraint() override;
+        virtual VKConstraintBase* clone() const override;
       private:
         double m_A,m_B,m_C,m_D;
-        VKVertex * m_originVertex;
    };
 
 } /* End namespace */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h
index 39d5fee48827f673fa1c53ac5c911de0948ee1f8..710c82e1f488b231a5084e2a05186a195e3607e1 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #ifndef _TrkVKalVrtCore_ForCFT_H
 #define _TrkVKalVrtCore_ForCFT_H
 
@@ -24,7 +24,7 @@ namespace Trk {
 // For several(up to 8) mass constraints
     int nmcnst;
     double wm[vkalNTrkM];
-    double wmfit[vkalMaxNMassCnst];
+    double wmfit[vkalMaxNMassCnst];
     double localbmag;
 // Since 20/09/2009 - Vertex in plane constraint 
     double Ap,Bp,Cp,Dp;
@@ -47,23 +47,40 @@ namespace Trk {
     int IterationNumber;
     double IterationPrecision;
  
-    ForCFT(){
+    void prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double  *vrt, double  *vrte) noexcept;
+
+    void vksetIterationNum(long int Iter) noexcept;
+    void vksetIterationPrec(double Prec) noexcept;
+    void vksetRobustScale(double Scale) noexcept;
+    void vksetRobustness(long int Rob) noexcept;
+    void vksetUseMassCnst() noexcept;
+    void vksetUsePhiCnst() noexcept;
+    void vksetUsePlaneCnst(double a, double b, double c, double d) noexcept;
+    void vksetUseThetaCnst() noexcept { useThetaCnst = 1;}
+    void vksetUseAprioriVrt() noexcept { useAprioriVrt = 1;}
+    void vksetUsePointingCnst(int iType = 1 ) noexcept { usePointingCnst = iType<2 ? 1 : 2 ;}
+    void vksetUsePassNear(int iType = 1 )  noexcept { usePassNear = iType<2 ? 1 : 2 ;}
+    void setmasscnst_(long int *ncnsttrk, long int *indextrk, double  *wmcnst) noexcept;
+
+    ForCFT() noexcept{
       nmcnst=0;
       useMassCnst=0; usePhiCnst=0; useThetaCnst=0; usePointingCnst=0; usePlaneCnst=0;
-      useAprioriVrt=0; usePassNear=0;
+      useAprioriVrt=0; usePassNear=0;
       Ap=Bp=Dp=Cp=0.;
-      IterationNumber = 50;
-      IterationPrecision=1.e-3;
+      IterationNumber = 50;
+      IterationPrecision=1.e-3;
       RobustScale = 1.; irob=0;
-      for (int ic=0; ic<vkalMaxNMassCnst; ++ic) wmfit[ic] = -10000.;
-      for (int it=0; it<vkalNTrkM; ++it) {
-         wm[it] = 139.57018;
-         for(int ic=0; ic<vkalMaxNMassCnst; ic++) indtrkmc[ic][it]=0;
-      }
+      for (int ic=0; ic<vkalMaxNMassCnst; ++ic) wmfit[ic] = -10000.;
+      for (int it=0; it<vkalNTrkM; ++it) {
+         wm[it] = 139.57018;
+         for(int ic=0; ic<vkalMaxNMassCnst; ic++) indtrkmc[ic][it]=0;
+      }
       localbmag=1.997;   // Safety: standard magnetic field in ID 
     };
-    ~ForCFT() {};
-  };
+
+    ~ForCFT() = default;
+
+  };
 
 }
 #endif
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/PGraph.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/PGraph.h
new file mode 100644
index 0000000000000000000000000000000000000000..734c013c277f4800e1ba329b55b02dbcb2fbba75
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/PGraph.h
@@ -0,0 +1,24 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+#ifndef _TrkVKalVrtCore_PGRAPH_H
+#define _TrkVKalVrtCore_PGRAPH_H
+
+namespace Trk {
+  class PGraph{
+
+    short int m_teit[999000]	/* was [2][499500] */, m_sett[499500];
+    long int m_vset[1000], m_wset[1000];
+    long int m_tabnr;
+    long int m_lteit[1000], m_lweit, m_lsett[1000];
+    long int m_lvset, m_lwset, m_choice;
+
+public:
+    PGraph() { } //Prevent zeroing of large arrays.
+    int pgraphm_(long int *weit, long int *edges, long int *nodes, long int *set, long int *nptr, long int *nth) noexcept;
+    static void trevni_(long int *from, long int *length, long int *to, long int *maxv, long int *newlng, long int *work) noexcept;
+
+  };
+}
+
+#endif
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalUtils.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalUtils.h
index 634138b98586fd146e5ed85a9499c2b2283779fa..0d28ed14791737e3f1aaecf67d520d7a2750313d 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalUtils.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalUtils.h
@@ -11,9 +11,9 @@ namespace Trk {
 
   struct Vect3DF{ 
     double X; double Y; double Z;
-    Vect3DF(){ X=Y=Z=0.; }
-    void Set(double arr[3]){ X=arr[0]; Y=arr[1]; Z=arr[2]; }
-    double Dist3D( Vect3DF & v) { return sqrt(pow(X-v.X,2)+pow(Y-v.Y,2)+pow(Z-v.Z,2)); }
+    Vect3DF() noexcept  { X=Y=Z=0.; }
+    void Set(double arr[3]) noexcept { X=arr[0]; Y=arr[1]; Z=arr[2]; }
+    double Dist3D( Vect3DF & v) const noexcept  { return sqrt(pow(X-v.X,2)+pow(Y-v.Y,2)+pow(Z-v.Z,2)); }
   };
 
   struct VectMOM { double Px; double Py; double Pz; double E; };
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h
index b92cfead3c58078817f47e3aaa542043d6dcf25b..3061995a67a974e3fc9299bfe51ff5ddfb584aa5 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h
@@ -39,7 +39,7 @@ namespace Trk {
      public:
        VKalVrtControl(const VKalVrtControlBase &);
        VKalVrtControl(const VKalVrtControl & src);              //copy
-      ~VKalVrtControl();
+      ~VKalVrtControl() = default;
 
      public:
 
@@ -59,26 +59,30 @@ namespace Trk {
        void setUsePassNear(int);
 
        void renewCascadeEvent(CascadeEvent *);
-       CascadeEvent * getCascadeEvent() const;
+       //Only edit the CascadeEvent in the same thread it was created in
+       const CascadeEvent * getCascadeEvent() const{ return m_cascadeEvent;};
+       CascadeEvent * getCascadeEvent() { return m_cascadeEvent;};
        void renewFullCovariance(double *);
-       double * getFullCovariance() const;
-
+       //Only edit the covariance in the same thread it was created.
+       const double * getFullCovariance () const { return m_fullCovariance.get(); }
+       double * getFullCovariance () { return m_fullCovariance.get(); }
        void setVertexMass(double mass) { m_vrtMassTot=mass;}
        void setVrtMassError(double error) { m_vrtMassError=error;}
        double getVertexMass() { return m_vrtMassTot;}
        double getVrtMassError() {return m_vrtMassError;}
 
-       ForCFT vk_forcft;
+
 
      private:
 
-       double * m_fullCovariance;   // On vertex fit exit contains full covariance matrix 
+       std::unique_ptr<double[]> m_fullCovariance;   // On vertex fit exit contains full covariance matrix 
                                     // (x,y,z,px_0,py_0,pz_0,....,px_n,py_n,pz_n)
                                     // in symmetric form
        double m_vrtMassTot;
        double m_vrtMassError;
        CascadeEvent * m_cascadeEvent=nullptr;       
-
+     public:
+       ForCFT vk_forcft;
   };
 
 } // end of namespace bracket
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h
index d8746feb71119ba885a2eff298bee10494635a18..830bd02a7c89634560cd620237a5713ed1ff79c5 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h
@@ -27,12 +27,12 @@ namespace Trk {
        void   setSCALE(double S) {m_SCALE=S;};
        double getAccuracyConstraint() const { return m_accuracyConstraint; };
        void   setAccuracyConstraint(double C) { m_accuracyConstraint=C; };
-       double *fullCovMatrix;
-       std::vector< VKVertex *> cascadeVertexList; 
+       std::unique_ptr<double[]> fullCovMatrix;
+       std::vector< std::unique_ptr<VKVertex> > cascadeVertexList; 
        std::vector<int> matrixPnt;
        CascadeEvent():cascadeNV(0), nearPrmVertex(0), fullCovMatrix(0), cascadeVertexList(0), 
                       matrixPnt(0), m_SCALE(1.), m_accuracyConstraint(1.e-4) {};
-      ~CascadeEvent(){if(fullCovMatrix)delete[] fullCovMatrix;};
+      ~CascadeEvent() = default;
 
      private:
        double m_SCALE;
@@ -129,10 +129,12 @@ namespace Trk {
    {   
     public:
       VKVertex(const VKalVrtControl &);
+      VKVertex(VKVertex &&) noexcept = default;
       VKVertex();
      ~VKVertex();
       VKVertex(const VKVertex & src);              //copy
       VKVertex& operator= (const VKVertex & src);  //assign
+      VKVertex& operator= (VKVertex &&) noexcept = default;  //move
 
      public:        // Relative coordinates with respect to refIterV[]
        double Chi2;         // vertex Chi2
@@ -163,9 +165,9 @@ namespace Trk {
        double wa[6];          // save WA matrix for futher use
        double dxyz0[3];       // unconstrained shift of vertex on current iteration. Needed for PostFit
       
-       std::vector<VKTrack* > TrackList;
-       std::vector<TWRK* >    tmpArr;
-       std::vector<VKConstraintBase *> ConstraintList;
+       std::vector<std::unique_ptr<VKTrack> > TrackList;
+       std::vector<std::unique_ptr<TWRK> >    tmpArr;
+       std::vector<std::unique_ptr<VKConstraintBase> > ConstraintList;
 
 
        void setRefV(double []);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx
index 0c7377449775023b1ed49e5f4e6d87991cc81038..e916df8c321dc2db534bb36dce08b17702eaad9a 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx
@@ -19,11 +19,12 @@ namespace Trk {
 //propagation in it.
 // No writable data members ==> thread-safe
 //=========================================================
-vkalMagFld      myMagFld;
-vkalPropagator  myPropagator;
+extern const vkalMagFld      myMagFld;
+extern const vkalPropagator  myPropagator;
+const vkalMagFld myMagFld = vkalMagFld();
+const vkalPropagator myPropagator = vkalPropagator();
 
-
-void printT(double p[], double e[], std::string name){
+void printT(double p[], double e[], const std::string &name){
   std::cout<<name<<p[0]<<", "<<p[1]<<", "<<p[2]<<", "<<p[3]<<", "<<p[4]<<'\n';
   std::cout<<e[0]<<'\n';
   std::cout<<e[1]<<", "<<e[2]<<'\n';
@@ -111,10 +112,10 @@ void fillVertex(VKVertex *vk, int NTRK, long int *ich, double xyz0[3], double (*
     vk->TrackList.resize(NTRK);
     for (int tk=0; tk<NTRK ; tk++) {
        long int TrkID=tk;
-       vk->TrackList[tk]= new VKTrack(TrkID, &inp_Trk5[tk][0], &inp_CovTrk5[tk][0], vk, vrtForCFT.wm[tk]);
+       vk->TrackList[tk]= std::make_unique< VKTrack >(TrkID, &inp_Trk5[tk][0], &inp_CovTrk5[tk][0], vk, vrtForCFT.wm[tk]);
      //printT(&inp_Trk5[tk*5], &inp_CovTrk5[tk*15] , "Input track:");
      //std::cout<<(*vk->TrackList[tk]);
-       vk->tmpArr[tk]=new TWRK();
+       vk->tmpArr[tk]= std::make_unique< TWRK > ();
        vk->TrackList[tk]->Charge = ich[tk];           // Charge coinsides with sign of curvature
     }
 
@@ -126,7 +127,7 @@ void fillVertex(VKVertex *vk, int NTRK, long int *ich, double xyz0[3], double (*
 /*           Initial value                                 */
 /* --------------------------------------------------------*/
     for(int tk=0; tk<NTRK; tk++){
-      VKTrack *trk = vk->TrackList[tk]; 
+      VKTrack *trk = vk->TrackList[tk].get(); 
       trk->iniP[0]=trk->cnstP[0]=trk->fitP[0]=par0[tk][0];   //initial guess
       trk->iniP[1]=trk->cnstP[1]=trk->fitP[1]=par0[tk][1];
       trk->iniP[2]=trk->cnstP[2]=trk->fitP[2]=par0[tk][2];
@@ -149,7 +150,7 @@ bool checkPosition(VKVertex * vk, double vertex[3]){
 extern int afterFit(VKVertex *, double *, double *, double *, double *, const VKalVrtControlBase* = 0);
 extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, const VKalVrtControl * =0);
 extern void cfmasserr(VKVertex* , int*, double, double*, double*);
-extern std::array<double, 4> getFitParticleMom( VKTrack *, double);
+extern std::array<double, 4> getFitParticleMom( const VKTrack *, double);
 
 int fitVertex(VKVertex * vk) 
 {
@@ -195,18 +196,18 @@ int fitVertex(VKVertex * vk)
        if(vrtForCFT.wmfit[ic]>0){    // new mass constraint
            index.clear();
            for(tk=0; tk<NTRK; tk++){ if( vrtForCFT.indtrkmc[ic][tk] )index.push_back(tk); }
-           vk->ConstraintList.push_back(new VKMassConstraint( NTRK, vrtForCFT.wmfit[ic], index, vk) );
+           vk->ConstraintList.emplace_back(new VKMassConstraint( NTRK, vrtForCFT.wmfit[ic], index, vk) );
         }
       }
       //VKMassConstraint *ctmp=dynamic_cast<VKMassConstraint*>( vk->ConstraintList[0]); std::cout<<(*ctmp)<<'\n';
     }
     if( vrtForCFT.usePointingCnst==1 ){  //3Dpointing
-      vk->ConstraintList.push_back(new VKPointConstraint( NTRK, vrtForCFT.vrt, vk, false));
+      vk->ConstraintList.emplace_back(new VKPointConstraint( NTRK, vrtForCFT.vrt, vk, false));
       //VKPointConstraint *ptmp=dynamic_cast<VKPointConstraint*>( vk->ConstraintList[1]); std::cout<<(*ptmp)<<'\n';
     }
     if( vrtForCFT.usePointingCnst==2 ){  //Z pointing
       VKPointConstraint *temp = new VKPointConstraint( NTRK, vrtForCFT.vrt, vk, true);
-      vk->ConstraintList.push_back(temp);
+      vk->ConstraintList.emplace_back(temp);
       //VKPointConstraint *ptmp=dynamic_cast<VKPointConstraint*>( vk->ConstraintList[1]); std::cout<<(*ptmp)<<'\n';
     }
     if ( vrtForCFT.useAprioriVrt ) {
@@ -216,11 +217,11 @@ int fitVertex(VKVertex * vk)
         cfdcopy(vrtForCFT.vrt, vk->apriorV,   3);
         cfdcopy(      aermd, vk->apriorVWGT,6);
     }
-    if ( vrtForCFT.usePhiCnst )  vk->ConstraintList.push_back(new VKPhiConstraint( NTRK, vk));
-    if ( vrtForCFT.useThetaCnst )vk->ConstraintList.push_back(new VKThetaConstraint( NTRK, vk));
+    if ( vrtForCFT.usePhiCnst )  vk->ConstraintList.emplace_back(new VKPhiConstraint( NTRK, vk));
+    if ( vrtForCFT.useThetaCnst )vk->ConstraintList.emplace_back(new VKThetaConstraint( NTRK, vk));
     if ( vrtForCFT.usePlaneCnst ){
       if( vrtForCFT.Ap+vrtForCFT.Bp+vrtForCFT.Cp != 0.){
-        vk->ConstraintList.push_back(new VKPlaneConstraint( NTRK, vrtForCFT.Ap, vrtForCFT.Bp, vrtForCFT.Cp, vrtForCFT.Dp, vk));
+        vk->ConstraintList.emplace_back(new VKPlaneConstraint( NTRK, vrtForCFT.Ap, vrtForCFT.Bp, vrtForCFT.Cp, vrtForCFT.Dp, vk));
       }
     }
 //
@@ -270,7 +271,7 @@ int fitVertex(VKVertex * vk)
 	  double targV[3]={newVrtXYZ[0],newVrtXYZ[1],newVrtXYZ[2]};  //Temporary to avoid overwriting
 	  for (tk = 0; tk < NTRK; ++tk) {
 //std::cout<<__func__<<" propagate trk="<<tk<<" X,Y,Z="<<targV[0]<<","<<targV[1]<<","<<targV[2]<<'\n';
-            myPropagator.Propagate(vk->TrackList[tk], vk->refV,  targV, tmpPer, tmpCov, (vk->vk_fitterControl).get());
+            myPropagator.Propagate(vk->TrackList[tk].get(), vk->refV,  targV, tmpPer, tmpCov, (vk->vk_fitterControl).get());
             cfTrkCovarCorr(tmpCov);
             double eig5=cfSmallEigenvalue(tmpCov,5 );
  	    if(eig5<1.e-15 ){ 
@@ -309,13 +310,13 @@ int fitVertex(VKVertex * vk)
 /*                    - apply protection against charge sign change      */
 /*-----------------------------------------------------------------------*/
 	for (tk = 0; tk < NTRK; ++tk){
-	    trk = vk->TrackList[tk]; protectCurvatureSign( trk->refPerig[4], trk->fitP[2] , trk->WgtM);
+	    trk = vk->TrackList[tk].get(); protectCurvatureSign( trk->refPerig[4], trk->fitP[2] , trk->WgtM);
         }
 /*--------------------------------  Now the fit itself -----------------*/
 	if (vrtForCFT.irob != 0) {robtest(vk, 0);}  // ROBUSTIFICATION new data structure
 	if (vrtForCFT.irob != 0) {robtest(vk, 1);}  // ROBUSTIFICATION new data structure
         for( tk=0; tk<NTRK; tk++){
-	  trk = vk->TrackList[tk]; 
+	  trk = vk->TrackList[tk].get(); 
 	  trk->iniP[0]=trk->cnstP[0]=trk->fitP[0];   //use fitted track parameters as initial guess
 	  trk->iniP[1]=trk->cnstP[1]=trk->fitP[1];
 	  trk->iniP[2]=trk->cnstP[2]=trk->fitP[2]; 
@@ -354,7 +355,7 @@ int fitVertex(VKVertex * vk)
 	  }
 
           for( tk=0; tk<NTRK; tk++){
-	    trk = vk->TrackList[tk]; 
+	    trk = vk->TrackList[tk].get(); 
 	    trk->iniP[0]=trk->cnstP[0]=trk->fitP[0];   //use fitted track parameters as initial guess
 	    trk->iniP[1]=trk->cnstP[1]=trk->fitP[1];
 	    trk->iniP[2]=trk->cnstP[2]=trk->fitP[2];
@@ -469,7 +470,7 @@ int fitVertex(VKVertex * vk)
     MainVRT->vk_fitterControl->vk_forcft.localbmag = myMagFld.getMagFld(xyzfit,(MainVRT->vk_fitterControl).get());
     chi2 = 0.;
     for (int tk = 0; tk < NTRK; tk++) {
-        VKTrack * trk = MainVRT->TrackList[tk];
+        VKTrack * trk = MainVRT->TrackList[tk].get();
 	chi2   += trk->Chi2;
 	chi2tr[tk] = trk->Chi2;
         cfdcopy( trk->fitP, &parfs[tk][0], 3);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx
index 222595bd54ea2e3180f1afc96db2314bdffb16a5..abea61b15cd391bf031cf0757396887efc324b7d 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx
@@ -13,8 +13,8 @@
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
-extern vkalMagFld      myMagFld;
+extern const vkalPropagator  myPropagator;
+extern const vkalMagFld      myMagFld;
 
 extern int cfdinv(double *, double *, long int );
 extern int cfInv5(double *cov, double *wgt );
@@ -35,7 +35,7 @@ extern void setFittedParameters(double * , std::vector<int> &, CascadeEvent &);
 extern int getCascadeNPar(CascadeEvent &, int Type=0);
 extern VKTrack * getCombinedVTrack(VKVertex *);
 extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, const VKalVrtControl * =0);
-extern std::array<double, 4> getFitParticleMom( VKTrack *, double);
+extern std::array<double, 4> getFitParticleMom( const VKTrack *, double);
 
 extern void setFittedMatrices(double * , long int , std::vector<int> &, std::vector< std::vector<double> > &, CascadeEvent& );
 extern std::vector<double> transformCovar(int , double **, const std::vector<double>& );
@@ -63,7 +63,7 @@ int setVTrackMass(VKVertex * vk)
    NTRK = vk->TrackList.size();                   // Number of tracks at vertex
    totP.Px=0.;totP.Py=0.;totP.Pz=0.;totP.E=0.;
    for(it=0; it<NTRK; it++){
-       std::array<double, 4> pp = getFitParticleMom( vk->TrackList[it], vBz );
+       std::array<double, 4> pp = getFitParticleMom( vk->TrackList[it].get(), vBz );
        totP.Px += pp[0];     
        totP.Py += pp[1];     
        totP.Pz += pp[2];     
@@ -95,7 +95,7 @@ long int getVertexCharge( VKVertex * vk){
 double cascadeCnstRemnants(CascadeEvent & cascadeEvent_){
   double cnstRemnants=0.;
   for(int iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     VKVertex * vk = cascadeEvent_.cascadeVertexList[iv];
+     VKVertex * vk = cascadeEvent_.cascadeVertexList[iv].get();
      for(int ii=0; ii<(int)vk->ConstraintList.size();ii++){
         for(int ic=0; ic<(int)vk->ConstraintList[ii]->NCDim; ic++){
            cnstRemnants +=  fabs( vk->ConstraintList[ii]->aa[ic] ); 
@@ -131,8 +131,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //
   bool existPointingCnst=false;
   for(int ic=0; ic<(int)vk->ConstraintList.size(); ic++){
-    VKPointConstraint * p_cnst=dynamic_cast<VKPointConstraint *>(vk->ConstraintList[ic]);
-    if(p_cnst) existPointingCnst=true;
+    if(vk->ConstraintList[ic]->getType() == VKContraintType::Point) { existPointingCnst=true; break; }
   }
 //
 //-------- Then fit
@@ -240,7 +239,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //   For last in structure (mother in cascade...) always calculate it - needed for pointing
 //
    CascadeEvent & cascadeEvent_ = *(vk->vk_fitterControl->getCascadeEvent());
-   if( vk->passNearVertex || vk==cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1]){
+   if( vk->passNearVertex || vk==cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get()){
       double dptot[4],VrtMomCov[21];      
       IERR = afterFit( vk, vk->ader, vk->FVC.dcv, dptot, VrtMomCov, (vk->vk_fitterControl).get());
       if (IERR) return -13;                        /* NONINVERTIBLE COV.MATRIX */
@@ -273,7 +272,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 // This initial step is needed to get initial estimation for "passing near constraint 
 //
   for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     vk = cascadeEvent_.cascadeVertexList[iv];
+     vk = cascadeEvent_.cascadeVertexList[iv].get();
      IERR = fitVertexCascade( vk, 0);     if(IERR)return IERR;   //fit 
      IERR = setVTrackMass(vk);            if(IERR)return IERR;   //mass of combined particle
   }
@@ -286,7 +285,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
   for(Iter=0; Iter<100; Iter++){
      Chi2Cur=0.;
      for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-       vk = cascadeEvent_.cascadeVertexList[iv];
+       vk = cascadeEvent_.cascadeVertexList[iv].get();
 //
 //Calculate derivatives for "passing near" cnst. Initial vertex position is used for derivatives.
 //Results are saved in ForVRTClose structure
@@ -322,10 +321,10 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //     of correct size
 //
   for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     vk = cascadeEvent_.cascadeVertexList[iv];
+     vk = cascadeEvent_.cascadeVertexList[iv].get();
      if(vk->nextCascadeVrt){
        long int NTRK = vk->TrackList.size();  
-       vk->ConstraintList.push_back(new VKPointConstraint( NTRK, vk->nextCascadeVrt->refIterV , vk, false));
+       vk->ConstraintList.emplace_back(new VKPointConstraint( NTRK, vk->nextCascadeVrt->refIterV , vk, false));
      }
   }
   long int fullNPar = getCascadeNPar(cascadeEvent_);
@@ -355,7 +354,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
      NStart=0;
      for( iv=0; iv<fullNPar*fullNPar; iv++)fullMatrix[iv]=0.;  // zero full matrix
      for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-       vk = cascadeEvent_.cascadeVertexList[iv];
+       vk = cascadeEvent_.cascadeVertexList[iv].get();
 //
 //Calculate derivatives for "passing near" cnst. Initial vertex position is used for derivatives.
 //Results are saved in ForVRTClose structure
@@ -434,15 +433,14 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
        IERR = vkMSolve(fullMatrix, fullLSide, fullNPar);
        if(IERR){ delete[] fullMatrix; delete[] fullLSide; delete[] tmpLSide; delete[] iniCovMatrix;return IERR;}
      }else{                                               //Last step. Solution+full error matrix
-       if(cascadeEvent_.fullCovMatrix)delete[] cascadeEvent_.fullCovMatrix;
-       cascadeEvent_.fullCovMatrix = new double[fullNPar*fullNPar];     //Create fresh matrix
-       IERR = vkMSolve(fullMatrix, fullLSide, fullNPar, cascadeEvent_.fullCovMatrix);
+       cascadeEvent_.fullCovMatrix = std::make_unique< double[] >(fullNPar*fullNPar);     //Create fresh matrix
+       IERR = vkMSolve(fullMatrix, fullLSide, fullNPar, cascadeEvent_.fullCovMatrix.get());
        if(IERR){ delete[] fullMatrix; delete[] fullLSide; delete[] tmpLSide; delete[] iniCovMatrix;
-                 delete[] cascadeEvent_.fullCovMatrix; cascadeEvent_.fullCovMatrix=0; return IERR;}
+                 cascadeEvent_.fullCovMatrix.reset(); return IERR;}
 //std::cout<<"fulcov="; for(int tt=0; tt<fullNPar; tt++)std::cout<<cascadeEvent_.fullCovMatrix[tt*fullNPar+tt]<<", "; std::cout<<'\n';
-       double *  newCov = new double[fullNPar*fullNPar];  //Check via error transfer from left side (measured values). Gives exactly the same errors - correct!!! 
-       getNewCov(iniCovMatrix, cascadeEvent_.fullCovMatrix, newCov, fullNPar);
-       delete[] cascadeEvent_.fullCovMatrix; cascadeEvent_.fullCovMatrix=newCov;
+       auto  newCov = std::make_unique<double[]>(fullNPar*fullNPar);  //Check via error transfer from left side (measured values). Gives exactly the same errors - correct!!! 
+       getNewCov(iniCovMatrix, cascadeEvent_.fullCovMatrix.get(), newCov.get(), fullNPar);
+       cascadeEvent_.fullCovMatrix=std::move(newCov); //Unique_ptr will handle deletion automatically
      }
 //
 // Set fitted parameters
@@ -453,9 +451,9 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //
      double Chi2Full=0.;
      for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-        vk = cascadeEvent_.cascadeVertexList[iv];
+        vk = cascadeEvent_.cascadeVertexList[iv].get();
         for(int it=0; it<(int)vk->TrackList.size(); it++){
-           VKTrack * trk=vk->TrackList[it]; if(trk->Id >= 0)Chi2Full+=trk->Chi2;    // real track in cascade
+           VKTrack * trk=vk->TrackList[it].get(); if(trk->Id >= 0)Chi2Full+=trk->Chi2;    // real track in cascade
         }
         if(cascadeEvent_.nearPrmVertex && iv==(cascadeEvent_.cascadeNV-1)){   //only last vertex in cascade may have it
            double signift = cfVrtDstSig( vk, vk->passWithTrkCov);
@@ -478,10 +476,10 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
      if(IERR){ delete[] fullMatrix; delete[] fullLSide; delete[] tmpLSide; delete[] iniCovMatrix; return IERR;}
 
      for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-        vk = cascadeEvent_.cascadeVertexList[iv];
+        vk = cascadeEvent_.cascadeVertexList[iv].get();
         if(vk->nextCascadeVrt){
           int pntCnst = vk->ConstraintList.size() - 1;  // pointing constraint is always last in the list
-          VKPointConstraint * pcnst = dynamic_cast<VKPointConstraint*>(vk->ConstraintList[pntCnst]);
+          VKPointConstraint * pcnst = dynamic_cast<VKPointConstraint*>(vk->ConstraintList[pntCnst].get());
           pcnst->setTargetVertex(vk->nextCascadeVrt->refIterV);
         }
      }
@@ -519,7 +517,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
  int processCascadePV(CascadeEvent & cascadeEvent_, double *primVrt, double *primVrtCov )
 {
     double aermd[6],tmpd[6];  // temporary arrays
-    VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1]; //Main vertex
+    VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get(); //Main vertex
 
     vk->vk_fitterControl->vk_forcft.vrt[0] = primVrt[0];
     vk->vk_fitterControl->vk_forcft.vrt[1] = primVrt[1];
@@ -547,7 +545,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
  int processCascade(CascadeEvent & cascadeEvent_, double *primVrt, double *primVrtCov )
 { 
     cascadeEvent_.nearPrmVertex=1;                                             //setting up additional Chi2 term
-    VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1]; //Main vertex
+    VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get(); //Main vertex
     vk->passNearVertex  =true;                        // For fitting machinery
     vk->passWithTrkCov  =true;                        // For fitting machinery
     vk->FVC.vrt[0] = primVrt[0];
@@ -567,9 +565,9 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //
  int processCascade(CascadeEvent & cascadeEvent_, double *primVrt )
 { 
-    VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1]; //Main vertex
+    VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get(); //Main vertex
     long int NTRK = vk->TrackList.size();  
-    vk->ConstraintList.push_back(new VKPointConstraint( NTRK, primVrt, vk, false));
+    vk->ConstraintList.emplace_back(new VKPointConstraint( NTRK, primVrt, vk, false));
     cascadeEvent_.nearPrmVertex=0;                 //explicitly turn off additional Chi2 term
     return processCascade(cascadeEvent_);
 }
@@ -588,7 +586,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
   if(Step>1.)Step=1.;
   
   for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     vk=cascadeEvent_.cascadeVertexList[iv];
+     vk=cascadeEvent_.cascadeVertexList[iv].get();
      NTRK = vk->TrackList.size();            // Number of tracks at vertex
      targetVertex[0]=vk->refIterV[0] + vk->fitV[0]*Step;  // target vertex for extrapolation
      targetVertex[1]=vk->refIterV[1] + vk->fitV[1]*Step;
@@ -602,7 +600,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
      else                                                      { insideGoodVolume = myPropagator.checkTarget(targetVertex); }
      if(!insideGoodVolume) { return -16; }       //Vertex is definitely outside working volume
      for(it=0; it<NTRK; it++){
-       trk=vk->TrackList[it];
+       trk=vk->TrackList[it].get();
        if(trk->Id < 0){                // pseudo-track from cascade vertex
           trk->fitP[0] =trk->iniP[0]+ Step*(trk->fitP[0]-trk->iniP[0]);
           trk->fitP[1] =trk->iniP[1]+ Step*(trk->fitP[1]-trk->iniP[1]);
@@ -634,7 +632,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
      vk->iniV[1] = vk->fitV[1] = vk->cnstV[1]=0.;
      vk->iniV[2] = vk->fitV[2] = vk->cnstV[2]=0.;
      for(it=0; it<NTRK; it++){
-       trk=vk->TrackList[it];
+       trk=vk->TrackList[it].get();
        if(Step<1.){                          // Step limitation for constraint calculation on next step
          trk->cnstP[0] = trk->iniP[0] =trk->iniP[0]+ Step*(trk->fitP[0]-trk->iniP[0]);
          trk->cnstP[1] = trk->iniP[1] =trk->iniP[1]+ Step*(trk->fitP[1]-trk->iniP[1]);
@@ -660,7 +658,7 @@ int restorePreviousPos(CascadeEvent & cascadeEvent_, std::vector<VKVertex> & SV
   VKTrack * trk; VKTrack * trks; VKVertex * vk; VKVertex * vks;
   
   for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     vk=cascadeEvent_.cascadeVertexList[iv];
+     vk=cascadeEvent_.cascadeVertexList[iv].get();
      vks=&SV[iv];
      NTRK = vk->TrackList.size();            // Number of tracks at vertex
      vk->refIterV[0]=vks->refIterV[0];
@@ -672,8 +670,8 @@ int restorePreviousPos(CascadeEvent & cascadeEvent_, std::vector<VKVertex> & SV
      cfdcopy(vks->fitMom,       vk->fitMom, 3);        //saved Momentum
      cfdcopy(vks->fitCovXYZMom, vk->fitCovXYZMom, 21); //saved XYZMom covariance
      for(it=0; it<NTRK; it++){
-       trk =vk ->TrackList[it];                  //  working track
-       trks=vks->TrackList[it];                // track from saved copy
+       trk =vk ->TrackList[it].get();                  //  working track
+       trks=vks->TrackList[it].get();                // track from saved copy
        if(trk->Id < 0) {     // pseudo-track from cascade vertex
           //trk->fitP[2]=0.;        // reset the pseudo-track parameters
           trk->fitP[0] =(trks->iniP[0]+trks->fitP[0])/2.;
@@ -689,12 +687,11 @@ int restorePreviousPos(CascadeEvent & cascadeEvent_, std::vector<VKVertex> & SV
      }      
   }
   for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-    vk = cascadeEvent_.cascadeVertexList[iv];
+    vk = cascadeEvent_.cascadeVertexList[iv].get();
     if(vk->nextCascadeVrt){
        int pntCnst = vk->ConstraintList.size() - 1;  // pointing constraint is always last in the list
-       VKPointConstraint * pcnst = dynamic_cast<VKPointConstraint*>(vk->ConstraintList[pntCnst]);
-       if(pcnst==0) return -1;
-       pcnst->setTargetVertex(vk->nextCascadeVrt->refIterV);
+       if(vk->ConstraintList[pntCnst]->getType() != VKContraintType::Point) return -1;
+       static_cast< VKPointConstraint* >(vk->ConstraintList[pntCnst].get())->setTargetVertex(vk->nextCascadeVrt->refIterV);
     }
   }
   return 0;
@@ -716,7 +713,7 @@ void getFittedCascade( CascadeEvent & cascadeEvent_,
 //   Split common covariance matrix into pieces
 //
    std::vector< std::vector<double> > cascadeCovarFit;
-   setFittedMatrices(cascadeEvent_.fullCovMatrix, getCascadeNPar(cascadeEvent_), cascadeEvent_.matrixPnt, cascadeCovarFit, cascadeEvent_);
+   setFittedMatrices(cascadeEvent_.fullCovMatrix.get(), getCascadeNPar(cascadeEvent_), cascadeEvent_.matrixPnt, cascadeCovarFit, cascadeEvent_);
 //
    double vBx,vBy,vBz,pp2,pt,invR;
    int iv,it,jt, NTRK, pnt;
@@ -731,11 +728,11 @@ void getFittedCascade( CascadeEvent & cascadeEvent_,
    VectMOM prtMom;
    VKVertex * vk;
    std::vector<VectMOM> momCollector;
-   std::vector<double>  tmpCov(6),Deriv(3);
+   std::vector<double>  tmpCov(6);
 //
    int pntPhys=0;  // Counter for physics cascade parameters 
    for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     vk=cascadeEvent_.cascadeVertexList[iv];
+     vk=cascadeEvent_.cascadeVertexList[iv].get();
      vrtPos.X=vk->refIterV[0] + vk->fitV[0];  // target vertex for extrapolation
      vrtPos.Y=vk->refIterV[1] + vk->fitV[1];
      vrtPos.Z=vk->refIterV[2] + vk->fitV[2];
@@ -752,7 +749,7 @@ void getFittedCascade( CascadeEvent & cascadeEvent_,
      myMagFld.getMagFld(vk->refIterV[0]+vk->fitV[0], vk->refIterV[1]+vk->fitV[1], vk->refIterV[2]+vk->fitV[2],
                                                       vBx,vBy,vBz,(vk->vk_fitterControl).get());
      for(it=0; it<NTRK; it++){
-       std::array<double, 4> pp = getFitParticleMom( vk->TrackList[it], vBz );
+       std::array<double, 4> pp = getFitParticleMom( vk->TrackList[it].get(), vBz );
        prtMom.Px=pp[0]; prtMom.Py=pp[1]; prtMom.Pz=pp[2]; prtMom.E=pp[3]; 
        momCollector.push_back( prtMom );
        if(vk->TrackList[it]->Id >= 0) particleChi2.push_back( vk->TrackList[it]->Chi2 ); //Only real tracks
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx
index ed2a51d486f5df7839dc7012efc2d018ebfa4a03..572cb256f8c45dc64672a9abda8f352fb6511ac0 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx
@@ -17,8 +17,8 @@
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
-extern vkalMagFld      myMagFld;
+extern const vkalPropagator  myPropagator;
+extern const vkalMagFld      myMagFld;
 
 extern int cfdinv(double *, double *, long int );
 extern int cfInv5(double *cov, double *wgt );
@@ -44,7 +44,7 @@ void rescaleVrtErrForPointing( double Div, CascadeEvent & cascadeEvent_ )
    if(Div<1.)Div=1.;
    cascadeEvent_.setSCALE(cascadeEvent_.getSCALE()/Div);
    for(int iv=0; iv<cascadeEvent_.cascadeNV-1; iv++){        // Last vertex must not be touched
-     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv];
+     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv].get();
      for(int i=0; i<6; i++) vk->FVC.covvrt[i] /=Div;
    }
 }
@@ -153,7 +153,7 @@ int fitVertexCascadeScale( VKVertex * vk, double & distToVertex )
 //
   double iv_dstToVrt=0., sum_dstToVrt=0., old_dstToVrt; 
   for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     vk = cascadeEvent_.cascadeVertexList[iv];
+     vk = cascadeEvent_.cascadeVertexList[iv].get();
      vk->passNearVertex=false;
      vk->passWithTrkCov=false;
      IERR = fitVertexCascadeScale( vk, iv_dstToVrt );    if(IERR)return IERR;   //fit 
@@ -181,7 +181,7 @@ int fitVertexCascadeScale( VKVertex * vk, double & distToVertex )
       Chi2Cur=0.;
       sum_dstToVrt=0.;
       for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-        vk = cascadeEvent_.cascadeVertexList[iv];
+        vk = cascadeEvent_.cascadeVertexList[iv].get();
 //
 //Calculate derivatives for "passing near" cnst. Initial vertex position is used for derivatives.
         if(vk->passNearVertex){   
@@ -212,7 +212,7 @@ int fitVertexCascadeScale( VKVertex * vk, double & distToVertex )
   }
   double cnstRemnants=0. ;
   for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     vk = cascadeEvent_.cascadeVertexList[iv];
+     vk = cascadeEvent_.cascadeVertexList[iv].get();
      for(int ii=0; ii<(int)vk->ConstraintList.size();ii++){
         for(int ic=0; ic<(int)vk->ConstraintList[ii]->NCDim; ic++){
            cnstRemnants +=  fabs( vk->ConstraintList[ii]->aa[ic] ); 
@@ -223,17 +223,16 @@ std::cout<<"================================================="<<sum_dstToVrt<<'\
 //  if(sum_dstToVrt>limDstToVrt*(cascadeEvent_.cascadeNV-1) )return -2;        //Pointing is not resolved
 
   long int fullNPar = getCascadeNPar(cascadeEvent_);
-  cascadeEvent_.fullCovMatrix = new double[fullNPar*fullNPar]; 
+  cascadeEvent_.fullCovMatrix = std::make_unique< double[] >(fullNPar*fullNPar);
   for(int im=0; im<fullNPar*fullNPar; im++)cascadeEvent_.fullCovMatrix[im]=0.;
   for(int im=0; im<fullNPar; im++)cascadeEvent_.fullCovMatrix[im*fullNPar + im]=1.;
   int NStart=0;
   cascadeEvent_.matrixPnt.resize(cascadeEvent_.cascadeNV);
-  double * tmpLSide   = new double[fullNPar];
+  auto tmpLSide   = std::make_unique<double[]>(fullNPar);
   for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
     cascadeEvent_.matrixPnt[iv]=NStart;
-    NStart  += FullMCNSTfill( vk, vk->ader, tmpLSide);
+    NStart  += FullMCNSTfill( vk, vk->ader, tmpLSide.get());
   }
-  delete[] tmpLSide; 
 
   return 0;
 }
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx
index fbe3c8b250c34b851f77d9a35c17a4b5f16d40db..a1c066c3dabfe1e0a61f01e29763f52cfdd0b7e2 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx
@@ -10,7 +10,7 @@
 
 namespace Trk {
 
-extern vkalMagFld      myMagFld;
+extern const vkalMagFld      myMagFld;
 
 extern int cfdinv(double *, double *, long int );
 extern int cfInv5(double *cov, double *wgt );
@@ -21,31 +21,37 @@ extern void cfdcopy(double *source, double *target, int);
 
 int initCascadeEngine(CascadeEvent &);
  
-void startCascade( VKVertex * vk)
+VKVertex* startCascade( std::unique_ptr<VKVertex> vk)
 {  
-   vk->vk_fitterControl->getCascadeEvent()->cascadeNV=1;
-   vk->vk_fitterControl->getCascadeEvent()->nearPrmVertex=0;
-   vk->vk_fitterControl->getCascadeEvent()->cascadeVertexList.clear();
-   vk->vk_fitterControl->getCascadeEvent()->cascadeVertexList.push_back(vk);
+   auto ptr = vk.get();
+   ptr->vk_fitterControl->getCascadeEvent()->cascadeNV=1;
+   ptr->vk_fitterControl->getCascadeEvent()->nearPrmVertex=0;
+   ptr->vk_fitterControl->getCascadeEvent()->cascadeVertexList.clear();
+   ptr->vk_fitterControl->getCascadeEvent()->cascadeVertexList.push_back(std::move(vk));
+   return ptr->vk_fitterControl->getCascadeEvent()->cascadeVertexList.back().get();
 }
 
-void addCascadeEntry( VKVertex * vk)
+VKVertex* addCascadeEntry( std::unique_ptr<VKVertex> vk)
 {
-   vk->vk_fitterControl->getCascadeEvent()->cascadeNV++;
-   vk->vk_fitterControl->getCascadeEvent()->cascadeVertexList.push_back(vk);
+   auto ptr = vk.get();
+   ptr->vk_fitterControl->getCascadeEvent()->cascadeNV++;
+   ptr->vk_fitterControl->getCascadeEvent()->cascadeVertexList.push_back(std::move(vk));
+   return ptr->vk_fitterControl->getCascadeEvent()->cascadeVertexList.back().get();
 }
 
-void addCascadeEntry( VKVertex * vk, const std::vector<int> &index)
+VKVertex* addCascadeEntry( std::unique_ptr<VKVertex> vk, const std::vector<int> &index)
 { 
    for(int i=0; i<(int)index.size(); i++){
-     VKVertex * predecessor =  vk->vk_fitterControl->getCascadeEvent()->cascadeVertexList.at(index[i]);
+     VKVertex * predecessor =  vk->vk_fitterControl->getCascadeEvent()->cascadeVertexList.at(index[i]).get();
      if(predecessor->nextCascadeVrt) std::cout <<"VKalVrtCore: ERROR 1 in CASCADE creation !!!"<<'\n';
-     predecessor->nextCascadeVrt = vk;
+     predecessor->nextCascadeVrt = vk.get();
      vk->includedVrt.push_back(predecessor);
    }
 //
-   vk->vk_fitterControl->getCascadeEvent()->cascadeNV++;
-   vk->vk_fitterControl->getCascadeEvent()->cascadeVertexList.push_back(vk);
+   auto ptr = vk.get();
+   ptr->vk_fitterControl->getCascadeEvent()->cascadeNV++;
+   ptr->vk_fitterControl->getCascadeEvent()->cascadeVertexList.push_back(std::move(vk));
+   return ptr->vk_fitterControl->getCascadeEvent()->cascadeVertexList.back().get();
 }
 
 
@@ -63,7 +69,7 @@ void addCascadeEntry( VKVertex * vk, const std::vector<int> &index)
 //  vertexDefinition[iv][it]   - list of real track to vertex associacion
 //  cascadeDefinition[iv][ipv] - for given vertex IV the list of previous vertices pointing to it.
 // 
-int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
+int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
                    const std::vector< std::vector<int> > &vertexDefinition,
                    const std::vector< std::vector<int> > &cascadeDefinition,
 		   double definedCnstAccuracy=1.e-4)
@@ -80,13 +86,12 @@ int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich,
     double xyz[3]={0.}; 
     double tmp[15]={0.}; 
     double tmpWgt[15],out[3];
-    double vBx,vBy,vBz;
-    VKVertex * VRT; 
+    double vBx,vBy,vBz; 
     VKTrack  * trk;
     int vEstimDone=0, nTrkTot=0;
 
     for(iv=0; iv<NV; iv++){ 
-      VRT = new VKVertex(FitCONTROL); 
+      auto VRT = std::make_unique< VKVertex >(FitCONTROL); 
       VRT->setRefV(xyz);                               //ref point
       VRT->setRefIterV(xyz);                           //iteration ref. point
       VRT->setIniV(xyz); VRT->setCnstV(xyz);           // initial guess. 0 of course.
@@ -96,18 +101,18 @@ int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich,
         tk=vertexDefinition[iv][it];
         if( tk >= NTRK ) {
           std::cout<<" WRONG INPUT!!!"<<'\n';
-          delete VRT; return -1;
+          return -1;
 	} 
-        VRT->TrackList.push_back(new VKTrack(tk, &inp_Trk5[tk*5], &inp_CovTrk5[tk*15] , VRT, wm[tk]));
-        VRT->tmpArr.push_back(new TWRK());
-        trk = VRT->TrackList[it];
+        VRT->TrackList.emplace_back(new VKTrack(tk, &inp_Trk5[tk*5], &inp_CovTrk5[tk*15] , VRT.get(), wm[tk]));
+        VRT->tmpArr.emplace_back(new TWRK());
+        trk = VRT->TrackList[it].get();
         trk->Charge = ich[tk];
         trk->iniP[0]=trk->cnstP[0]=trk->fitP[0]=inp_Trk5[tk*5+2];   //initial guess
         trk->iniP[1]=trk->cnstP[1]=trk->fitP[1]=inp_Trk5[tk*5+3];
         trk->iniP[2]=trk->cnstP[2]=trk->fitP[2]=inp_Trk5[tk*5+4];
 	IERR=cfInv5(&inp_CovTrk5[tk*15], tmpWgt);  
 	if (IERR) IERR=cfdinv(&inp_CovTrk5[tk*15], tmpWgt, 5); 
-	if (IERR) { delete VRT; return  -1; }
+	if (IERR) { return  -1; }
         trk->setCurrent(&inp_Trk5[tk*5],tmpWgt);
         arr[it*5]=inp_Trk5[tk*5];arr[it*5+1]=inp_Trk5[tk*5+1];arr[it*5+2]=inp_Trk5[tk*5+2];
         arr[it*5+3]=inp_Trk5[tk*5+3];arr[it*5+4]=inp_Trk5[tk*5+4];
@@ -124,17 +129,17 @@ int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich,
         VRT->setRefIterV(aVrt);                       //iteration ref. point
       }
       if(iv==0){                           // start cascade creation
-         startCascade( VRT );
+         startCascade( std::move(VRT) );
          continue;
       } 
       int includeNV=cascadeDefinition[iv].size();
       if(!includeNV) {                     // no predecessors
-        addCascadeEntry( VRT );
+        addCascadeEntry( std::move(VRT) );
       }else{
-        addCascadeEntry( VRT, cascadeDefinition[iv]);
+        auto vrttemp = addCascadeEntry( std::move(VRT), cascadeDefinition[iv]);
         for (it=0; it<includeNV ; it++) {             // tracks created out of predecessing vertices
-          VRT->TrackList.push_back(new VKTrack(-999, tmp, tmp , VRT, 0.));
-          VRT->tmpArr.push_back(new TWRK());
+          vrttemp->TrackList.emplace_back(new VKTrack(-999, tmp, tmp , vrttemp, 0.));
+          vrttemp->tmpArr.emplace_back(new TWRK());
         }
       }        
     }
@@ -143,10 +148,10 @@ int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich,
     if(vEstimDone){ 
       IERR = translateToFittedPos(*(FitCONTROL.getCascadeEvent()),1.); if(IERR)return IERR;
       for( iv=0; iv<FitCONTROL.getCascadeEvent()->cascadeNV; iv++){
-        VRT=FitCONTROL.getCascadeEvent()->cascadeVertexList[iv];
+        auto VRT=FitCONTROL.getCascadeEvent()->cascadeVertexList[iv].get();
         int NTv = VRT->TrackList.size();            // Number of tracks at vertex
         for(it=0; it<NTv; it++){
-          trk=VRT->TrackList[it];
+          trk=VRT->TrackList[it].get();
           if(trk->Id < 0) continue;               // pseudo-track from cascade vertex
           trk->cnstP[0] = trk->iniP[0] = trk->fitP[0] = trk->Perig[2];
           trk->cnstP[1] = trk->iniP[1] = trk->fitP[1] = trk->Perig[3];
@@ -195,7 +200,7 @@ int initCascadeEngine(CascadeEvent & cascadeEvent_)
 // ----------------  Fisrt fit without any constraints at all, just vertices
   for( i=0; i<4; i++){
     for(iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-       VRT = cascadeEvent_.cascadeVertexList[iv];
+       VRT = cascadeEvent_.cascadeVertexList[iv].get();
        IERR = fitVertexCascade( VRT, 0);     if(IERR)return IERR;   //fit 
        IERR = setVTrackMass(VRT);            if(IERR)return IERR;   //mass of combined particle
        if(VRT->includedVrt.size()){  // Save fitted vertex as target for "pass near" constraint in previous vertex
@@ -220,9 +225,9 @@ int setCascadeMassConstraint(CascadeEvent & cascadeEvent_, long int IV, double M
 {
     if(IV>cascadeEvent_.cascadeNV-1) return -1;  //error in format
     if(IV<0)                         return -1;
-    VKVertex * vk =  cascadeEvent_.cascadeVertexList[IV];  //target vertex
+    VKVertex * vk =  cascadeEvent_.cascadeVertexList[IV].get();  //target vertex
     int NTRK = vk->TrackList.size();
-    vk->ConstraintList.push_back(new VKMassConstraint( NTRK, Mass, vk));
+    vk->ConstraintList.emplace_back(new VKMassConstraint( NTRK, Mass, vk));
     return 0;
 }
 //-----------------------------------------
@@ -236,7 +241,7 @@ int setCascadeMassConstraint(CascadeEvent & cascadeEvent_, long int IV, std::vec
     int it;
     if(IV>cascadeEvent_.cascadeNV-1) return -1;  //error in format
     if(IV<0)                         return -1;
-    VKVertex * vk =  cascadeEvent_.cascadeVertexList[IV];  //target vertex
+    VKVertex * vk =  cascadeEvent_.cascadeVertexList[IV].get();  //target vertex
     int NTRK = vk->TrackList.size();             //tracks+pseudotracks
     int nRealTrk=0;                              //number of real tracks
     for(it=0; it<(int)trkInVrt.size(); it++) if(vk->TrackList[it]->Id >= 0) nRealTrk++;
@@ -259,7 +264,7 @@ int setCascadeMassConstraint(CascadeEvent & cascadeEvent_, long int IV, std::vec
        tmpIndex.push_back(pseudoInVrt[it]+nRealTrk);
     }
 
-    vk->ConstraintList.push_back(new VKMassConstraint( NTRK, Mass, tmpIndex, vk));
+    vk->ConstraintList.emplace_back(new VKMassConstraint( NTRK, Mass, tmpIndex, vk));
     return 0; 
 }
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx
index bfd91e3f557a50efb1c75f25ff63f6557b04ffd2..4af902d65f05035eba1abe7e1fd3f526b77871ad 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx
@@ -10,17 +10,17 @@
 
 namespace Trk {
 
-extern vkalMagFld      myMagFld;
+extern const vkalMagFld      myMagFld;
 
-extern std::array<double, 4> getIniParticleMom( VKTrack *, VKTrack *);
-extern std::array<double, 4> getIniParticleMom( VKTrack *, double );
+extern std::array<double, 4> getIniParticleMom( const VKTrack *, const VKTrack *);
+extern std::array<double, 4> getIniParticleMom( const VKTrack *, double );
 
 //  Add to system matrix the derivatives due to pseudotrack constraints
 //
 //
 int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEvent & cascadeEvent_)
 {
-   VKVertex * vk=0;
+
    int iv,it,ivnext;
    auto DerivC = std::make_unique<double[]>(NPar);
    auto DerivP = std::make_unique<double[]>(NPar);
@@ -28,7 +28,7 @@ int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEve
 //
    std::vector<double> vMagFld; double vBx,vBy,vBz;
    for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-      vk = cascadeEvent_.cascadeVertexList[iv];
+      VKVertex * vk = cascadeEvent_.cascadeVertexList[iv].get();
       myMagFld.getMagFld(vk->refIterV[0]+vk->iniV[0], vk->refIterV[1]+vk->iniV[1], vk->refIterV[2]+vk->iniV[2],vBx,vBy,vBz,(vk->vk_fitterControl).get());
       vMagFld.push_back(vBz);  // fill mag.fields for all vertices
    }
@@ -37,10 +37,10 @@ int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEve
       int indCombTrk=-1;
       int iniPosTrk=0;                              /* Start of track part of vertex in global matrix */
       int posCombTrk=0;                             /* Conbined track position in global matrix */
-      vk = cascadeEvent_.cascadeVertexList[iv];
+      VKVertex* vk = cascadeEvent_.cascadeVertexList[iv].get();
       if(vk->nextCascadeVrt){                           //next vertex exists
 	ivnext=-1;                                      //index of next vertex in common structure
-        for(int ivt=0;ivt<cascadeEvent_.cascadeNV;ivt++)if(vk->nextCascadeVrt==cascadeEvent_.cascadeVertexList[ivt])ivnext=ivt; 
+        for(int ivt=0;ivt<cascadeEvent_.cascadeNV;ivt++)if(vk->nextCascadeVrt==cascadeEvent_.cascadeVertexList[ivt].get())ivnext=ivt; 
         if(ivnext<0){return -1;};  //error in cascade
 //
         int NV=vk->nextCascadeVrt->includedVrt.size();
@@ -60,7 +60,7 @@ int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEve
         DerivC[posCombTrk+2]=-1.;
         DerivT[posCombTrk+0]=-1.;
         DerivP[posCombTrk+1]=-1.;
-        std::array<double, 4> ppsum = getIniParticleMom( vk->nextCascadeVrt->TrackList[indCombTrk], vMagFld[ivnext] ); // INI for pseudo
+        std::array<double, 4> ppsum = getIniParticleMom( vk->nextCascadeVrt->TrackList[indCombTrk].get(), vMagFld[ivnext] ); // INI for pseudo
 	double csum=vk->nextCascadeVrt->TrackList[indCombTrk]->iniP[2];                                              // INI for pseudo
         double ptsum=sqrt(ppsum[0]*ppsum[0] + ppsum[1]*ppsum[1]);
         double sinth2sum=(ppsum[0]*ppsum[0] + ppsum[1]*ppsum[1])/(ppsum[0]*ppsum[0] + ppsum[1]*ppsum[1] + ppsum[2]*ppsum[2]);
@@ -69,7 +69,7 @@ int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEve
 // Momenta+Derivatives of tracks in vertex itself
 	double tpx,tpy; tpx=tpy=0;
         for(it=0; it<(int)vk->TrackList.size(); it++){
-          std::array<double, 4> pp =    getIniParticleMom( vk->TrackList[it], vMagFld[iv]);
+          std::array<double, 4> pp =    getIniParticleMom( vk->TrackList[it].get(), vMagFld[iv]);
 	  double curv=vk->TrackList[it]->iniP[2];
           double pt=sqrt(pp[0]*pp[0] + pp[1]*pp[1]);
           double cth=pp[2]/pt;
@@ -99,7 +99,7 @@ int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEve
         for(it=0; it<NPar; it++) fullMtx[ (NPar-3*(cascadeEvent_.cascadeNV-1)+3*iv  ) + it*NPar] = DerivT[it];
         for(it=0; it<NPar; it++) fullMtx[ (NPar-3*(cascadeEvent_.cascadeNV-1)+3*iv+1) + it*NPar] = DerivP[it];
         for(it=0; it<NPar; it++) fullMtx[ (NPar-3*(cascadeEvent_.cascadeNV-1)+3*iv+2) + it*NPar] = DerivC[it];
-        VKTrack* cmbt=vk->nextCascadeVrt->TrackList[indCombTrk];
+        VKTrack* cmbt=vk->nextCascadeVrt->TrackList[indCombTrk].get();
         LSide[ NPar-3*(cascadeEvent_.cascadeNV-1)+3*iv  ] = cmbt->iniP[0]-cmbt->Perig[2];
         LSide[ NPar-3*(cascadeEvent_.cascadeNV-1)+3*iv+1] = cmbt->iniP[1]-cmbt->Perig[3];
         LSide[ NPar-3*(cascadeEvent_.cascadeNV-1)+3*iv+2] = cmbt->iniP[2]-cmbt->Perig[4];
@@ -122,7 +122,7 @@ VKTrack * getCombinedVTrack(VKVertex * vk)
     if(itv<0) return 0;                               // Not found in list
 
     int totNT = vk->nextCascadeVrt->TrackList.size();
-    return vk->nextCascadeVrt->TrackList[totNT - NV + itv]; // pointer to combined track in next vertex
+    return vk->nextCascadeVrt->TrackList[totNT - NV + itv].get(); // pointer to combined track in next vertex
 }
 
 
@@ -140,7 +140,7 @@ int getCascadeNPar(CascadeEvent & cascadeEvent_, int Type=0)
   int NTrk=0;
   int NCnst=0;
   for( int iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv];
+     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv].get();
      NTrk += vk->TrackList.size();
      for(int ic=0; ic<(int)vk->ConstraintList.size();ic++) NCnst += vk->ConstraintList[ic]->NCDim;
   }
@@ -158,11 +158,11 @@ void setFittedParameters(double * result, std::vector<int> & matrixPnt, CascadeE
    int iv,it,Pnt;
    double Chi2=0.;
    for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv];
+     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv].get();
      Pnt=matrixPnt[iv];    // start of vertex parameters
      vk->fitV[0]=result[Pnt]; vk->fitV[1]=result[Pnt+1]; vk->fitV[2]=result[Pnt+2];
      for( it=0; it<(int)vk->TrackList.size(); it++){
-        VKTrack * trk=vk->TrackList[it];
+        VKTrack * trk=vk->TrackList[it].get();
         trk->fitP[0]=trk->iniP[0]+result[Pnt+3+it*3 + 0];
         trk->fitP[1]=trk->iniP[1]+result[Pnt+3+it*3 + 1];
         trk->fitP[2]=trk->iniP[2]+result[Pnt+3+it*3 + 2];
@@ -179,7 +179,7 @@ void setFittedMatrices(double * COVFIT, long int MATRIXSIZE,
 {
    int iv, Pnt, ic, ir, vrtMtxSize, count;
    for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv];
+     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv].get();
      Pnt=matrixPnt[iv];    // start of vertex parameters
      vrtMtxSize=3+vk->TrackList.size()*3;         //size of matrix for given vertex
      std::vector<double> Res(vrtMtxSize*(vrtMtxSize+1)/2);
@@ -217,10 +217,10 @@ void addCrossVertexDeriv(CascadeEvent & cascadeEvent_, double * ader, long int M
    //for( iv=0; iv<cascadeEvent_.cascadeNV; iv++)std::cout<<matrixPnt[iv]<<", ";std::cout<<'\n';
 
    for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
-     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv];
+     VKVertex *vk = cascadeEvent_.cascadeVertexList[iv].get();
      if(!vk->nextCascadeVrt)continue;                        //no pointing
      for( ivn=iv; ivn<cascadeEvent_.cascadeNV; ivn++){
-        if(vk->nextCascadeVrt == cascadeEvent_.cascadeVertexList[ivn]) break;    //vertex found
+        if(vk->nextCascadeVrt == cascadeEvent_.cascadeVertexList[ivn].get()) break;    //vertex found
      }
      if( ivn == cascadeEvent_.cascadeNV ) continue;  // no found vertex
 //
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx
index 6ca6fce25cbbab1372c7c1302a821ccda2eeea07..ef1cba35d32224202425a4e5ce51dd780f925bca 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx
@@ -18,7 +18,7 @@ namespace Trk {
 //      cnstV and cnstP values are used!!!
 //-----------------------------------------------
 
-extern std::array<double, 4> getCnstParticleMom( VKTrack *, VKVertex * );
+extern std::array<double, 4> getCnstParticleMom( const VKTrack *, const VKVertex * );
 
 void  calcMassConstraint( VKMassConstraint * cnst )
 {
@@ -26,14 +26,14 @@ void  calcMassConstraint( VKMassConstraint * cnst )
     double ptot[4]={0.,0.,0.,0.};  
     double cth, invR, pp2, pt; 
     VKConstraintBase * base_cnst = (VKConstraintBase*) cnst;
-    VKVertex * vk=cnst->getOriginVertex();
-    std::vector<int> usedParticles=cnst->getUsedParticles();
+    const VKVertex * vk=cnst->getOriginVertex();
+    const std::vector<int> &usedParticles=cnst->getUsedParticles();
     int usedNTRK = usedParticles.size();
     VKTrack * trk;
     std::vector< std::array<double, 4> > pp(usedNTRK);
     for( itc=0; itc<usedNTRK; itc++){
       it = usedParticles[itc];
-      trk = vk->TrackList.at(it);
+      trk = vk->TrackList.at(it).get();
       pp[itc]=getCnstParticleMom( trk , vk);
       ptot[0] += pp[itc][0];    
       ptot[1] += pp[itc][1];    
@@ -65,7 +65,7 @@ void  calcMassConstraint( VKMassConstraint * cnst )
 //Derivatives               Here pp[][3] - particle energy, pp[][4] - squared particle mom
     for( itc=0; itc<usedNTRK; itc++){
       it = usedParticles[itc];
-      trk  = vk->TrackList.at(it);
+      trk  = vk->TrackList.at(it).get();
       invR = trk->cnstP[2];
       cth  = 1. / tan( trk->cnstP[0] );
       pt   = sqrt(pp[itc][0]*pp[itc][0] + pp[itc][1]*pp[itc][1]);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx
index 9423613174aeee3a2888bef6dfda14d0932d06e8..2b758225e5a18d67ff491128f764e250cfccace5 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx
@@ -17,13 +17,13 @@ namespace Trk {
 //      cnstV and cnstP values are used!!!
 //-----------------------------------------------
 extern void cfnewp(long int*, double*, double*, double*, double*, double*);
-extern std::array<double, 4> getCnstParticleMom( VKTrack *, double );
-extern vkalMagFld      myMagFld;
+extern std::array<double, 4> getCnstParticleMom( const VKTrack *, double );
+extern const vkalMagFld      myMagFld;
 
 void  calcPointConstraint( VKPointConstraint * cnst )
 {
     VKConstraintBase * base_cnst = (VKConstraintBase*) cnst;
-    VKVertex * vk=cnst->getOriginVertex();
+    const VKVertex * vk=cnst->getOriginVertex();
 //
 //  Magnetic field in fitted vertex position
     double cnstPos[3];
@@ -37,10 +37,10 @@ void  calcPointConstraint( VKPointConstraint * cnst )
     int it,Charge=0;
     double ptot[4]={0.,0.,0.,0.};  
     int NTRK = vk->TrackList.size();
-    VKTrack * trk;
+    
     std::vector< std::array<double, 4> > pp(NTRK);
     for( it=0; it<NTRK; it++){
-      trk = vk->TrackList[it];
+      VKTrack * trk = vk->TrackList[it].get();
       pp[it]=getCnstParticleMom( trk, localField );
       ptot[0] += pp[it][0];    
       ptot[1] += pp[it][1];    
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx
index 3c90024bfa621a44c51766e3703b9b7c3d8ff871..3975e7760fd6c8f9911bf3fda535947c73b4649b 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx
@@ -21,7 +21,7 @@ namespace Trk {
 void calcPhiConstraint( VKPhiConstraint * cnst)
 {
     VKConstraintBase * base_cnst = (VKConstraintBase*) cnst;
-    VKVertex * vk=cnst->getOriginVertex();
+    const VKVertex * vk=cnst->getOriginVertex();
     int NTRK = vk->TrackList.size();
     int i,j;
     double Scale=1.;   // Scaling for better precision VK 28.03.2011 Wrong for error matrix!!! Should always be 1.!!!
@@ -60,7 +60,7 @@ void calcPhiConstraint( VKPhiConstraint * cnst)
 void calcThetaConstraint( VKThetaConstraint * cnst)
 {
     VKConstraintBase * base_cnst = (VKConstraintBase*) cnst;
-    VKVertex * vk=cnst->getOriginVertex();
+    const VKVertex * vk=cnst->getOriginVertex();
     int NTRK = vk->TrackList.size();
     int i,j;
     double Scale=1.;   // Scaling for better precision  VK 28.03.2011 Wrong for error matrix!!! Should always be 1.!!!
@@ -98,7 +98,7 @@ void calcThetaConstraint( VKThetaConstraint * cnst)
 void calcPlaneConstraint( VKPlaneConstraint * cnst)
 {
     VKConstraintBase * base_cnst = (VKConstraintBase*) cnst;
-    VKVertex * vk=cnst->getOriginVertex();
+    const VKVertex * vk=cnst->getOriginVertex();
     int NTRK = vk->TrackList.size();
     double curV[3] = {vk->refIterV[0]+vk->cnstV[0], vk->refIterV[1]+vk->cnstV[1],vk->refIterV[2]+vk->cnstV[2]};
  
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PGraph.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PGraph.cxx
index 34358bffa26c4aafc5d8fe55f8bd299b9e65094a..e13abc6c44db5f02f95bc1175bd7950945fbc0a5 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PGraph.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PGraph.cxx
@@ -1,31 +1,27 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+#include "TrkVKalVrtCore/PGraph.h"
+
+
 namespace Trk {
 
-int pgraphm_(long int *weit, long int *edges, long int *nodes, 
-	long int *set, long int *nptr, long int *nth)
+int PGraph::pgraphm_(long int *weit, long int *edges, long int *nodes, 
+	long int *set, long int *nptr, long int *nth) noexcept
 {
 
     /* Builtin functions */
 //  void s_stop(char *, ftnlen);
 
     /* Local variables */
-    static short int teit[999000]	/* was [2][499500] */, sett[499500];
-    static long int vset[1000], wset[1000];
-    static long int tabnr;
-    static long int lteit[1000], lweit, lsett[1000];
-    static long int lvset, lwset,choice;
-
     long int node=0, maxl,i__1;
     long int k1,k2,ind,nlink[1000];
     long int i__, k, l, ndmap[1000];
 
-    void trevni_(long int *, long int *, long int *, long int *, long int *, long int *);
 
 
-#define teit_ref(a_1,a_2) teit[(a_2)*2 + a_1 - 3]
+
+#define teit_ref(a_1,a_2) m_teit[(a_2)*2 + a_1 - 3]
 #define weit_ref(a_1,a_2) weit[(a_2)*2 + a_1]
 
 
@@ -89,7 +85,7 @@ int pgraphm_(long int *weit, long int *edges, long int *nodes,
 	goto L999;
     }
     if (*nptr > 0) {
-	switch (choice) {
+	switch (m_choice) {
 	    case 1:  goto L10;
 	    case 2:  goto L20;
 	    case 3:  goto L999;
@@ -98,12 +94,12 @@ int pgraphm_(long int *weit, long int *edges, long int *nodes,
     if (*nodes == 1 || *edges == 0) {
 	goto L900;
     }
-    lweit = *edges;
-    tabnr = 1;
-    lwset = 0;
-    lvset = 0;
-    lteit[0] = 0;
-    lsett[0] = 0;
+    m_lweit = *edges;
+    m_tabnr = 1;
+    m_lwset = 0;
+    m_lvset = 0;
+    m_lteit[0] = 0;
+    m_lsett[0] = 0;
 
 /* Add a node to the VSET list. Select first NODE with the largest */
 /* number of links. This can be time-consuming, time about NODES^3. */
@@ -118,7 +114,7 @@ L888:
 /* L61: */
 	nlink[i__ - 1] = 0;
     }
-    i__1 = lweit;
+    i__1 = m_lweit;
     for (i__ = 1; i__ <= i__1; ++i__) {
 	k = weit_ref(1, i__);
 	l = weit_ref(2, i__);
@@ -141,8 +137,8 @@ L888:
 
 /* ***   STEP2 */
 
-    ++lvset;
-    vset[lvset - 1] = node;
+    ++m_lvset;
+    m_vset[m_lvset - 1] = node;
 
 /* ***   STEP 3 + 4 */
 /* WSET() - list of nodes connected with selected NODE. */
@@ -154,18 +150,18 @@ L888:
 
 /*      K1 = 0 */
 /*      K2 = 0 */
-    ind = lteit[tabnr - 1];
-    i__1 = lweit;
+    ind = m_lteit[m_tabnr - 1];
+    i__1 = m_lweit;
     for (i__ = 1; i__ <= i__1; ++i__) {
 	k = weit_ref(1, i__);
 	l = weit_ref(2, i__);
 	if (k == node) {
-	    ++lwset;
-	    wset[lwset - 1] = l;
+	    ++m_lwset;
+	    m_wset[m_lwset - 1] = l;
 /*         K2 = K2 + 1 */
 	} else if (l == node) {
-	    ++lwset;
-	    wset[lwset - 1] = k;
+	    ++m_lwset;
+	    m_wset[m_lwset - 1] = k;
 /*         K2 = K2 + 1 */
 	} else {
 	    ++ind;
@@ -175,8 +171,8 @@ L888:
 	}
 /* L2: */
     }
-    k1 = ind - lteit[tabnr - 1];
-    k2 = lweit - k1;
+    k1 = ind - m_lteit[m_tabnr - 1];
+    k2 = m_lweit - k1;
 /* --   Note that IND.GT.EDGES is possible. */
     if (ind > 499500) {
 	return 1;
@@ -186,11 +182,11 @@ L888:
 	goto L300;
     }
 /* -- */
-    ind = lsett[tabnr - 1];
-    i__1 = lvset;
+    ind = m_lsett[m_tabnr - 1];
+    i__1 = m_lvset;
     for (i__ = 1; i__ <= i__1; ++i__) {
 	++ind;
-	sett[ind - 1] = (short int) vset[i__ - 1];
+	m_sett[ind - 1] = (short int) m_vset[i__ - 1];
 /* L51: */
     }
     if (ind > 499500) {
@@ -200,13 +196,13 @@ L888:
 
 /* ***   STEP 5 */
 
-    ++tabnr;
-    if (tabnr > *nodes) {
+    ++m_tabnr;
+    if (m_tabnr > *nodes) {
 	return 3;
 //	s_stop("PGRAPH: LSETT stack overflow", 28L);
     }
-    lsett[tabnr - 1] = lsett[tabnr - 2] + lvset;
-    lteit[tabnr - 1] = lteit[tabnr - 2] + k1;
+    m_lsett[m_tabnr - 1] = m_lsett[m_tabnr - 2] + m_lvset;
+    m_lteit[m_tabnr - 1] = m_lteit[m_tabnr - 2] + k1;
 
 /* Replace WEIT by the set of edges which are NOT connected with nodes */
 /* in WSET (and in VSET too). If there are no such edges, then WSET is */
@@ -232,14 +228,14 @@ L888:
 /* L26: */
 	ndmap[i__ - 1] = 0;
     }
-    i__1 = lwset;
-    for (i__ = lwset - k2 + 1; i__ <= i__1; ++i__) {
+    i__1 = m_lwset;
+    for (i__ = m_lwset - k2 + 1; i__ <= i__1; ++i__) {
 /* L27: */
-	ndmap[wset[i__ - 1] - 1] = 1;
+	ndmap[m_wset[i__ - 1] - 1] = 1;
     }
     k1 = 0;
-    i__1 = lteit[tabnr - 1];
-    for (i__ = lteit[tabnr - 2] + 1; i__ <= i__1; ++i__) {
+    i__1 = m_lteit[m_tabnr - 1];
+    for (i__ = m_lteit[m_tabnr - 2] + 1; i__ <= i__1; ++i__) {
 	k = teit_ref(1, i__);
 	l = teit_ref(2, i__);
 	if (ndmap[k - 1] + ndmap[l - 1] == 0) {
@@ -256,13 +252,13 @@ L888:
 	goto L10;
     }
 /* ---- */
-    i__1 = lwset;
+    i__1 = m_lwset;
     for (i__ = 1; i__ <= i__1; ++i__) {
 /* L50: */
-	vset[i__ - 1] = wset[i__ - 1];
+	m_vset[i__ - 1] = m_wset[i__ - 1];
     }
-    lvset = lwset;
-    lweit = k1;
+    m_lvset = m_lwset;
+    m_lweit = k1;
     goto L888;
 
 /*  THE STATEMENTS 300 ... 20 RETURN THE SOLUTIONS IN V AND W. */
@@ -273,35 +269,35 @@ L888:
 /** Do not returt set complement; do not return solutions shorter than NTH.*/
 
 L300:
-    if (*nodes - lvset < *nth) {
+    if (*nodes - m_lvset < *nth) {
 	goto L10;
     }
-    trevni_(vset, &lvset, &set[1], nodes, nptr, ndmap);
+    trevni_(m_vset, &m_lvset, &set[1], nodes, nptr, ndmap);
 /*     DO 41 I = 1,LVSET ; NPTR = NPTR + 1 ; 41 SET(NPTR) = VSET(I) */
-    choice = 1;
+    m_choice = 1;
     return 0;
 
 L10:
-    if (*nodes - lwset < *nth) {
+    if (*nodes - m_lwset < *nth) {
 	goto L20;
     }
-    trevni_(wset, &lwset, &set[1], nodes, nptr, ndmap);
+    trevni_(m_wset, &m_lwset, &set[1], nodes, nptr, ndmap);
 /*     DO 40 I = 1,LWSET ; NPTR = NPTR + 1 ; 40 SET(NPTR) = WSET(I) */
-    choice = 2;
+    m_choice = 2;
     return 0;
 
 /* ***   STEP 6. Go back one level, exit if we are at the first level. */
 
 L20:
-    if (tabnr == 1) {
+    if (m_tabnr == 1) {
 	goto L999;
     }
-    lweit = lteit[tabnr - 1] - lteit[tabnr - 2];
-    lwset = lsett[tabnr - 1] - lsett[tabnr - 2];
-    lvset = lwset;
-    --tabnr;
-    ind = lteit[tabnr - 1];
-    i__1 = lweit;
+    m_lweit = m_lteit[m_tabnr - 1] - m_lteit[m_tabnr - 2];
+    m_lwset = m_lsett[m_tabnr - 1] - m_lsett[m_tabnr - 2];
+    m_lvset = m_lwset;
+    --m_tabnr;
+    ind = m_lteit[m_tabnr - 1];
+    i__1 = m_lweit;
     for (i__ = 1; i__ <= i__1; ++i__) {
 	++ind;
 	weit_ref(1, i__) = teit_ref(1, ind);
@@ -314,13 +310,13 @@ L20:
 /*       NLINK(L) = NLINK(L) + 1 */
 /* L21: */
     }
-    ind = lsett[tabnr - 1];
-    i__1 = lwset;
+    ind = m_lsett[m_tabnr - 1];
+    i__1 = m_lwset;
     for (i__ = 1; i__ <= i__1; ++i__) {
 	++ind;
-	l = sett[ind - 1];
-	wset[i__ - 1] = l;
-	vset[i__ - 1] = l;
+	l = m_sett[ind - 1];
+	m_wset[i__ - 1] = l;
+	m_vset[i__ - 1] = l;
 /* L22: */
     }
     goto L888;
@@ -332,7 +328,7 @@ L900:
 	set[i__] = i__;
     }
     *nptr = *nodes;
-    choice = 3;
+    m_choice = 3;
     return 0;
 /* ---- */
 L999:
@@ -344,8 +340,8 @@ L999:
 #undef teit_ref
 
 
- void trevni_(long int *from, long int *length, long int *to, 
-	long int *maxv, long int *newlng, long int *work)
+ void PGraph::trevni_(long int *from, long int *length, long int *to, 
+	long int *maxv, long int *newlng, long int *work) noexcept
 {
      long int i__1, i__, k;
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx
index 63daf452669e84bc6e58daba16387b54f96568c0..65d20289a89683c5f6860649350c864d0ca25652 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include <math.h>
 #include "TrkVKalVrtCore/ForCFT.h"
 #include "TrkVKalVrtCore/CommonPars.h"
@@ -9,7 +9,6 @@
 
 namespace Trk {
 
-ForCFT      forcft_1;
 
 /*------------------------------------------------------------------------------*/
 /* Package for vertex fit with constraints 					*/
@@ -41,7 +40,7 @@ ForCFT      forcft_1;
 /*   STPCNV :   track momentum from track (theta,phi,1/r) at vertex       	*/
 /*------------------------------------------------------------------------------*/
 
-void prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double  *vrt, double  *vrte)
+void ForCFT::prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double  *vrt, double  *vrte) noexcept
 {
     long int i__1;
     double   summ;
@@ -76,108 +75,105 @@ void prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double
 /*										*/
 /*------------------------------------------------------------------------------*/
 
-    forcft_1.localbmag = (*bmag);
-    forcft_1.nmcnst = 0;
-    for (int i=0; i<8; ++i) forcft_1.wmfit[i] = -10000.;
+    localbmag = (*bmag);
+    nmcnst = 0;
+    for (int i=0; i<8; ++i) wmfit[i] = -10000.;
     summ = 0.;
     i__1 = (*ntrk)<vkalNTrkM ? (*ntrk): vkalNTrkM;
     for (int i=0; i<i__1; ++i) {
-	forcft_1.wm[i] =  fabs(wm[i]);
+	wm[i] =  fabs(wm[i]);
 	summ += wm[i];
     }
     if ((*wmfit) > summ) {
 /*  Set general mass constraint based on ALL tracks */
-	forcft_1.nmcnst = 1;
+	nmcnst = 1;
 	for (int i = 0; i < vkalNTrkM; ++i) {
-	    forcft_1.indtrkmc[0][i] = 0;
-	    if (i < (*ntrk)) {forcft_1.indtrkmc[0][i] = 1;}
+	    indtrkmc[0][i] = 0;
+	    if (i < (*ntrk)) {indtrkmc[0][i] = 1;}
 	}
-	forcft_1.wmfit[0] = (*wmfit);
+	wmfit[0] = (*wmfit);
     }
 
-    forcft_1.vrt[0]    = vrt[0];
-    forcft_1.vrt[1]    = vrt[1];
-    forcft_1.vrt[2]    = vrt[2];
-    forcft_1.covvrt[0] = vrte[0];
-    forcft_1.covvrt[1] = vrte[1];
-    forcft_1.covvrt[2] = vrte[2];
-    forcft_1.covvrt[3] = vrte[3];
-    forcft_1.covvrt[4] = vrte[4];
-    forcft_1.covvrt[5] = vrte[5];
-    forcft_1.irob = 0;
-    forcft_1.IterationNumber    = 50;
-    forcft_1.IterationPrecision = 1.e-3;
-    for (int i = 0; i < vkalNTrkM; ++i) forcft_1.robres[i]=1.; //Safety
+    this->vrt[0] = vrt[0];
+    this->vrt[1] = vrt[1];
+    this->vrt[2] = vrt[2];
+    this->covvrt[0] = vrte[0];
+    this->covvrt[1] = vrte[1];
+    this->covvrt[2] = vrte[2];
+    this->covvrt[3] = vrte[3];
+    this->covvrt[4] = vrte[4];
+    this->covvrt[5] = vrte[5];
+    irob = 0;
+    IterationNumber    = 50;
+    IterationPrecision = 1.e-3;
+    for (int i = 0; i < vkalNTrkM; ++i) robres[i]=1.; //Safety
 //
 // Reset all constraints
 //
-forcft_1.useMassCnst = 0;
-forcft_1.usePhiCnst = 0;
-forcft_1.useThetaCnst = 0;
-forcft_1.useAprioriVrt = 0;
-forcft_1.usePointingCnst = 0;
-forcft_1.usePassNear = 0;
+useMassCnst = 0;
+usePhiCnst = 0;
+useThetaCnst = 0;
+useAprioriVrt = 0;
+usePointingCnst = 0;
+usePassNear = 0;
 //forcft_1.usePlaneCnst = 0;   //Used only on demand=> must NOT be reset here!!!
 } 
 
 
-void vksetIterationNum(long int Iter)
+void ForCFT::vksetIterationNum(long int Iter) noexcept
 {
     if (Iter<3)   Iter=3;
     if (Iter>100) Iter=100;
-    forcft_1.IterationNumber    = Iter;
+    IterationNumber    = Iter;
 }
 
-void vksetIterationPrec(double Prec)
+void ForCFT::vksetIterationPrec(double Prec) noexcept
 {
     if (Prec<1.e-5)   Prec=1.e-5;
     if (Prec>1.e-1)   Prec=1.e-1;
-    forcft_1.IterationPrecision = Prec;
+    IterationPrecision = Prec;
 }
 
-void vksetRobustScale(double Scale)
+void ForCFT::vksetRobustScale(double Scale) noexcept
 {
     if (Scale<0.01)   Scale=0.01;
     if (Scale>100.)   Scale=100.;
-    forcft_1.RobustScale = Scale;
+    RobustScale = Scale;
 }
 
-void vksetRobustness(long int Rob)
+void ForCFT::vksetRobustness(long int Rob) noexcept
 {
     if (Rob<0)   Rob=0;
     if (Rob>7)   Rob=7;
-    forcft_1.irob = Rob;
+    irob = Rob;
 }
 
-void vksetUseMassCnst()  { forcft_1.useMassCnst = 1;}
-void vksetUsePhiCnst()   { forcft_1.usePhiCnst = 1;}
-void vksetUsePlaneCnst(double a, double b, double c, double d)   { 
-  if(a+b+c+d == 0.){  forcft_1.usePlaneCnst = 0;
-  }else{              forcft_1.usePlaneCnst = 1; }
-  forcft_1.Ap = a; forcft_1.Bp = b; forcft_1.Cp = c; forcft_1.Dp = d;
+void ForCFT::vksetUseMassCnst() noexcept { useMassCnst = 1;}
+void ForCFT::vksetUsePhiCnst()  noexcept { usePhiCnst = 1;}
+void ForCFT::vksetUsePlaneCnst(double a, double b, double c, double d) noexcept  { 
+  if(a+b+c+d == 0.){  usePlaneCnst = 0;
+  }else{              usePlaneCnst = 1; }
+  Ap = a; Bp = b; Cp = c; Dp = d;
 }
-void vksetUseThetaCnst() { forcft_1.useThetaCnst = 1;}
-void vksetUseAprioriVrt(){ forcft_1.useAprioriVrt = 1;}
-void vksetUsePointingCnst(int iType = 1 ) { forcft_1.usePointingCnst = iType<2 ? 1 : 2 ;}
-void vksetUsePassNear(int iType = 1 ) { forcft_1.usePassNear = iType<2 ? 1 : 2 ;}
 
 
-void setmasscnst_(long int *ncnsttrk, long int *indextrk, double  *wmcnst)
+
+void ForCFT::setmasscnst_(long int *ncnsttrk, long int *indextrk, double  *wmcnst) noexcept
 {
     if (indextrk==0) return;  //Protection!  Track indices start from 1 (not 0)!
     --indextrk;
 
-    ++forcft_1.nmcnst;
-    if (forcft_1.nmcnst > 8) return ;
+    ++nmcnst;
+    if (nmcnst > 8) return ;
     for (int i = 0; i < vkalNTrkM; ++i) {
-	forcft_1.indtrkmc[forcft_1.nmcnst-1][i] = 0;
+	indtrkmc[nmcnst-1][i] = 0;
     }
     for (int i = 0; i < (*ncnsttrk);  ++i) {
 	if (indextrk[i] > 0 && indextrk[i] < vkalNTrkM) {
-	    forcft_1.indtrkmc[forcft_1.nmcnst-1][indextrk[i]] = 1;
+	    indtrkmc[nmcnst-1][indextrk[i]] = 1;
 	}
     }
-    forcft_1.wmfit[forcft_1.nmcnst - 1] = (*wmcnst);
+    wmfit[nmcnst - 1] = (*wmcnst);
  }
 
 } /* End of namespace */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx
index ac5992584e52a153ae9ae88cc4e37eacb7538eab..3e37bf6f62c02a946d799b481c0d7d18b4afb77c 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx
@@ -17,7 +17,7 @@
 
 namespace Trk {
 
-extern vkalMagFld      myMagFld;
+extern const vkalMagFld      myMagFld;
 
 
 extern void cfnewp(long int*, double*, double*, double*, double*, double*);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx
index 29f7804f406bd99fa1594d507dcc166f739d53f5..71a7c726ebfdf8c863932b3c75d3d750dbed10c4 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx
@@ -42,7 +42,7 @@ void robtest(VKVertex * vk, long int ifl)
 
     if ( ifl == 0) {                               /* FILLING OF EIGENVALUES AND VECTORS */
 	for (it = 0; it < NTRK ; ++it) {               /* RESTORE MATRIX */
-            VKTrack *trk=vk->TrackList[it];
+            VKTrack *trk=vk->TrackList[it].get();
             if(trk->Id < 0) continue;  // Not a real track
 	    //k = 0;   double dest[5][5];
 	    //for (i = 0; i < 5; ++i) {
@@ -64,7 +64,7 @@ void robtest(VKVertex * vk, long int ifl)
 /* -- */
     double    halfPi=M_PI/2.;
     for (it = 0; it < NTRK; ++it) {
-        VKTrack *trk=vk->TrackList[it];
+        VKTrack *trk=vk->TrackList[it].get();
         if(trk->Id < 0) continue;  // Not a real track
         c[0]=c[1]=c[2]=c[3]=c[4]=0.;
         for( k = 0; k < 5; k++){
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx
index 76ca058806f47bb76cc74faf756e8f3eef5c3006..7d7ed355045a92d19413637ed79837c9842f788d 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <math.h>
@@ -8,6 +8,7 @@
 #include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 #include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/Derivt.h"
+#include "TrkVKalVrtCore/ForCFT.h"
 
 namespace Trk {
 
@@ -26,7 +27,7 @@ namespace Trk {
        vk_objProp(src.vk_objProp), 
        vk_funcProp(src.vk_funcProp){}
 
-  VKalVrtControl::VKalVrtControl(const VKalVrtControlBase & base): VKalVrtControlBase(base) { 
+  VKalVrtControl::VKalVrtControl(const VKalVrtControlBase & base): VKalVrtControlBase(base), vk_forcft() { 
     m_fullCovariance=nullptr;
     m_vrtMassTot=-1.;
     m_vrtMassError=-1.;
@@ -39,8 +40,6 @@ namespace Trk {
     m_vrtMassError=src.m_vrtMassError;
     m_cascadeEvent=src.m_cascadeEvent;
   }
-  VKalVrtControl::~VKalVrtControl()  { if(m_fullCovariance) delete[] m_fullCovariance;}
-
 
   VKTrack::VKTrack(long int iniId, double Perigee[], double Covariance[], VKVertex * vk, double m):
   Chi2(0), m_mass(m)
@@ -52,7 +51,6 @@ namespace Trk {
      m_originVertex = vk;
   }
 
-
   void VKTrack::setCurrent(double Perigee[], double Weight[])
   {  for(int i=0; i<5;  i++) Perig[i]=Perigee[i];
      for(int i=0; i<15; i++) WgtM[i]=WgtM_save[i]=Weight[i];  }
@@ -118,14 +116,10 @@ namespace Trk {
      Chi2=0.;
      truncatedStep=false;
      existFullCov=0;
-     std::fill_n(ader,(3*vkalNTrkM+3)*(3*vkalNTrkM+3),0);
   }
 
   VKVertex::~VKVertex()
   {  
-       for( int i=0; i<(int)TrackList.size(); i++) delete TrackList[i];
-       for( int i=0; i<(int)tmpArr.size(); i++) delete tmpArr[i];
-       for( int i=0; i<(int)ConstraintList.size(); i++) delete ConstraintList[i];
        for( int i=0; i<(int)includedVrt.size(); i++) includedVrt[i]=0;  // these vertice are not owned, then must not be deleted.
   }
   void VKVertex::setRefV(double v[3]){ refV[0]=v[0]; refV[1]=v[1]; refV[2]=v[2];}
@@ -140,7 +134,9 @@ namespace Trk {
   useApriorVertex(src.useApriorVertex),   //for a priory vertex position knowledge usage
   passNearVertex(src.passNearVertex),     // needed for "passing near vertex" constraint
   passWithTrkCov(src.passWithTrkCov),     //  Vertex, CovVertex, Charge and derivatives 
-  FVC(src.FVC)
+  FVC(src.FVC),
+  TrackList(0), 
+  ConstraintList(0)
   {
     for( int i=0; i<6; i++) {
       fitVcov[i]    =src.fitVcov[i];  // range[0:5]
@@ -161,10 +157,17 @@ namespace Trk {
     nextCascadeVrt = 0;
     truncatedStep = src.truncatedStep;
     existFullCov = src.existFullCov;
-    std::copy(src.ader,src.ader+(3*vkalNTrkM+3)*(3*vkalNTrkM+3),ader);
-    //----- Creation of track copies
-    TrackList.clear();
-    for( int i=0; i<(int)src.TrackList.size(); i++) TrackList.push_back( new VKTrack(*(src.TrackList[i])) );
+
+    int NTrack=src.TrackList.size();
+    int FULLSIZE=3*vkalNTrkM+3;
+    int SIZE=3*NTrack+3;
+    for(int i=0; i<SIZE; i++) for(int j=0; j<SIZE; j++) { ader[i*FULLSIZE+j]=src.ader[i*FULLSIZE+j]; }
+    //----- Creation of track and constraint copies
+    for( int i=0; i<NTrack; i++) TrackList.emplace_back( new VKTrack(*(src.TrackList[i])) );
+    ConstraintList.reserve(src.ConstraintList.size());
+    for( int ic=0; ic<(int)src.ConstraintList.size(); ic++){
+        ConstraintList.emplace_back(src.ConstraintList[ic]->clone());
+    }
     vk_fitterControl = std::unique_ptr<VKalVrtControl>(new VKalVrtControl(*src.vk_fitterControl));
    }
 
@@ -197,32 +200,39 @@ namespace Trk {
       nextCascadeVrt = 0;
       truncatedStep = src.truncatedStep;
       existFullCov = src.existFullCov;
-      std::copy(src.ader,src.ader+(3*vkalNTrkM+3)*(3*vkalNTrkM+3),ader);
-    //----- Creation of track copies
+
+      int NTrack=src.TrackList.size();
+      int FULLSIZE=3*vkalNTrkM+3;
+      int SIZE=3*NTrack+3;
+      for(int i=0; i<SIZE; i++) for(int j=0; j<SIZE; j++) { ader[i*FULLSIZE+j]=src.ader[i*FULLSIZE+j]; }
+    //----- Creation of track and constraint copies
       TrackList.clear();
       tmpArr.clear();
       ConstraintList.clear();
-      for( int i=0; i<(int)src.TrackList.size(); i++) TrackList.push_back( new VKTrack(*(src.TrackList[i])) );
-    //for( int i=0; i<(int)src.ConstraintList.size(); i++) ConstraintList.push_back( new (*(src.TrackList[i])) );
+      for( int i=0; i<NTrack; i++) TrackList.emplace_back( new VKTrack(*(src.TrackList[i])) );
+      ConstraintList.reserve(src.ConstraintList.size());
+      for( int ic=0; ic<(int)src.ConstraintList.size(); ic++){
+        ConstraintList.emplace_back(src.ConstraintList[ic]->clone());
+      }
     }
     return *this;
   }
 
 
-  void VKalVrtControl::setIterationNum(int Iter)
-  {
+  void VKalVrtControl::setIterationNum(int Iter)
+  {
     if (Iter<3)   Iter=3;
     if (Iter>100) Iter=100;
     vk_forcft.IterationNumber    = Iter;
-  }
-
+  }
+
   void VKalVrtControl::setIterationPrec(double Prec)
-  {
-    if (Prec<1.e-5)   Prec=1.e-5;
-    if (Prec>1.e-1)   Prec=1.e-1;
-    vk_forcft.IterationPrecision = Prec;
-  }
-
+  {
+    if (Prec<1.e-5)   Prec=1.e-5;
+    if (Prec>1.e-1)   Prec=1.e-1;
+    vk_forcft.IterationPrecision = Prec;
+  }
+
   void VKalVrtControl::setRobustScale(double Scale)
   {
     if (Scale<0.01)   Scale=0.01;
@@ -246,8 +256,9 @@ namespace Trk {
     }
     vk_forcft.useMassCnst = 1;
   }
-  void VKalVrtControl::setMassCnstData(int Ntrk, std::vector<int> & Index, double Mass){
+  void VKalVrtControl::setMassCnstData(int NtrkTot, std::vector<int> & Index, double Mass){
     double sumM(0.);
+    int Ntrk=std::min((int)Index.size(),NtrkTot);
     for(int it=0; it<Ntrk; it++) sumM +=   vk_forcft.wm[Index[it]];                 //sum of particle masses
     if(sumM<Mass) {
       vk_forcft.wmfit[0]=Mass;
@@ -267,15 +278,12 @@ namespace Trk {
   void VKalVrtControl::setUseAprioriVrt(){ vk_forcft.useAprioriVrt = 1;}
   void VKalVrtControl::setUsePointingCnst(int iType = 1 ) { vk_forcft.usePointingCnst = iType<2 ? 1 : 2 ;}
   void VKalVrtControl::setUsePassNear(int iType = 1 ) { vk_forcft.usePassNear = iType<2 ? 1 : 2 ;}
-  CascadeEvent * VKalVrtControl::getCascadeEvent() const { return m_cascadeEvent;}
   void VKalVrtControl::renewCascadeEvent(CascadeEvent * newevt) { 
      if(m_cascadeEvent)delete m_cascadeEvent;
      m_cascadeEvent=newevt;
   }
-  double * VKalVrtControl::getFullCovariance() const { return m_fullCovariance; }
   void VKalVrtControl::renewFullCovariance(double * newarray) { 
-     if(m_fullCovariance) delete[] m_fullCovariance;
-     m_fullCovariance=newarray;
+     m_fullCovariance.reset(newarray);
   }
 
 } /* End of namespace */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx
index 4ead07e704f3ba771f5f521b15bd547afcbc8ce5..bccb3432f30fc172e335ef003d8599e977e3ff21 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx
@@ -1,16 +1,16 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include <math.h>
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
-#include "TrkVKalVrtCore/VKalVrtBMag.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/CommonPars.h"
 #include <iostream>
 
 namespace Trk {
 
-extern vkalMagFld  myMagFld;
+extern const vkalMagFld  myMagFld;
 
 void vkgrkuta_(double *charge, double *step, double *vect, double *vout, const VKalVrtControlBase* CONTROL)
 {
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKvFast.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKvFast.cxx
index 69134b754be93284e5b4f07aa621c09f0f17a2d2..f17228a3eca140209dc3e768b4aaa131258c9ef4 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKvFast.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKvFast.cxx
@@ -25,7 +25,7 @@ void vkvfast_(double *p1, double *p2, double *dbmag, double *out)
 
 void vkvFastV(double *p1, double *p2, double* vRef, double dbmag, double *out)
 {
-    extern void vkPerigeeToP( double*, double*, double );
+    extern void vkPerigeeToP( const double*, double*, double );
     double d__1;
 
     double diff, coef, cent1[2], cent2[2], angle, cross[6];/* was [3][2] */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx
index 10d50e537ebebd306df8da92cd9d0c4d0efddc99..2f04feb4f3d61a799b8d83ed2ab1fd8dfe126b64 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx
@@ -160,7 +160,7 @@ namespace Trk {
 
     double chi2i = 0.;
     for ( kt = 0; kt < NTRK; ++kt) {
-       VKTrack* trk = vk->TrackList[kt];
+       VKTrack* trk = vk->TrackList[kt].get();
        double theta_ini =trk->iniP[0];
        double phi_ini   =trk->iniP[1];
        double invR_ini  =trk->iniP[2];
@@ -289,7 +289,7 @@ namespace Trk {
 	double ew35 = e13 * trk->WgtM[10]+ e23 * trk->WgtM[11]+ e43 * trk->WgtM[13]+ trk->WgtM[14];
 
 /*   computation of vector  TT = EW * DPAR */
-        TWRK* t_trk=vk->tmpArr[kt];
+        TWRK* t_trk=vk->tmpArr[kt].get();
 	t_trk->tt[0]  = ew11*deps[kt] + ew12*dzp[kt];
 	t_trk->tt[1]  = ew21*deps[kt] + ew22*dzp[kt];
 	t_trk->tt[2]  = ew31*deps[kt] + ew32*dzp[kt];
@@ -569,7 +569,7 @@ namespace Trk {
 	    }
 	    double tparf0[3]={0.};
 	    for (it = 1; it <= NTRK; ++it) {
-                TWRK* t_trk=vk->tmpArr[it-1];
+                TWRK* t_trk=vk->tmpArr[it-1].get();
 		for (j=0; j<3; ++j) {
                    tparf0[j] = 0.;
 		   for (ii = 1; ii <= NParam; ++ii) { tparf0[j] +=  ader_ref(it*3+j+1, ii)*fortst[ii-1];}
@@ -678,8 +678,8 @@ namespace Trk {
     }
 
     for(int ii = 0; ii < NTRK; ++ii) {         // track parameters at intermediate vertex. Also save to cnstP for constraint
-        VKTrack*  trk=vk->TrackList[ii]; 
-        TWRK*   t_trk=vk->tmpArr[ii];
+        VKTrack*  trk=vk->TrackList[ii].get(); 
+        TWRK*   t_trk=vk->tmpArr[ii].get();
         t_trk->part[0]=trk->cnstP[0]= trk->iniP[0] + (alf+bet)*(trk->fitP[0] - trk->iniP[0]) + bet*dCoefNorm * t_trk->parf0[0];
 	t_trk->part[1]=trk->cnstP[1]= trk->iniP[1] + (alf+bet)*(trk->fitP[1] - trk->iniP[1]) + bet*dCoefNorm * t_trk->parf0[1];
 	t_trk->part[2]=trk->cnstP[2]= trk->iniP[2] + (alf+bet)*(trk->fitP[2] - trk->iniP[2]) + bet*dCoefNorm * t_trk->parf0[2];
@@ -724,7 +724,7 @@ namespace Trk {
     if (vk->ConstraintList.size()) {                     // Restore initial derivatives 
       int NTRK=vk->TrackList.size();
       vk->setCnstV(vk->iniV); 
-      for(int i=0; i<NTRK; ++i){ VKTrack* trk=vk->TrackList[i]; for (int j=0;j<3;j++){trk->cnstP[j]=trk->iniP[j];}}
+      for(int i=0; i<NTRK; ++i){ VKTrack* trk=vk->TrackList[i].get(); for (int j=0;j<3;j++){trk->cnstP[j]=trk->iniP[j];}}
       applyConstraints(vk);
     }
   }
@@ -827,7 +827,7 @@ namespace Trk {
 //--------------------------------------------------------------------------------------------------------
     if (NCNST) {                  /* Restore initial derivatives */
       vk->setCnstV(vk->iniV); 
-      for (ii=0; ii<NTRK; ++ii){ VKTrack* trk=vk->TrackList[ii]; for (j=0;j<3;j++){trk->cnstP[j]=trk->iniP[j];}}
+      for (ii=0; ii<NTRK; ++ii){ VKTrack* trk=vk->TrackList[ii].get(); for (j=0;j<3;j++){trk->cnstP[j]=trk->iniP[j];}}
       applyConstraints(vk);
     }
    
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx
index 38ea0e448540ea1eac4c2ebaa56333fc174cc70b..3f9d3e263f2ee65dfa3e72cc0783b3e691a386f5 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <math.h>
@@ -122,7 +122,7 @@ int vtcfitc( VKVertex * vk )
 			      + al0[jc].Z * vk->fitVcov[5] * al0[ic].Z;
 
 	    for (it=0; it<NTRK; ++it) {
-                t_trk=vk->tmpArr[it];
+                t_trk=vk->tmpArr[it].get();
 		denom[ic][jc] +=          tf0t[ic][it].X * t_trk->wci[0] * tf0t[jc][it].X 
 					+ tf0t[ic][it].Y * t_trk->wci[1] * tf0t[jc][it].X 
 					+ tf0t[ic][it].Z * t_trk->wci[3] * tf0t[jc][it].X 
@@ -148,7 +148,7 @@ int vtcfitc( VKVertex * vk )
 /*    Solving of system DENOM(i,j)*COEF(j)=ANUM(i) */
 /*            for lagrange couplings               */
 /*-------------------------------------------------*/
-    double * coef = new double[totNC];
+    auto coef = std::make_unique<double[]>(totNC);
     if (totNC == 1) {
 	if (denom[0][0] != 0.) {
 	    coef[0] = anum[0] / denom[0][0];
@@ -156,26 +156,24 @@ int vtcfitc( VKVertex * vk )
 	    coef[0] = 1.e3;
 	}
     } else {
-        double * adenom = new double[totNC*totNC];
-        double * work   = new double[totNC*totNC];
-        double * eigv   = new double[totNC*totNC];
-        double * scale  = new double[totNC];
+        auto adenom = std::make_unique<double[]>(totNC*totNC);
+//        auto work   = std::make_unique<double[]>(totNC*totNC);
+//        auto eigv   = std::make_unique<double[]>(totNC*totNC);
+        auto scale  = std::make_unique<double[]>(totNC);
 	for (ic=0; ic<totNC; ic++) {
 	    for (jc=0; jc<totNC; jc++) {
 		adenom[ic*totNC + jc] = denom[ic][jc];
 	    }
 	}
-	scaleg(adenom, scale,  totNC,  totNC);
+	scaleg(adenom.get(), scale.get(),  totNC,  totNC);
 	//digx(adenom, eigv, work, totNC, 0);
 	//if (eigv[0] <= eigv[totNC-1] * 1.e-10) {
 	//    double sdet = fabs(eigv[0]) + eigv[totNC-1] * 1.e-15;
 	//    for (ic=0; ic<totNC; ++ic) { adenom[ic*totNC + ic] += sdet;}
 	//}
 /* -- INVERT */
-	dsinv(&totNC, adenom, totNC, &IERR);
+	dsinv(&totNC, adenom.get(), totNC, &IERR);
 	if (IERR) {
-          delete[] adenom; delete[] work; delete[] eigv; delete[] scale;
-          delete[] coef;
 	  return IERR;
 	}
 	for (ic=0; ic<totNC; ++ic) {
@@ -186,7 +184,6 @@ int vtcfitc( VKVertex * vk )
 		coef[ic] += adenom[index] * anum[jc];
 	    }
 	}
-        delete[] adenom; delete[] work; delete[] eigv; delete[] scale;
     }
 
 
@@ -218,7 +215,7 @@ int vtcfitc( VKVertex * vk )
 
 /*  new momenta */
     for (it=0; it<NTRK; ++it) {
-        t_trk=vk->tmpArr[it];
+        t_trk=vk->tmpArr[it].get();
 	tmp[0] = 0.;
 	tmp[1] = 0.;
 	tmp[2] = 0.;
@@ -235,7 +232,7 @@ int vtcfitc( VKVertex * vk )
 	}
 
 /*    calculation WCI * TMP */
-        VKTrack * trk = vk->TrackList[it];
+        VKTrack * trk = vk->TrackList[it].get();
 	trk->fitP[0] -=  t_trk->wci[0]*tmp[0] + t_trk->wci[1]*tmp[1] + t_trk->wci[3]*tmp[2];
 	trk->fitP[1] -=  t_trk->wci[1]*tmp[0] + t_trk->wci[2]*tmp[1] + t_trk->wci[4]*tmp[2];
 	double concor =  t_trk->wci[3]*tmp[0] + t_trk->wci[4]*tmp[1] + t_trk->wci[5]*tmp[2];
@@ -244,7 +241,6 @@ int vtcfitc( VKVertex * vk )
 //std::cout<<" Npar="<<trk->fitP[0] <<", "<<trk->fitP[1]<<", "<<trk->fitP[2]<<'\n';
    }
 /* =================================================================== */
-    delete[] coef;
     return 0;
 } 
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx
index ddd32ef7e6c87c70ebc56da3f949de4461623afe..0d2d73881bb2987a5b205f0b6deddf7c6f264287 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx
@@ -191,7 +191,7 @@ int getFullVrtCov(VKVertex * vk, double *ader, double *dcv, double verr[6][6])
 	ader_ref(3,2) = ader_ref(2,3);
 
 	for (it=1; it<=NTRK; it++) {
-            t_trk=vk->tmpArr[it-1];
+            t_trk=vk->tmpArr[it-1].get();
 	    ader_ref(1, it*3 + 1) = -vcov[0] * t_trk->wbci[0] 
 	                           - vcov[1] * t_trk->wbci[1] 
 				   - vcov[3] * t_trk->wbci[2];
@@ -232,7 +232,7 @@ int getFullVrtCov(VKVertex * vk, double *ader, double *dcv, double verr[6][6])
 
 
 	for (it = 1; it<=NTRK; ++it) {
-            t_trk=vk->tmpArr[it-1];
+            t_trk=vk->tmpArr[it-1].get();
 	    for (jt=1; jt<=NTRK; ++jt) {
 	        int j3   = jt*3;
 	        int i3   = it*3;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx
index bb79d5904e32ad562ba7e2e856f18012337dd311..48f5d94c9107eb5fec8041dcbaa9202135c0e302 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx
@@ -12,8 +12,8 @@
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
-extern vkalMagFld      myMagFld;
+extern const vkalPropagator  myPropagator;
+extern const vkalMagFld      myMagFld;
 
 
 void vpderiv(bool UseTrackErr, long int Charge, double *pari0, double *covi, double *vrtref, double *covvrtref, 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx
index a24d7e07d5ae4d95cfe54dee53f3f9daefa7f189..1f111c4a52dc44358b80350b85aa17c23fe3efdf 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx
@@ -1,16 +1,16 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include <math.h>
-#include "TrkVKalVrtCore/CommonPars.h"
+#include "TrkVKalVrtCore/CommonPars.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/Propagator.h"
 #include <iostream>
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
+extern const vkalPropagator  myPropagator;
 extern void tdasatVK(double *, double *, double *, long int, long int);
 
 #define cnv_ref(a_1,a_2) cnv[(a_2)*6 + (a_1) - 7]
@@ -20,8 +20,8 @@ void  xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double BMAG
     double covd[15],par[5], cnv[36];	/* was [6][6] */ 
 /* ---------------------------------------------------------- */
 /*       Subroutine for convertion                            */
-/*           (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r)       */
-/* Now it's used in VKalVrtFitter only                        */
+/*           (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r)       */
+/* Now it's used in VKalVrtFitter only                        */
 /*                                                            */
 /*       Input:                                               */
 /*                 ICH      -  charge of track ( +1,0,-1 )    */
@@ -38,7 +38,7 @@ void  xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double BMAG
 /* Author: V.Kostyukhin                                       */
 /* ---------------------------------------------------------- */
 
-    double constBF =BMAG * vkalMagCnvCst; 
+    double constBF =BMAG * vkalMagCnvCst; 
 
     double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]);
     double pp = pt*pt + pv0[2]*pv0[2];                   // p**2
@@ -117,8 +117,8 @@ void  combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double
 
     double cnv[36];	/* was [6][6] */
 /* ---------------------------------------------------------- */
-/*       Subroutine for convertion for VKalvrtCore            */
-/* Correct magnetic field BMAG at conversion point            */
+/*       Subroutine for convertion for VKalvrtCore            */
+/* Correct magnetic field BMAG at conversion point            */
 /*  is provided externally.                                   */
 /*           (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r)       */
 /*       Input:                                               */
@@ -133,7 +133,7 @@ void  combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double
 /* Author: V.Kostyukhin                                       */
 /* ---------------------------------------------------------- */
 
-    double constBF =BMAG * vkalMagCnvCst;
+    double constBF =BMAG * vkalMagCnvCst;
 
     double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]);
     double pp = pt*pt + pv0[2]*pv0[2];
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx
index 4f6eb5d464a42172f83a033cd86f773d195e0ed9..5de72f65425f032b9bbbc29ef345f87cb3010fa8 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include <math.h>
 #include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 #include "TrkVKalVrtCore/Propagator.h"
@@ -9,7 +9,7 @@
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
+extern const vkalPropagator  myPropagator;
 extern int cfdinv(double *, double *, long int); 
 
 #define min(a,b) ((a) <= (b) ? (a) : (b))
@@ -55,8 +55,8 @@ extern int cfdinv(double *, double *, long int);
 
 
     double Ref0[3]={0.,0.,0.};  //base reference point for standard perigee
-
-    myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL);
+
+    myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL);
 
 //std::cout <<" CFImp new par R,Z="<<paro[0]<<", "<<paro[1]<<'\n';
 /* ---------- */
@@ -128,7 +128,7 @@ extern int cfdinv(double *, double *, long int);
     for (int ii = 0; ii < 15; ++ii) {errd[ii] = err[ii];}
 
     double Ref0[3]={0.,0.,0.};  //base reference point for standard perigee
-    myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL);
+    myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL);
 
     double tmpVrt[3]={0.,0.,0.}; double ClosestPnt[3];
     cfClstPnt( paro, tmpVrt, ClosestPnt);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx
index 9222129c1d7ecfab30b7d73ef627670cf0f9e0a1..2e0fcd192905e5539d0c552bd9be1e4a7db680b3 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx
@@ -10,9 +10,9 @@
 
 namespace Trk {
 
-extern vkalMagFld      myMagFld;
+extern const vkalMagFld      myMagFld;
 
-void vkPerigeeToP( double *perig3, double *pp, double BMAG)
+void vkPerigeeToP( const double *perig3, double *pp, double BMAG)
 {
     double constB =BMAG  * vkalMagCnvCst;
     double phiv = perig3[1];
@@ -24,7 +24,7 @@ void vkPerigeeToP( double *perig3, double *pp, double BMAG)
 
 
 
-std::array<double, 4> getFitParticleMom( VKTrack * trk, VKVertex *vk)
+std::array<double, 4> getFitParticleMom( const VKTrack * trk, const VKVertex *vk)
 {
     std::array<double, 4> p;
     double fieldPos[3];
@@ -43,7 +43,7 @@ std::array<double, 4> getFitParticleMom( VKTrack * trk, VKVertex *vk)
     p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
     return p;
 }
-std::array<double, 4> getFitParticleMom( VKTrack * trk, double BMAG)
+std::array<double, 4> getFitParticleMom(const VKTrack * trk, double BMAG)
 {
     std::array<double, 4> p;
     double magConst =BMAG  * vkalMagCnvCst;
@@ -59,7 +59,7 @@ std::array<double, 4> getFitParticleMom( VKTrack * trk, double BMAG)
     return p;
 }
 
-std::array<double, 4> getIniParticleMom( VKTrack * trk, VKVertex *vk)
+std::array<double, 4> getIniParticleMom( const VKTrack * trk, const VKVertex *vk)
 {
     std::array<double, 4> p;
     double magConst = myMagFld.getMagFld(vk->refIterV,(vk->vk_fitterControl).get())  * myMagFld.getCnvCst();
@@ -74,7 +74,7 @@ std::array<double, 4> getIniParticleMom( VKTrack * trk, VKVertex *vk)
     p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
     return p;
 }
-std::array<double, 4> getIniParticleMom( VKTrack * trk, double BMAG)
+std::array<double, 4> getIniParticleMom(const VKTrack * trk, double BMAG)
 {
     std::array<double, 4> p;
     double magConst =BMAG  * vkalMagCnvCst;
@@ -91,7 +91,7 @@ std::array<double, 4> getIniParticleMom( VKTrack * trk, double BMAG)
 }
 
 
-std::array<double, 4> getCnstParticleMom( VKTrack * trk, VKVertex *vk )
+std::array<double, 4> getCnstParticleMom( const VKTrack * trk, const VKVertex *vk )
 {
     std::array<double, 4> p;
     double cnstPos[3];
@@ -110,7 +110,7 @@ std::array<double, 4> getCnstParticleMom( VKTrack * trk, VKVertex *vk )
     p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
     return p;
 }
-std::array<double, 4> getCnstParticleMom( VKTrack * trk, double BMAG )
+std::array<double, 4> getCnstParticleMom(const VKTrack * trk, double BMAG )
 {
     std::array<double, 4> p;
     double magConst =BMAG  * vkalMagCnvCst;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx
index 3ce2bf20354bcc1dc57ba4cb8c11cd4d856d39b5..f7bf36ea1d924cae306003d603c97043d7d5897d 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx
@@ -1,16 +1,16 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include <math.h>
 #include <iostream>
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
-#include "TrkVKalVrtCore/Propagator.h"
+#include "TrkVKalVrtCore/Propagator.h"
 #include "TrkVKalVrtCore/TrkVKalUtils.h"
 
 namespace Trk {
 
-extern vkalMagFld  myMagFld;
+extern const vkalMagFld  myMagFld;
 
 
 extern double d_sign(double, double);
@@ -50,7 +50,7 @@ void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, doubl
     vect[1] = -cos(par[4]) * par[1]   +xyzStart[1];
     vect[2] = par[2]                  +xyzStart[2];
 
-    double constB = myMagFld.getMagFld(vect,CONTROL) * myMagFld.getCnvCst();
+    double constB = myMagFld.getMagFld(vect,CONTROL) * myMagFld.getCnvCst();
 
     double pt = constB / fabs(par[5]);
     double px = pt * cos(par[4]);
@@ -90,8 +90,8 @@ void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, doubl
 
 /* --- Now we are in the new point. Calculate track parameters */
 /*   at new point with new mag.field */
-
-    constB = myMagFld.getMagFld(xyzEnd,CONTROL) * myMagFld.getCnvCst() ;
+
+    constB = myMagFld.getMagFld(xyzEnd,CONTROL) * myMagFld.getCnvCst() ;
 
     dpar0[0] = 0.;
     dpar0[1] = 0.;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfPEst.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfPEst.cxx
index 3d67fe905a1e21fe6548b86985cf4f34333ee2b5..22f237999b2c82483f87a82fb7b70f2ff64c0468 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfPEst.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfPEst.cxx
@@ -1,12 +1,12 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 #include "TrkVKalVrtCore/Propagator.h"
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
+extern const vkalPropagator  myPropagator;
 
 void cfpest(int ntrk, double *xyz, long int *ich, double (*parst)[5], double (*parf)[3])
 {
@@ -20,7 +20,7 @@ void cfpest(int ntrk, double *xyz, long int *ich, double (*parst)[5], double (*p
     double Ref0[3]={0.,0.,0.};
 
     for (int i = 0; i < ntrk; ++i) {
-
+
         long int TrkID=i;
         myPropagator.Propagate( TrkID, ich[i], &parst[i][0], 0, Ref0, xyz, partmp, 0);
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx
index fe6c02d023e4df25f1e4419988f0400e73556fd8..cfa3a2d0174cf44859e7565a4b48b6f793e65b63 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx
@@ -22,7 +22,7 @@ namespace Trk {
 //--------------------------------------------------------------
 extern int getFullVrtCov(VKVertex *, double *, double *, double[6][6]);
 extern void cfsetdiag(long int , double *, double );
-extern vkalMagFld      myMagFld;
+extern const vkalMagFld      myMagFld;
 
 int afterFit(VKVertex *vk, double *ader, double * dcv, double * ptot, double * VrtMomCov, const VKalVrtControlBase* CONTROL )
 {
@@ -42,7 +42,7 @@ int afterFit(VKVertex *vk, double *ader, double * dcv, double * ptot, double * V
     double constBF = myMagFld.getMagFld(vk->refIterV,CONTROL) * myMagFld.getCnvCst() ;
 
     for (i = 1; i <= NTRK; ++i) {
-        VKTrack *trk=vk->TrackList[i-1];
+        VKTrack *trk=vk->TrackList[i-1].get();
         invR = trk->fitP[2];
 	cth = 1. / tan(trk->fitP[0]);
 	pt = constBF / fabs(invR);
@@ -96,7 +96,7 @@ int afterFitWithIniPar(VKVertex *vk, double *ader, double * dcv, double * ptot,
     double constBF = myMagFld.getMagFld(vk->refIterV,CONTROL) * myMagFld.getCnvCst() ;
 
     for (i = 1; i <= NTRK; ++i) {
-        VKTrack *trk=vk->TrackList[i-1];
+        VKTrack *trk=vk->TrackList[i-1].get();
         invR = trk->iniP[2];
 	cth = 1. / tan(trk->iniP[0]);
 	pt = constBF / fabs(invR);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx
index af8fe6dbd613965583359a5325e7dd42da523199..85c5f28a374d738a85248ea0db1194e1065b2c42 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx
@@ -10,8 +10,8 @@
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
-extern vkalMagFld      myMagFld;
+extern const vkalPropagator  myPropagator;
+extern const vkalMagFld      myMagFld;
 
 // Function calculates distance between summary track after fit and vertex for constraint
 // Flag UseTrkErr tells if SummaryTrack errors+VertexErrors are used or only VertexErrors
@@ -35,14 +35,14 @@ double cfVrtDstSig( VKVertex * vk, bool UseTrkErr)
     double Signif;
 
     extern void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *paro, double *covo);
-    extern std::array<double, 4> getCnstParticleMom( VKTrack * , VKVertex *);
+    extern std::array<double, 4> getCnstParticleMom(const VKTrack * , const VKVertex *);
     extern int cfdinv(double *, double *, long int); 
  /* ------------------------------------------------------------------- */
 
     double ptot[3]= {0.,0.,0.};
     int NTRK = vk->TrackList.size();
     for ( it=0; it<NTRK; it++) {
-        std::array<double, 4>  pp=getCnstParticleMom( vk->TrackList[it], vk );
+        std::array<double, 4>  pp=getCnstParticleMom( vk->TrackList[it].get(), vk );
 	ptot[0] += pp[0];
 	ptot[1] += pp[1];
 	ptot[2] += pp[2];
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx
index b3a22963d362dd688fbdf0c2334bc5992c242d43..aee772ef3c362a3de796b4f45ea4a26e689566eb 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
 //    Management of constraints 
 //
 //----------------------------------------------------
@@ -18,37 +18,15 @@ extern void  calcMassConstraint( VKMassConstraint * );
 extern void  calcPhiConstraint( VKPhiConstraint * );
 extern void  calcThetaConstraint( VKThetaConstraint * );
 extern void  calcPointConstraint( VKPointConstraint * );
-extern void  calcPlaneConstraint( VKPlaneConstraint * );
+extern void  calcPlaneConstraint( VKPlaneConstraint * );
 
 
 void applyConstraints(VKVertex * vk)
 {
   int NCEntries=vk->ConstraintList.size();
   int NTRK=vk->TrackList.size();
-  VKMassConstraint  * mass_cnst;
-  VKPhiConstraint   * p_cnst;
-  VKThetaConstraint * t_cnst;
-  VKPointConstraint * pnt_cnst;
-  VKPlaneConstraint * pln_cnst;
   for(int ic=0; ic<NCEntries; ic++){
-    mass_cnst = dynamic_cast<VKMassConstraint *>(vk->ConstraintList[ic]);
-    if(mass_cnst){  calcMassConstraint( mass_cnst ); 
-                 //std::cout<<(*mass_cnst)<<'\n';
-    }
-    p_cnst = dynamic_cast<VKPhiConstraint *>(vk->ConstraintList[ic]);
-    if(p_cnst){  calcPhiConstraint( p_cnst ); 
-                 //std::cout<<(*p_cnst)<<'\n';
-    }
-    t_cnst = dynamic_cast<VKThetaConstraint *>(vk->ConstraintList[ic]);
-    if(t_cnst){  calcThetaConstraint( t_cnst ); 
-                 //std::cout<<(*t_cnst)<<'\n';
-    }
-    pln_cnst = dynamic_cast<VKPlaneConstraint *>(vk->ConstraintList[ic]);
-    if(pln_cnst){  calcPlaneConstraint( pln_cnst ); 
-                 //std::cout<<(*pln_cnst)<<'\n';
-    }
-    pnt_cnst = dynamic_cast<VKPointConstraint *>(vk->ConstraintList[ic]);
-    if(pnt_cnst){  calcPointConstraint( pnt_cnst ); 
+    vk->ConstraintList[ic]->applyConstraint();
                  //std::cout<<(*pnt_cnst)<<'\n';
 /*//-------------------------------------
        int ici=1;  double aa0=vk->ConstraintList[ic]->aa[ici];
@@ -73,7 +51,7 @@ void applyConstraints(VKVertex * vk)
        vk->cnstV[2] -= 0.001; der3=(vk->ConstraintList[ic]->aa[ici]-aa0)/0.001;
        std::cout<<"Numerical deriv vrt="<<der1<<", "<<der2<<", "<<der3<<'\n';
 *///------------------------------------------
-     }
+     
   }      
 //
 // Effect of symmetrization
@@ -93,25 +71,19 @@ void applyConstraints(VKVertex * vk)
     return;
 }
 
-
 
-
-  VKConstraintBase::VKConstraintBase(const int NC,int NTRK): NCDim(NC), NTrk(NTRK), aa(NC), f0t(NTRK), h0t(NC)
-  {    
-    std::vector< Vect3DF > tmp(NC);
-    for(int i=0; i<NCDim; i++){
-        aa[i]=0.; 
-	h0t[i].X=0; h0t[i].Y=0; h0t[i].Z=0;
-	tmp[i].X=0; tmp[i].Y=0; tmp[i].Z=0;
-    }
-    for(int i=0; i<NTrk; i++) f0t[i]=tmp;
+ VKConstraintBase::VKConstraintBase(const int NC,int NTRK, VKContraintType t, VKVertex* vrt): NCDim(NC), NTrk(NTRK),
+   aa(NC, 0.), f0t(NTRK, std::vector< Vect3DF >(NC, Vect3DF())), h0t(NC, Vect3DF()), m_originVertex(vrt), m_type(t)
+  {
   }
+
+
   VKConstraintBase::~VKConstraintBase(){}
   std::ostream &  operator << ( std::ostream& out, const VKConstraintBase & cnst  )
   {
         int NTRK=cnst.f0t.size();
 	//out.setf( std::ios::scientific); out.precision(7); out << std::endl;
-	out.precision(7); out << std::defaultfloat;
+	out.precision(7); out << std::defaultfloat;
         out << " Base constraint derivatives for NTRK="<<NTRK<<" CNST dim="<<cnst.NCDim<<std::endl;
         out << " Momentum derivatives "<< std::endl;
         for(int ic=0; ic<cnst.NCDim; ic++){
@@ -129,15 +101,14 @@ void applyConstraints(VKVertex * vk)
 //
 //                   MASS constraint
 //
-  VKMassConstraint::VKMassConstraint(int NTRK, double mass, VKVertex *vk) :
-    VKConstraintBase(1,NTRK),
+  VKMassConstraint::VKMassConstraint(int NTRK, double mass, VKVertex *vk) :
+    VKConstraintBase(1,NTRK, VKContraintType::Mass, vk),
     m_usedParticles(NTRK,0), m_targetMass(mass)
-  {
+  {
     for(int i=0; i<NTrk; i++) m_usedParticles[i]=i;
-    m_originVertex = vk;
   }
   VKMassConstraint::VKMassConstraint(int NTRK, double mass, const std::vector<int> &listTrk, VKVertex *vk) :
-    VKConstraintBase(1,NTRK),
+    VKConstraintBase(1,NTRK, VKContraintType::Mass, vk),
     m_usedParticles(0), m_targetMass(mass)
   {
     for(int i=0; i<(int)listTrk.size(); i++) m_usedParticles.push_back(listTrk[i]);
@@ -146,10 +117,10 @@ void applyConstraints(VKVertex * vk)
   VKMassConstraint::~VKMassConstraint(){}
   std::ostream &  operator << ( std::ostream& out, const VKMassConstraint & cnst  )
   {
-        VKVertex * vk = cnst.getOriginVertex();
+        const VKVertex * vk = cnst.getOriginVertex();
         int NP=cnst.m_usedParticles.size();
 	//out.setf( std::ios::scientific); out.precision(7); out << std::endl;
-	out.precision(7); out << std::defaultfloat;
+	out.precision(7); out << std::defaultfloat;
         out << " Mass constraint  (total NTRK="<<vk->TrackList.size()<<")"<< std::endl;
 	out << " * target mass: "<< cnst.getTargetMass()                  << std::endl;
 	out << " * particle indexes: ";
@@ -158,7 +129,7 @@ void applyConstraints(VKVertex * vk)
 	out << " * particle masses: ";
         for(int i=0; i<NP; i++){out<<vk->TrackList[cnst.m_usedParticles[i]]->getMass()<<", ";}
 	out << std::endl;
-        out<< (VKConstraintBase)cnst <<'\n';
+        out<< (VKConstraintBase&)cnst <<'\n';
 	out.precision(6); //restore default
 	return out;                                 
   }                                              
@@ -166,29 +137,29 @@ void applyConstraints(VKVertex * vk)
 //                   Angular constraints
 //
   VKPhiConstraint::VKPhiConstraint(int NTRK, VKVertex *vk):
-    VKConstraintBase(1,NTRK)
+    VKConstraintBase(1,NTRK, VKContraintType::Phi, vk)
   {m_originVertex = vk;}
   VKPhiConstraint::~VKPhiConstraint(){}
   std::ostream &  operator << ( std::ostream& out, const VKPhiConstraint & cnst  )
-  {     VKVertex * vk = cnst.getOriginVertex();
+  {     const VKVertex * vk = cnst.getOriginVertex();
 	//out.setf( std::ios::scientific); out.precision(7); out << std::endl;
-	out.precision(7); out << std::defaultfloat;
+	out.precision(7); out << std::defaultfloat;
         out << " Phi constraint  (total NTRK="<<vk->TrackList.size()<<")"<< std::endl;
-        out<< (VKConstraintBase)cnst <<'\n';
+        out<< (VKConstraintBase&)cnst <<'\n';
 	out.precision(6); //restore default
 	return out;                                 
   }                                              
 
   VKThetaConstraint::VKThetaConstraint(int NTRK, VKVertex *vk):
-    VKConstraintBase(1,NTRK)
+    VKConstraintBase(1,NTRK, VKContraintType::Theta, vk)
   {m_originVertex = vk;}
   VKThetaConstraint::~VKThetaConstraint(){}
   std::ostream &  operator << ( std::ostream& out, const VKThetaConstraint & cnst  )
-  {     VKVertex * vk = cnst.getOriginVertex();
+  {     const VKVertex * vk = cnst.getOriginVertex();
 	//out.setf( std::ios::scientific); out.precision(7); out << std::endl;
-	out.precision(7); out << std::defaultfloat;
+	out.precision(7); out << std::defaultfloat;
         out << " Theta constraint  (total NTRK="<<vk->TrackList.size()<<")"<< std::endl;
-        out<< (VKConstraintBase)cnst <<'\n';
+        out<< (VKConstraintBase&)cnst <<'\n';
 	out.precision(6); //restore default
 	return out;                                 
   }                                              
@@ -196,15 +167,15 @@ void applyConstraints(VKVertex * vk)
 //                   Pointing constraint
 //
   VKPointConstraint::VKPointConstraint(int NTRK, double vrt[3], VKVertex *vk, bool onlyZ=false):
-    VKConstraintBase(2,NTRK)
+    VKConstraintBase(2,NTRK, VKContraintType::Point, vk)
   { m_originVertex = vk;m_targetVertex[0]=vrt[0]; m_targetVertex[1]=vrt[1]; m_targetVertex[2]=vrt[2];
     m_onlyZ=onlyZ;  // For Z only constraint
   }
   VKPointConstraint::~VKPointConstraint(){}
   std::ostream &  operator << ( std::ostream& out, const VKPointConstraint & cnst  )
-  {     VKVertex * vk = cnst.getOriginVertex();
+  {     const VKVertex * vk = cnst.getOriginVertex();
 	//out.setf( std::ios::scientific); out.precision(7); out << std::endl;
-	out.precision(7); out << std::defaultfloat;
+	out.precision(7); out << std::defaultfloat;
         if(!cnst.onlyZ()){
           out << " Point constraint  (total NTRK="<<vk->TrackList.size()<<")"<< std::endl;
         }else{
@@ -213,7 +184,7 @@ void applyConstraints(VKVertex * vk)
         out << " target vertex="<<cnst.getTargetVertex()[0]<<", "
                                 <<cnst.getTargetVertex()[1]<<", "
                                 <<cnst.getTargetVertex()[2]<<std::endl;
-        out<< (VKConstraintBase)cnst <<'\n';
+        out<< (VKConstraintBase&)cnst <<'\n';
 	out.precision(6); //restore default
 	return out;                                 
   }                                              
@@ -221,20 +192,41 @@ void applyConstraints(VKVertex * vk)
 //                   Vertex in plane constraint
 //
   VKPlaneConstraint::VKPlaneConstraint(int NTRK, double a, double b, double c, double d, VKVertex *vk):
-    VKConstraintBase(1,NTRK)
-  {m_A=a; m_B=b; m_C=c; m_D=d; m_originVertex = vk;}
+    VKConstraintBase(1,NTRK, VKContraintType::Plane, vk)
+  {m_A=a; m_B=b; m_C=c; m_D=d; }
   VKPlaneConstraint::~VKPlaneConstraint(){}
   std::ostream &  operator << ( std::ostream& out, const VKPlaneConstraint & cnst  )
-  {     VKVertex * vk = cnst.getOriginVertex();
+  {     const VKVertex * vk = cnst.getOriginVertex();
 	//out.setf( std::ios::scientific); out.precision(7); out << std::endl;
-	out.precision(7); out << std::defaultfloat;
+	out.precision(7); out << std::defaultfloat;
         out << " Vertex in plane constraint  (total NTRK="<<vk->TrackList.size()<<")"<< std::endl;
         out << " Plane(A,B,C,D):"<<cnst.getA()<<", "<<cnst.getB()<<", "<<cnst.getC()<<", "<<cnst.getD()<<std::endl;
-        out<< (VKConstraintBase)cnst <<'\n';
+        out<< (VKConstraintBase&)cnst <<'\n';
 	out.precision(6); //restore default
 	return out;                                 
   }                                              
 
+  VKConstraintBase* VKMassConstraint::clone() const{
+     return new VKMassConstraint(*this);
+  }
+  VKConstraintBase* VKPhiConstraint::clone() const{
+     return new VKPhiConstraint(*this);
+  }
+  VKConstraintBase* VKThetaConstraint::clone() const{
+     return new VKThetaConstraint(*this);
+  }
+  VKConstraintBase* VKPointConstraint::clone() const{
+     return new VKPointConstraint(*this);
+  }
+  VKConstraintBase* VKPlaneConstraint::clone() const{
+     return new VKPlaneConstraint(*this);
+  }
+
+  void VKMassConstraint::applyConstraint(){  calcMassConstraint(this); }
+  void VKPhiConstraint::applyConstraint(){  calcPhiConstraint(this); }
+  void VKThetaConstraint::applyConstraint(){  calcThetaConstraint(this); }
+  void VKPointConstraint::applyConstraint(){  calcPointConstraint(this); }
+  void VKPlaneConstraint::applyConstraint(){  calcPlaneConstraint(this); }
 } /* End of namespace */
 
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..ea0dc1e3dd0a4560636edf58d06a047b7ec06839
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVKalVrtFitter
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
index fbbaf254809d7a4982f7c961e7d54fe373d967e8..c7fd7d5419c12e9d59389da720f38872d70a3918 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
@@ -37,7 +37,7 @@ namespace Trk{
 
   class VKalVrtControl;
 
-  enum { NTrMaxVFit=300 };
+  enum { NTrMaxVFit=200 };
   typedef std::vector<double> dvect;
   class VKalAtlasMagFld;
   class IExtrapolator;
@@ -67,7 +67,7 @@ namespace Trk{
   
 
 //------------------------------------------------------------------------
-
+  //Tool should not be used reentrantly or used publically
   class TrkVKalVrtFitter : public AthAlgTool, virtual public IVertexFitter,
                                               virtual public ITrkVKalVrtFitter,
 					      virtual public IVertexCascadeFitter
@@ -391,7 +391,8 @@ namespace Trk{
         void VKalVrtConfigureFitterCore(int NTRK);
         void VKalToTrkTrack( double, double  , double  , double , double& , double& , double& );
 
-        int VKalVrtFit3(  int ntrk, Amg::Vector3D& Vertex, TLorentzVector&   Momentum,
+        //This is safe as long as the tool is not called from multiple threads or reentrantly
+        int VKalVrtFit3 (  int ntrk, Amg::Vector3D& Vertex, TLorentzVector&   Momentum,
 	                   long int& Charge, dvect& ErrorMatrix, dvect& Chi2PerTrk, 
                            std::vector< std::vector<double> >& TrkAtVrt, double& Chi2 );
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VxCascadeInfo.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VxCascadeInfo.h
index 1e8469ab18ef9d94342214e85628aeaf5a08d9d7..2b29dec7e6d681781a22b17aab023932a0b7b49f 100644
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VxCascadeInfo.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VxCascadeInfo.h
@@ -52,9 +52,9 @@ namespace Trk {
     VxCascadeInfo();
 
     /* constructor */
-    VxCascadeInfo(const std::vector<xAOD::Vertex*> & vertices,
-                  const std::vector<std::vector<TLorentzVector> > & moms,
-                              const std::vector< Amg::MatrixX >   & covs,
+    VxCascadeInfo(std::vector<xAOD::Vertex*>  vertices,
+                  std::vector<std::vector<TLorentzVector> >  moms,
+                              std::vector< Amg::MatrixX >    covs,
 			       int nDoF, double Chi2);
 
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx
index 527f7df9dce2d4dd82f175a013c2e32a7ef1b0f5..bf807d477243df8fb6296ee5a853c6c6ad8cc8a4 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx
@@ -20,7 +20,7 @@
 
 namespace Trk {
 
- extern vkalPropagator  myPropagator;
+ extern const vkalPropagator  myPropagator;
 
 //--------------------------------------------------------------------
 //  Extract xAOD::TrackParticles
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx
index ba87194f0bc251eafa8201f291bf666263c892cd..364e92e95cb5ddfd30030756a0c47f867ff55c04 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx
@@ -19,7 +19,7 @@
 
 namespace Trk{
 
-    extern vkalPropagator  myPropagator;
+    extern const vkalPropagator  myPropagator;
 
 //--------------------------------------------------------------------
 //  Extract TrkTracks
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
index 66bc669292adde7807110103d7f70d115748ed0e..6cba5767c7ddf4421485a9876f6a80a7b4bcb4f7 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
@@ -17,8 +17,7 @@ namespace Trk{
   void TrkVKalVrtFitter::VKalVrtConfigureFitterCore(int NTRK)
   {
     m_FitStatus = 0;     // Drop all previous fit results
-    ForCFT newforcft;    //Create fresh ForCFT
-    std::swap(m_vkalFitControl->vk_forcft,newforcft);
+    m_vkalFitControl->vk_forcft = ForCFT();
   
     //Set input particle masses
     for(int it=0; it<NTRK; it++){
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx
index 7680f750ce31825b711d5a77c6614d7599868a3c..bdfc445db8b79c0bb8076bb4bf16cb1235448ffd 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx
@@ -15,7 +15,7 @@
 #include<iostream>
 
 namespace Trk {
-    extern int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
+    extern int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
                    const std::vector< std::vector<int> > &vertexDefinition,
                    const std::vector< std::vector<int> > &cascadeDefinition,
 		   double definedCnstAccuracy=1.e-4);
@@ -103,7 +103,7 @@ VertexID TrkVKalVrtFitter::startVertex(const  std::vector<const xAOD::TrackParti
       tmpMcnst.Mass     =  massConstraint;
       tmpMcnst.VRT      =  new_vID;
       for(it=0; it<NTRK; it++)tmpMcnst.trkInVrt.push_back(it);
-      m_partMassCnstForCascade.push_back(tmpMcnst);
+      m_partMassCnstForCascade.push_back(std::move(tmpMcnst));
     }
 //
 //
@@ -114,7 +114,7 @@ VertexID TrkVKalVrtFitter::startVertex(const  std::vector<const xAOD::TrackParti
     for(it=0; it<NTRK; it++){
        newV.trkInVrt.push_back(it);
     }
-    m_cascadeVList.push_back(newV);
+    m_cascadeVList.push_back(std::move(newV));
 //--------------------------------------------------------------  
     return new_vID;
 }
@@ -165,7 +165,7 @@ VertexID TrkVKalVrtFitter::nextVertex(const  std::vector<const xAOD::TrackPartic
       tmpMcnst.Mass     =  massConstraint;
       tmpMcnst.VRT      =   new_vID;
       for(int it=0; it<NTRK; it++)tmpMcnst.trkInVrt.push_back(it+presentNT);
-      m_partMassCnstForCascade.push_back(tmpMcnst);
+      m_partMassCnstForCascade.push_back(std::move(tmpMcnst));
     }
 //
 //
@@ -174,7 +174,7 @@ VertexID TrkVKalVrtFitter::nextVertex(const  std::vector<const xAOD::TrackPartic
     for(int it=0; it<NTRK; it++){
        newV.trkInVrt.push_back(it+presentNT);
     }
-    m_cascadeVList.push_back(newV);
+    m_cascadeVList.push_back(std::move(newV));
 //--------------------------------------------------------------  
     return new_vID;
 }
@@ -326,10 +326,10 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
        unsigned int indexFMP;
        for (i_ntrk = m_partListForCascade.begin(); i_ntrk < m_partListForCascade.end(); ++i_ntrk) {
 	  if ((*i_ntrk)->indexOfParameterAtPosition(indexFMP, xAOD::FirstMeasurement)){
-            if(msgLvl(MSG::DEBUG))msg()<< "FirstMeasuredPoint on track is discovered. Use it."<<'\n';
+            ATH_MSG_DEBUG("FirstMeasuredPoint on track is discovered. Use it.");
 	    baseInpTrk.push_back(new CurvilinearParameters((*i_ntrk)->curvilinearParameters(indexFMP)));
           }else{
-            if(msgLvl(MSG::INFO))msg()<< "No FirstMeasuredPoint on track in CascadeFitter. Stop fit"<<'\n';
+            ATH_MSG_DEBUG("No FirstMeasuredPoint on track in CascadeFitter. Stop fit");
             { CLEANCASCADE();  return 0; }
           }	      
        }
@@ -471,7 +471,7 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
          //std::cout<<"pse="; for(int I=0; I<(int)indexV.size(); I++)std::cout<<indexV[I]; std::cout<<'\n';
          IERR = setCascadeMassConstraint(*(m_vkalFitControl->getCascadeEvent()), index , indexT, indexV, m_partMassCnstForCascade[ic].Mass); if(IERR)break;
        }
-       msg(MSG::DEBUG)<<"Setting compressed mass constraints ierr="<<IERR<<endmsg;
+       ATH_MSG_DEBUG("Setting compressed mass constraints ierr="<<IERR);
        if(IERR){ CLEANCASCADE(); return 0;}
 //
 //--------------------------- Refit
@@ -587,12 +587,10 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
 //
 //-------------------------------------Saving
 //
-    msg(MSG::DEBUG)<<"Now save results" << endmsg;
-    //CLHEP::HepSymMatrix VrtCovMtx(3,0);  
+    ATH_MSG_DEBUG("Now save results");
     Amg::MatrixX VrtCovMtx(3,3);
     Trk::Perigee * measPerigee;
-//    std::vector<Trk::VxCandidate*> vxVrtList;    //VK now is replaced by xAOD::Vertex, see below
-    std::vector<xAOD::Vertex*> xaodVrtList;
+    std::vector<xAOD::Vertex*> xaodVrtList(0);
     double phi, theta, invP, mom, fullChi2=0.;
 
     int NDOF=getCascadeNDoF(); if(NDOFsqueezed) NDOF=NDOFsqueezed; 
@@ -608,19 +606,22 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
       VrtCovMtx(2,1) = VrtCovMtx(1,2);
       double Chi2=0; int NTrInV=0;
       for(it=0; it<(int)m_vertexDefinition[iv].size(); it++) { Chi2 += particleChi2[m_vertexDefinition[iv][it]]; NTrInV++ ;};
-//      Trk::RecVertex * tmpRecV = new Trk::RecVertex(FitVertex, VrtCovMtx, NDOF, Chi2); 
       fullChi2+=Chi2;
 
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=  xAOD::Vertex creation
+      xAOD::Vertex * tmpXAODVertex=new xAOD::Vertex();
+      tmpXAODVertex->makePrivateStore();
+      tmpXAODVertex->setPosition(FitVertex);
+      tmpXAODVertex->setFitQuality(Chi2, (float)NDOF);
+      std::vector<VxTrackAtVertex> & tmpVTAV=tmpXAODVertex->vxTrackAtVertex();
+      tmpVTAV.clear();
+
       int NRealT=m_vertexDefinition[iv].size();
-    //std::vector<Trk::VxTrackAtVertex*> * tmpVTAV = new std::vector<Trk::VxTrackAtVertex*>();
-      std::vector<Trk::VxTrackAtVertex> tmpVTAV;
-      //VK CLHEP::HepSymMatrix genCOV( m_vertexDefinition[iv].size()*3+3, 0 );   //Migration                       // Fill cov. matrix for vertex
       Amg::MatrixX genCOV( NRealT*3+3, NRealT*3+3 );     // Fill cov. matrix for vertex
       for( it=0; it<NRealT*3+3; it++){                                 // (X,Y,Z,px1,py1,....pxn,pyn,pzn)
         for( jt=0; jt<=it; jt++){                                      // 
            genCOV(it,jt) = genCOV(jt,it) = fittedCovariance[iv][it*(it+1)/2+jt];      // for real tracks only
       } }                                                              // (first in the list)
-      //VK CLHEP::HepMatrix *fullDeriv=0;                                 // full derivative matrix for ExtendedVxCandidate
       Amg::MatrixX *fullDeriv=0;
       if( m_makeExtendedVertex ){
          //VK fullDeriv=new CLHEP::HepMatrix( NRealT*3+3, NRealT*3+3, 0); // matrix is filled by zeros
@@ -640,7 +641,6 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
          theta=acos( Pz/mom );
          invP = - m_ich[m_vertexDefinition[iv][it]] / mom;   // Change charge sign according to ATLAS
 //  d(Phi,Theta,InvP)/d(Px,Py,Pz)  -  Perigee vs summary momentum
-         //VK CLHEP::HepMatrix tmpDeriv( 5, NRealT*3+3, 0);                            // matrix is filled by zeros
          Amg::MatrixX tmpDeriv( 5, NRealT*3+3);
 	 tmpDeriv.setZero();                            // matrix is filled by zeros
          tmpDeriv(0,1) = -sin(phi);                     // Space derivatives
@@ -657,60 +657,16 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
          tmpDeriv(2+2,3*it+3+0) = -Px/(mom*mom) * invP;  //dInvP/dPx
          tmpDeriv(2+2,3*it+3+1) = -Py/(mom*mom) * invP;  //dInvP/dPy
          tmpDeriv(2+2,3*it+3+2) = -Pz/(mom*mom) * invP;  //dInvP/dPz
-/*/ Old CLHEP---
-         tmpDeriv(1,1) = -sin(phi);                     // Space derivatives
-         tmpDeriv(1,2) =  cos(phi);
-         tmpDeriv(2,1) = -cos(phi)/tan(theta);
-         tmpDeriv(2,2) = -sin(phi)/tan(theta);
-         tmpDeriv(2,3) =  1.;
-         tmpDeriv(2+1,3*it+3+1) = -Py/Pt/Pt;             //dPhi/dPx
-         tmpDeriv(2+1,3*it+3+2) =  Px/Pt/Pt;             //dPhi/dPy
-         tmpDeriv(2+1,3*it+3+3) =  0;                    //dPhi/dPz
-         tmpDeriv(2+2,3*it+3+1) =  Px*Pz/(Pt*mom*mom);   //dTheta/dPx
-         tmpDeriv(2+2,3*it+3+2) =  Py*Pz/(Pt*mom*mom);   //dTheta/dPy
-         tmpDeriv(2+2,3*it+3+3) = -Pt/(mom*mom);         //dTheta/dPz
-         tmpDeriv(2+3,3*it+3+1) = -Px/(mom*mom) * invP;  //dInvP/dPx
-         tmpDeriv(2+3,3*it+3+2) = -Py/(mom*mom) * invP;  //dInvP/dPy
-         tmpDeriv(2+3,3*it+3+3) = -Pz/(mom*mom) * invP;  //dInvP/dPz
-*/
-//----------  Here for CLHEP sub(minrow,maxrow,mincol,maxcol)
-//         if( m_makeExtendedVertex )(*fullDeriv).sub(3*it+3+1,3*it+3+1,tmpDeriv.sub(3,5,3*it+3+1,3*it+3+3));
 //----------  Here for Eigen block(startrow,startcol,sizerow,sizecol)
          if( m_makeExtendedVertex )(*fullDeriv).block(3*it+3+0,3*it+3+0,3,3) = tmpDeriv.block(2,3*it+3+0,3,3);
 //----------
 	 AmgSymMatrix(5) *tmpCovMtx = new AmgSymMatrix(5);                      // New Eigen based EDM
 	 (*tmpCovMtx) = genCOV.similarity(tmpDeriv);                            // New Eigen based EDM
          measPerigee =  new Perigee( 0.,0., phi, theta, invP, PerigeeSurface(FitVertex), tmpCovMtx );  // New Eigen based EDM
-	    //new Trk::ErrorMatrix(new Trk::CovarianceMatrix( genCOV.similarity(tmpDeriv) )) );  //VK Old track EDM 
-//
-//--Trk::VxCandidate---save pointer to VxTrackAtVertex 
-//         Trk::VxTrackAtVertex *tmpPointer = new Trk::VxTrackAtVertex( m_ich[m_vertexDefinition[iv][it]], measPerigee ) ;
-//         ElementLink<Trk::TrackParticleBaseCollection> TEL;  
-//         TEL.setElement( (Trk::TrackParticleBase*) m_partListForCascade[m_vertexDefinition[iv][it]]);
-//         Trk::LinkToTrackParticleBase * ITL = new Trk::LinkToTrackParticleBase(TEL); 
-//         tmpPointer->setOrigTrack(ITL);                                  //pointer to initial TrackParticleBase
-//         tmpPointer->setWeight(1.);
-//         tmpVTAV->push_back( tmpPointer );
-//--xAOD::Vertex--- save VxTrackAtVertex directly 
-         tmpVTAV.emplace_back(  m_ich[m_vertexDefinition[iv][it]], measPerigee ) ;
-       }
-//-------------------------------------------------------------- Trk::VxCandidate creation
-//       Trk::VxCandidate* tmpVx;
-//       if( m_makeExtendedVertex ){
-//  	      Amg::MatrixX *tmpCovMtx = new Amg::MatrixX(NRealT*3+3,NRealT*3+3);                      // New Eigen based EDM
-//              (*tmpCovMtx)=genCOV.similarity(*fullDeriv);
-//              tmpVx = new ExtendedVxCandidate(*tmpRecV,*tmpVTAV, tmpCovMtx  );                  // New Eigen based EDM
-//	              //new ErrorMatrix(new CovarianceMatrix(  genCOV.similarity(*fullDeriv)  ))  ); //VK Old track EDM 
-//	              delete fullDeriv;
-//       }else{ tmpVx = new VxCandidate(*tmpRecV,*tmpVTAV);    }
-//       vxVrtList.push_back(tmpVx);                          //VK Save Trk::VxCandidate
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=  xAOD::Vertex creation
-       xAOD::Vertex * tmpXAODVertex=new xAOD::Vertex();
-       tmpXAODVertex->makePrivateStore();
-       tmpXAODVertex->setPosition(FitVertex);
-       tmpXAODVertex->setFitQuality(Chi2, (float)NDOF);
-       std::vector<float> floatErrMtx;
-       if( m_makeExtendedVertex ) {
+         tmpVTAV.emplace_back( particleChi2[m_vertexDefinition[iv][it]] , measPerigee ) ;
+      }
+      std::vector<float> floatErrMtx;
+      if( m_makeExtendedVertex ) {
   	 Amg::MatrixX tmpCovMtx(NRealT*3+3,NRealT*3+3);                      // New Eigen based EDM
          tmpCovMtx=genCOV.similarity(*fullDeriv);
          floatErrMtx.resize((NRealT*3+3)*(NRealT*3+3+1)/2);
@@ -719,27 +675,25 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
            for(int j=0;j<=i;j++){
                floatErrMtx.at(ivk++)=tmpCovMtx(i,j);
            }
-	 }
-       }else{
+         }
+      }else{
          floatErrMtx.resize(6);
          for(int i=0; i<6; i++) floatErrMtx[i]=covVertices[iv][i];
-       }
-       tmpXAODVertex->setCovariance(floatErrMtx);
-       std::vector<VxTrackAtVertex> & xaodVTAV=tmpXAODVertex->vxTrackAtVertex();
-       xaodVTAV.swap(tmpVTAV);
-       for(int itvk=0; itvk<(int)xaodVTAV.size(); itvk++) {
+      }
+      tmpXAODVertex->setCovariance(floatErrMtx);
+      for(int itvk=0; itvk<NRealT; itvk++) {
           ElementLink<xAOD::TrackParticleContainer> TEL;
-	  if(itvk < (int)m_cascadeVList[iv].trkInVrt.size()){
-	    TEL.setElement( m_partListForCascade[ m_cascadeVList[iv].trkInVrt[itvk] ] );
-	  }else{
-	    TEL.setElement( 0 );
-	  }
+          if(itvk < (int)m_cascadeVList[iv].trkInVrt.size()){
+            TEL.setElement( m_partListForCascade[ m_cascadeVList[iv].trkInVrt[itvk] ] );
+          }else{
+            TEL.setElement( 0 );
+          }
           tmpXAODVertex->addTrackAtVertex(TEL,1.);
-       }
-       xaodVrtList.push_back(tmpXAODVertex);              //VK Save xAOD::Vertex
+      }
+      xaodVrtList.push_back(tmpXAODVertex);              //VK Save xAOD::Vertex
 //
 //---- Save and clean
-       delete fullDeriv;   //Mandatory cleaning
+      delete fullDeriv;   //Mandatory cleaning
     }
 //
 //  Save momenta of all particles including combined at vertex positions
@@ -761,8 +715,8 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
         for( jt=0; jt<=it; jt++){
            COV(it,jt) = COV(jt,it) = fittedCovariance[iv][it*(it+1)/2+jt];
       } }
-      particleMoms.push_back( tmpMoms );
-      particleCovs.push_back( COV );
+      particleMoms.push_back( std::move(tmpMoms) );
+      particleCovs.push_back( std::move(COV) );
       allFitPrt += NTrkF;
     }
 //
@@ -786,7 +740,7 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
 //
 //
 //    VxCascadeInfo * recCascade= new VxCascadeInfo(vxVrtList,particleMoms,particleCovs, NDOF ,fullChi2);
-    VxCascadeInfo * recCascade= new VxCascadeInfo(xaodVrtList,particleMoms,particleCovs, NDOF ,fullChi2);
+    VxCascadeInfo * recCascade= new VxCascadeInfo(std::move(xaodVrtList),std::move(particleMoms),std::move(particleCovs), NDOF ,fullChi2);
     recCascade->setFullCascadeCovariance(FULL);
     CLEANCASCADE();
     return recCascade;
@@ -840,7 +794,7 @@ StatusCode  TrkVKalVrtFitter::addMassConstraint(VertexID Vertex,
        tmpMcnst.pseudoInVrt.push_back( pseudotracksInConstraint[ivc] );
     }
 
-    m_partMassCnstForCascade.push_back(tmpMcnst);
+    m_partMassCnstForCascade.push_back(std::move(tmpMcnst));
   
     return StatusCode::SUCCESS;
 }
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VxCascadeInfo.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VxCascadeInfo.cxx
index 1f9d99a4eb85d3a8dd7018e1b172a31bc20c9e8b..b9b9cff2cc54d064e09f7c61e7d4e02ea2d51cc4 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VxCascadeInfo.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VxCascadeInfo.cxx
@@ -14,17 +14,13 @@ namespace Trk {
 
   VxCascadeInfo::VxCascadeInfo() :  VxSecVertexInfo(), m_nDoF(0), m_fullChi2(0) {}
 
-  VxCascadeInfo::VxCascadeInfo(const std::vector<xAOD::Vertex*> & vertices,
-                               const std::vector< std::vector<TLorentzVector> > & moms,
-                               const std::vector< Amg::MatrixX > & covs,
+  VxCascadeInfo::VxCascadeInfo(std::vector<xAOD::Vertex*> vertices,
+                               std::vector< std::vector<TLorentzVector> > moms,
+                               std::vector< Amg::MatrixX >  covs,
 			       int nDoF, double Chi2    ) :
-    VxSecVertexInfo(vertices)
+    VxSecVertexInfo(std::move(vertices)), m_particleMomAtVertex(std::move(moms)),
+     m_covarianceAtVertex(std::move(covs)),  m_nDoF(nDoF), m_fullChi2(Chi2)
   {
-    m_nDoF=nDoF;   m_fullChi2=Chi2;
-    for( int iv=0; iv<(int)moms.size(); iv++ ){
-         m_particleMomAtVertex.push_back( moms[iv] );
-         m_covarianceAtVertex.push_back( covs[iv] );
-    }
   }
 
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/CMakeLists.txt
index 72cd99948fb3cadfacb254f35ea5304a0f5cf7c1..60a9d5a8ed88c7befbbb53a576d59ffb35b7529f 100644
--- a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/CMakeLists.txt
@@ -29,11 +29,11 @@ atlas_add_library( TrkVertexAnalysisUtilsLib
                    PUBLIC_HEADERS TrkVertexAnalysisUtils
                    INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives EventKernel EventPrimitives xAODTracking GaudiKernel
+                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives EventKernel  xAODTracking GaudiKernel
                    PRIVATE_LINK_LIBRARIES TrkParametersBase TrkParticleBase VxVertex TrkExInterfaces )
 
 atlas_add_component( TrkVertexAnalysisUtils
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives EventKernel EventPrimitives xAODTracking GaudiKernel TrkParametersBase TrkParticleBase VxVertex TrkExInterfaces TrkVertexAnalysisUtilsLib )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives EventKernel xAODTracking GaudiKernel TrkParametersBase TrkParticleBase VxVertex TrkExInterfaces TrkVertexAnalysisUtilsLib )
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/TrkVertexAnalysisUtils/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/TrkVertexAnalysisUtils/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..2f408a772f03ff41d53ac522a2d10b14231a5a6b
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/TrkVertexAnalysisUtils/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVertexAnalysisUtils
diff --git a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/TrkVertexAnalysisUtils/V0Tools.h b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/TrkVertexAnalysisUtils/V0Tools.h
old mode 100755
new mode 100644
index b05e2ed7c507e1285c319052225a69ffbe904670..40ade4882aacd8df2f44817792909c51fe02c597
--- a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/TrkVertexAnalysisUtils/V0Tools.h
+++ b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/TrkVertexAnalysisUtils/V0Tools.h
@@ -6,13 +6,11 @@
 #define V0TOOLS_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "EventKernel/PdtPdg.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "EventPrimitives/EventPrimitives.h"
-#include "GeoPrimitives/GeoPrimitivesHelpers.h"
 #include "xAODTracking/Vertex.h"
-#include "xAODTracking/TrackParticleContainer.h"
-#include "CLHEP/Vector/LorentzVector.h"
+#include "xAODTracking/TrackParticle.h"
+#include "EventKernel/PdtPdg.h"
 
 /**
  *  @class V0Tools
@@ -23,9 +21,12 @@
  *  e.bouhova@cern.ch
  */
 
+namespace CLHEP{
+    class HepLorentzVector;
+}
+ 
 namespace Trk
 {
- class TrackParticleBase;
  class IExtrapolator;
 
  static const InterfaceID IID_V0Tools("V0Tools", 1, 1);
@@ -204,6 +205,17 @@ namespace Trk
  */
   double lxyError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex) const;
 
+/**
+ * projection of distance in 3D of the vertex wrt an xAOD::Vertex vertex along the momentum direction
+ * (Px*dx+Py*dy+Pz*dz)/p
+ */
+  double lxyz(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex) const;
+
+/**
+ * error on lxyz
+ */
+  double lxyzError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex) const;
+
 /**
  * proper time wrt an xAOD::Vertex vertex assuming posTrackMass and negTrackMass
  * tau = CONST*M*lxy/pT
@@ -269,6 +281,28 @@ namespace Trk
   double massTauCov(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double posTrackMass, double negTrackMass) const;
   double massTauCov(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, const std::vector<double> &masses) const;
 
+/**
+ * proper time in 3D wrt an xAOD::Vertex vertex assuming track masses
+ */
+  double tau3D(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, const std::vector<double> &masses) const;
+
+/**
+ * proper time in 3D wrt an xAOD::Vertex vertex assuming massV0
+ * imposing a V0 mass without making an adjustment 
+ */
+  double tau3D(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double massV0) const;
+
+/**
+ * proper time error in 3D wrt an xAOD::Vertex vertex assuming track masses
+ */
+  double tau3DError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, const std::vector<double> &masses) const;
+
+/**
+ * proper time error in 3D wrt an xAOD::Vertex vertex assuming massV0
+ * imposing a V0 mass without making an adjustment 
+ */
+  double tau3DError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double massV0) const;
+
 /**
  * Polarization angles in helicity frame (using positive track):
  *
@@ -346,14 +380,16 @@ namespace Trk
 /**
  * pointer from a mass constrained (Kshort, Lambda or Lambdabar) V0 to the unconstrained one
  */
-  xAOD::Vertex* v0Link(const xAOD::Vertex * vxCandidate) const;
+  const xAOD::Vertex* v0Link(const xAOD::Vertex * vxCandidate) const;
 
 /**
  * pointers to Kshort, Lambda or Lambdabar mass constrained V0s, if they exist, from the unconstrained one
  */
-  xAOD::Vertex* kshortLink(const xAOD::Vertex * vxCandidate) const;
-  xAOD::Vertex* lambdaLink(const xAOD::Vertex * vxCandidate) const;
-  xAOD::Vertex* lambdabarLink(const xAOD::Vertex * vxCandidate) const;
+  const xAOD::Vertex* kshortLink(const xAOD::Vertex * vxCandidate) const;
+  const xAOD::Vertex* lambdaLink(const xAOD::Vertex * vxCandidate) const;
+  const xAOD::Vertex* lambdabarLink(const xAOD::Vertex * vxCandidate) const;
+ 
+  Amg::MatrixX makeV0Cov(const xAOD::Vertex * vxCandidate) const;
  
   private:
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx
old mode 100755
new mode 100644
index fc459a68aa31e40a67ada99e65ed862d50c0e043..c70053ba406e838e6828bdbdd78532fff9049231
--- a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx
@@ -15,14 +15,11 @@
 #include "TrkParticleBase/LinkToTrackParticleBase.h"
 #include "TrkParticleBase/TrackParticleBase.h"
 #include "VxVertex/VxTrackAtVertex.h"
-#include "EventPrimitives/EventPrimitives.h"
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
-#include "CLHEP/Units/SystemOfUnits.h"
-#include "CLHEP/Units/PhysicalConstants.h"
 #include "xAODTracking/Vertex.h"
 #include "xAODTracking/VertexContainer.h"
-
+#include "CLHEP/Vector/LorentzVector.h"
 namespace Trk
 {
 
@@ -58,46 +55,42 @@ namespace Trk
   }
 
 
-  xAOD::Vertex * V0Tools::v0Link(const xAOD::Vertex * vxCandidate) const
+  const xAOD::Vertex * V0Tools::v0Link(const xAOD::Vertex * vxCandidate) const
   {
-    xAOD::Vertex* v0(0);
-    static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "V0Link" );
+    const xAOD::Vertex* v0(0);
+    const static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "V0Link" );
     if ((acc(*vxCandidate)).isValid()) {
-      const xAOD::Vertex* v0_linked = *(acc(*vxCandidate));
-      if (v0_linked) v0 = const_cast<xAOD::Vertex*>(v0_linked);
+      v0 = *(acc(*vxCandidate));
     }
     return v0;
   }
 
-  xAOD::Vertex * V0Tools::kshortLink(const xAOD::Vertex * vxCandidate) const
+  const xAOD::Vertex * V0Tools::kshortLink(const xAOD::Vertex * vxCandidate) const
   {
-    xAOD::Vertex* v0(0);
-    static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "KshortLink" );
+    const xAOD::Vertex* v0(0);
+    const static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "KshortLink" );
     if ((acc(*vxCandidate)).isValid()) {
-      const xAOD::Vertex* v0_linked = *(acc(*vxCandidate));
-      if (v0_linked) v0 = const_cast<xAOD::Vertex*>(v0_linked);
+      v0 = *(acc(*vxCandidate));
     }
     return v0;
   }
 
-  xAOD::Vertex * V0Tools::lambdaLink(const xAOD::Vertex * vxCandidate) const
+  const xAOD::Vertex * V0Tools::lambdaLink(const xAOD::Vertex * vxCandidate) const
   {
-    xAOD::Vertex* v0(0);
-    static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "LambdaLink" );
+    const xAOD::Vertex* v0(0);
+    const static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "LambdaLink" );
     if ((acc(*vxCandidate)).isValid()) {
-      const xAOD::Vertex* v0_linked = *(acc(*vxCandidate));
-      if (v0_linked) v0 = const_cast<xAOD::Vertex*>(v0_linked);
+      v0 = *(acc(*vxCandidate));
     }
     return v0;
   }
 
-  xAOD::Vertex * V0Tools::lambdabarLink(const xAOD::Vertex * vxCandidate) const
+  const xAOD::Vertex * V0Tools::lambdabarLink(const xAOD::Vertex * vxCandidate) const
   {
-    xAOD::Vertex* v0(0);
-    static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "LambdabarLink" );
+    const xAOD::Vertex* v0(0);
+    const static SG::AuxElement::Accessor< ElementLink< xAOD::VertexContainer > > acc( "LambdabarLink" );
     if ((acc(*vxCandidate)).isValid()) {
-      const xAOD::Vertex* v0_linked = *(acc(*vxCandidate));
-      if (v0_linked) v0 = const_cast<xAOD::Vertex*>(v0_linked);
+      v0 = *(acc(*vxCandidate));
     }
     return v0;
   }
@@ -183,7 +176,7 @@ namespace Trk
     if (fullCov == 0) return -999999.;
     unsigned int ndim = fullCov->rows();
     double E=0., Px=0., Py=0., Pz=0.; 
-    std::vector<double>d0(NTrk), z0(NTrk), phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
+    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dm2dphi(NTrk), dm2dtheta(NTrk), dm2dqOverP(NTrk);
     for( unsigned int it=0; it<NTrk; it++) {
       if (masses[it] >= 0.) {
@@ -191,8 +184,6 @@ namespace Trk
         double trkCharge = 1.;
         if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
         charge[it] = trkCharge;
-        d0[it]     = bPer->parameters()[Trk::d0];
-        z0[it]     = bPer->parameters()[Trk::z0];
         phi[it]    = bPer->parameters()[Trk::phi];
         theta[it]  = bPer->parameters()[Trk::theta];
         qOverP[it] = bPer->parameters()[Trk::qOverP];
@@ -254,13 +245,12 @@ namespace Trk
     Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
     if (fullCov == 0) return -999999.;
  
-    double phi=0.,theta=0.,invP=0.;
     for( unsigned int it=0; it<NTrk; it++){
       if (masses[it] >= 0.) {
         const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
-        phi   =  bPer->parameters()[Trk::phi];
-        theta =  bPer->parameters()[Trk::theta];
-        invP  =  bPer->parameters()[Trk::qOverP];
+        double phi   =  bPer->parameters()[Trk::phi];
+        double theta =  bPer->parameters()[Trk::theta];
+        double invP  =  bPer->parameters()[Trk::qOverP];
         double px = cos(phi)*sin(theta)/fabs(invP);
         double py = sin(phi)*sin(theta)/fabs(invP);
         double pz = cos(theta)/fabs(invP);
@@ -285,17 +275,16 @@ namespace Trk
       }
     }
   
-    double dMdPx=0., dMdPy=0., dMdPz=0., dMdPhi=0., dMdTheta=0., dMdInvP=0.;
     std::vector<double> Deriv(3*NTrk+3, 0.);
     for(unsigned int it=0; it<NTrk; it++){
       if (masses[it] >= 0.) {
-        dMdPx = ( totalMom.E() * particleMom[it].Px()/particleMom[it].E() - totalMom.Px() ) / totalMom.M();
-        dMdPy = ( totalMom.E() * particleMom[it].Py()/particleMom[it].E() - totalMom.Py() ) / totalMom.M();
-        dMdPz = ( totalMom.E() * particleMom[it].Pz()/particleMom[it].E() - totalMom.Pz() ) / totalMom.M();
+        double dMdPx = ( totalMom.E() * particleMom[it].Px()/particleMom[it].E() - totalMom.Px() ) / totalMom.M();
+        double dMdPy = ( totalMom.E() * particleMom[it].Py()/particleMom[it].E() - totalMom.Py() ) / totalMom.M();
+        double dMdPz = ( totalMom.E() * particleMom[it].Pz()/particleMom[it].E() - totalMom.Pz() ) / totalMom.M();
   
-        dMdPhi   = dMdPx*particleDeriv[it](0,0) + dMdPy*particleDeriv[it](1,0) + dMdPz*particleDeriv[it](2,0);
-        dMdTheta = dMdPx*particleDeriv[it](0,1) + dMdPy*particleDeriv[it](1,1) + dMdPz*particleDeriv[it](2,1);
-        dMdInvP  = dMdPx*particleDeriv[it](0,2) + dMdPy*particleDeriv[it](1,2) + dMdPz*particleDeriv[it](2,2);
+        double dMdPhi   = dMdPx*particleDeriv[it](0,0) + dMdPy*particleDeriv[it](1,0) + dMdPz*particleDeriv[it](2,0);
+        double dMdTheta = dMdPx*particleDeriv[it](0,1) + dMdPy*particleDeriv[it](1,1) + dMdPz*particleDeriv[it](2,1);
+        double dMdInvP  = dMdPx*particleDeriv[it](0,2) + dMdPy*particleDeriv[it](1,2) + dMdPz*particleDeriv[it](2,2);
   
         Deriv[3*it + 3 + 0] = dMdPhi;    Deriv[3*it + 3 + 1] = dMdTheta; Deriv[3*it + 3 + 2] = dMdInvP;
       }
@@ -327,7 +316,7 @@ namespace Trk
       return -999999.;
     }
     double E=0., Px=0., Py=0., Pz=0.; 
-    std::vector<double>d0(NTrk), z0(NTrk), phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
+    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dm2dphi(NTrk), dm2dtheta(NTrk), dm2dqOverP(NTrk);
     Amg::MatrixX V0_cor(5*NTrk,5*NTrk); V0_cor.setZero();
     for( unsigned int it=0; it<NTrk; it++) {
@@ -346,8 +335,6 @@ namespace Trk
         double trkCharge = 1.;
         if (bPer->parameters()(Trk::qOverP) < 0.) trkCharge = -1.;
         charge[it] = trkCharge;
-        d0[it]     = bPer->parameters()(Trk::d0);
-        z0[it]     = bPer->parameters()(Trk::z0);
         phi[it]    = bPer->parameters()(Trk::phi);
         theta[it]  = bPer->parameters()(Trk::theta);
         qOverP[it] = bPer->parameters()(Trk::qOverP);
@@ -632,9 +619,7 @@ namespace Trk
   double V0Tools::pTError(const xAOD::Vertex * vxCandidate) const
   {
     unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
-    Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero(); // no full covariance
     double Px=0., Py=0.; 
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
     std::vector<double>dPTdqOverP(NTrk), dPTdtheta(NTrk), dPTdphi(NTrk);
@@ -644,30 +629,17 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
-      const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-      if (fullCov == 0) {
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double PTsq = Px*Px+Py*Py;
     double PT = (PTsq>0.) ? sqrt(PTsq) : 0.;
@@ -697,6 +669,7 @@ namespace Trk
         D_vec(5*it+4,0)  = dPTdqOverP[it];
       }
       if (fullCov == 0) {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         PtErrSq = D_vec.transpose() * V0_cov * D_vec;
       } else {
         PtErrSq = D_vec.transpose() * fullCov->block(0,0,5*NTrk-1,5*NTrk-1) * D_vec;
@@ -793,13 +766,10 @@ namespace Trk
     double dx = vert.x();
     double dy = vert.y();
     double dz = vert.z();
-    Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
     double Px=0., Py=0., Pz=0.;
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
     std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk);
-    std::vector<double>dP2dqOverP(NTrk), dP2dtheta(NTrk), dP2dphi(NTrk);
     std::vector<double>da0dqOverP(NTrk), da0dtheta(NTrk), da0dphi(NTrk);
 
     Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
@@ -807,34 +777,20 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpzdqOverP[it] = -(cos(theta[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpzdtheta[it]  = -(sin(theta[it])*charge[it])/qOverP[it];
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
+      dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+      dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
       Pz += bPer->momentum()[Trk::pz];
-      if (fullCov == 0) {
-        //V0_cov.block(5*it,5*it,5,5) = *(bPer->covariance());
-        const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double P2 = Px*Px+Py*Py+Pz*Pz;
     double B = Px*dx+Py*dy+Pz*dz;
@@ -846,14 +802,14 @@ namespace Trk
     double da0dy0 = -da0dy;
     double da0dz0 = -da0dz;
     for( unsigned int it=0; it<NTrk; it++) {
-      dP2dqOverP[it] = 2.*(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]);
-      dP2dtheta[it]  = 2.*(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it]);
-      dP2dphi[it]    = 2.*(Px*dpxdphi[it]+Py*dpydphi[it]);
-      da0dqOverP[it] =  (B*(P2*dpzdqOverP[it]-Pz*dP2dqOverP[it]) +
+      double dP2dqOverP = 2.*(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]);
+      double dP2dtheta  = 2.*(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it]);
+      double dP2dphi    = 2.*(Px*dpxdphi[it]+Py*dpydphi[it]);
+      da0dqOverP[it] =  (B*(P2*dpzdqOverP[it]-Pz*dP2dqOverP) +
                          Pz*P2*(dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it]))/(P2*P2);
-      da0dtheta[it]  =  (B*(P2*dpzdtheta[it]-Pz*dP2dtheta[it]) +
+      da0dtheta[it]  =  (B*(P2*dpzdtheta[it]-Pz*dP2dtheta) +
                          Pz*P2*(dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it]))/(P2*P2);
-      da0dphi[it]    = -(B*Pz*dP2dphi[it] -
+      da0dphi[it]    = -(B*Pz*dP2dphi -
                          Pz*P2*(dx*dpxdphi[it]+dy*dpydphi[it]))/(P2*P2);
     }
 
@@ -885,6 +841,7 @@ namespace Trk
       if (fullCov != 0) {
         W_mat.block(0,0,ndim,ndim) = *fullCov;
       } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
         W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
       }
@@ -929,9 +886,7 @@ namespace Trk
     double dx = vert.x();
     double dy = vert.y();
     double dz = vert.z();
-    Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
     double Px=0., Py=0., Pz=0.;
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
     std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk);
@@ -942,36 +897,22 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
       if ( in3D ) {
-        dpzdqOverP[it] = -(cos(theta[it])*charge[it])/(qOverP[it]*qOverP[it]);
-        dpzdtheta[it]  = -(sin(theta[it])*charge[it])/qOverP[it];
+        dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+        dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
       }
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
       Pz += bPer->momentum()[Trk::pz];
-      if (fullCov == 0) {
-        //V0_cov.block(5*it,5*it,5,5) = *(bPer->covariance());
-        const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double cosineTheta;
     double a0val;
@@ -1027,6 +968,7 @@ namespace Trk
       if (fullCov != 0) {
         W_mat.block(0,0,ndim,ndim) = *fullCov;
       } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
         W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
       }
@@ -1075,12 +1017,9 @@ namespace Trk
     double dx = vert.x();
     double dy = vert.y();
     unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
-    Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
     double Px=0., Py=0.; 
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
-    std::vector<double>dPTdqOverP(NTrk), dPTdtheta(NTrk), dPTdphi(NTrk);
     std::vector<double>dLxydqOverP(NTrk), dLxydtheta(NTrk), dLxydphi(NTrk);
 
     Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
@@ -1088,43 +1027,29 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
-      if (fullCov == 0) {
-        //V0_cov.block(5*it,5*it,5,5) = *(bPer->covariance());
-        const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double PTsq = Px*Px+Py*Py;
     double PT = (PTsq>0.) ? sqrt(PTsq) : 0.;
-    double LXYoverPT = (Px*dx+Py*dy)/(PT*PT);
+    double LXYoverPT = (Px*dx+Py*dy)/PTsq;
 
     for( unsigned int it=0; it<NTrk; it++) {
-      dPTdqOverP[it]  = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
-      dPTdtheta[it]   = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
-      dPTdphi[it]     = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
-      dLxydqOverP[it] = (dx*dpxdqOverP[it]+dy*dpydqOverP[it])/PT-LXYoverPT*dPTdqOverP[it];
-      dLxydtheta[it]  = (dx*dpxdtheta[it]+dy*dpydtheta[it])/PT-LXYoverPT*dPTdtheta[it];
-      dLxydphi[it]    = (dx*dpxdphi[it]+dy*dpydphi[it])/PT-LXYoverPT*dPTdphi[it];
+      double dPTdqOverP  = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
+      double dPTdtheta   = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
+      double dPTdphi     = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
+      dLxydqOverP[it] = (dx*dpxdqOverP[it]+dy*dpydqOverP[it])/PT-LXYoverPT*dPTdqOverP;
+      dLxydtheta[it]  = (dx*dpxdtheta[it]+dy*dpydtheta[it])/PT-LXYoverPT*dPTdtheta;
+      dLxydphi[it]    = (dx*dpxdphi[it]+dy*dpydphi[it])/PT-LXYoverPT*dPTdphi;
     }
     double dLxydx = Px/PT;
     double dLxydy = Py/PT;
@@ -1159,6 +1084,7 @@ namespace Trk
       if (fullCov != 0) {
         W_mat.block(0,0,ndim,ndim) = *fullCov;
       } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
         W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
       }
@@ -1190,6 +1116,129 @@ namespace Trk
     return (LxyErrsq>0.) ? sqrt(LxyErrsq) : 0.;
   }
 
+  double V0Tools::lxyz(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex) const
+  {
+    auto vert = vxCandidate->position() - vertex->position();
+    double dx = vert.x();
+    double dy = vert.y();
+    double dz = vert.z();
+    Amg::Vector3D mom = V0Momentum(vxCandidate);
+    double dxyz= (mom.x()*dx + mom.y()*dy + mom.z()*dz)/mom.mag();
+    return dxyz;
+  }
+
+  double V0Tools::lxyzError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex) const
+  {
+    auto vert = vxCandidate->position() - vertex->position();
+    double dx = vert.x();
+    double dy = vert.y();
+    double dz = vert.z();
+    unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
+    double Px=0., Py=0., Pz=0.; 
+    std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
+    std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
+    std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk);
+    std::vector<double>dLxyzdqOverP(NTrk), dLxyzdtheta(NTrk), dLxyzdphi(NTrk);
+
+    Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
+    for( unsigned int it=0; it<NTrk; it++) {
+      const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
+      double trkCharge = 1.;
+      if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
+      dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+      dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
+      Px += bPer->momentum()[Trk::px];
+      Py += bPer->momentum()[Trk::py];
+      Pz += bPer->momentum()[Trk::pz];
+    }
+    double Psq = Px*Px+Py*Py+Pz*Pz;
+    double P = (Psq>0.) ? sqrt(Psq) : 0.;
+    double LXYZoverP = (Px*dx+Py*dy+Pz*dz)/Psq;
+
+    for( unsigned int it=0; it<NTrk; it++) {
+      double dPdqOverP  = (Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it])/P;
+      double dPdtheta   = (Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/P;
+      double dPdphi     = (Px*dpxdphi[it]+Py*dpydphi[it])/P;
+      dLxyzdqOverP[it] = (dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it])/P-LXYZoverP*dPdqOverP;
+      dLxyzdtheta[it]  = (dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it])/P-LXYZoverP*dPdtheta;
+      dLxyzdphi[it]    = (dx*dpxdphi[it]+dy*dpydphi[it])/P-LXYZoverP*dPdphi;
+    }
+    double dLxyzdx = Px/P;
+    double dLxyzdy = Py/P;
+    double dLxyzdz = Pz/P;
+    double dLxyzdx0 = -dLxyzdx;
+    double dLxyzdy0 = -dLxyzdy;
+    double dLxyzdz0 = -dLxyzdz;
+
+    unsigned int ndim = 0;
+    if (fullCov != 0) {
+      ndim = fullCov->rows();
+    } else {
+      ndim = 5*NTrk+3;
+    }
+
+    Amg::MatrixX V0_err;
+    if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
+      Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
+      for( unsigned int it=0; it<NTrk; it++) {
+        D_vec(5*it+0)  = 0.;
+        D_vec(5*it+1)  = 0.;
+        D_vec(5*it+2)  = dLxyzdphi[it];
+        D_vec(5*it+3)  = dLxyzdtheta[it];
+        D_vec(5*it+4)  = dLxyzdqOverP[it];
+      }
+      D_vec(5*NTrk+0) = dLxyzdx;
+      D_vec(5*NTrk+1) = dLxyzdy;
+      D_vec(5*NTrk+2) = dLxyzdz;
+      D_vec(5*NTrk+3) = dLxyzdx0;
+      D_vec(5*NTrk+4) = dLxyzdy0;
+      D_vec(5*NTrk+5) = dLxyzdz0;
+
+      Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
+      if (fullCov != 0) {
+        W_mat.block(0,0,ndim,ndim) = *fullCov;
+      } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
+        W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
+        W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
+      }
+      W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
+      V0_err = D_vec.transpose() * W_mat * D_vec;
+    } else if (ndim == 3*NTrk+3) {
+      Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
+      D_vec(0)  = dLxyzdx;
+      D_vec(1)  = dLxyzdy;
+      D_vec(2)  = dLxyzdz;
+      for( unsigned int it=0; it<NTrk; it++) {
+        D_vec(3*it+3) = dLxyzdphi[it];
+        D_vec(3*it+4) = dLxyzdtheta[it];
+        D_vec(3*it+5) = dLxyzdqOverP[it];
+      }
+      D_vec(3*NTrk+3) = dLxyzdx0;
+      D_vec(3*NTrk+4) = dLxyzdy0;
+      D_vec(3*NTrk+5) = dLxyzdz0;
+
+      Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
+      W_mat.block(0,0,ndim,ndim) = *fullCov;
+      W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
+      V0_err = D_vec.transpose() * W_mat * D_vec;
+    }
+
+    double LxyzErrsq = V0_err(0,0);
+    if (LxyzErrsq <= 0.) ATH_MSG_DEBUG("lxyzError: negative sqrt LxyzErrsq " << LxyzErrsq);
+    delete fullCov;
+    return (LxyzErrsq>0.) ? sqrt(LxyzErrsq) : 0.;
+  }
+
   double V0Tools::tau(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double posTrackMass, double negTrackMass) const
   {
     std::vector<double> masses = {posTrackMass, negTrackMass};
@@ -1268,15 +1317,10 @@ namespace Trk
     double dx = vert.x();
     double dy = vert.y();
     double M = invariantMass(vxCandidate, masses);
-    Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
     double E=0., Px=0., Py=0., Pz=0.; 
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
     std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk), dedqOverP(NTrk);
-    std::vector<double>dMdqOverP(NTrk), dMdtheta(NTrk), dMdphi(NTrk);
-    std::vector<double>dPTdqOverP(NTrk), dPTdtheta(NTrk), dPTdphi(NTrk);
-    std::vector<double>dLXYdqOverP(NTrk), dLXYdtheta(NTrk), dLXYdphi(NTrk);
     std::vector<double>dTaudqOverP(NTrk), dTaudtheta(NTrk), dTaudphi(NTrk);
 
     Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
@@ -1284,55 +1328,40 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      double tmp = 1./(qOverP[it]*qOverP[it]) + masses[it]*masses[it];
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
       double pe = (tmp>0.) ? sqrt(tmp) : 0.;
-      e[it] = pe;
-      dedqOverP[it]  = -1./(qOverP[it]*qOverP[it]*qOverP[it]*e[it]);
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpzdqOverP[it] = -(cos(theta[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpzdtheta[it]  = -(sin(theta[it])*charge[it])/qOverP[it];
-      E  += e[it];
+      dedqOverP[it]  = -1./(qOverP*qOverP*qOverP*pe);
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
+      dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+      dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
+      E  += pe;
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
       Pz += bPer->momentum()[Trk::pz];
-      if (fullCov == 0) {
-        //V0_cov.block(5*it,5*it,5,5) = *(bPer->covariance());
-        const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double LXY = Px*dx+Py*dy;
 
     for( unsigned int it=0; it<NTrk; it++) {
-      dMdqOverP[it]   = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
-      dMdtheta[it]    = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
-      dMdphi[it]      = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
-      dPTdqOverP[it]  =  (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
-      dPTdtheta[it]   =  (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
-      dPTdphi[it]     =  (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
-      dLXYdqOverP[it] =  dx*dpxdqOverP[it]+dy*dpydqOverP[it];
-      dLXYdtheta[it]  =  dx*dpxdtheta[it]+dy*dpydtheta[it];
-      dLXYdphi[it]    =  dx*dpxdphi[it]+dy*dpydphi[it];
-      dTaudqOverP[it] =  (LXY*dMdqOverP[it]+M*dLXYdqOverP[it])/(PT*PT)-(2.*LXY*M*dPTdqOverP[it])/(PT*PT*PT);
-      dTaudtheta[it]  =  (LXY*dMdtheta[it]+M*dLXYdtheta[it])/(PT*PT)-(2.*LXY*M*dPTdtheta[it])/(PT*PT*PT);
-      dTaudphi[it]    =  (LXY*dMdphi[it]+M*dLXYdphi[it])/(PT*PT)-(2.*LXY*M*dPTdphi[it])/(PT*PT*PT);
+      double dMdqOverP   = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
+      double dMdtheta    = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
+      double dMdphi      = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
+      double dPTdqOverP  =  (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
+      double dPTdtheta   =  (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
+      double dPTdphi     =  (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
+      double dLXYdqOverP =  dx*dpxdqOverP[it]+dy*dpydqOverP[it];
+      double dLXYdtheta  =  dx*dpxdtheta[it]+dy*dpydtheta[it];
+      double dLXYdphi    =  dx*dpxdphi[it]+dy*dpydphi[it];
+      dTaudqOverP[it] =  (LXY*dMdqOverP+M*dLXYdqOverP)/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
+      dTaudtheta[it]  =  (LXY*dMdtheta+M*dLXYdtheta)/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
+      dTaudphi[it]    =  (LXY*dMdphi+M*dLXYdphi)/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
     }
     double dTaudx = (M*Px)/(PT*PT);
     double dTaudy = (M*Py)/(PT*PT);
@@ -1367,6 +1396,7 @@ namespace Trk
       if (fullCov != 0) {
         W_mat.block(0,0,ndim,ndim) = *fullCov;
       } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
         W_mat.block(5*NTrk,5*NTrk,3,3) =  vxCandidate->covariancePosition();
       }
@@ -1431,13 +1461,10 @@ namespace Trk
     double dx = vecsub.x();
     double dy = vecsub.y();
     unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
-    Amg::MatrixX V0_cov(5*NTrk,1); V0_cov.setZero();
     double Px=0., Py=0.; 
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
-    std::vector<double>dPTdqOverP(NTrk), dPTdtheta(NTrk), dPTdphi(NTrk);
-    std::vector<double>dLXYdqOverP(NTrk), dLXYdtheta(NTrk), dLXYdphi(NTrk);
+    std::vector<double>dPTdtheta(NTrk), dPTdphi(NTrk);
     std::vector<double>dTaudqOverP(NTrk), dTaudtheta(NTrk), dTaudphi(NTrk);
 
     Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
@@ -1445,44 +1472,30 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
+      double phi = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
-      if (fullCov == 0) {
-        //V0_cov.block(5*it,5*it,5,5) =  *(bPer->covariance());
-        const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double LXY = Px*dx+Py*dy;
 
     for( unsigned int it=0; it<NTrk; it++) {
-      dPTdqOverP[it]  = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
-      dPTdtheta[it]   = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
-      dPTdphi[it]     = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
-      dLXYdqOverP[it] = dx*dpxdqOverP[it]+dy*dpydqOverP[it];
-      dLXYdtheta[it]  = dx*dpxdtheta[it]+dy*dpydtheta[it];
-      dLXYdphi[it]    = dx*dpxdphi[it]+dy*dpydphi[it];
-      dTaudqOverP[it] = M*dLXYdqOverP[it]/(PT*PT)-(2.*LXY*M*dPTdqOverP[it])/(PT*PT*PT);
-      dTaudtheta[it]  = M*dLXYdtheta[it]/(PT*PT)-(2.*LXY*M*dPTdtheta[it])/(PT*PT*PT);
-      dTaudphi[it]    = M*dLXYdphi[it]/(PT*PT)-(2.*LXY*M*dPTdphi[it])/(PT*PT*PT);
+      double dPTdqOverP  = (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
+      double dPTdtheta   = (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
+      double dPTdphi     = (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
+      double dLXYdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it];
+      double dLXYdtheta  = dx*dpxdtheta[it]+dy*dpydtheta[it];
+      double dLXYdphi = dx*dpxdphi[it]+dy*dpydphi[it];
+      dTaudqOverP[it] = M*dLXYdqOverP/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
+      dTaudtheta[it]  = M*dLXYdtheta/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
+      dTaudphi[it]    = M*dLXYdphi/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
     }
     double dTaudx = (M*Px)/(PT*PT);
     double dTaudy = (M*Py)/(PT*PT);
@@ -1517,6 +1530,7 @@ namespace Trk
       if (fullCov != 0) {
         W_mat.block(0,0,ndim,ndim) = *fullCov;
       } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
         W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
       }
@@ -1549,6 +1563,278 @@ namespace Trk
     return CONST*tauErr;
   }
 
+  double V0Tools::tau3D(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, const std::vector<double> &masses) const
+  {
+    unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
+    if (masses.size() != NTrk) {
+      ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");
+      return -999999.;
+    }
+    //double CONST = 1000./CLHEP::c_light;
+    double CONST = 1000./299.792;
+    double M = invariantMass(vxCandidate, masses);
+    double LXYZ = lxyz(vxCandidate,vertex);
+    double P = V0Momentum(vxCandidate).mag();
+    return CONST*M*LXYZ/P;
+  }
+
+  double V0Tools::tau3D(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double M) const
+  {
+    //double CONST = 1000./CLHEP::c_light;
+    double CONST = 1000./299.792;
+    double LXYZ = lxyz(vxCandidate,vertex);
+    double P = V0Momentum(vxCandidate).mag();
+    return CONST*M*LXYZ/P;
+  }
+
+  double V0Tools::tau3DError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, const std::vector<double> &masses) const
+  {
+    // Tau = CONST*M*(Px*dx+Py*dy+Pz*dz)/(P*P)
+    unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
+    if (masses.size() != NTrk) {
+      ATH_MSG_DEBUG("The provided number of masses does not match the number of tracks in the vertex");
+      return -999999.;
+    }
+    //double CONST = 1000./CLHEP::c_light;
+    double CONST = 1000./299.792;
+    double P = V0Momentum(vxCandidate).mag();
+    auto vert = vxCandidate->position() - vertex->position();
+    double dx = vert.x();
+    double dy = vert.y();
+    double dz = vert.z();
+    double M = invariantMass(vxCandidate, masses);
+    double E=0., Px=0., Py=0., Pz=0.; 
+    std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
+    std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
+    std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk), dedqOverP(NTrk);
+    std::vector<double>dTaudqOverP(NTrk), dTaudtheta(NTrk), dTaudphi(NTrk);
+
+    Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
+    for( unsigned int it=0; it<NTrk; it++) {
+      const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
+      double trkCharge = 1.;
+      if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
+      double pe = (tmp>0.) ? sqrt(tmp) : 0.;
+      dedqOverP[it]  = -1./(qOverP*qOverP*qOverP*pe);
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
+      dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+      dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
+      E  += pe;
+      Px += bPer->momentum()[Trk::px];
+      Py += bPer->momentum()[Trk::py];
+      Pz += bPer->momentum()[Trk::pz];
+    }
+    double LXYZ = Px*dx+Py*dy+Pz*dz;
+
+    for( unsigned int it=0; it<NTrk; it++) {
+      double dMdqOverP    = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
+      double dMdtheta     = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
+      double dMdphi       = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
+      double dPdqOverP    =  (Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it])/P;
+      double dPdtheta     =  (Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/P;
+      double dPdphi       =  (Px*dpxdphi[it]+Py*dpydphi[it])/P;
+      double dLXYZdqOverP =  dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it];
+      double dLXYZdtheta  =  dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it];
+      double dLXYZdphi    =  dx*dpxdphi[it]+dy*dpydphi[it];
+      dTaudqOverP[it]  =  (LXYZ*dMdqOverP+M*dLXYZdqOverP)/(P*P)-(2.*LXYZ*M*dPdqOverP)/(P*P*P);
+      dTaudtheta[it]   =  (LXYZ*dMdtheta+M*dLXYZdtheta)/(P*P)-(2.*LXYZ*M*dPdtheta)/(P*P*P);
+      dTaudphi[it]     =  (LXYZ*dMdphi+M*dLXYZdphi)/(P*P)-(2.*LXYZ*M*dPdphi)/(P*P*P);
+    }
+    double dTaudx = (M*Px)/(P*P);
+    double dTaudy = (M*Py)/(P*P);
+    double dTaudz = (M*Pz)/(P*P);
+    double dTaudx0 = -dTaudx;
+    double dTaudy0 = -dTaudy;
+    double dTaudz0 = -dTaudz;
+
+    unsigned int ndim = 0;
+    if (fullCov != 0) {
+      ndim = fullCov->rows();
+    } else {
+      ndim = 5*NTrk+3;
+    }
+
+    Amg::MatrixX V0_err;
+    if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
+      Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
+      for( unsigned int it=0; it<NTrk; it++) {
+        D_vec(5*it+0) = 0.;
+        D_vec(5*it+1) = 0.;
+        D_vec(5*it+2) = dTaudphi[it];
+        D_vec(5*it+3) = dTaudtheta[it];
+        D_vec(5*it+4) = dTaudqOverP[it];
+      }
+      D_vec(5*NTrk+0) = dTaudx;
+      D_vec(5*NTrk+1) = dTaudy;
+      D_vec(5*NTrk+2) = dTaudz;
+      D_vec(5*NTrk+3) = dTaudx0;
+      D_vec(5*NTrk+4) = dTaudy0;
+      D_vec(5*NTrk+5) = dTaudz0;
+
+      Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
+      if (fullCov != 0) {
+        W_mat.block(0,0,ndim,ndim) = *fullCov;
+      } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
+        W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
+        W_mat.block(5*NTrk,5*NTrk,3,3) =  vxCandidate->covariancePosition();
+      }
+      W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
+      V0_err = D_vec.transpose() * W_mat * D_vec;
+    } else if (ndim == 3*NTrk+3) {
+      Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
+      D_vec(0) = dTaudx;
+      D_vec(1) = dTaudy;
+      D_vec(2) = dTaudz;
+      for( unsigned int it=0; it<NTrk; it++) {
+        D_vec(3*it+3) = dTaudphi[it];
+        D_vec(3*it+4) = dTaudtheta[it];
+        D_vec(3*it+5) = dTaudqOverP[it];
+      }
+      D_vec(3*NTrk+3) = dTaudx0;
+      D_vec(3*NTrk+4) = dTaudy0;
+      D_vec(3*NTrk+5) = dTaudz0;
+
+      Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
+      W_mat.block(0,0,ndim,ndim) = *fullCov;
+      W_mat.block(3*NTrk+3,3*NTrk+3,3,3) =  vertex->covariancePosition();
+      V0_err = D_vec.transpose() * W_mat * D_vec;
+    }
+
+    double tauErrsq = V0_err(0,0);
+    if (tauErrsq <= 0.) ATH_MSG_DEBUG("tauError: negative sqrt tauErrsq " << tauErrsq);
+    double tauErr = (tauErrsq>0.) ? sqrt(tauErrsq) : 0.;
+    delete fullCov;
+    return CONST*tauErr;
+  }
+
+  double V0Tools::tau3DError(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, double M) const
+  {
+    // Tau = CONST*M*(Px*dx+Py*dy+Pz*dz)/(P*P)
+    //double CONST = 1000./CLHEP::c_light;
+    double CONST = 1000./299.792;
+    double P = V0Momentum(vxCandidate).mag();
+    auto vecsub = vxCandidate->position() - vertex->position();
+    double dx = vecsub.x();
+    double dy = vecsub.y();
+    double dz = vecsub.z();
+    unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
+    double Px=0., Py=0., Pz=0.; 
+    std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
+    std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
+    std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk);
+    std::vector<double>dTaudqOverP(NTrk), dTaudtheta(NTrk), dTaudphi(NTrk);
+
+    Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
+    for( unsigned int it=0; it<NTrk; it++) {
+      const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
+      double trkCharge = 1.;
+      if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
+      dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+      dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
+      Px += bPer->momentum()[Trk::px];
+      Py += bPer->momentum()[Trk::py];
+      Pz += bPer->momentum()[Trk::pz];
+    }
+    double LXYZ = Px*dx+Py*dy+Pz*dz;
+
+    for( unsigned int it=0; it<NTrk; it++) {
+      double dPdqOverP    = (Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it])/P;
+      double dPdtheta     = (Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/P;
+      double dPdphi       = (Px*dpxdphi[it]+Py*dpydphi[it])/P;
+      double dLXYZdqOverP = dx*dpxdqOverP[it]+dy*dpydqOverP[it]+dz*dpzdqOverP[it];
+      double dLXYZdtheta  = dx*dpxdtheta[it]+dy*dpydtheta[it]+dz*dpzdtheta[it];
+      double dLXYZdphi    = dx*dpxdphi[it]+dy*dpydphi[it];
+      dTaudqOverP[it]  = M*dLXYZdqOverP/(P*P)-(2.*LXYZ*M*dPdqOverP)/(P*P*P);
+      dTaudtheta[it]   = M*dLXYZdtheta/(P*P)-(2.*LXYZ*M*dPdtheta)/(P*P*P);
+      dTaudphi[it]     = M*dLXYZdphi/(P*P)-(2.*LXYZ*M*dPdphi)/(P*P*P);
+    }
+    double dTaudx = (M*Px)/(P*P);
+    double dTaudy = (M*Py)/(P*P);
+    double dTaudz = (M*Pz)/(P*P);
+    double dTaudx0 = -dTaudx;
+    double dTaudy0 = -dTaudy;
+    double dTaudz0 = -dTaudz;
+
+    unsigned int ndim = 0;
+    if (fullCov != 0) {
+      ndim = fullCov->rows();
+    } else {
+      ndim = 5*NTrk+3;
+    }
+
+    Amg::MatrixX V0_err;
+    if (ndim == 5*NTrk+3 || ndim == 5*NTrk+6) {
+      Amg::MatrixX D_vec(5*NTrk+6,1); D_vec.setZero();
+      for( unsigned int it=0; it<NTrk; it++) {
+        D_vec(5*it+0) = 0.;
+        D_vec(5*it+1) = 0.;
+        D_vec(5*it+2) = dTaudphi[it];
+        D_vec(5*it+3) = dTaudtheta[it];
+        D_vec(5*it+4) = dTaudqOverP[it];
+      }
+      D_vec(5*NTrk+0) = dTaudx;
+      D_vec(5*NTrk+1) = dTaudy;
+      D_vec(5*NTrk+2) = dTaudz;
+      D_vec(5*NTrk+3) = dTaudx0;
+      D_vec(5*NTrk+4) = dTaudy0;
+      D_vec(5*NTrk+5) = dTaudz0;
+
+      Amg::MatrixX W_mat(5*NTrk+6,5*NTrk+6); W_mat.setZero();
+      if (fullCov != 0) {
+        W_mat.block(0,0,ndim,ndim) = *fullCov;
+      } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
+        W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
+        W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
+      }
+      W_mat.block(5*NTrk+3,5*NTrk+3,3,3) = vertex->covariancePosition();
+      V0_err = D_vec.transpose() * W_mat * D_vec;
+    } else if (ndim == 3*NTrk+3) {
+      Amg::MatrixX D_vec(3*NTrk+6,1); D_vec.setZero();
+      D_vec(0)  = dTaudx;
+      D_vec(1)  = dTaudy;
+      D_vec(2)  = dTaudz;
+      for( unsigned int it=0; it<NTrk; it++) {
+        D_vec(3*it+3) = dTaudphi[it];
+        D_vec(3*it+4) = dTaudtheta[it];
+        D_vec(3*it+5) = dTaudqOverP[it];
+      }
+      D_vec(3*NTrk+3) = dTaudx0;
+      D_vec(3*NTrk+4) = dTaudy0;
+      D_vec(3*NTrk+5) = dTaudz0;
+
+      Amg::MatrixX W_mat(3*NTrk+6,3*NTrk+6); W_mat.setZero();
+      W_mat.block(0,0,ndim,ndim) = *fullCov;
+      W_mat.block(3*NTrk+3,3*NTrk+3,3,3) = vertex->covariancePosition();
+      V0_err = D_vec.transpose() * W_mat * D_vec;
+    }
+
+    double tauErrsq = V0_err(0,0);
+    if (tauErrsq <= 0.) ATH_MSG_DEBUG("tauError: negative sqrt tauErrsq " << tauErrsq);
+    double tauErr = (tauErrsq>0.) ? sqrt(tauErrsq) : 0.;
+    delete fullCov;
+    return CONST*tauErr;
+  }
+
   double V0Tools::thetaStar(const xAOD::Vertex * vxCandidate, double mass1, double mass2) const
   {
     double theta = 0.;
@@ -2046,7 +2332,7 @@ namespace Trk
     }
     double mass = invariantMassBeforeFitIP(vxCandidate, masses);
     double E=0., Px=0., Py=0., Pz=0.; 
-    std::vector<double>d0(NTrk), z0(NTrk), phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
+    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dm2dphi(NTrk), dm2dtheta(NTrk), dm2dqOverP(NTrk);
     Amg::MatrixX V0_cor(5*NTrk,5*NTrk); V0_cor.setZero();
     for( unsigned int it=0; it<NTrk; it++) {
@@ -2064,8 +2350,6 @@ namespace Trk
         V0_cor(5*it+4,5*it+2) = cov_tmp(2,4);
         V0_cor(5*it+4,5*it+3) = cov_tmp(3,4);
         charge[it] = TP->charge();
-        d0[it]     = TP->d0();
-        z0[it]     = TP->z0();
         phi[it]    = TP->phi();
         theta[it]  = TP->theta();
         qOverP[it] = TP->qOverP();
@@ -2138,7 +2422,7 @@ namespace Trk
     }
     Trk::PerigeeSurface perigeeSurface(vertex);
     double E=0., Px=0., Py=0., Pz=0.; 
-    std::vector<double>d0(NTrk), z0(NTrk), phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
+    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dm2dphi(NTrk), dm2dtheta(NTrk), dm2dqOverP(NTrk);
     Amg::MatrixX V0_cor(5*NTrk,5*NTrk); V0_cor.setZero();
     for( unsigned int it=0; it<NTrk; it++) {
@@ -2158,8 +2442,6 @@ namespace Trk
         V0_cor(5*it+4,5*it+2) = (*cov_tmp)(2,4);
         V0_cor(5*it+4,5*it+3) = (*cov_tmp)(3,4);
         charge[it] = TP->charge();
-        d0[it]     = extrPer->parameters()[Trk::d0];
-        z0[it]     = extrPer->parameters()[Trk::z0];
         phi[it]    = extrPer->parameters()[Trk::phi];
         theta[it]  = extrPer->parameters()[Trk::theta];
         qOverP[it] = extrPer->parameters()[Trk::qOverP];
@@ -2223,15 +2505,11 @@ namespace Trk
     double dx = vert.x();
     double dy = vert.y();
     double M = invariantMass(vxCandidate, masses);
-    Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
     double E=0., Px=0., Py=0., Pz=0.; 
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
     std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk), dedqOverP(NTrk);
     std::vector<double>dMdqOverP(NTrk), dMdtheta(NTrk), dMdphi(NTrk);
-    std::vector<double>dPTdqOverP(NTrk), dPTdtheta(NTrk), dPTdphi(NTrk);
-    std::vector<double>dLXYdqOverP(NTrk), dLXYdtheta(NTrk), dLXYdphi(NTrk);
     std::vector<double>dTaudqOverP(NTrk), dTaudtheta(NTrk), dTaudphi(NTrk);
 
     Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
@@ -2239,39 +2517,24 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      double tmp = 1./(qOverP[it]*qOverP[it]) + masses[it]*masses[it];
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
       double pe = (tmp>0.) ? sqrt(tmp) : 0.;
-      e[it] = pe;
-      dedqOverP[it]  = -1./(qOverP[it]*qOverP[it]*qOverP[it]*e[it]);
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpzdqOverP[it] = -(cos(theta[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpzdtheta[it]  = -(sin(theta[it])*charge[it])/qOverP[it];
-      E  += e[it];
+      dedqOverP[it]  = -1./(qOverP*qOverP*qOverP*pe);
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
+      dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+      dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
+      E  += pe;
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
       Pz += bPer->momentum()[Trk::pz];
-      if (fullCov == 0) {
-        //V0_cov.block(5*it,5*it,5,5) = *(bPer->covariance());
-        const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double LXY = Px*dx+Py*dy;
 
@@ -2279,15 +2542,15 @@ namespace Trk
       dMdqOverP[it]   = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
       dMdtheta[it]    = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
       dMdphi[it]      = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
-      dPTdqOverP[it]  =  (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
-      dPTdtheta[it]   =  (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
-      dPTdphi[it]     =  (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
-      dLXYdqOverP[it] =  dx*dpxdqOverP[it]+dy*dpydqOverP[it];
-      dLXYdtheta[it]  =  dx*dpxdtheta[it]+dy*dpydtheta[it];
-      dLXYdphi[it]    =  dx*dpxdphi[it]+dy*dpydphi[it];
-      dTaudqOverP[it] =  (LXY*dMdqOverP[it]+M*dLXYdqOverP[it])/(PT*PT)-(2.*LXY*M*dPTdqOverP[it])/(PT*PT*PT);
-      dTaudtheta[it]  =  (LXY*dMdtheta[it]+M*dLXYdtheta[it])/(PT*PT)-(2.*LXY*M*dPTdtheta[it])/(PT*PT*PT);
-      dTaudphi[it]    =  (LXY*dMdphi[it]+M*dLXYdphi[it])/(PT*PT)-(2.*LXY*M*dPTdphi[it])/(PT*PT*PT);
+      double dPTdqOverP  =  (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
+      double dPTdtheta  =  (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
+      double dPTdphi     =  (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
+      double dLXYdqOverP =  dx*dpxdqOverP[it]+dy*dpydqOverP[it];
+      double dLXYdtheta  =  dx*dpxdtheta[it]+dy*dpydtheta[it];
+      double dLXYdphi    =  dx*dpxdphi[it]+dy*dpydphi[it];
+      dTaudqOverP[it] =  (LXY*dMdqOverP[it]+M*dLXYdqOverP)/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
+      dTaudtheta[it]  =  (LXY*dMdtheta[it]+M*dLXYdtheta)/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
+      dTaudphi[it]    =  (LXY*dMdphi[it]+M*dLXYdphi)/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
     }
     double dTaudx = (M*Px)/(PT*PT);
     double dTaudy = (M*Py)/(PT*PT);
@@ -2326,6 +2589,7 @@ namespace Trk
       if (fullCov != 0) {
         W_mat.block(0,0,ndim,ndim) = *fullCov;
       } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
         W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
       }
@@ -2356,6 +2620,25 @@ namespace Trk
     return V0_err(0,1);
   }
 
+  Amg::MatrixX V0Tools::makeV0Cov(const xAOD::Vertex * vxCandidate) const{
+      unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
+      Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
+      for( unsigned int it=0; it<NTrk; it++){
+          const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
+          const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
+          V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
+          V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
+          V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
+          V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
+          V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
+          V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
+          V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
+          V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
+          V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
+      }
+      return V0_cov;
+  }
+  
   Amg::MatrixX V0Tools::tauMassCovariance(const xAOD::Vertex * vxCandidate, const xAOD::Vertex* vertex, const std::vector<double> &masses) const
   {
     // Tau = CONST*M*(Px*dx+Py*dy)/(PT*PT)
@@ -2372,15 +2655,11 @@ namespace Trk
     double dx = vert.x();
     double dy = vert.y();
     double M = invariantMass(vxCandidate, masses);
-    Amg::MatrixX V0_cov(5*NTrk,5*NTrk); V0_cov.setZero();
     double E=0., Px=0., Py=0., Pz=0.; 
-    std::vector<double>phi(NTrk), theta(NTrk), qOverP(NTrk), charge(NTrk), e(NTrk);
     std::vector<double>dpxdqOverP(NTrk), dpxdtheta(NTrk), dpxdphi(NTrk);
     std::vector<double>dpydqOverP(NTrk), dpydtheta(NTrk), dpydphi(NTrk);
     std::vector<double>dpzdqOverP(NTrk), dpzdtheta(NTrk), dedqOverP(NTrk);
     std::vector<double>dMdqOverP(NTrk), dMdtheta(NTrk), dMdphi(NTrk);
-    std::vector<double>dPTdqOverP(NTrk), dPTdtheta(NTrk), dPTdphi(NTrk);
-    std::vector<double>dLXYdqOverP(NTrk), dLXYdtheta(NTrk), dLXYdphi(NTrk);
     std::vector<double>dTaudqOverP(NTrk), dTaudtheta(NTrk), dTaudphi(NTrk);
 
     Amg::MatrixX* fullCov = convertCovMatrix(vxCandidate);
@@ -2388,39 +2667,24 @@ namespace Trk
       const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
       double trkCharge = 1.;
       if (bPer->parameters()[Trk::qOverP] < 0.) trkCharge = -1.;
-      charge[it] = trkCharge;
-      phi[it]    = bPer->parameters()[Trk::phi];
-      theta[it]  = bPer->parameters()[Trk::theta];
-      qOverP[it] = bPer->parameters()[Trk::qOverP];
-      double tmp = 1./(qOverP[it]*qOverP[it]) + masses[it]*masses[it];
+      double phi    = bPer->parameters()[Trk::phi];
+      double theta  = bPer->parameters()[Trk::theta];
+      double qOverP = bPer->parameters()[Trk::qOverP];
+      double tmp = 1./(qOverP*qOverP) + masses[it]*masses[it];
       double pe = (tmp>0.) ? sqrt(tmp) : 0.;
-      e[it] = pe;
-      dedqOverP[it]  = -1./(qOverP[it]*qOverP[it]*qOverP[it]*e[it]);
-      dpxdqOverP[it] = -(sin(theta[it])*cos(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpxdtheta[it]  =  (cos(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpxdphi[it]    = -(sin(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydqOverP[it] = -(sin(theta[it])*sin(phi[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpydtheta[it]  =  (cos(theta[it])*sin(phi[it])*charge[it])/qOverP[it];
-      dpydphi[it]    =  (sin(theta[it])*cos(phi[it])*charge[it])/qOverP[it];
-      dpzdqOverP[it] = -(cos(theta[it])*charge[it])/(qOverP[it]*qOverP[it]);
-      dpzdtheta[it]  = -(sin(theta[it])*charge[it])/qOverP[it];
-      E  += e[it];
+      dedqOverP[it]  = -1./(qOverP*qOverP*qOverP*pe);
+      dpxdqOverP[it] = -(sin(theta)*cos(phi)*trkCharge)/(qOverP*qOverP);
+      dpxdtheta[it]  =  (cos(theta)*cos(phi)*trkCharge)/qOverP;
+      dpxdphi[it]    = -(sin(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydqOverP[it] = -(sin(theta)*sin(phi)*trkCharge)/(qOverP*qOverP);
+      dpydtheta[it]  =  (cos(theta)*sin(phi)*trkCharge)/qOverP;
+      dpydphi[it]    =  (sin(theta)*cos(phi)*trkCharge)/qOverP;
+      dpzdqOverP[it] = -(cos(theta)*trkCharge)/(qOverP*qOverP);
+      dpzdtheta[it]  = -(sin(theta)*trkCharge)/qOverP;
+      E  += pe;
       Px += bPer->momentum()[Trk::px];
       Py += bPer->momentum()[Trk::py];
       Pz += bPer->momentum()[Trk::pz];
-      if (fullCov == 0) {
-        //V0_cov.block(5*it,5*it,5,5) = *(bPer->covariance());
-        const AmgSymMatrix(5)* cov_tmp = bPer->covariance();
-        V0_cov(5*it+2,5*it+2) = (*cov_tmp)(2,2);
-        V0_cov(5*it+2,5*it+3) = (*cov_tmp)(2,3);
-        V0_cov(5*it+2,5*it+4) = (*cov_tmp)(2,4);
-        V0_cov(5*it+3,5*it+3) = (*cov_tmp)(3,3);
-        V0_cov(5*it+3,5*it+4) = (*cov_tmp)(3,4);
-        V0_cov(5*it+4,5*it+4) = (*cov_tmp)(4,4);
-        V0_cov(5*it+3,5*it+2) = (*cov_tmp)(2,3);
-        V0_cov(5*it+4,5*it+2) = (*cov_tmp)(2,4);
-        V0_cov(5*it+4,5*it+3) = (*cov_tmp)(3,4);
-      }
     }
     double LXY = Px*dx+Py*dy;
 
@@ -2428,15 +2692,15 @@ namespace Trk
       dMdqOverP[it]   = -(Px*dpxdqOverP[it]+Py*dpydqOverP[it]+Pz*dpzdqOverP[it]-E*dedqOverP[it])/M;
       dMdtheta[it]    = -(Px*dpxdtheta[it]+Py*dpydtheta[it]+Pz*dpzdtheta[it])/M;
       dMdphi[it]      = -(Px*dpxdphi[it]+Py*dpydphi[it])/M;
-      dPTdqOverP[it]  =  (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
-      dPTdtheta[it]   =  (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
-      dPTdphi[it]     =  (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
-      dLXYdqOverP[it] =  dx*dpxdqOverP[it]+dy*dpydqOverP[it];
-      dLXYdtheta[it]  =  dx*dpxdtheta[it]+dy*dpydtheta[it];
-      dLXYdphi[it]    =  dx*dpxdphi[it]+dy*dpydphi[it];
-      dTaudqOverP[it] =  (LXY*dMdqOverP[it]+M*dLXYdqOverP[it])/(PT*PT)-(2.*LXY*M*dPTdqOverP[it])/(PT*PT*PT);
-      dTaudtheta[it]  =  (LXY*dMdtheta[it]+M*dLXYdtheta[it])/(PT*PT)-(2.*LXY*M*dPTdtheta[it])/(PT*PT*PT);
-      dTaudphi[it]    =  (LXY*dMdphi[it]+M*dLXYdphi[it])/(PT*PT)-(2.*LXY*M*dPTdphi[it])/(PT*PT*PT);
+      double dPTdqOverP  =  (Px*dpxdqOverP[it]+Py*dpydqOverP[it])/PT;
+      double dPTdtheta   =  (Px*dpxdtheta[it]+Py*dpydtheta[it])/PT;
+      double dPTdphi     =  (Px*dpxdphi[it]+Py*dpydphi[it])/PT;
+      double dLXYdqOverP =  dx*dpxdqOverP[it]+dy*dpydqOverP[it];
+      double dLXYdtheta  =  dx*dpxdtheta[it]+dy*dpydtheta[it];
+      double dLXYdphi    =  dx*dpxdphi[it]+dy*dpydphi[it];
+      dTaudqOverP[it] =  (LXY*dMdqOverP[it]+M*dLXYdqOverP)/(PT*PT)-(2.*LXY*M*dPTdqOverP)/(PT*PT*PT);
+      dTaudtheta[it]  =  (LXY*dMdtheta[it]+M*dLXYdtheta)/(PT*PT)-(2.*LXY*M*dPTdtheta)/(PT*PT*PT);
+      dTaudphi[it]    =  (LXY*dMdphi[it]+M*dLXYdphi)/(PT*PT)-(2.*LXY*M*dPTdphi)/(PT*PT*PT);
     }
     double dTaudx = (M*Px)/(PT*PT);
     double dTaudy = (M*Py)/(PT*PT);
@@ -2474,6 +2738,7 @@ namespace Trk
       if (fullCov != 0) {
         W_mat.block(0,0,ndim,ndim) = *fullCov;
       } else {
+        Amg::MatrixX V0_cov = makeV0Cov(vxCandidate);
         W_mat.block(0,0,V0_cov.rows(),V0_cov.rows()) = V0_cov;
         W_mat.block(5*NTrk,5*NTrk,3,3) = vxCandidate->covariancePosition();
       }
@@ -2507,7 +2772,7 @@ namespace Trk
   Amg::MatrixX * V0Tools::convertCovMatrix(const xAOD::Vertex * vxCandidate) const
   {
     unsigned int NTrk = vxCandidate->nTrackParticles();
-    std::vector<float> matrix = vxCandidate->covariance();
+    const std::vector<float> &matrix = vxCandidate->covariance();
 
     int ndim = 0;
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx
index e6ef09db5b367a4cf11ac8d41f11421d33dab2bb..8de3a450a95dcdb24802aa4049c3fe36e7418190 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx
@@ -17,7 +17,7 @@ namespace Trk
 
   Mode3dTo1dFinder::Mode3dTo1dFinder(const std::string& t, const std::string& n, const IInterface*  p) : 
     AthAlgTool(t,n,p),
-    m_mode1dfinder("Trk::FsmwMode1dFinder")
+    m_mode1dfinder("Trk::FsmwMode1dFinder", this)
   {   
     declareProperty("Mode1dFinder", m_mode1dfinder);
     declareInterface<IMode3dFinder>(this);
diff --git a/Tracking/TrkVertexFitter/TrkVertexTools/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexTools/CMakeLists.txt
index 5f7d7abb6157bd7ab695a6c6237b5d42cb1b3618..6f0518b2cd14b0f08ad33b83492d8a478ab08b7f 100644
--- a/Tracking/TrkVertexFitter/TrkVertexTools/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexTools/CMakeLists.txt
@@ -12,11 +12,11 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/xAOD/xAODTracking
                           GaudiKernel
                           Tracking/TrkVertexFitter/TrkVertexFitterInterfaces
+                          InnerDetector/InDetConditions/BeamSpotConditionsData
                           PRIVATE
                           Control/CxxUtils
                           Event/EventPrimitives
                           Generators/GeneratorObjects
-                          InnerDetector/InDetConditions/InDetBeamSpotService
                           Tracking/TrkEvent/TrkEventPrimitives
                           Tracking/TrkEvent/VxVertex )
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexTools/TrkVertexTools/VertexMergingTool.h b/Tracking/TrkVertexFitter/TrkVertexTools/TrkVertexTools/VertexMergingTool.h
index c8ad6b46152330447d7d5eb1f9d67fad27f9e900..858b88410467e9418de2075c6d4b926e6067a8c6 100644
--- a/Tracking/TrkVertexFitter/TrkVertexTools/TrkVertexTools/VertexMergingTool.h
+++ b/Tracking/TrkVertexFitter/TrkVertexTools/TrkVertexTools/VertexMergingTool.h
@@ -9,7 +9,7 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "TrkVertexFitterInterfaces/IVertexMergingTool.h"
 #include "TrkVertexFitterInterfaces/IVertexFitter.h"
-
+#include "BeamSpotConditionsData/BeamSpotData.h"
 
 //xAOD include
 #include "xAODTracking/VertexFwd.h"
@@ -33,7 +33,6 @@
   *
   */
  
- class IBeamCondSvc;
  
  namespace Trk
  {
@@ -42,8 +41,7 @@
   class VertexMergingTool : public AthAlgTool, virtual public IVertexMergingTool
   {
   public:
-    StatusCode initialize();
-    StatusCode finalize();
+    StatusCode initialize() override;
     
     /**
      * constructor
@@ -58,12 +56,12 @@
     /**
      *Merging  
      */
-    virtual std::pair<xAOD::VertexContainer*,xAOD::VertexAuxContainer*> mergeVertexContainer(const xAOD::VertexContainer& MyVxCont);
+    virtual std::pair<xAOD::VertexContainer*,xAOD::VertexAuxContainer*> mergeVertexContainer(const xAOD::VertexContainer& MyVxCont) override;
 
         
   private:
     
-    ServiceHandle<IBeamCondSvc> m_iBeamCondSvc; //!< pointer to the beam condition service
+    SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
     ToolHandle< Trk::IVertexFitter > m_iVertexFitter;
     bool m_useBeamConstraint;
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexTools/src/VertexMergingTool.cxx b/Tracking/TrkVertexFitter/TrkVertexTools/src/VertexMergingTool.cxx
index 5af8fbb45b7efb8b999a5507bf5d291429250815..a8559366139be97a835b2acbb10493f9407fc07c 100644
--- a/Tracking/TrkVertexFitter/TrkVertexTools/src/VertexMergingTool.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexTools/src/VertexMergingTool.cxx
@@ -5,7 +5,6 @@
 #include "TrkVertexTools/VertexMergingTool.h"
 #include "TrkVertexFitterInterfaces/IVertexWeightCalculator.h" 
 #include "VxVertex/VxTrackAtVertex.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
 #include <vector> 
 
 namespace Trk{
@@ -13,12 +12,10 @@ namespace Trk{
    //constructor
   VertexMergingTool::VertexMergingTool ( const std::string& t, const std::string& n, const IInterface*  p )
           : AthAlgTool ( t,n,p ),
-	    m_iBeamCondSvc("BeamCondSvc",n),
 	    m_iVertexFitter("Trk::AdaptiveVertexFitter"),
             m_useBeamConstraint(false)
   {
     declareInterface<IVertexMergingTool> ( this );
-    declareProperty("BeamPositionSvc", m_iBeamCondSvc);
     declareProperty("VertexFitterTool", m_iVertexFitter);
     declareProperty("useBeamConstraint",m_useBeamConstraint);
   }
@@ -35,20 +32,12 @@ namespace Trk{
       return StatusCode::FAILURE;
     } 
     
-    if (m_iBeamCondSvc.retrieve().isFailure())
-    {
-      msg(MSG::ERROR) << "Could not find BeamCondSvc." << endmsg;
-      return StatusCode::FAILURE;
-    }
+     ATH_CHECK(m_beamSpotKey.initialize());
     
      ATH_MSG_DEBUG("Re-merging tool initialization successful");
      return StatusCode::SUCCESS;
    }///EndOfInitialize
 
-   StatusCode VertexMergingTool::finalize()
-   {
-     return StatusCode::SUCCESS;
-   }
 
   std::pair<xAOD::VertexContainer*,xAOD::VertexAuxContainer*> VertexMergingTool::mergeVertexContainer(const xAOD::VertexContainer& MyVxCont) {
 
@@ -57,10 +46,12 @@ namespace Trk{
     //if beamspot constraint was requested, get it now
     xAOD::Vertex theconstraint;
     if (m_useBeamConstraint) {
+      SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
+      if(not beamSpotHandle.isValid()) ATH_MSG_ERROR("Cannot Retrieve " << m_beamSpotKey.key() );
       theconstraint = xAOD::Vertex(); // Default constructor creates a private store
-      theconstraint.setPosition( m_iBeamCondSvc->beamVtx().position() );
-      theconstraint.setCovariancePosition( m_iBeamCondSvc->beamVtx().covariancePosition() );
-      theconstraint.setFitQuality( m_iBeamCondSvc->beamVtx().fitQuality().chiSquared(), m_iBeamCondSvc->beamVtx().fitQuality().doubleNumberDoF() );
+      theconstraint.setPosition( beamSpotHandle->beamVtx().position() );
+      theconstraint.setCovariancePosition( beamSpotHandle->beamVtx().covariancePosition() );
+      theconstraint.setFitQuality( beamSpotHandle->beamVtx().fitQuality().chiSquared(), beamSpotHandle->beamVtx().fitQuality().doubleNumberDoF() );
     }
 
     //new output containers to be filled
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETAlgMT.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETAlgMT.h
index 063aa7d0428b8317dbcd28784b94c18bd9805bf8..b0ca481432c191c75e86af4f8b7fc7f5cd6f136b 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETAlgMT.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETAlgMT.h
@@ -44,7 +44,6 @@ class EFMissingETAlgMT : public ::AthReentrantAlgorithm
   SG::WriteHandleKey<xAOD::TrigMissingETContainer> m_metContainerKey { this, "METContainerKey", "HLT_MET", "Name of the output collection" };
   ToolHandleArray<IMissingETTool> m_metTools { this, "METTools", {}, "Tools to fill MET object" };
   ToolHandle<GenericMonitoringTool> m_monTool{ this, "MonTool", "", "Monitoring tool" };
-  ToolHandle<EFMissingETFromHelper> m_helperTool{ this, "HelperTool", "EFMissingETFromHelper/HelperTool", "Helper tool" };
 }; 
 
 
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFlags.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFlags.h
index 1a75eed6261ea7ad3a0c99a0ac203ffaeb62a975..e5dfa7fc5816b6d3376d86caa25510af9d8dba09 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFlags.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFlags.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRIGEFMISSINGET_EFMISSINGETFLAGS_H
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx
index dcbd34afddbac7f8f91430d483c6ad8474dc1ab4..a18382bb2b6127b191c55fc1f9cda2e90287a9d8 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx
@@ -34,7 +34,6 @@ StatusCode EFMissingETAlgMT::initialize() {
   CHECK( m_metTools.retrieve() );
   CHECK( m_metContainerKey.initialize() );
   CHECK( m_monTool.retrieve() );
-  CHECK( m_helperTool.retrieve() );
   return StatusCode::SUCCESS;
 }
 
@@ -77,8 +76,6 @@ StatusCode EFMissingETAlgMT::execute( const EventContext& context ) const {
   }
   loopTimer.stop();
 
-  ATH_CHECK( m_helperTool->executeMT(met, &metHelper) );
-
   auto EF_MEx_log = Monitored::Scalar( "EF_MEx_log", toLogGeV( met->ex() ) );
   auto EF_MEy_log = Monitored::Scalar( "EF_MEy_log", toLogGeV( met->ey() ) );
   auto EF_MEz_log = Monitored::Scalar( "EF_MEz_log", toLogGeV( met->ez() ) );
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlagsMT.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlagsMT.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..28689d56eab6f55e84fb7b8072b2150df2a18b60
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlagsMT.cxx
@@ -0,0 +1,290 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/********************************************************************
+
+NAME:     EFMissingETFlagsMT.cxx
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+
+AUTHOR: Gabriel Gallardo
+DATE: April 25, 2019
+
+Based on: EFMissingETFlags.cxx
+AUTHORS:  Diego Casadei
+CREATED:  May 15, 2008
+
+PURPOSE:  Performs checks with global and auxiliary information
+and updates the global event status flag
+
+ ********************************************************************/
+
+#include "EFMissingETFlagsMT.h"
+#include "TrigEFMissingET/EFMissingETHelper.h"
+
+#include <string>
+#include <cmath>
+using namespace std;
+
+const std::vector<float> EFMissingETFlagsMT::s_dummyMax   (24, +1e9);
+const std::vector<float> EFMissingETFlagsMT::s_dummyMin   (24, -1e9);
+const std::vector<float> EFMissingETFlagsMT::s_dummyRatio (24,  0.8);
+
+
+EFMissingETFlagsMT::EFMissingETFlagsMT(const std::string& type,
+    const std::string& name,
+    const IInterface* parent):
+  base_class(type, name, parent)
+{
+
+
+}
+
+StatusCode EFMissingETFlagsMT::update(xAOD::TrigMissingET* /*met*/,
+                            TrigEFMissingEtHelper *metHelper, const EventContext& /*ctx*/) const
+{
+  ATH_MSG_DEBUG( "EFMissingETFlagsMT::execute() called" );
+
+  if (metHelper==0) {
+     ATH_MSG_FATAL( "Null pointers as input!  Aborting" );
+    return StatusCode::FAILURE;
+  }
+
+
+  // global flag (bit meaning defined in IMissingETTool)
+  int flag=metHelper->GetStatus();
+
+  unsigned char nHelperComp = metHelper->GetElements();
+
+  float caloSumE = 0;
+  float caloSumEt = 0;
+  float caloSumBadEt = 0;
+  float EM_SumE=0;
+
+  float EMB_SumE=0;
+  float EME_SumE=0;
+  float HEC_SumE=0;
+  float TileBar_SumE=0;
+  float TileGap_SumE=0;
+  float TileExt_SumE=0;
+  float FCal_SumE=0;
+
+  // compute subdetector energies
+  if (nHelperComp == static_cast<uint>(TrigEFMissingEtComponent::ComponentSize)) { 
+    for (uint helper_i=0; helper_i < TrigEFMissingEtComponent::TCLCW ; ++helper_i) { 
+      TrigEFMissingEtComponent* metComp = metHelper->GetComponent(helper_i);
+      string Name=metComp->m_name;
+
+      float c0 =         metComp->m_calib0;
+      float c1 =         metComp->m_calib1;
+      short sumOfSigns = metComp->m_sumOfSigns;
+      float sumE =       sumOfSigns * c0 + c1 *  metComp->m_sumE;
+      float sumEt =      sumOfSigns * c0 + c1 *  metComp->m_sumEt;
+      float sumBadEt =   sumOfSigns * c0 + c1 *  metComp->m_sumBadEt;
+
+      caloSumE += sumE;
+      caloSumEt += sumEt;
+      caloSumBadEt += sumBadEt;
+
+      // compute auxiliary quantities
+      switch(static_cast<TrigEFMissingEtComponent::Component>(helper_i))
+      {
+        case TrigEFMissingEtComponent::PreSamplB:
+        case TrigEFMissingEtComponent::EMB1: case TrigEFMissingEtComponent::EMB2: case TrigEFMissingEtComponent::EMB3:
+          EM_SumE += sumE;
+          EMB_SumE += sumE;
+          break;
+        case TrigEFMissingEtComponent::PreSamplE:
+        case TrigEFMissingEtComponent::EME1: case TrigEFMissingEtComponent::EME2: case TrigEFMissingEtComponent::EME3:
+          EM_SumE += sumE;
+          EME_SumE += sumE;
+          break;
+        case TrigEFMissingEtComponent::HEC0:
+        case TrigEFMissingEtComponent::HEC1: case TrigEFMissingEtComponent::HEC2: case TrigEFMissingEtComponent::HEC3:
+          HEC_SumE += sumE;
+          break;
+        case TrigEFMissingEtComponent::TileBar0: case TrigEFMissingEtComponent::TileBar1: case TrigEFMissingEtComponent::TileBar2:
+          TileBar_SumE += sumE;
+          break;
+        case TrigEFMissingEtComponent::TileGap1: case TrigEFMissingEtComponent::TileGap2: case TrigEFMissingEtComponent::TileGap3:
+          TileGap_SumE += sumE;
+          break;
+        case TrigEFMissingEtComponent::TileExt0: case TrigEFMissingEtComponent::TileExt1: case TrigEFMissingEtComponent::TileExt2:
+          TileExt_SumE += sumE;
+          break;
+        case TrigEFMissingEtComponent::FCalEM:
+          EM_SumE += sumE;
+          /* FALLTHROUGH */
+        case TrigEFMissingEtComponent::FCalHad1:
+        case TrigEFMissingEtComponent::FCalHad2:
+          FCal_SumE += sumE;
+          break;
+        default:
+          break;
+      }
+    }  //end nHelperComponent == ComponentSize
+  } else {
+    ATH_MSG_WARNING( "Found " << nHelperComp << " (!=" << 
+                  static_cast<uint>(TrigEFMissingEtComponent::ComponentSize) << ") auxiliary components.  Skipping checks!" );
+  }
+
+  /// main loop over components ///
+  for (unsigned char helper_i=0; helper_i<nHelperComp; ++helper_i) {
+    TrigEFMissingEtComponent* metComp = metHelper->GetComponent(helper_i);
+    float c0 =         metComp->m_calib0;
+    float c1 =         metComp->m_calib1;
+    short sumOfSigns = metComp->m_sumOfSigns;
+    float MEx   = sumOfSigns * c0 + c1 *  metComp->m_ex;
+    float MEy   = sumOfSigns * c0 + c1 *  metComp->m_ey;
+    float sumEt = sumOfSigns * c0 + c1 *  metComp->m_sumEt;
+    float sumE  = sumOfSigns * c0 + c1 *  metComp->m_sumE;
+    float MET = sqrtf(MEx*MEx+MEy*MEy);
+    float sumBadEt =   sumOfSigns * c0 + c1 *  metComp->m_sumBadEt;
+
+    switch(static_cast<TrigEFMissingEtComponent::Component>(helper_i))
+    {
+      // All cell components. Count there should be 24. 
+      case TrigEFMissingEtComponent::PreSamplB:
+      case TrigEFMissingEtComponent::EMB1: case TrigEFMissingEtComponent::EMB2: case TrigEFMissingEtComponent::EMB3:
+      case TrigEFMissingEtComponent::PreSamplE:
+      case TrigEFMissingEtComponent::EME1: case TrigEFMissingEtComponent::EME2: case TrigEFMissingEtComponent::EME3:
+      case TrigEFMissingEtComponent::HEC0:
+      case TrigEFMissingEtComponent::HEC1: case TrigEFMissingEtComponent::HEC2: case TrigEFMissingEtComponent::HEC3:
+      case TrigEFMissingEtComponent::TileBar0: case TrigEFMissingEtComponent::TileBar1: case TrigEFMissingEtComponent::TileBar2:
+      case TrigEFMissingEtComponent::TileGap1: case TrigEFMissingEtComponent::TileGap2: case TrigEFMissingEtComponent::TileGap3:
+      case TrigEFMissingEtComponent::TileExt0: case TrigEFMissingEtComponent::TileExt1: case TrigEFMissingEtComponent::TileExt2:
+      case TrigEFMissingEtComponent::FCalEM:
+      case TrigEFMissingEtComponent::FCalHad1: case TrigEFMissingEtComponent::FCalHad2:
+        // flag component if |MET/SumET| is too large
+        if (sumEt>0 && fabsf(MET/sumEt)>m_CompMaxMEtSumEtRatio[helper_i]) metComp->m_status |= m_maskCompBigMEtSEtRatio;
+
+        // flag component if its energy is too large (positive or negative)
+        if ((sumE<m_MinCompE[helper_i] || sumE>m_MaxCompE[helper_i])) metComp->m_status |= m_maskBadCompEnergy;
+
+        // flag component if cell energy is outside the allowed boundaries
+        if ((metComp->m_minE<m_MinCellE[helper_i] || metComp->m_maxE>m_MaxCellE[helper_i])) metComp->m_status |= m_maskBadCellEnergy;
+
+        // flag component if cell time is outside the allowed boundaries
+        if ((metComp->m_minTime<m_MinCellTime[helper_i] || metComp->m_maxTime>m_MaxCellTime[helper_i])) metComp->m_status |= m_maskBadCellTime;
+
+        // flag component if cell quality is poor
+        if (metComp->m_maxQlty>m_WorstCellQlty[helper_i]) metComp->m_status |= m_maskBadCellQuality;
+
+        //flag component if noiy energy ratio is too large
+        if (sumEt>1e-3 && sumBadEt>1e-3 && (sumBadEt/sumEt)>m_CompMaxNoisyEnergyRatio[helper_i]) metComp->m_status |= m_maskNoisyEnergyRatio;
+
+      default:
+        continue; // non cell components not needed for the rest of this for(helperComp : metHelper  loop)
+    }
+    
+
+    // flag component if SumE/SumE_subdet is outside the allowed range
+    switch(static_cast<TrigEFMissingEtComponent::Component>(helper_i))
+    {
+      case TrigEFMissingEtComponent::PreSamplB:
+      case TrigEFMissingEtComponent::EMB1: case TrigEFMissingEtComponent::EMB2: case TrigEFMissingEtComponent::EMB3:
+        if (EMB_SumE != 0) {
+          float ratio = sumE / EMB_SumE;
+          if (ratio<m_MinSumEratioInEMB || ratio>m_MaxSumEratioInEMB) metComp->m_status |= m_maskBadEnergyRatio;
+        } break;
+
+      case TrigEFMissingEtComponent::PreSamplE:
+      case TrigEFMissingEtComponent::EME1: case TrigEFMissingEtComponent::EME2: case TrigEFMissingEtComponent::EME3:
+        if (EME_SumE != 0) {
+          float ratio = sumE / EME_SumE;
+          if (ratio<m_MinSumEratioInEME || ratio>m_MaxSumEratioInEME) metComp->m_status |= m_maskBadEnergyRatio;
+        } break;
+
+      case TrigEFMissingEtComponent::HEC0:
+      case TrigEFMissingEtComponent::HEC1: case TrigEFMissingEtComponent::HEC2: case TrigEFMissingEtComponent::HEC3:
+        if (HEC_SumE != 0) {
+          float ratio = sumE / HEC_SumE;
+          if (ratio<m_MinSumEratioInHEC || ratio>m_MaxSumEratioInHEC) metComp->m_status |= m_maskBadEnergyRatio;
+        } break;
+
+      case TrigEFMissingEtComponent::TileBar0: case TrigEFMissingEtComponent::TileBar1: case TrigEFMissingEtComponent::TileBar2:
+        if (TileBar_SumE != 0) {
+          float ratio = sumE / TileBar_SumE;
+          if (ratio<m_MinSumEratioInTileBar || ratio>m_MaxSumEratioInTileBar) metComp->m_status |= m_maskBadEnergyRatio;
+        } break;
+
+      case TrigEFMissingEtComponent::TileGap1: case TrigEFMissingEtComponent::TileGap2: case TrigEFMissingEtComponent::TileGap3:
+        if (TileGap_SumE != 0) {
+          float ratio = sumE / TileGap_SumE;
+          if (ratio<m_MinSumEratioInTileGap || ratio>m_MaxSumEratioInTileGap) metComp->m_status |= m_maskBadEnergyRatio;
+        } break;
+
+      case TrigEFMissingEtComponent::TileExt0: case TrigEFMissingEtComponent::TileExt1: case TrigEFMissingEtComponent::TileExt2:
+        if (TileExt_SumE != 0) {
+          float ratio = sumE / TileExt_SumE;
+          if (ratio<m_MinSumEratioInTileExt || ratio>m_MaxSumEratioInTileExt) metComp->m_status |= m_maskBadEnergyRatio;
+        } break;
+      case TrigEFMissingEtComponent::FCalEM:
+      case TrigEFMissingEtComponent::FCalHad1:
+      case TrigEFMissingEtComponent::FCalHad2:
+        if (FCal_SumE != 0) {
+          float ratio = sumE / FCal_SumE;
+          if (ratio<m_MinSumEratioInFCal || ratio>m_MaxSumEratioInFCal) metComp->m_status |= m_maskBadEnergyRatio;
+        } break;
+      default:
+        break;
+    }
+
+    /** define the lowest 16 bits of global flag as the OR of all
+     ** component flags, excluding bits "Processing" and "Processed"
+     **/
+    unsigned short int exclude = m_maskProcessing | m_maskProcessed;
+    flag |= (metComp->m_status & ~exclude);
+  } // end for (helperComp : metHelper)
+
+  /// map component error bit into event error bit
+  if (flag & m_maskCompErrors) flag |= m_maskGlobErrors;
+
+
+  /*
+  /// set error bit if any subdetector is missing
+  if (flag & (m_maskEMB_A_Missing|m_maskEMB_C_Missing
+             |m_maskEME_A_Missing|m_maskEME_C_Missing
+	     |m_maskHEC_A_Missing|m_maskHEC_C_Missing
+	     |m_maskFCAL_A_Missing|m_maskFCAL_C_Missing
+	     |m_maskTileB_A_Missing|m_maskTileB_C_Missing
+	     |m_maskTileE_A_Missing|m_maskTileE_C_Missing))
+    flag |= m_maskGlobErrors;
+  */
+
+  /// flag events with anomalous EM fraction
+  if (EM_SumE !=0 && caloSumE != 0) {
+    float ratio = EM_SumE / caloSumE;
+    if (ratio<m_MinEMfraction || ratio>m_MaxEMfraction)
+      flag |= m_maskBadEMfraction;
+  }
+
+
+  /// flag events with anomalous TileGap fraction
+  if (TileGap_SumE !=0 && caloSumE != 0) {
+    float ratio = TileGap_SumE / caloSumE;
+    if (ratio>m_MaxTileGapEratio)
+      flag |= m_maskObjInCrack;
+  }
+
+  /// flag event if |MET/SumET| is too large
+  float mex=metHelper->GetEx();
+  float mey=metHelper->GetEy();
+  float SET=metHelper->GetSumEt();
+  float MET=sqrt(mex*mex+mey*mey);
+
+  if (fabsf(SET)>1e-3 && fabsf(MET/SET)>m_GlobMaxMEtSumEtRatio) {
+    flag |= m_maskGlobBigMEtSEtRatio;
+  }
+
+  if ( caloSumEt>1e-3 && caloSumBadEt>1e-3 && (caloSumBadEt/caloSumEt)>m_GlobMaxNoisyEnergyRatio) {
+     flag |= m_maskGlobNoisyEnergyRatio;
+  }
+
+  metHelper->SetStatus(flag); // update helper object
+
+
+  /// TODO: monitor component bits
+
+  return StatusCode::SUCCESS;
+}
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlagsMT.h b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlagsMT.h
new file mode 100644
index 0000000000000000000000000000000000000000..a21a1805ac973711151415bf2a3d1bbc42e5293f
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlagsMT.h
@@ -0,0 +1,90 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGEFMISSINGET_EFMISSINGETFLAGSMT_H
+#define TRIGEFMISSINGET_EFMISSINGETFLAGSMT_H
+
+
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "TrigEFMissingET/IMissingETTool.h"
+#include <vector>
+
+/**
+  $class EFMissingETFlagsMT
+  \author Gabriel Gallardo
+  \data Mar 15 2019
+  It should make checks about fake sources of MET (for the cell algorithm) and update the event status flag.
+ **/
+
+//Based on code EFMissingETFlags by Diego Casadei, May 15, 2008.
+
+class EFMissingETFlagsMT : public extends<AthAlgTool, IMissingETTool> 
+{
+ public:
+
+  EFMissingETFlagsMT(const std::string& type,
+		   const std::string& name,
+		   const IInterface* parent);
+
+  virtual ~EFMissingETFlagsMT() = default;
+
+  virtual StatusCode update(xAOD::TrigMissingET *met,
+                  TrigEFMissingEtHelper *metHelper, const EventContext& /*ctx*/) const override;
+
+ private:
+
+  const static std::vector<float> s_dummyMax;
+  const static std::vector<float> s_dummyMin;
+  const static std::vector<float> s_dummyRatio;
+
+
+  /** configurables */
+  /// NB: Trivial limits are set here.
+  ///     Look at TrigEFMissingETConfig.py for actual initialization
+  ///     24 used for number of vector elements as nCaloSamplings==24
+  Gaudi::Property<float> m_MaxEMfraction {this, "MaxEMfraction",  1.0, "max reasonable energy ratio in EM samplings"};
+  Gaudi::Property<float> m_MinEMfraction {this, "MinEMfraction",  0.0, "min reasonable energy ratio in EM samplings"};
+
+  Gaudi::Property<float> m_MaxTileGapEratio {this, "MaxTileGapEratio",  1.0, "max energy in TileGap scint. compared to global SumE"};
+
+  Gaudi::Property<float> m_MaxSumEratioInEMB {this, "MaxSumEratioInEMB",  1.0, "max reasonable component energy ratio in EMB"};
+  Gaudi::Property<float> m_MaxSumEratioInEME {this, "MaxSumEratioInEME",  1.0, "max reasonable component energy ratio in EME"};
+  Gaudi::Property<float> m_MaxSumEratioInHEC {this, "MaxSumEratioInHEC",  1.0, "max reasonable component energy ratio in HEC"};
+  Gaudi::Property<float> m_MaxSumEratioInTileBar {this, "MaxSumEratioInTileBar",  1.0, "max reasonable component energy ratio in Tile Barrel"};
+  Gaudi::Property<float> m_MaxSumEratioInTileGap {this, "MaxSumEratioInTileGap",  1.0, "max reasonable component energy ratio in TileGap scintillators"};
+  Gaudi::Property<float> m_MaxSumEratioInTileExt {this, "MaxSumEratioInTileExt",  1.0, "max reasonable component energy ratio in Tile Extended-Barrel"};
+  Gaudi::Property<float> m_MaxSumEratioInFCal {this, "MaxSumEratioInFCal",  1.0, "max reasonable component energy ratio in FCal"};
+
+  Gaudi::Property<float> m_MinSumEratioInEMB {this, "MinSumEratioInEMB",  0.0, "min reasonable component energy ratio in EMB"};
+  Gaudi::Property<float> m_MinSumEratioInEME {this, "MinSumEratioInEME",  0.0, "min reasonable component energy ratio in EME"};
+  Gaudi::Property<float> m_MinSumEratioInHEC {this, "MinSumEratioInHEC",  0.0, "min reasonable component energy ratio in HEC"};
+  Gaudi::Property<float> m_MinSumEratioInTileBar {this, "MinSumEratioInTileBar",  0.0, "min reasonable component energy ratio in Tile Barrel"};
+  Gaudi::Property<float> m_MinSumEratioInTileGap {this, "MinSumEratioInTileGap",  0.0, "min reasonable component energy ratio in TileGap scintillators"};
+  Gaudi::Property<float> m_MinSumEratioInTileExt {this, "MinSumEratioInTileExt",  0.0, "min reasonable component energy ratio in Tile Extended-Barrel"};
+  Gaudi::Property<float> m_MinSumEratioInFCal {this, "MinSumEratioInFCal",  0.0, "min reasonable component energy ratio in FCal"};
+
+  Gaudi::Property<float> m_GlobMaxNoisyEnergyRatio {this, "GlobMaxNoisyEnergyRatio",  0.9, "max reasonable BadSET/SET"};
+
+  Gaudi::Property<float> m_GlobMaxMEtSumEtRatio {this, "GlobMaxMEtSumEtRatio",  0.7, "max reasonable |MET/SumET|"};
+
+  Gaudi::Property<std::vector<float> > m_MaxCompE {"MaxCompE", s_dummyMax , "(vector) max reasonable component energy"};
+  Gaudi::Property<std::vector<float> > m_MinCompE {"MinCompE", s_dummyMin , "(vector) min reasonable component energy"};
+
+  Gaudi::Property<std::vector<float> > m_MaxCellE {"MaxCellE", s_dummyMax , "(vector) max reasonable cell energy for each component"};
+  Gaudi::Property<std::vector<float> > m_MinCellE {"MinCellE", s_dummyMin , "(vector) min reasonable cell energy for each component"};
+
+  Gaudi::Property<std::vector<float> > m_MaxCellTime {"MaxCellTime", s_dummyMax , "(vector) max reasonable cell time for each component"};
+  Gaudi::Property<std::vector<float> > m_MinCellTime {"MinCellTime", s_dummyMin , "(vector) min reasonable cell time for each component"};
+
+  Gaudi::Property<std::vector<float> > m_CompMaxNoisyEnergyRatio {"CompMaxNoisyEnergyRatio", s_dummyRatio , "(vector) max reasonable BadSET/SET for each component"};
+
+  Gaudi::Property<std::vector<float> > m_WorstCellQlty {"WorstCellQuality", s_dummyMax , "(vector) max reasonable CaloCell::quality() for each component"};
+
+  Gaudi::Property<std::vector<float> > m_CompMaxMEtSumEtRatio {"CompMaxMEtSumEtRatio", s_dummyRatio , "(vector) max reasonable |MET/SumET| for each component"};
+
+};
+
+#endif // TRIGEFMISSINGET_EFMISSINGETFLAGSMT
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelperMT.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelperMT.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..1386b6e201c278410989004f392322d021530cdf
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelperMT.cxx
@@ -0,0 +1,309 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/********************************************************************
+
+NAME:     EFMissingETFromHelperMT.cxx
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+
+AUTHOR: Gabriel Gallardo
+DATE:   Mar 8, 2019
+
+Based on: EFMissingETFromHelperMT.cxx
+AUTHOR:   Diego Casadei
+CREATED:  March 12, 2008
+
+PURPOSE:  Updates TrigMissingET using TrigEFMissingEtHelper info for AthenaMT.
+
+Components are left uncorrected when saved into
+TrigMissingET as auxiliary information.
+
+ ********************************************************************/
+
+#include "EFMissingETFromHelperMT.h"
+#include "TrigTimeAlgs/TrigTimerSvc.h"
+#include "GaudiKernel/ITHistSvc.h"
+#include "CxxUtils/StrFormat.h"
+
+#include <string>
+
+using CxxUtils::strformat;
+
+void EFMissingETFromHelperMT::ComponentCopier::addHelperCompToMET(unsigned char helper_i)
+{
+  TrigEFMissingEtComponent* metComp = m_helper->GetComponent(helper_i);
+
+  float ex =            metComp->m_ex;
+  float ey =            metComp->m_ey;
+  float ez =            metComp->m_ez;
+  float sumE =          metComp->m_sumE;
+  float sumEt =         metComp->m_sumEt;
+  float c0 =            metComp->m_calib0;
+  float c1 =            metComp->m_calib1;
+  short sumOfSigns =    metComp->m_sumOfSigns;
+
+  m_met->setEx(       m_met->ex() + sumOfSigns * c0 + c1 * ex );
+  m_met->setEy(       m_met->ey() + sumOfSigns * c0 + c1 * ey );
+  m_met->setEz(       m_met->ez() + sumOfSigns * c0 + c1 * ez );
+  m_met->setSumE(   m_met->sumE() + sumOfSigns * c0 + c1 * sumE );
+  m_met->setSumEt( m_met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
+  return;
+}
+
+void EFMissingETFromHelperMT::ComponentCopier::setMETCompFromHelper(unsigned char met_i, unsigned char helper_i)
+{
+  TrigEFMissingEtComponent* metComp = m_helper->GetComponent(helper_i);
+
+  m_met->setNameOfComponent(       met_i, metComp->m_name           );
+  m_met->setExComponent(           met_i, metComp->m_ex             );
+  m_met->setEyComponent(           met_i, metComp->m_ey             );
+  m_met->setEzComponent(           met_i, metComp->m_ez             );
+  m_met->setSumEtComponent(        met_i, metComp->m_sumEt          );
+  m_met->setSumEComponent(         met_i, metComp->m_sumE           );
+  m_met->setCalib0Component(       met_i, metComp->m_calib0         );
+  m_met->setCalib1Component(       met_i, metComp->m_calib1         );
+  m_met->setStatusComponent(       met_i, metComp->m_status         );
+  m_met->setSumOfSignsComponent(   met_i, metComp->m_sumOfSigns     );
+  m_met->setUsedChannelsComponent( met_i, metComp->m_usedChannels   );
+  return;
+}
+
+void EFMissingETFromHelperMT::ComponentCopier::addMETCompWithHelper(unsigned char met_i, unsigned char met_add_i, unsigned char helper_i)
+{
+  TrigEFMissingEtComponent* metComp = m_helper->GetComponent(helper_i);
+
+  m_met->setExComponent(              met_i, metComp->m_ex           + m_met->exComponent(           met_add_i ) );
+  m_met->setEyComponent(              met_i, metComp->m_ey           + m_met->eyComponent(           met_add_i ) );
+  m_met->setEzComponent(              met_i, metComp->m_ez           + m_met->ezComponent(           met_add_i ) );
+  m_met->setSumEtComponent(           met_i, metComp->m_sumEt        + m_met->sumEtComponent(        met_add_i ) );
+  m_met->setSumEComponent(            met_i, metComp->m_sumE         + m_met->sumEComponent(         met_add_i ) );
+  m_met->setSumOfSignsComponent(      met_i, metComp->m_sumOfSigns   + m_met->sumOfSignsComponent(   met_add_i ) );
+  m_met->setUsedChannelsComponent(    met_i, metComp->m_usedChannels + m_met->usedChannelsComponent( met_add_i ) );
+  m_met->setStatusComponent(          met_i, metComp->m_status       | m_met->statusComponent(       met_add_i ) );
+  m_met->setCalib0Component(          met_i, metComp->m_calib0 );
+  m_met->setCalib1Component(          met_i, metComp->m_calib1 );
+  return;
+}
+
+void EFMissingETFromHelperMT::ComponentCopier::addMETCompWithHelper(unsigned char met_i, unsigned char helper_i)
+{
+  TrigEFMissingEtComponent* metComp = m_helper->GetComponent(helper_i);
+
+  m_met->setExComponent(              met_i, metComp->m_ex           );
+  m_met->setEyComponent(              met_i, metComp->m_ey           );
+  m_met->setEzComponent(              met_i, metComp->m_ez           );
+  m_met->setSumEtComponent(           met_i, metComp->m_sumEt        );
+  m_met->setSumEComponent(            met_i, metComp->m_sumE         );
+  m_met->setSumOfSignsComponent(      met_i, metComp->m_sumOfSigns   );
+  m_met->setUsedChannelsComponent(    met_i, metComp->m_usedChannels );
+  m_met->setStatusComponent(          met_i, metComp->m_status       );
+  m_met->setCalib0Component(          met_i, metComp->m_calib0 );
+  m_met->setCalib1Component(          met_i, metComp->m_calib1 );
+  return;
+}
+
+void EFMissingETFromHelperMT::ComponentCopier::setHelperFromMET()
+{
+  m_helper->SetEx(     m_met->ex()     );
+  m_helper->SetEy(     m_met->ey()     );
+  m_helper->SetEz(     m_met->ez()     );
+  m_helper->SetSumEt(  m_met->sumEt( ) );
+  m_helper->SetSumE(   m_met->sumE()   );
+  return;
+}
+// ----------------------- //
+
+EFMissingETFromHelperMT::EFMissingETFromHelperMT(const std::string& type,
+    const std::string& name,
+    const IInterface* parent)
+  : base_class( type, name, parent ) 
+{
+
+}
+
+StatusCode EFMissingETFromHelperMT::update(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper, const EventContext& /*ctx*/) const
+{
+    
+  ATH_MSG_DEBUG( "EFMissingETFromHelperMT::update() called" );
+
+  if (met==0 || metHelper==0) {
+    ATH_MSG_ERROR( "ERROR: null pointers as input!" );
+    return StatusCode::FAILURE;
+  }
+
+  ComponentCopier copier = ComponentCopier(met, metHelper);
+
+  ATH_MSG_DEBUG( "Found this info in the helper class: " << metHelper->getFormattedValues() );
+
+  met->setFlag( metHelper->GetStatus() );
+
+  uint nMetComp = met->getNumberOfComponents(); // final no. of aux. compon.
+  uint nHelperComp = metHelper->GetElements(); // no. of transient aux. compon.
+  if (nHelperComp != static_cast<unsigned char>(TrigEFMissingEtComponent::ComponentSize)) {
+    ATH_MSG_WARNING( "Found " << nHelperComp << " aux components in the transient helper class.  Not supported!" );
+  } else ATH_MSG_DEBUG( "Found " << nHelperComp << " aux components in the transient helper class" );
+
+
+  // Initialize EDM by setting all components to zero
+  met->setEx(0.); met->setEy(0.); met->setEz(0.);
+  met->setSumE(0.); met->setSumEt(0.);
+
+  // take info from *metHelper and update *met
+  for (uint helper_i=0; helper_i<nHelperComp; ++helper_i){
+    switch(static_cast<TrigEFMissingEtComponent::Component>(helper_i))
+    {
+      case TrigEFMissingEtComponent::PreSamplB:
+      case TrigEFMissingEtComponent::EMB1: case TrigEFMissingEtComponent::EMB2: case TrigEFMissingEtComponent::EMB3:
+
+      case TrigEFMissingEtComponent::PreSamplE:
+      case TrigEFMissingEtComponent::EME1: case TrigEFMissingEtComponent::EME2: case TrigEFMissingEtComponent::EME3: 
+
+      case TrigEFMissingEtComponent::HEC0: case TrigEFMissingEtComponent::HEC1:
+      case TrigEFMissingEtComponent::HEC2: case TrigEFMissingEtComponent::HEC3:
+
+      case TrigEFMissingEtComponent::TileBar0: case TrigEFMissingEtComponent::TileBar1: case TrigEFMissingEtComponent::TileBar2: 
+      case TrigEFMissingEtComponent::TileGap1: case TrigEFMissingEtComponent::TileGap2: case TrigEFMissingEtComponent::TileGap3:
+      case TrigEFMissingEtComponent::TileExt0: case TrigEFMissingEtComponent::TileExt1: case TrigEFMissingEtComponent::TileExt2:
+
+      case TrigEFMissingEtComponent::FCalEM:
+      case TrigEFMissingEtComponent::FCalHad1: case TrigEFMissingEtComponent::FCalHad2:
+        copier.addHelperCompToMET(helper_i);
+        break;
+      default:
+        break;
+    }
+  }
+
+  switch (nMetComp) {
+    case 9:
+      ATH_MSG_DEBUG("Save summed HAD MET");
+      copier.addHelperCompToMET(TrigEFMissingEtComponent::TCLCW);
+
+      copier.setMETCompFromHelper(0, TrigEFMissingEtComponent::TCLCWB1);
+      copier.setMETCompFromHelper(1, TrigEFMissingEtComponent::TCLCWB2);
+      copier.setMETCompFromHelper(2, TrigEFMissingEtComponent::TCLCWE1);
+      copier.setMETCompFromHelper(3, TrigEFMissingEtComponent::TCLCWE2);
+      copier.setMETCompFromHelper(4, TrigEFMissingEtComponent::TCEMB1);
+      copier.setMETCompFromHelper(5, TrigEFMissingEtComponent::TCEMB2);
+      copier.setMETCompFromHelper(6, TrigEFMissingEtComponent::TCEME1);
+      copier.setMETCompFromHelper(7, TrigEFMissingEtComponent::TCEME2);
+      copier.setMETCompFromHelper(8, TrigEFMissingEtComponent::Muons);
+      break;
+
+    case 6:
+      ATH_MSG_DEBUG("Save Jets+Mu, with jet components");
+      copier.addHelperCompToMET(TrigEFMissingEtComponent::JET);
+
+      copier.setMETCompFromHelper(0, TrigEFMissingEtComponent::JET);
+      copier.setMETCompFromHelper(1, TrigEFMissingEtComponent::JETB1);
+      copier.setMETCompFromHelper(2, TrigEFMissingEtComponent::JETB2);
+      copier.setMETCompFromHelper(3, TrigEFMissingEtComponent::JETE1);
+      copier.setMETCompFromHelper(4, TrigEFMissingEtComponent::JETE2);
+      copier.setMETCompFromHelper(5, TrigEFMissingEtComponent::Muons);
+      break;
+
+    case 2:
+      ATH_MSG_DEBUG("Save Jets+Mu, no jet components");
+      copier.addHelperCompToMET(TrigEFMissingEtComponent::JET);
+
+      copier.setMETCompFromHelper(0, TrigEFMissingEtComponent::JET);
+      copier.setMETCompFromHelper(1, TrigEFMissingEtComponent::Muons);
+      break;
+
+    case 5:
+      copier.addMETCompWithHelper(0, TrigEFMissingEtComponent::PreSamplB);
+      copier.addMETCompWithHelper(0, TrigEFMissingEtComponent::EMB1);
+      copier.addMETCompWithHelper(0, TrigEFMissingEtComponent::EMB2);
+      copier.addMETCompWithHelper(0, TrigEFMissingEtComponent::EMB3);
+
+      copier.addMETCompWithHelper(1, TrigEFMissingEtComponent::PreSamplE);
+      copier.addMETCompWithHelper(1, TrigEFMissingEtComponent::EME1);
+      copier.addMETCompWithHelper(1, TrigEFMissingEtComponent::EME2);
+      copier.addMETCompWithHelper(1, TrigEFMissingEtComponent::EME3);
+      copier.addMETCompWithHelper(1, TrigEFMissingEtComponent::FCalEM);
+
+      copier.addMETCompWithHelper(2, TrigEFMissingEtComponent::TileBar0);
+      copier.addMETCompWithHelper(2, TrigEFMissingEtComponent::TileBar1);
+      copier.addMETCompWithHelper(2, TrigEFMissingEtComponent::TileBar2);
+      copier.addMETCompWithHelper(2, TrigEFMissingEtComponent::TileExt0);
+      copier.addMETCompWithHelper(2, TrigEFMissingEtComponent::TileExt1);
+      copier.addMETCompWithHelper(2, TrigEFMissingEtComponent::TileExt2);
+
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::HEC0);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::HEC1);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::HEC2);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::HEC3);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::TileGap1);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::TileGap2);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::TileGap3);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::FCalHad1);
+      copier.addMETCompWithHelper(3, TrigEFMissingEtComponent::FCalHad2);
+
+      copier.addMETCompWithHelper(4, TrigEFMissingEtComponent::Muons);
+
+      break;
+    case 3:
+      ATH_MSG_DEBUG("Save pufit clusters MET");
+      copier.addHelperCompToMET(TrigEFMissingEtComponent::TCPUC);
+      copier.setMETCompFromHelper(0, TrigEFMissingEtComponent::TCPUC);
+      copier.setMETCompFromHelper(1, TrigEFMissingEtComponent::TCPUCUnc);
+      copier.setMETCompFromHelper(2, TrigEFMissingEtComponent::Muons);
+
+      break;
+    case 1:
+      copier.setMETCompFromHelper(0, TrigEFMissingEtComponent::Muons);
+      break;
+
+    default:
+      ATH_MSG_WARNING( "Found " << nMetComp << " aux components in TrigMissingET.  Not supported.  NOT SAVING AUX INFO" );
+  } ATH_MSG_DEBUG( "Found " << nMetComp << " aux components in TrigMissingET." );
+  // also update transient helper class, for monitoring
+  copier.setHelperFromMET();
+
+
+
+
+  if(msgLvl(MSG::DEBUG)){
+    std::string message;
+
+    message = strformat ("REGTEST Ex =         %10.2f CLHEP::MeV", met->ex());
+    ATH_MSG_DEBUG( message );
+    message = strformat ("REGTEST Ey =         %10.2f CLHEP::MeV", met->ey());
+    ATH_MSG_DEBUG( message );
+    message = strformat ("REGTEST Ez =         %10.2f CLHEP::MeV", met->ez());
+    ATH_MSG_DEBUG( message );
+    message = strformat ("REGTEST SumET =         %10.2f CLHEP::MeV", met->sumEt());
+    ATH_MSG_DEBUG( message );
+    message = strformat ("REGTEST SumE =       %10.2f CLHEP::MeV", met->sumE());
+    ATH_MSG_DEBUG( message );
+    message = strformat ("REGTEST Flag =       %d", met->flag());
+    ATH_MSG_DEBUG( message );
+
+    message="REGTEST __name____status_usedChannels__sumOfSigns__calib1_calib0";
+      message+="/MeV__ex/MeV_____ey/MeV_____ez/MeV___sumE/MeV__sumEt/CLHEP::MeV";
+    
+    if (nMetComp>0) ATH_MSG_DEBUG( message );
+
+    for(uint j = 0; j < nMetComp; j++) 
+    {
+    	const char* name =               met->nameOfComponent(j).c_str();
+    	const short status =             met->statusComponent(j);
+    	const unsigned short usedChan =  met->usedChannelsComponent(j);
+    	const short sumOfSigns =         met->sumOfSignsComponent(j);
+    	const float calib0 =             met->calib0Component(j);
+    	const float calib1 =             met->calib1Component(j);
+    	const float ex =                 met->exComponent(j);
+    	const float ey =                 met->eyComponent(j);
+    	const float ez =                 met->ezComponent(j);
+    	const float sumE =               met->sumEComponent(j);
+    	const float sumEt =              met->sumEtComponent(j);
+
+      message = strformat ("REGTEST   %s   %6d %12d %10d   %6.2f  %6.3f %10.2f %10.2f %10.2f %10.2f %10.2f",
+       name, status, usedChan, sumOfSigns, calib1, calib0, ex, ey, ez, sumE, sumEt);
+      ATH_MSG_DEBUG( message );
+    }
+  }
+  return StatusCode::SUCCESS;
+}
+
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelperMT.h b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelperMT.h
new file mode 100644
index 0000000000000000000000000000000000000000..d710def1a37e1c3d6b802e76c03217ed0f66995e
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelperMT.h
@@ -0,0 +1,86 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGEFMISSINGET_EFMISSINGETFROMHELPER_MT_H
+#define TRIGEFMISSINGET_EFMISSINGETFROMHELPER_MT_H
+
+/********************************************************************
+
+NAME:     EFMissingETFromHelperMT.h
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+
+AUTHORS:  Gabriel Gallardo
+CREATED:  March 8, 2019
+
+BASED ON: EFMissingETFromHelperMT.h
+AUTHORS:  Diego Casadei
+CREATED:  March 12, 2008
+
+PURPOSE:  Updates TrigMissingET using TrigMissingETHelper info
+
+ ********************************************************************/
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "TrigMissingEtEvent/TrigMissingET.h"
+#include "TrigEFMissingET/IMissingETTool.h"
+
+/**
+  $class EFMissingETFromHelperMT
+  - Saves transient information in the persistent object,
+  applying calibration only to global properties.
+  - Fills component-level monitoring histograms
+ **/
+
+class EFMissingETFromHelperMT : public extends<AthAlgTool, IMissingETTool> 
+{
+  public:
+
+    EFMissingETFromHelperMT(const std::string& type,
+                          const std::string& name,
+                          const IInterface* parent);
+
+    virtual ~EFMissingETFromHelperMT() = default;
+
+    virtual StatusCode update( xAOD::TrigMissingET *met,
+             TrigEFMissingEtHelper *metHelper,
+             const EventContext& /*ctx*/ ) const override;
+
+    class ComponentCopier
+    {
+    public:
+      ComponentCopier(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper)
+      {
+        m_met = met;
+        m_helper = metHelper;
+      }
+
+      void addHelperCompToMET(unsigned char helper_i);
+      void addHelperCompToMET(TrigEFMissingEtComponent::Component helper_i)
+        { return addHelperCompToMET(static_cast<uint>(helper_i) ); }
+
+      void setMETCompFromHelper(unsigned char met_i, unsigned char helper_i);
+      void setMETCompFromHelper(unsigned char met_i, TrigEFMissingEtComponent::Component helper_i)
+        { return setMETCompFromHelper(met_i, static_cast<uint>(helper_i) ); }
+
+      void addMETCompWithHelper(unsigned char met_i, unsigned char met_add_i, unsigned char helper_i);
+      void addMETCompWithHelper(unsigned char met_i, unsigned char met_add_i, TrigEFMissingEtComponent::Component helper_i)
+        { return addMETCompWithHelper(met_i, met_add_i, static_cast<uint>(helper_i) );}
+
+      void addMETCompWithHelper(unsigned char met_i, unsigned char helper_i);
+      void addMETCompWithHelper(unsigned char met_i, TrigEFMissingEtComponent::Component helper_i)
+        { return addMETCompWithHelper(met_i, static_cast<uint>(helper_i) );}
+        
+      void setHelperFromMET();
+
+      xAOD::TrigMissingET* getMET() {return m_met; }
+      TrigEFMissingEtHelper* getMETHelper() {return m_helper; }
+      
+    private:
+      xAOD::TrigMissingET *m_met;
+      TrigEFMissingEtHelper *m_helper;
+    };
+
+};
+
+#endif // TRIGEFMISSINGET_EFMISSINGETFROMHELPER_MT
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx
index 0a28559cffd521dfab808f11185e3fffa0ec7e7e..3de839620e688c4f3e2bdd3354a51118fbccc132 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx
@@ -17,6 +17,8 @@
 #include "../EFMissingETFromClustersMT.h"
 #include "../EFMissingETFromClustersPufitMT.h"
 #include "../EFMissingETFromJetsMT.h"
+#include "../EFMissingETFromHelperMT.h"
+#include "../EFMissingETFlagsMT.h"
 
 DECLARE_COMPONENT( EFMissingET )
 DECLARE_COMPONENT( EFMissingETBaseTool )
@@ -37,4 +39,6 @@ DECLARE_COMPONENT( EFMissingETFromCellsMT )
 DECLARE_COMPONENT( EFMissingETFromClustersMT )
 DECLARE_COMPONENT( EFMissingETFromClustersPufitMT )
 DECLARE_COMPONENT( EFMissingETFromJetsMT )
+DECLARE_COMPONENT( EFMissingETFromHelperMT )
+DECLARE_COMPONENT( EFMissingETFlagsMT )
 
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
index 723459a24f27d63f24a66dace1fe31e23edd7bfc..98d42355a95cb3b43f2ea3590a7bca0a959b8e57 100644
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaToolFactories.py
@@ -18,7 +18,7 @@ from AthenaCommon.SystemOfUnits import GeV,MeV,deg
 # New configuration for use in rel 19.X with xAOD
 # Adapted from egammaRec/egammaGetter.py
 # Factory tools, handles configuration of tools and dependencies
-from egammaRec.Factories import Factory, PublicToolFactory, FcnWrapper, getPropertyValue 
+from egammaRec.Factories import Factory, ToolFactory, PublicToolFactory, FcnWrapper, getPropertyValue 
 
 # Import tools required for trigger reconstruction
 # Following offline tools not used at HLT: 
@@ -47,6 +47,16 @@ TrigCaloFillRectangularCluster = PublicToolFactory( Cccc.CaloFillRectangularClus
         phi_size = 7,
         cells_name = "")
 
+# tool to extrapolate to the calo
+from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool
+#this is just regular extrapolator, but in ToolFactory form
+from egammaTools.InDetTools import egammaExtrapolator
+CaloExtensionTool =  ToolFactory (Trk__ParticleCaloExtensionTool,
+                                  Extrapolator = egammaExtrapolator)
+
+CaloCellAssocTool =  ToolFactory (Rec__ParticleCaloCellAssociationTool,
+                                  ParticleCaloExtensionTool = CaloExtensionTool)
+
 from AthenaCommon.GlobalFlags import globalflags
 isMC = not globalflags.DataSource()=='data'
 from IsolationCorrections.IsolationCorrectionsConf import CP__IsolationCorrectionTool as ICT
@@ -55,28 +65,32 @@ IsoCorrectionToolTrig = PublicToolFactory(ICT,
                                     IsMC = isMC)
 from IsolationTool.IsolationToolConf import xAOD__CaloIsolationTool,xAOD__TrackIsolationTool
 from CaloIdentifier import SUBCALO
-TrigCaloIsolationTool = PublicToolFactory(xAOD__CaloIsolationTool,name = "TrigEgammaCaloIsolationTool",
+TrigCaloIsolationTool = ToolFactory(xAOD__CaloIsolationTool,name = "TrigEgammaCaloIsolationTool",
         doEnergyDensityCorrection = False,
         saveOnlyRequestedCorrections = True,
         IsoLeakCorrectionTool          = IsoCorrectionToolTrig,
         CaloFillRectangularClusterTool = TrigCaloFillRectangularCluster,
+        ParticleCaloExtensionTool      = CaloExtensionTool,
+        ParticleCaloCellAssociationTool = CaloCellAssocTool,
         EMCaloNums = [SUBCALO.LAREM],
         HadCaloNums = [SUBCALO.LARHEC,SUBCALO.TILE])
 
 from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInConeTool
 TrigCaloClustersInConeTool = PublicToolFactory(xAOD__CaloClustersInConeTool,CaloClusterLocation = "CaloCalTopoCluster")
 
-TrigCaloTopoIsolationTool = PublicToolFactory(xAOD__CaloIsolationTool,name = "TrigEgammaCaloTopoIsolationTool",
+TrigCaloTopoIsolationTool = ToolFactory(xAOD__CaloIsolationTool,name = "TrigEgammaCaloTopoIsolationTool",
         doEnergyDensityCorrection = True,
         saveOnlyRequestedCorrections = True,
         IsoLeakCorrectionTool          = IsoCorrectionToolTrig,
         ClustersInConeTool              = TrigCaloClustersInConeTool,
         CaloFillRectangularClusterTool = TrigCaloFillRectangularCluster,
         UseEMScale = True,
+        ParticleCaloExtensionTool      = CaloExtensionTool,
+        ParticleCaloCellAssociationTool = CaloCellAssocTool,
         TopoClusterEDCentralContainer = "HLTTopoClusterIsoCentralEventShape",
         TopoClusterEDForwardContainer = "HLTTopoClusterIsoForwardEventShape")
 
-TrigTrackIsolationTool = PublicToolFactory(xAOD__TrackIsolationTool, name = 'TrigEgammaTrackIsolationTool')
+TrigTrackIsolationTool = ToolFactory(xAOD__TrackIsolationTool, name = 'TrigEgammaTrackIsolationTool')
 
 TrkIsoCfg = CfgMgr.xAOD__TrackIsolationTool('TrigEgammaTrackIsolationTool')
 TrkIsoCfg.TrackSelectionTool.maxZ0SinTheta = 3.
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
index 902b40a328283b8ed750ff219f94602f37c8bcbc..f90b1ca2c3c9eb3c8df044aa1658b1c5be3c99cf 100755
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
@@ -99,6 +99,9 @@ TrigEgammaRec::TrigEgammaRec(const std::string& name,ISvcLocator* pSvcLocator):
     HLT::FexAlgo(name, pSvcLocator),
     m_electronContainerName("egamma_Electrons"),
     m_photonContainerName("egamma_Photons"),
+    m_trackIsolationTool("", this),
+    m_caloCellIsolationTool("", this),
+    m_topoIsolationTool("", this),
     m_lumiBlockMuTool("LumiBlockMuTool/LumiBlockMuTool")
 {
 
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
index a566e806402b1b13fbf527e1da05c509481265bf..8ddaa3c3dd54cafda55262336f7ab22a0ecdab5f 100755
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
@@ -613,6 +613,10 @@ class TrigFastTrackFinder_MuonFS(TrigFastTrackFinderBase):
   def __init__(self, name = "TrigFastTrackFinder_MuonFS"):
     TrigFastTrackFinderBase.__init__(self, "TrigFastTrackFinder_MuonFS","Muon")
 
+class TrigFastTrackFinder_MuonIso(TrigFastTrackFinderBase):
+  def __init__(self, name = "TrigFastTrackFinder_MuonIso"):
+    TrigFastTrackFinderBase.__init__(self, "TrigFastTrackFinder_MuonIso","Muon")
+
 class TrigFastTrackFinder_eGamma(TrigFastTrackFinderBase):
   def __init__(self, name = "TrigFastTrackFinder_eGamma"):
     TrigFastTrackFinderBase.__init__(self, "TrigFastTrackFinder_eGamma","eGamma")
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py
new file mode 100644
index 0000000000000000000000000000000000000000..2d12d606bb023aec7929152cc0ba53f7d23e8142
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py
@@ -0,0 +1,315 @@
+#
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+#  This file configs the L2MuonSA reco alg in the newJO way, 
+#      but now is located here temporarily until newJO migrations are done in all trigger signatures.
+#  This should be moved at somewhere in offline.
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+### Output Name ###
+muFastInfo = "MuonL2SAInfo"
+
+# Get Rpc data decoder for MuFast data preparator 
+def RpcDataPreparatorCfg( flags, roisKey ):
+
+    acc = ComponentAccumulator()
+
+    # Get BS decoder 
+    from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg
+    rpcAcc = RpcBytestreamDecodeCfg( flags, forTrigger=True )
+    #rpcAcc.getEventAlgo("RpcRawDataProvider").RoIs = roisKey
+    acc.merge( rpcAcc )
+
+    # Get BS->RDO convertor
+    from MuonConfig.MuonRdoDecodeConfig import RpcRDODecodeCfg    
+    rpcAcc = RpcRDODecodeCfg( flags, forTrigger=True )
+    #rpcAcc.getEventAlgo("RpcRdoToRpcPrepData").RoIs = roisKey
+    acc.merge( rpcAcc )
+
+    # Set Rpc data preparator for MuFast data preparator
+    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__RpcDataPreparator
+    RpcDataPreparator = TrigL2MuonSA__RpcDataPreparator( RpcPrepDataProvider  = acc.getPublicTool( "RpcRdoToRpcPrepDataTool" ),
+                                                         RpcRawDataProvider   = acc.getPublicTool( "RPC_RawDataProviderTool" ),
+                                                         #DecodeBS = DetFlags.readRDOBS.RPC_on() ) # This should be used flags
+                                                         DecodeBS = True )
+    acc.addPublicTool( RpcDataPreparator, primary=True ) # Now this is needed, but should be removed
+ 
+    return acc, RpcDataPreparator
+
+# Get Tgc data decoder for MuFast data preparator 
+def TgcDataPreparatorCfg( flags, roisKey ):
+
+    acc = ComponentAccumulator()
+
+    # Get BS decoder 
+    from MuonConfig.MuonBytestreamDecodeConfig import TgcBytestreamDecodeCfg
+    tgcAcc = TgcBytestreamDecodeCfg( flags, forTrigger=True )
+    #TgcRawDataProvider.RoIs = roisKey
+    acc.merge( tgcAcc )
+
+    # Get BS->RDO convertor
+    from MuonConfig.MuonRdoDecodeConfig import TgcRDODecodeCfg    
+    tgcAcc = TgcRDODecodeCfg( flags, forTrigger=True )
+    #tgcAcc.getEventAlgo("TgcRdoToTgcPrepData").RoIs = roisKey
+    acc.merge( tgcAcc )
+
+    # Set Tgc data preparator for MuFast data preparator
+    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__TgcDataPreparator
+    TgcDataPreparator = TrigL2MuonSA__TgcDataPreparator( TgcPrepDataProvider  = acc.getPublicTool( "TgcRdoToTgcPrepDataTool" ) )
+                                                         #DecodeBS = DetFlags.readRDOBS.TGC_on() ) # This should be used flags
+ 
+    return acc, TgcDataPreparator
+
+# Get Mdt data decoder for MuFast data preparator 
+def MdtDataPreparatorCfg( flags, roisKey ):
+
+    acc = ComponentAccumulator()
+
+    # Get BS decoder 
+    from MuonConfig.MuonBytestreamDecodeConfig import MdtBytestreamDecodeCfg
+    mdtAcc = MdtBytestreamDecodeCfg( flags, forTrigger=True )
+    #MdtRawDataProvider.RoIs = roisKey
+    acc.merge( mdtAcc )
+
+    # Get BS->RDO convertor
+    from MuonConfig.MuonRdoDecodeConfig import MdtRDODecodeCfg    
+    mdtAcc = MdtRDODecodeCfg( flags, forTrigger=True )
+    #mdtAcc.getEventAlgo("MdtRdoToMdtPrepData").RoIs = roisKey
+    acc.merge( mdtAcc )
+
+    # Set Mdt data preparator for MuFast data preparator
+    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MdtDataPreparator
+    MdtDataPreparator = TrigL2MuonSA__MdtDataPreparator( MdtPrepDataProvider  = acc.getPublicTool( "MdtRdoToMdtPrepDataTool" ),
+                                                         MDT_RawDataProvider   = acc.getPublicTool( "MDT_RawDataProviderTool" ),
+                                                         #DecodeBS = DetFlags.readRDOBS.MDT_on() ) # This should be used flags
+                                                         DecodeBS = True )
+ 
+    return acc, MdtDataPreparator
+
+# Get Csc data decoder for MuFast data preparator 
+def CscDataPreparatorCfg( flags, roisKey ):
+
+    acc = ComponentAccumulator()
+
+    # Get BS decoder 
+    from MuonConfig.MuonBytestreamDecodeConfig import CscBytestreamDecodeCfg
+    cscAcc = CscBytestreamDecodeCfg( flags, forTrigger=True )
+    #CscRawDataProvider.RoIs = roisKey
+    acc.merge( cscAcc )
+
+    # Get BS->RDO convertor
+    from MuonConfig.MuonRdoDecodeConfig import CscRDODecodeCfg    
+    cscAcc = CscRDODecodeCfg( flags, forTrigger=True )
+    #cscAcc.getEventAlgo("CscRdoToCscPrepData").RoIs = roisKey
+    acc.merge( cscAcc )
+
+    # Get cluster builder
+    from MuonConfig.MuonRdoDecodeConfig import CscClusterBuildCfg
+    cscAcc = CscClusterBuildCfg( flags, forTrigger=True )
+    acc.merge( cscAcc )
+
+    # Set Csc data preparator for MuFast data preparator
+    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__CscDataPreparator
+    CscDataPreparator = TrigL2MuonSA__CscDataPreparator( CscPrepDataProvider  = acc.getPublicTool( "CscRdoToCscPrepDataTool" ),
+                                                         CscClusterProvider   = acc.getPublicTool( "CscThesholdClusterBuilderTool" ) )
+                                                         #DecodeBS = DetFlags.readRDOBS.CSC_on() ) # This should be used flags
+    acc.addPublicTool( CscDataPreparator, primary=True ) # This should be removed
+ 
+    return acc, CscDataPreparator
+
+# Based on TrigL2MuonSAMTConfig at TrigL2MuonSA/TrigL2MuonSAConfig.py
+def muFastSteeringCfg( flags, roisKey, setup="" ):
+
+    acc = ComponentAccumulator()
+
+    # Get RPC decoder
+    rpcAcc, RpcDataPreparator = RpcDataPreparatorCfg( flags, roisKey )
+    acc.merge( rpcAcc )
+
+    # Get TGC decoder
+    tgcAcc, TgcDataPreparator = TgcDataPreparatorCfg( flags, roisKey )
+    acc.merge( tgcAcc )
+
+    # Get MDT decoder
+    mdtAcc, MdtDataPreparator = MdtDataPreparatorCfg( flags, roisKey )
+    acc.merge( mdtAcc )
+
+    # Get CSC decoder
+    cscAcc, CscDataPreparator = CscDataPreparatorCfg( flags, roisKey )
+    acc.merge( cscAcc )
+
+    # Set MuFast data preparator
+    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MuFastDataPreparator
+    MuFastDataPreparator = TrigL2MuonSA__MuFastDataPreparator( CSCDataPreparator = CscDataPreparator,
+                                                               MDTDataPreparator = MdtDataPreparator,
+                                                               RPCDataPreparator = RpcDataPreparator,
+                                                               TGCDataPreparator = TgcDataPreparator )
+
+    # Setup the station fitter
+    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MuFastStationFitter,TrigL2MuonSA__PtFromAlphaBeta
+    PtFromAlphaBeta = TrigL2MuonSA__PtFromAlphaBeta()
+    if flags.Trigger.run2Config == '2016':
+        PtFromAlphaBeta.useCscPt = False
+        PtFromAlphaBeta.AvoidMisalignedCSCs = True
+    else:
+        PtFromAlphaBeta.useCscPt = True
+        PtFromAlphaBeta.AvoidMisalignedCSCs = True
+
+    MuFastStationFitter = TrigL2MuonSA__MuFastStationFitter( PtFromAlphaBeta = PtFromAlphaBeta )
+
+    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MuFastPatternFinder,TrigL2MuonSA__MuFastTrackFitter,TrigL2MuonSA__MuFastTrackExtrapolator,TrigL2MuonSA__MuCalStreamerTool,TrigL2MuonSA__CscSegmentMaker
+    MuFastPatternFinder     = TrigL2MuonSA__MuFastPatternFinder()
+    MuFastTrackFitter       = TrigL2MuonSA__MuFastTrackFitter()
+    MuFastTrackExtrapolator = TrigL2MuonSA__MuFastTrackExtrapolator()
+    MuCalStreamerTool       = TrigL2MuonSA__MuCalStreamerTool()
+    CscSegmentMaker         = TrigL2MuonSA__CscSegmentMaker()
+
+    # Set Reco alg of muFast step
+    from TrigL2MuonSA.TrigL2MuonSAMonitoring import TrigL2MuonSAMonitoring
+    from TrigL2MuonSA.TrigL2MuonSAConf import MuFastSteering
+    muFastAlg = MuFastSteering( name                   = "MuFastSteering_Muon"+setup,
+                                DataPreparator         = MuFastDataPreparator,
+                                StationFitter          = MuFastStationFitter,
+                                PatternFinder          = MuFastPatternFinder,
+                                TrackFitter            = MuFastTrackFitter,
+                                TrackExtrapolator      = MuFastTrackExtrapolator,
+                                CalibrationStreamer    = MuCalStreamerTool, 
+                                CscSegmentMaker        = CscSegmentMaker,
+                                R_WIDTH_TGC_FAILED     = 200,
+                                R_WIDTH_RPC_FAILED     = 400,
+                                DoCalibrationStream    = False,
+                                USE_ROIBASEDACCESS_CSC = True,
+                                RpcErrToDebugStream    = True,
+                                Timing                 = False,
+                                MonTool                = TrigL2MuonSAMonitoring() )
+
+    # Default backextrapolator is for MC Misaligned Detector
+    # Based on MuonBackExtrapolatorForMisalignedDet at TrigMuonBackExtrapolator/TrigMuonBackExtrapolatorConfig.py
+    from TrigMuonBackExtrapolator.TrigMuonBackExtrapolatorConf import TrigMuonBackExtrapolator
+    muFastAlg.BackExtrapolator = TrigMuonBackExtrapolator( name        = "MisalignedBackExtrapolator",
+                                                           Aligned     = False,
+                                                           DataSet     = False )
+
+    if flags.Trigger.run2Config == '2016':
+        muFastAlg.UseEndcapInnerFromBarrel = False
+    else: 
+        muFastAlg.UseEndcapInnerFromBarrel = True
+
+    if setup == '900GeV':
+        muFastAlg.WinPt = 4.0
+        muFastAlg.Scale_Road_BarrelInner  = 3
+        muFastAlg.Scale_Road_BarrelMiddle = 3
+        muFastAlg.Scale_Road_BarrelOuter  = 3
+    else:
+        muFastAlg.WinPt = 6.0
+        muFastAlg.Scale_Road_BarrelInner  = 1
+        muFastAlg.Scale_Road_BarrelMiddle = 1
+        muFastAlg.Scale_Road_BarrelOuter  = 1
+
+    if setup == 'MuonCalib':
+        muFastAlg.DoCalibrationStream = True
+        muFastAlg.MuonCalDataScouting = False
+        muFastAlg.MuonCalBufferSize   = 1024*1024
+
+    if setup == 'MuonCalibDataScouting':
+        muFastAlg.DoCalibrationStream = True
+        muFastAlg.MuonCalDataScouting = True
+        muFastAlg.MuonCalBufferSize   = 1024*1024
+
+    return acc, muFastAlg
+
+def PtBarrelLUTSvcCfg( flags ):
+
+    acc = ComponentAccumulator()
+    from TrigL2MuonSA.TrigL2MuonSAConfig import PtBarrelLUTSvc
+    ptBarrelLUTSvc = PtBarrelLUTSvc()
+    acc.addService( ptBarrelLUTSvc )
+
+    return acc, ptBarrelLUTSvc
+
+def PtBarrelLUTSvcCfg_MC( flags ):
+
+    acc = ComponentAccumulator()
+    from TrigL2MuonSA.TrigL2MuonSAConfig import PtBarrelLUTSvc_MC
+    ptBarrelLUTSvc_MC = PtBarrelLUTSvc_MC() 
+    acc.addService( ptBarrelLUTSvc_MC )
+
+    return acc, ptBarrelLUTSvc_MC
+
+def PtEndcapLUTSvcCfg( flags ):
+
+    acc = ComponentAccumulator()
+    from TrigL2MuonSA.TrigL2MuonSAConfig import PtEndcapLUTSvc
+    ptEndcapLUTSvc = PtEndcapLUTSvc()
+    acc.addService( ptEndcapLUTSvc )
+
+    return acc, ptEndcapLUTSvc
+
+def PtEndcapLUTSvcCfg_MC( flags ):
+
+    acc = ComponentAccumulator()
+    from TrigL2MuonSA.TrigL2MuonSAConfig import PtEndcapLUTSvc_MC
+    ptEndcapLUTSvc_MC = PtEndcapLUTSvc_MC() 
+    acc.addService( ptEndcapLUTSvc_MC )
+
+    return acc, ptEndcapLUTSvc_MC
+
+
+def AlignmentBarrelLUTSvcCfg( flags ):
+
+    acc = ComponentAccumulator()
+    from TrigL2MuonSA.TrigL2MuonSAConfig import AlignmentBarrelLUTSvc
+    alignmentBarrelLUTSvc = AlignmentBarrelLUTSvc()
+    acc.addService( alignmentBarrelLUTSvc )
+
+    return acc, alignmentBarrelLUTSvc
+
+# In the future, above functions should be moved to TrigL2MuonSA package(?)
+
+def l2MuFastAlgCfg( flags, roisKey="MURoIs" ):
+
+    acc = ComponentAccumulator()
+
+    # Get Reco alg of muFast step
+    muFastAcc, muFastFex = muFastSteeringCfg( flags, roisKey )  
+    muFastFex.MuRoIs = roisKey
+    muFastFex.RecMuonRoI = "RecMURoIs"
+    muFastFex.MuonL2SAInfo = muFastInfo
+    muFastFex.forID = "forID"
+    muFastFex.forMS = "forMS"
+    acc.merge( muFastAcc )
+
+    # Get services of the Reco alg
+    acc.merge( PtBarrelLUTSvcCfg(flags)[0] )   
+    acc.merge( PtBarrelLUTSvcCfg_MC(flags)[0] )   
+    acc.merge( PtEndcapLUTSvcCfg(flags)[0] )   
+    acc.merge( PtEndcapLUTSvcCfg_MC(flags)[0] )   
+    acc.merge( AlignmentBarrelLUTSvcCfg(flags)[0] )
+
+    return acc, muFastFex
+
+
+def l2MuFastRecoCfg( flags ):
+
+    # Set EventViews for muFast step
+    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco
+    reco = InViewReco("L2MuFastReco")
+
+    # Get Reco alg of muFast Step in order to set into the view
+    algAcc, alg = l2MuFastAlgCfg( flags, roisKey=reco.name+"RoIs")
+
+    reco.addRecoAlg( alg )
+    reco.merge( algAcc )
+
+    return reco
+
+
+def l2MuFastHypoCfg( flags, name="UNSPECIFIED", muFastInfo="UNSPECIFIED" ):
+
+    from TrigMuonHypoMT.TrigMuonHypoMTConf import TrigMufastHypoAlg
+    muFastHypo = TrigMufastHypoAlg( name )
+    muFastHypo.MuonL2SAInfoFromMuFastAlg = muFastInfo 
+
+    return muFastHypo
+ 
diff --git a/Trigger/TrigAlgorithms/TrigMuSuperEF/python/TrigMuSuperEFConfig.py b/Trigger/TrigAlgorithms/TrigMuSuperEF/python/TrigMuSuperEFConfig.py
index 035bb6d5a772ded0d948ff835fa768fa48c89221..dd8522580e2bef5c51052b6b5d3ef06137fb4b17 100644
--- a/Trigger/TrigAlgorithms/TrigMuSuperEF/python/TrigMuSuperEFConfig.py
+++ b/Trigger/TrigAlgorithms/TrigMuSuperEF/python/TrigMuSuperEFConfig.py
@@ -38,6 +38,16 @@ class TrigMuSuperEFConfig(TrigMuSuperEF):
         kwargs.setdefault("UseL2Info",False)
         kwargs.setdefault("DoCache", True)
 
+        from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+        from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+
+        from MuonTGRecTools.MuonTGRecToolsConf import Muon__MuonSystemExtensionTool
+        pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+
+        muonExtTool = Muon__MuonSystemExtensionTool(Extrapolator = AtlasExtrapolator(),
+                                                    ParticleCaloExtensionTool = pcExtensionTool)
+        kwargs.setdefault("MuonSystemExtensionTool", muonExtTool)
+
         doTrigMuonEF     = kwargs["doOutsideIn"]
         doTrigMuGirl     = kwargs["doInsideOut"]
         doStandaloneOnly = kwargs["StandaloneOnly"]
diff --git a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
index 2e66c05e7c0487dbe44d404f4abc0ac7f63907b2..c1b144311e4ba1815ec0c2e6f3dff06b82bcbbac 100644
--- a/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuSuperEF/src/TrigMuSuperEF.cxx
@@ -109,7 +109,7 @@ TrigMuSuperEF::TrigMuSuperEF(const std::string& name, ISvcLocator* pSvcLocator)
   m_TrackToTrackParticleConvTool("TrackToTrackParticleConvTool",this),
   m_muonCreatorTool("MuonCreatorTool"),
   m_stauCreatorTool("MuonCreatorTool"),
-  m_muonSystemExtensionTool("Muon::MuonSystemExtensionTool/MuonSystemExtensionTool"),
+  m_muonSystemExtensionTool("Muon::MuonSystemExtensionTool/MuonSystemExtensionTool", this),
   m_doMuonFeature(false),
   m_useL2Info(false),
   m_doCache(true)
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
index 7e2e12083ef2f9230d89e96724f8cac9a51ab9de..395e6743ff7b8a8254460e527ffae3086bdda809 100755
--- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
@@ -373,6 +373,11 @@ def TMEF_MuonCandidateTool(name="TMEF_MuonCandidateTool",**kwargs):
     return CfgMgr.MuonCombined__MuonCandidateTool(name,**kwargs)
 
 def TMEF_MuonCreatorTool(name="TMEF_MuonCreatorTool",**kwargs):
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+
+    kwargs.setdefault("ParticleCaloExtensionTool", pcExtensionTool)
     kwargs.setdefault('TrackParticleCreator','TMEF_TrkToTrackParticleConvTool')
     kwargs.setdefault('MakeTrackAtMSLink',True)
     kwargs.setdefault("CaloMaterialProvider", "TMEF_TrkMaterialProviderTool")
@@ -826,3 +831,28 @@ class TrigMuonEFIDTrackRoiMakerConfig(TrigMuonEFIDTrackRoiMaker):
         montool = TrigMuonEFIDTrackRoiMakerMonitoring()
 
         self.AthenaMonTools = [ montool ]
+
+
+class TrigMuonEFTrackIsolationMTConfig (TrigMuonEFTrackIsolationAlgMT):
+    __slots__ = ()
+
+    def __init__( self, name="TrigMuonEFTrackIsolationMTConfig" ):
+        super( TrigMuonEFTrackIsolationMTConfig, self ).__init__( name )
+
+        # configure the isolation tool
+        TMEF_IsolationTool = TMEF_TrackIsolationTool('TMEF_IsolationTool',useVarIso=True)
+
+        # Isolation tool
+        self.OnlineIsolationTool = TMEF_IsolationTool
+
+        # ID tracks
+        #self.IdTrackParticles = "InDetTrigParticleCreation_FullScan_EFID"
+        #self.IdTrackParticles = "InDetTrigParticleCreation_MuonIso_EFID"
+        self.IdTrackParticles = "InDetTrigTrackingxAODCnv_Muon_IDTrig"
+
+        # Only run algo on combined muons
+        self.requireCombinedMuon = True
+
+        # Use offline isolation variables
+        self.useVarIso = True
+        self.MuonContName = "Muons"
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h
index 632282cc5154a83fe44bb4e8ee405723cd6516a0..844ee8755479ad905dab74872c3dc810bfa9a39a 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/IReAlgToolCalo.h
@@ -32,7 +32,6 @@
 #include "TrigT2CaloCommon/ITrigCaloDataAccessSvc.h"
 #include "TrigT2CaloCommon/T2Calibration.h"
 #include "TrigT2CaloCommon/T2GeometryTool.h"
-#include "TrigTimeAlgs/TrigTimerSvc.h"
 #include "xAODTrigCalo/TrigEMCluster.h"
 
 /** Base Class for Tools used for Egamma and Tau Feature Extraction Algorithms */
@@ -58,19 +57,11 @@ protected:
   /** Very useful function to check about the Cluster structure.
   It prints out a grid of cells eta and phi positions and energies.
   Only exist in DEBUG versions of the code. */
-  void PrintCluster(const double energyFromAlg, const int nCaloType, const int nCaloSamp,
+  void PrintCluster(const double /*energyFromAlg*/, const int /*nCaloType*/, const int /*nCaloSamp*/,
                     const CaloSampling::CaloSample, const CaloSampling::CaloSample) const
   {}
 #endif
 
-  /** Timing measure items in all IReAlgToolCalos.
-  m_timer[0] is the complete exec timer. m_timer[1] is the
-  Region Selector timer, m_timer[2] is the LoadCollection
-  timer (Data Preparation), m_timer[3] is the real algorithmic
-  timer and m_timer[4] is the saving data (to TrigCaloEvent
-  object) timer. */
-  TrigTimer* m_timer[5];
-
   /** Objects will need T2Calibration. So far, a given tool will
   not need more than one of such objects. */
   T2Calibration* m_calib{nullptr};
@@ -92,9 +83,6 @@ protected:
   Gaudi::Property<float> m_cellkeepthr{this, "ThresholdKeepCells", 1e5,
                                        "Threshold to keep cells incontainer"};
 
-  ServiceHandle<ITrigTimerSvc> m_timersvc{this, "TrigTimerSvc", "TrigTimerSvc/TrigTimerSvc",
-                                          "Trigger Timer Service for benchmarking algorithms"};
-
   ToolHandle<IT2GeometryTool> m_geometryTool{
       this, "T2GeometryTool", "T2GeometryTool/T2GeometryTool",
       "Tool to check that a cells are contained in a given cluster"};
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
index c9f6ea6b9e3dcb8bff79169870c70f32e1d43c75..d953b5da363e412d91dee46538b0c800aaa94f3e 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
@@ -2,6 +2,7 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 #include <iostream>
+#include <random>
 #include "tbb/parallel_reduce.h"
 #include "tbb/blocked_range.h"
 #include "TestTools/expect.h"
@@ -13,38 +14,6 @@
 #include "TestCaloDataAccess.h"
 #include <sys/time.h>
 
-// little code to generate random numbers
-// in gaussian form instead of uniform distribution
-// used to generate RoIs. mu=mediam; sigma;
-double randn (double mu, double sigma)
-{
-  double U1, U2, W, mult;
-  static double X1, X2;
-  static int call = 0;
- 
-  if (call == 1)
-    {
-      call = !call;
-      return (mu + sigma * (double) X2);
-    }
- 
-  do
-    {
-      U1 = -1 + ((double) rand () / RAND_MAX) * 2;
-      U2 = -1 + ((double) rand () / RAND_MAX) * 2;
-      W = pow (U1, 2) + pow (U2, 2);
-    }
-  while (W >= 1 || W == 0);
- 
-  mult = sqrt ((-2 * log (W)) / W);
-  X1 = U1 * mult;
-  X2 = U2 * mult;
- 
-  call = !call;
- 
-  return (mu + sigma * (double) X1);
-}
-
 
 #define DIFF(_name, _a, _b) if ( _a != _b )				\
     m_msg << MSG::WARNING << "Difference in " << _name << " " << _a << "  ref " << _b  << endmsg; \
@@ -249,11 +218,17 @@ StatusCode TestCaloDataAccess::initialize() {
 
 void TestCaloDataAccess::emulateRoIs( const EventContext& context, std::vector<ParallelCallTest*>& allRoIs ) const{
 
-  double RoI_phi1 = M_PI*(-1.0 + ((double) rand () / RAND_MAX) * 2);
-  double RoI_eta1 = randn(0,1.7);
+  std::default_random_engine generator;
+  std::normal_distribution<double> N1(0.0, 1.7);
+  std::normal_distribution<double> N2(0.0, 0.2);
+  std::uniform_real_distribution<double> U(0.0, 1.0);
+  std::uniform_real_distribution<double> Uphi(-M_PI, M_PI);
+
+  double RoI_phi1 = Uphi(generator);
+  double RoI_eta1 = N1(generator);
   if ( RoI_eta1 < -2.5 ) RoI_eta1 = -2.5;
   if ( RoI_eta1 >  2.5 ) RoI_eta1 = 2.5;
-  double chance = ((double) rand () / RAND_MAX);
+  double chance = U(generator);
   double width = 0.1;
   TrigRoiDescriptor roi( RoI_eta1, RoI_eta1-width, RoI_eta1+width, // eta
 			 RoI_phi1, RoI_phi1-width, RoI_phi1+width, // phi
@@ -261,10 +236,10 @@ void TestCaloDataAccess::emulateRoIs( const EventContext& context, std::vector<P
   AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
   allRoIs.push_back( afr );
 
-  chance = ((double) rand () / RAND_MAX);
+  chance = U(generator);
   if ( chance > 0.6 ) {
-    double RoI_eta2 = -RoI_eta1 + randn(0,0.2);
-    double RoI_phi2 = -RoI_phi1 + randn(0,0.2);
+    double RoI_eta2 = -RoI_eta1 + N2(generator);
+    double RoI_phi2 = -RoI_phi1 + N2(generator);
     if ( RoI_eta2 < -2.5 ) RoI_eta2 = -2.5;
     if ( RoI_eta2 >  2.5 ) RoI_eta2 = 2.5;
     TrigRoiDescriptor roi( RoI_eta2, RoI_eta2-width, RoI_eta2+width, // eta
@@ -275,10 +250,10 @@ void TestCaloDataAccess::emulateRoIs( const EventContext& context, std::vector<P
   }
 
   for(int i=0;i<10;i++){
-    chance = ((double) rand () / RAND_MAX);
+    chance = U(generator);
     if ( chance > 0.75 ) {
-      double RoI_phi3 = M_PI*(-1.0 + ((double) rand () / RAND_MAX) * 2);
-      double RoI_eta3 = randn(0,1.7);
+      double RoI_phi3 = Uphi(generator);
+      double RoI_eta3 = N1(generator);
       if ( RoI_eta3 < -2.5 ) RoI_eta3 = -2.5;
       if ( RoI_eta3 >  2.5 ) RoI_eta3 = 2.5;
       width = 0.1;
@@ -291,7 +266,7 @@ void TestCaloDataAccess::emulateRoIs( const EventContext& context, std::vector<P
     }
   }
 
-  chance = ((double) rand () / RAND_MAX);
+  chance = U(generator);
   if ( chance > 0.6 ) {
     TrigRoiDescriptor roi( true );
     AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.cxx
index 7654c61b138abc133b8cfe758189e3b7fa499282..429c5d13f85b62fa17f92e82d558eed90eccfa66 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.cxx
@@ -48,6 +48,8 @@
 // Event Incident to get Event Info
 #include "GaudiKernel/IIncidentSvc.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 // Initialize method for all tools
 // Retrieval of all Tools to be used during run
 StatusCode TrigDataAccess::initialize()
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
index e7f4160748592655f8ffc0713c31f7949d1515f2..2afd63361139d9f1edb049fdb16ab174f735603b 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccess.h
@@ -1,7 +1,7 @@
 // emacs: this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -63,6 +63,9 @@
 
 #include "TrigT2CaloCommon/phiutils.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class IRegSelSvc;
 // class ITrigRegionSelector;
 class LArRoI_Map;
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.cxx
index 6267997809b38c370bfbb7730b9d8a13687be6b0..2639bf607d5384c3ad6ede4f97c5957455bcf3d2 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.cxx
@@ -40,6 +40,8 @@
 #include "EventInfo/EventInfo.h"
 #include "EventInfo/EventID.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 // Initialize method for all tools
 // Retrieval of all Tools to be used during run
 StatusCode TrigDataAccessATLFAST::initialize()
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.h
index e9550cb476881f7677416649540adb15757a44e1..97f692d13bde4b4d54a8cf6ccd122d96c097e01d 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigDataAccessATLFAST.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -54,6 +54,9 @@
 
 #include "TrigT2CaloCommon/phiutils.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class IRegSelSvc;
 // class ITrigRegionSelector;
 class LArRoI_Map;
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/CMakeLists.txt
index bb3ad649f5bfbb78cc79e94172f2a6e0f68eb4eb..cdb60515df370bc5d54ba332859811e5ecfe8436 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/CMakeLists.txt
@@ -36,5 +36,5 @@ atlas_install_python_modules( python/*.py )
 
 # Python code checking:
 atlas_add_test( flake8
-   SCRIPT flake8 --select=F,E7,E9,W6 ${CMAKE_CURRENT_SOURCE_DIR}/python
+   SCRIPT flake8 --select=ATL,F,E7,E9,W6 ${CMAKE_CURRENT_SOURCE_DIR}/python
    POST_EXEC_SCRIPT nopost.sh )
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py
index 1dbe9923e67de2482f4904248a80541a0fa95817..1c3ebda4705bf8cc1b37d522899f3bccdfc89b0b 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaConfig.py
@@ -59,13 +59,12 @@ class EgammaSamp2FexConfig (EgammaSamp2Fex):
        self.MaxDetaHotCell=0.15
        self.MaxDphiHotCell=0.15
 
-class EgammaReSamp2FexNoTimerConfig (EgammaReSamp2Fex):
+class EgammaReSamp2FexConfig (EgammaReSamp2Fex):
    __slots__ = []
-   def __init__ (self, name="EgammaReSamp2FexNoTimerConfig"):
-       super(EgammaReSamp2FexNoTimerConfig, self).__init__(name)
+   def __init__ (self, name="EgammaReSamp2FexConfig", *args, **kwargs):
+       super(EgammaReSamp2FexConfig, self).__init__(name, *args, **kwargs)
        self.MaxDetaHotCell=0.15
        self.MaxDphiHotCell=0.15
-       self.TrigTimerSvc=""
 
 class EgammaSamp2FexNoTimerConfig (EgammaSamp2Fex):
    __slots__ = []
@@ -75,11 +74,10 @@ class EgammaSamp2FexNoTimerConfig (EgammaSamp2Fex):
        self.MaxDphiHotCell=0.15
        self.TrigTimerSvc=""
 
-class EgammaReSamp1FexNoTimerConfig (EgammaReSamp1Fex):
+class EgammaReSamp1FexConfig (EgammaReSamp1Fex):
    __slots__ = []
-   def __init__ (self, name="EgammaReSamp1Fex"):
-       super(EgammaReSamp1FexNoTimerConfig, self).__init__(name)
-       self.TrigTimerSvc=""
+   def __init__ (self, name="EgammaReSamp1Fex", *args, **kwargs):
+       super(EgammaReSamp1FexConfig, self).__init__(name, *args, **kwargs)
 
 class EgammaSamp1FexNoTimerConfig (EgammaSamp1Fex):
    __slots__ = []
@@ -87,11 +85,10 @@ class EgammaSamp1FexNoTimerConfig (EgammaSamp1Fex):
        super(EgammaSamp1FexNoTimerConfig, self).__init__(name)
        self.TrigTimerSvc=""
 
-class EgammaReEmEnFexNoTimerConfig (EgammaReEmEnFex):
+class EgammaReEmEnFexConfig (EgammaReEmEnFex):
    __slots__ = []
-   def __init__ (self, name="EgammaReEmEnFex"):
-       super(EgammaReEmEnFexNoTimerConfig, self).__init__(name)
-       self.TrigTimerSvc=""
+   def __init__ (self, name="EgammaReEmEnFex", *args, **kwargs):
+       super(EgammaReEmEnFexConfig, self).__init__(name, *args, **kwargs)
 
 class EgammaEmEnFexNoTimerConfig (EgammaEmEnFex):
    __slots__ = []
@@ -99,17 +96,15 @@ class EgammaEmEnFexNoTimerConfig (EgammaEmEnFex):
        super(EgammaEmEnFexNoTimerConfig, self).__init__(name)
        self.TrigTimerSvc=""
 
-class EgammaReHadEnFexNoTimerConfig (EgammaReHadEnFex):
+class EgammaReHadEnFexConfig (EgammaReHadEnFex):
    __slots__ = []
-   def __init__ (self, name="EgammaReHadEnFex"):
-       super(EgammaReHadEnFexNoTimerConfig, self).__init__(name)
-       self.TrigTimerSvc=""
+   def __init__ (self, name="EgammaReHadEnFex", *args, **kwargs):
+       super(EgammaReHadEnFexConfig, self).__init__(name, *args, **kwargs)
 
-class EgammaHadEnFexNoTimerConfig (EgammaHadEnFex):
+class EgammaHadEnFexConfig (EgammaHadEnFex):
    __slots__ = []
    def __init__ (self, name="EgammaHadEnFex"):
-       super(EgammaHadEnFexNoTimerConfig, self).__init__(name)
-       self.TrigTimerSvc=""
+       super(EgammaHadEnFexConfig, self).__init__(name)
 
 class T2CaloEgamma_eGamma (T2CaloEgamma):
    __slots__ = []
@@ -408,43 +403,31 @@ class T2CaloEgamma_ReFastAlgo (T2CaloEgammaReFastAlgo):
    def __init__ (self, name="T2CaloEgamma_ReFastAlgo"):
        super(T2CaloEgamma_ReFastAlgo, self).__init__(name)
        # here put your customizations
-       from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        from TrigT2CaloCommon.TrigT2CaloCommonConf import TrigCaloDataAccessSvc
        svcMgr += TrigCaloDataAccessSvc()
-       samp2 = EgammaReSamp2FexNoTimerConfig(name="ReFaAlgoSamp2FexConfig")
-       samp2.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc
-       samp2.ExtraInputs+=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )]
-       ToolSvc+=samp2
-       samp1 = EgammaReSamp1FexNoTimerConfig("ReFaAlgoSamp1FexConfig")
-       samp1.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc
-       samp1.ExtraInputs+=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )]
-       ToolSvc+=samp1
-       sampe = EgammaReEmEnFexNoTimerConfig("ReFaAlgoEmEnFexConfig")
-       sampe.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc
-       sampe.ExtraInputs+=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )]
-       ToolSvc+=sampe
-       samph = EgammaReHadEnFexNoTimerConfig("ReFaAlgoHadEnFexConfig")
+       samp2 = EgammaReSamp2FexConfig(name="ReFaAlgoSamp2FexConfig",
+                                      trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc,
+                                      ExtraInputs=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )])
+       samp1 = EgammaReSamp1FexConfig("ReFaAlgoSamp1FexConfig",
+                                      trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc,
+                                      ExtraInputs=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )])
+       sampe = EgammaReEmEnFexConfig("ReFaAlgoEmEnFexConfig",
+                                     trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc,
+                                     ExtraInputs=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )])
+       samph = EgammaReHadEnFexConfig("ReFaAlgoHadEnFexConfig",
+                                      trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc,
+                                      ExtraInputs=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )])
        # temporary fix for Tile
-       samph.ExtraInputs=[('TileEMScale','ConditionStore+TileEMScale'),('TileBadChannels','ConditionStore+TileBadChannels')]
-       samph.ExtraInputs+=[( 'LArOnOffIdMapping' , 'ConditionStore+LArOnOffIdMap' )]
-       samph.trigDataAccessMT=svcMgr.TrigCaloDataAccessSvc
-       ToolSvc+=samph
-       #ToolSvc+=RingerFexConfig("RingsMaker") 
-       #ToolSvc.RingsMaker.OutputLevel=DEBUG
-       #ToolSvc.RingsMaker.RingsKey="CaloRings"
-       self.IReAlgToolList = [ samp2 ]
-       self.IReAlgToolList+= [ samp1 ]
-       self.IReAlgToolList+= [ sampe ]
-       self.IReAlgToolList+= [ samph ]
-       #self.IReAlgToolList+= [ ToolSvc.RingsMaker ] 
+       samph.ExtraInputs += [('TileEMScale','ConditionStore+TileEMScale'),('TileBadChannels','ConditionStore+TileBadChannels')]
+
+       self.IReAlgToolList = [ samp2, samp1, sampe, samph ]
 
        self.EtaWidth = 0.2
        self.PhiWidth = 0.2
        #self.EtaWidthForID = 0.1
        #self.PhiWidthForID = 0.1
        #self.TrigEMClusterKey="TrigT2CaloEgamma"
-       #t2catime.TimerHistLimits = [0,20]
        self.CalibListEndcap=[EgammaSshapeCalibrationEndcapConfig()]
        self.CalibListBarrel=[EgammaSshapeCalibrationBarrelConfig()]
        self.CalibListBarrel+=[EgammaHitsCalibrationBarrelConfig()]
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaMTConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaMTConfig.py
index 5346419afb5fd7dc5b68ba040f23d48319b22fff..f5423ff19d4dbe1c18df6c4430bf367777ff56fe 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaMTConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/python/TrigT2CaloEgammaMTConfig.py
@@ -8,7 +8,6 @@ from CaloTools.CaloLumiBCIDConfig import CaloLUMIBCIDToolCfg
 
 def fastL2EgammaClusteringAlg( flags, roisKey="EMCaloRoIs"):
     acc = ComponentAccumulator()
-    from AthenaCommon.Constants import DEBUG
     # configure calo data access
     from TrigT2CaloCommon.TrigCaloDataAccessConfig import trigCaloDataAccessSvcCfg
     cdaSvcAcc = trigCaloDataAccessSvcCfg( flags )
@@ -39,15 +38,12 @@ def fastL2EgammaClusteringAlg( flags, roisKey="EMCaloRoIs"):
 
     #from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import RingerFexConfig
     #ring = RingerFexConfig('RingsMaker')
-    #ring.OutputLevel=DEBUG
     #ring.RingsKey='CaloRings'
     #acc.addPublicTool( ring )
 
     __fex_tools = [ samp2, samp1, sampe, samph] #, ring ]
     for t in __fex_tools:
-        t.TrigTimerSvc = ""
         t.trigDataAccessMT = cdaSvc # set data access svc
-        t.OutputLevel = DEBUG
 
     
     alg = T2CaloEgammaReFastAlgo("FastEMCaloAlgo")
@@ -58,7 +54,6 @@ def fastL2EgammaClusteringAlg( flags, roisKey="EMCaloRoIs"):
     alg.RoIs           = roisKey
     alg.EtaWidth       = 0.2
     alg.PhiWidth       = 0.2
-    alg.OutputLevel = DEBUG
 
     # set calibration
     from TrigT2CaloCalibration.EgammaCalibrationConfig import EgammaSshapeCalibrationBarrelConfig, EgammaHitsCalibrationBarrelConfig, EgammaGapCalibrationConfig, EgammaTransitionRegionsConfig
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReEmEnFex.cxx b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReEmEnFex.cxx
index 4b2dae4a168ccad1a536025b185207c0ccdcabd8..76d7cd841a52f8097e2872d6f663eb9b5a9ff356 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReEmEnFex.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReEmEnFex.cxx
@@ -3,213 +3,165 @@
 */
 
 // ********************************************************************
-// 
+//
 // NAME:     EgammaReEmEnFex.cxx
 // PACKAGE:  Trigger/TrigAlgorithms/TrigT2CaloEgamma
-// 
+//
 // AUTHOR:   M.P. Casado
-// 
+//
 // ********************************************************************
 
-//#include "TrigCaloEvent/TrigEMCluster.h"
-#include "xAODTrigCalo/TrigEMCluster.h"
 #include "CaloGeoHelpers/CaloSampling.h"
+#include "xAODTrigCalo/TrigEMCluster.h"
 
 #include "EgammaReEmEnFex.h"
-#include "TrigT2CaloCommon/Calo_Def.h"
 #include "T2CalibrationEgamma.h"
+#include "TrigT2CaloCommon/Calo_Def.h"
 
-
-EgammaReEmEnFex::EgammaReEmEnFex(const std::string & type, const std::string & name, 
-                   const IInterface* parent): IReAlgToolCalo(type, name, parent)
-		   {
-  declareProperty( "QlCorrectionLimit",
-		    m_limit );
-  declareProperty( "QlCorrectionDimension",
-		    m_dimension );
-  declareProperty( "QlCorrection",
-		    m_correction );
-	// Calibration object
-	m_calib = new T2CalibrationEgamma();
+EgammaReEmEnFex::EgammaReEmEnFex(const std::string& type, const std::string& name,
+                                 const IInterface* parent) :
+    IReAlgToolCalo(type, name, parent)
+{
+  declareProperty("QlCorrectionLimit", m_limit);
+  declareProperty("QlCorrectionDimension", m_dimension);
+  declareProperty("QlCorrection", m_correction);
+  // Calibration object
+  m_calib = new T2CalibrationEgamma();
 }
 
-EgammaReEmEnFex::~EgammaReEmEnFex(){
-	delete m_calib;
+EgammaReEmEnFex::~EgammaReEmEnFex()
+{
+  delete m_calib;
 }
 
-StatusCode EgammaReEmEnFex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
-				  const IRoiDescriptor& roi,
-				  const CaloDetDescrElement*& caloDDE,
-                                  const EventContext& context ) const{
- 
-        // Time total AlgTool time
-        if (!m_timersvc.empty()) m_timer[0]->start();
-        bool cluster_in_barrel = true;
-        if ( caloDDE )
-          cluster_in_barrel = caloDDE->is_lar_em_barrel();
-
-        // MsgStream log(msgSvc(), name());
-        ATH_MSG_DEBUG( "in execute(TrigEMCluster &)" );
-
-        // Time to access RegionSelector
-        if (!m_timersvc.empty()) m_timer[1]->start();
-
-        // Region Selector, sampling 0
-        int sampling = 0;
-
-        LArTT_Selector<LArCellCont> sel;
-	LArTT_Selector<LArCellCont>::const_iterator iBegin, iEnd, it;
-        m_dataSvc->loadCollections( context, roi, TTEM, sampling, sel );
-        iBegin = sel.begin();
-        iEnd = sel.end();
-        // Finished to access Collection
-        if (!m_timersvc.empty()) m_timer[2]->pause();
-        // Algorithmic time
-        if (!m_timersvc.empty()) m_timer[3]->start();
-  
-  double deta = 0.;           // eta difference current cell - seed
-  double dphi = 0.;           // phi difference current cell - seed
+StatusCode EgammaReEmEnFex::execute(xAOD::TrigEMCluster& rtrigEmCluster, const IRoiDescriptor& roi,
+                                    const CaloDetDescrElement*& caloDDE,
+                                    const EventContext& context) const
+{
+  bool clusterInBarrel = true;
+  if (caloDDE) clusterInBarrel = caloDDE->is_lar_em_barrel();
+
+  ATH_MSG_DEBUG("in execute(TrigEMCluster &)");
+
+  // Region Selector, sampling 0
+  int sampling = 0;
+
+  LArTT_Selector<LArCellCont> sel;
+  ATH_CHECK( m_dataSvc->loadCollections(context, roi, TTEM, sampling, sel) );
+
+  double deta = 0.; // eta difference current cell - seed
+  double dphi = 0.; // phi difference current cell - seed
 
   double totalEnergy = 0;
-  CaloSampling::CaloSample samp;  
+  CaloSampling::CaloSample samp;
 
   double energyEta = rtrigEmCluster.eta();
   double energyPhi = rtrigEmCluster.phi();
-  if ( caloDDE ){
-        energyEta = caloDDE->eta();
-        energyPhi = caloDDE->phi();
+  if (caloDDE) {
+    energyEta = caloDDE->eta();
+    energyPhi = caloDDE->phi();
   }
 
   int ncells = 0;
-  
-  for(it = iBegin;it != iEnd; ++it) {                                       // Should be revised for London scheme
+
+  for (const LArCell* larcell : sel) { // Should be revised for London scheme
     ncells++;
 
-    const LArCell* larcell = (*it);
     double etaCell = larcell->eta();
     double phiCell = larcell->phi();
     double energyCell = larcell->energy();
 
-      // find the standard em cluster energy (3*7 cell, now sampling 0)
-      // Find position of current cell w.r.t. seed
-      deta = fabs( etaCell - energyEta );
-      dphi = fabs( phiCell - energyPhi );
+    // find the standard em cluster energy (3*7 cell, now sampling 0)
+    // Find position of current cell w.r.t. seed
+    deta = fabs(etaCell - energyEta);
+    dphi = fabs(phiCell - energyPhi);
 
-      if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
-       // 3x7 means three cells per 7 in the second layer 0.025*3/2, 0.025*7/2, for instance
-       bool condition37 = cluster_in_barrel && ( (deta <= 0.0375+0.0005) && (dphi <= 0.0875+0.0005) );
-       bool condition55 = (!cluster_in_barrel) && ( (deta <= 0.0625+0.0005) && (dphi <= 0.0625+0.0005) );
+    if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
+    // 3x7 means three cells per 7 in the second layer 0.025*3/2, 0.025*7/2, for instance
+    bool condition37 = clusterInBarrel &&
+                       ((deta <= 0.0375 + 0.0005) && (dphi <= 0.0875 + 0.0005));
+    bool condition55 = (!clusterInBarrel) &&
+                       ((deta <= 0.0625 + 0.0005) && (dphi <= 0.0625 + 0.0005));
 
-       if ( condition37 || condition55 ) {
+    if (condition37 || condition55) {
 
-	totalEnergy += energyCell;
-	//samp = CaloSampling::getSampling(*larcell);
-	samp = larcell->caloDDE()->getSampling();
-	rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-	rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
+      totalEnergy += energyCell;
+      // samp = CaloSampling::getSampling(*larcell);
+      samp = larcell->caloDDE()->getSampling();
+      rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
+      rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
+    }
 
-      }      
-    
   } // end of loop over sampling 0
 
-        // Pause algorithmic time
-        if (!m_timersvc.empty()) m_timer[3]->pause();
-        // Save EMShowerMinimal time
-        if (!m_timersvc.empty()) m_timer[4]->start();
-
-  // update stored variables
-
-
 #ifndef NDEBUG
-	// This will internaly define normal, narrow and large clusters
-  if ( msgLvl(MSG::ERROR) ) {
-        if ( m_geometryTool->EtaPhiRange(0,0,energyEta, energyPhi))
-          ATH_MSG_ERROR( "problems with EtaPhiRange" );
-        PrintCluster(totalEnergy,0,0,CaloSampling::PreSamplerB
-		,CaloSampling::PreSamplerE);
+  // This will internaly define normal, narrow and large clusters
+  if (msgLvl(MSG::DEBUG)) {
+    if (m_geometryTool->EtaPhiRange(0, 0, energyEta, energyPhi)) {
+      ATH_MSG_ERROR("problems with EtaPhiRange");
+    }
+    PrintCluster(totalEnergy, 0, 0, CaloSampling::PreSamplerB, CaloSampling::PreSamplerE);
   }
 #endif
-        // Pause save EMShowerMinimal time
-        if (!m_timersvc.empty()) m_timer[4]->pause();
-        // Time to access RegionSelector
-        if (!m_timersvc.empty()) m_timer[1]->resume();
-
-        // Region Selector, sampling 3
-        sampling = 3;
-
-        LArTT_Selector<LArCellCont> sel3;
-        m_dataSvc->loadCollections( context, roi, TTEM, sampling, sel3 );
-        iBegin = sel3.begin();
-        iEnd = sel3.end();
-/*
-        if ( m_saveCells ){
-           m_data->storeCells(iBegin,iEnd,*m_CaloCellContPoint,m_cellkeepthr);
-        }
-*/
-        // Finished to access Collection
-        if (!m_timersvc.empty()) m_timer[2]->stop();
-        // Algorithmic time
-        if (!m_timersvc.empty()) m_timer[3]->resume();
 
+  // Region Selector, sampling 3
+  sampling = 3;
 
-  for(it = iBegin;it != iEnd; ++it) {                                       // Should be revised for London scheme
+  LArTT_Selector<LArCellCont> sel3;
+  ATH_CHECK( m_dataSvc->loadCollections(context, roi, TTEM, sampling, sel3) );
+  /*
+          if ( m_saveCells ){
+             m_data->storeCells(iBegin,iEnd,*m_CaloCellContPoint,m_cellkeepthr);
+          }
+  */
+
+  for (const LArCell* larcell : sel3) { // Should be revised for London scheme
     ncells++;
-    const LArCell* larcell = (*it);
     double etaCell = larcell->eta();
     double phiCell = larcell->phi();
     double energyCell = larcell->energy();
 
-      // find the standard em cluster energy (3*7 cell, now sampling 0)
-      // Find position of current cell w.r.t. seed
-      deta = fabs( etaCell - energyEta );
-      dphi = fabs( phiCell - energyPhi );
-      if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
-      
-       // 3x7 means three cells per 7 in the second layer 0.025*3/2, 0.025*7/2, for instance
-       bool condition37 = cluster_in_barrel && ( (deta <= 0.0375+0.001) && (dphi <= 0.0875+0.001) );
-       bool condition55 = (!cluster_in_barrel) && ( (deta <= 0.0625+0.001) && (dphi <= 0.0625+0.001) );
-
-       if ( condition37 || condition55 ) {
-
-	totalEnergy += energyCell;
-	//samp = CaloSampling::getSampling(*larcell);
-	samp = larcell->caloDDE()->getSampling();
-	rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-	rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
-
-      }      
-    
+    // find the standard em cluster energy (3*7 cell, now sampling 0)
+    // Find position of current cell w.r.t. seed
+    deta = fabs(etaCell - energyEta);
+    dphi = fabs(phiCell - energyPhi);
+    if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
+
+    // 3x7 means three cells per 7 in the second layer 0.025*3/2, 0.025*7/2, for instance
+    bool condition37 = clusterInBarrel && ((deta <= 0.0375 + 0.001) && (dphi <= 0.0875 + 0.001));
+    bool condition55 = (!clusterInBarrel) &&
+                       ((deta <= 0.0625 + 0.001) && (dphi <= 0.0625 + 0.001));
+
+    if (condition37 || condition55) {
+
+      totalEnergy += energyCell;
+      // samp = CaloSampling::getSampling(*larcell);
+      samp = larcell->caloDDE()->getSampling();
+      rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
+      rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
+    }
+
   } // end of loop over sampling 3
 
-        // Update Cluster Variables
-        rtrigEmCluster.setNCells(ncells+rtrigEmCluster.nCells());
-        rtrigEmCluster.setRawEnergy( rtrigEmCluster.rawEnergy() + totalEnergy );
-	// The dependency with energy is not defined yet
-	rtrigEmCluster.setEnergy( rtrigEmCluster.rawEnergy()*
-			m_calib->Calib(energyEta,rtrigEmCluster.energy()) );
+  // Update Cluster Variables
+  rtrigEmCluster.setNCells(ncells + rtrigEmCluster.nCells());
+  rtrigEmCluster.setRawEnergy(rtrigEmCluster.rawEnergy() + totalEnergy);
+  // The dependency with energy is not defined yet
+  rtrigEmCluster.setEnergy(rtrigEmCluster.rawEnergy() *
+                           m_calib->Calib(energyEta, rtrigEmCluster.energy()));
 
-	// Algorithmic time
-	if (!m_timersvc.empty()) m_timer[3]->stop();
-	// Save EMShowerMinimal
-	if (!m_timersvc.empty()) m_timer[4]->resume();
-        rtrigEmCluster.setEt ( rtrigEmCluster.energy()/cosh(energyEta) );
-        rtrigEmCluster.setRawEt ( rtrigEmCluster.rawEnergy()/cosh(energyEta) );
+  rtrigEmCluster.setEt(rtrigEmCluster.energy() / cosh(energyEta));
+  rtrigEmCluster.setRawEt(rtrigEmCluster.rawEnergy() / cosh(energyEta));
 
 #ifndef NDEBUG
-        // This will internaly define normal, narrow and large clusters
-  if ( msgLvl(MSG::ERROR) ) {
-        if ( m_geometryTool->EtaPhiRange(0,3,energyEta, energyPhi))
-          ATH_MSG_ERROR( "problems with EtaPhiRange" );
-
-        PrintCluster(totalEnergy,0,3,CaloSampling::EMB3,CaloSampling::EME3);
+  // This will internaly define normal, narrow and large clusters
+  if (msgLvl(MSG::DEBUG)) {
+    if (m_geometryTool->EtaPhiRange(0, 3, energyEta, energyPhi)) {
+      ATH_MSG_ERROR("problems with EtaPhiRange");
+    }
+    PrintCluster(totalEnergy, 0, 3, CaloSampling::EMB3, CaloSampling::EME3);
   }
 #endif
-	// Save EMShowerMinimal
-	if (!m_timersvc.empty()) m_timer[4]->stop();
-
-  // Time total AlgTool time 
-  if (!m_timersvc.empty()) m_timer[0]->stop();      
 
   return StatusCode::SUCCESS;
 }
-
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReHadEnFex.cxx b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReHadEnFex.cxx
index ae0527d13d32fa827777fcadf6ad10a61d786a61..e6eebc6916b597703f6a638cc74e2ce9dfd4becb 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReHadEnFex.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReHadEnFex.cxx
@@ -3,56 +3,34 @@
 */
 
 // ********************************************************************
-// 
+//
 // NAME:     EgammaReHadEnFex.cxx
 // PACKAGE:  Trigger/TrigAlgorithms/TrigT2CaloEgamma
-// 
+//
 // AUTHOR:   M.P. Casado
-// 
+//
 // REFERENCES: Based on Trigger/TrigT2CaloEgamma/T2EmHadAlgorithm.cxx
 //
 // ********************************************************************
 
-//#include "TrigCaloEvent/TrigEMCluster.h"
-#include "CaloGeoHelpers/CaloSampling.h"
-
 #include "EgammaReHadEnFex.h"
+#include "CaloGeoHelpers/CaloSampling.h"
 #include "TrigT2CaloCommon/Calo_Def.h"
 #include <math.h>
 
-inline double check_tilemin(const double x){
-   const double dphi=0.09817477;
-   const double oneoverdphi=1.0/0.09817477;
-   if(x>=0)
-        return (dphi*ceilf(x*oneoverdphi))+0.01;
-   else
-        return (-dphi*floorf(-x*oneoverdphi))+0.01;
-}
-inline double check_tilemax(const double x){
-   const double dphi=0.09817477;
-   const double oneoverdphi=1.0/0.09817477;
-   if(x>=0)
-        return (dphi*floorf(x*oneoverdphi))-0.01;
-   else
-        return (-dphi*ceilf(-x*oneoverdphi))-0.01;
-}
-
-EgammaReHadEnFex::EgammaReHadEnFex(const std::string & type, const std::string & name, 
-                   const IInterface* parent): IReAlgToolCalo(type, name, parent)
-		   {
-}
-
-StatusCode EgammaReHadEnFex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
-				   const IRoiDescriptor& roi,
-				   const CaloDetDescrElement*& /*caloDDE*/,
-                                   const EventContext& context ) const {
-        // Time total AlgTool time
-        if (!m_timersvc.empty()) m_timer[0]->start();
+EgammaReHadEnFex::EgammaReHadEnFex(const std::string& type, const std::string& name,
+                                   const IInterface* parent) :
+    IReAlgToolCalo(type, name, parent)
+{}
 
-  double deta = 0.;           // eta difference current cell - seed
-  double dphi = 0.;           // phi difference current cell - seed
+StatusCode EgammaReHadEnFex::execute(xAOD::TrigEMCluster& rtrigEmCluster, const IRoiDescriptor& roi,
+                                     const CaloDetDescrElement*& /*caloDDE*/,
+                                     const EventContext& context) const
+{
+  double deta = 0.; // eta difference current cell - seed
+  double dphi = 0.; // phi difference current cell - seed
 
-  CaloSampling::CaloSample samp;  
+  CaloSampling::CaloSample samp;
 
   double energyEta = rtrigEmCluster.eta();
   double energyPhi = rtrigEmCluster.phi();
@@ -60,156 +38,96 @@ StatusCode EgammaReHadEnFex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
 
   // Dump eta-phi strip ranges into arrays
   // Define variables here so that their scope covers both the Tile and HEC loops
-  // Use arrays of length 3 since there is no samp 0 in the HAD calorimeters 
+  // Use arrays of length 3 since there is no samp 0 in the HAD calorimeters
   // this avoids wasting memory but makes the code slightly less clear
 
-  // Time Region Selector 
-  if (!m_timersvc.empty()) {
-	m_timer[1]->start();      
-	m_timer[1]->pause();      
-	m_timer[2]->start();      
-	m_timer[2]->pause();      
-	m_timer[3]->start();      
-	m_timer[3]->pause();      
-	m_timer[4]->start();      
-	m_timer[4]->pause();      
-  }
-
-  int ncells=0;
+  int ncells = 0;
 
-  for (unsigned int sampling = 0;sampling<3;sampling++) {                  
+  for (unsigned int sampling = 0; sampling < 3; sampling++) {
 
-        // Time to access RegionSelector
-        if (!m_timersvc.empty()) m_timer[1]->resume();
+    LArTT_Selector<LArCellCont> sel;
+    ATH_CHECK( m_dataSvc->loadCollections(context, roi, TTHEC, sampling, sel) );
 
-        LArTT_Selector<LArCellCont> sel;
-	LArTT_Selector<LArCellCont>::const_iterator iBegin, iEnd, it;
-        m_dataSvc->loadCollections( context, roi, TTHEC, sampling, sel );
-        iBegin = sel.begin();
-        iEnd = sel.end();
-        // Finished to access Collection
-        if (!m_timersvc.empty()) m_timer[2]->pause();
-        // Algorithmic time
-        if (!m_timersvc.empty()) m_timer[3]->resume();
-	
-    for(it = iBegin;it != iEnd; ++it) {
+    for (const LArCell* larcell : sel) {
 
       ncells++;
-      const LArCell* larcell = (*it);
       double etaCell = larcell->eta();
       double phiCell = larcell->phi();
       double energyCell = larcell->energy();
 
       // find position of current cell w.r.t. seed
-      deta = fabs( etaCell - energyEta );
-      dphi = fabs( phiCell - energyPhi );
-      if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
+      deta = fabs(etaCell - energyEta);
+      dphi = fabs(phiCell - energyPhi);
+      if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
       // hadronic measurements: energy sum in 0.1*0.1
-      if ( deta <= 0.12  &&
-	   dphi <= 0.12 ){ 
-        //samp = CaloSampling::getSampling(*larcell);
+      if (deta <= 0.12 && dphi <= 0.12) {
+        // samp = CaloSampling::getSampling(*larcell);
         samp = larcell->caloDDE()->getSampling();
-	rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-	rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
-	if (CaloSampling::HEC0 == samp) {
-	  rtrigEmCluster.setEhad1(rtrigEmCluster.ehad1() + energyCell );
-	}
+        rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
+        rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
+        if (CaloSampling::HEC0 == samp) {
+          rtrigEmCluster.setEhad1(rtrigEmCluster.ehad1() + energyCell);
+        }
       }
-	
-    } // end of loop over cells 
-    // End of Algorithmic time
-    if (!m_timersvc.empty()) m_timer[3]->pause();
- 
-  } // End sampling loop     
+
+    } // end of loop over cells
+
+  } // End sampling loop
 #ifndef NDEBUG
-  if ( msg().level() <= MSG::DEBUG ) {
-	for (int sampling=0; sampling<3;sampling++)
-          if (m_geometryTool->EtaPhiRange(1,sampling,energyEta, energyPhi))
-                msg() << MSG::ERROR << "problems with EtaPhiRange" << endmsg;
-        PrintCluster(rtrigEmCluster.energy(CaloSampling::HEC0),1,0
-		,CaloSampling::HEC0,CaloSampling::HEC0);
-        PrintCluster(rtrigEmCluster.energy(CaloSampling::HEC1),1,1
-		,CaloSampling::HEC1,CaloSampling::HEC1);
-        PrintCluster(rtrigEmCluster.energy(CaloSampling::HEC2),1,2
-		,CaloSampling::HEC2,CaloSampling::HEC2);
+  if (msgLvl(MSG::DEBUG)) {
+    for (int sampling = 0; sampling < 3; sampling++) {
+      if (m_geometryTool->EtaPhiRange(1, sampling, energyEta, energyPhi)) {
+        ATH_MSG_ERROR("problems with EtaPhiRange");
+      }
+    }
+    PrintCluster(rtrigEmCluster.energy(CaloSampling::HEC0), 1, 0, CaloSampling::HEC0, CaloSampling::HEC0);
+    PrintCluster(rtrigEmCluster.energy(CaloSampling::HEC1), 1, 1, CaloSampling::HEC1, CaloSampling::HEC1);
+    PrintCluster(rtrigEmCluster.energy(CaloSampling::HEC2), 1, 2, CaloSampling::HEC2, CaloSampling::HEC2);
   }
 #endif
 
- // Next TILECAL
-	// Needs some fix for RS
-	
-  
-  // MS       phimin=check_tilemin(phimin);
-  // MS       phimax=check_tilemax(phimax);
-	
-        // Time to access RegionSelector
-        if (!m_timersvc.empty()) m_timer[1]->resume();
-
-	
-        TileCellCollection seltile;
-	TileCellCollection::const_iterator itBegin, itEnd, itt;
-        m_dataSvc->loadCollections( context, roi, seltile );
-        itBegin = seltile.begin();
-        itt = itBegin;
-        itEnd = seltile.end();
-
-        // Finished to access Collection
-        if (!m_timersvc.empty()) m_timer[2]->pause();
-        // Algorithmic time
-        if (!m_timersvc.empty()) m_timer[3]->resume();
-
-   for(;itt != itEnd; ++itt) { //loop over cells
-    
+  // Next TILECAL
+
+  TileCellCollection seltile;
+  ATH_CHECK( m_dataSvc->loadCollections(context, roi, seltile) );
+
+  for (const TileCell* tilecell : seltile) { // loop over cells
+
     ncells++;
-    const TileCell* tilecell = (*itt);
     double etaCell = tilecell->eta();
     double phiCell = tilecell->phi();
     double energyCell = tilecell->energy();
 
     // find position of current cell w.r.t. seed
-    deta = fabs( etaCell - energyEta );
-    dphi = fabs( phiCell - energyPhi );
-    if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
+    deta = fabs(etaCell - energyEta);
+    dphi = fabs(phiCell - energyPhi);
+    if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
     // hadronic measurements: energy sum in 0.1*0.1
-    if ( deta <= 0.12  &&
-	 dphi <= 0.12 ){ 
-      //samp = CaloSampling::getSampling(*tilecell);
+    if (deta <= 0.12 && dphi <= 0.12) {
+      // samp = CaloSampling::getSampling(*tilecell);
       samp = tilecell->caloDDE()->getSampling();
-      rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-      rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
-      if( (CaloSampling::TileBar0 == samp) || (CaloSampling::TileExt0 == samp) || (CaloSampling::TileGap1 == samp) || (CaloSampling::TileGap2 == samp) ) {
+      rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
+      rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
+      if ((CaloSampling::TileBar0 == samp) || (CaloSampling::TileExt0 == samp) ||
+          (CaloSampling::TileGap1 == samp) || (CaloSampling::TileGap2 == samp)) {
         rtrigEmCluster.setEhad1(rtrigEmCluster.ehad1() + energyCell);
       }
     }
 
-   } // end of loop over cells 
-   // Algorithmic time
-   if (!m_timersvc.empty()) m_timer[3]->pause();
-   
-  rtrigEmCluster.setNCells(ncells+rtrigEmCluster.nCells() );
-  if (!m_timersvc.empty())  m_timer[0]->propVal(rtrigEmCluster.nCells() );
+  } // end of loop over cells
+
+  rtrigEmCluster.setNCells(ncells + rtrigEmCluster.nCells());
 
 #ifndef NDEBUG
-  if ( msg().level() <= MSG::DEBUG ) {
-        PrintCluster(rtrigEmCluster.energy(CaloSampling::TileBar0)
-		+rtrigEmCluster.energy(CaloSampling::TileExt0),1,0
-		,CaloSampling::TileBar0,CaloSampling::TileExt0);
-        PrintCluster(rtrigEmCluster.energy(CaloSampling::TileBar1)
-		+rtrigEmCluster.energy(CaloSampling::TileExt1),1,1
-		,CaloSampling::TileBar1,CaloSampling::TileExt1);
-        PrintCluster(rtrigEmCluster.energy(CaloSampling::TileBar2)
-		+rtrigEmCluster.energy(CaloSampling::TileExt2),1,2
-		,CaloSampling::TileBar2,CaloSampling::TileExt2);
+  if (msgLvl(MSG::DEBUG)) {
+    PrintCluster(rtrigEmCluster.energy(CaloSampling::TileBar0) + rtrigEmCluster.energy(CaloSampling::TileExt0),
+                 1, 0, CaloSampling::TileBar0, CaloSampling::TileExt0);
+    PrintCluster(rtrigEmCluster.energy(CaloSampling::TileBar1) + rtrigEmCluster.energy(CaloSampling::TileExt1),
+                 1, 1, CaloSampling::TileBar1, CaloSampling::TileExt1);
+    PrintCluster(rtrigEmCluster.energy(CaloSampling::TileBar2) + rtrigEmCluster.energy(CaloSampling::TileExt2),
+                 1, 2, CaloSampling::TileBar2, CaloSampling::TileExt2);
   }
 #endif
-	// Stop all timers
-        if (!m_timersvc.empty()){ 
-		m_timer[4]->stop();
-		m_timer[3]->stop();
-		m_timer[2]->stop();
-		m_timer[1]->stop();
-		m_timer[0]->stop();
-	}
 
   return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp1Fex.cxx b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp1Fex.cxx
index f9780cc2835b5d59bf007783c74775d81c02b2d2..4cfd19522a1863fce16c4b852165cec6b09b8aba 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp1Fex.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp1Fex.cxx
@@ -3,296 +3,259 @@
 */
 
 // ********************************************************************
-// 
+//
 // NAME:     EgammaReSamp1Fex.cxx
 // PACKAGE:  Trigger/TrigAlgorithms/TrigT2CaloEgamma
-// 
+//
 // AUTHOR:   M.P. Casado
-// 
+//
 //   Energy Ratio calculation modifications by Steve Armstrong
 //                                             8 May 2003
 //
 // ********************************************************************
 
-//#include "TrigCaloEvent/TrigEMCluster.h"
-#include "CaloGeoHelpers/CaloSampling.h"
-
 #include "EgammaReSamp1Fex.h"
-#include "TrigT2CaloCommon/Calo_Def.h"
-
+#include "CaloGeoHelpers/CaloSampling.h"
 #include "IRegionSelector/IRoiDescriptor.h"
+#include "TrigT2CaloCommon/Calo_Def.h"
 
-inline double proxim(double b,double a){ return b+2.*M_PI*round((a-b)*(1./(2.*M_PI))) ;}
-
-
-EgammaReSamp1Fex::EgammaReSamp1Fex(const std::string & type, const std::string & name, 
-                   const IInterface* parent): IReAlgToolCalo(type, name, parent)
-		   {
-#ifndef NDEBUG
-	// Create Geometry object
-        // 0 -> CaloType EM, 1 -> First Layer
-//        m_geometry[0] = new T2Geometry(0,1);
-#endif
+inline double proxim(double b, double a)
+{
+  return b + 2. * M_PI * round((a - b) * (1. / (2. * M_PI)));
 }
 
-StatusCode EgammaReSamp1Fex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
-				   const IRoiDescriptor& roi,
-				   const CaloDetDescrElement*& caloDDE,
-                                   const EventContext& context ) const {
-  
-	// Time total AlgTool time 
-	if (!m_timersvc.empty()) m_timer[0]->start();      
-
-        bool cluster_in_barrel = true;
-        if ( caloDDE )
-          cluster_in_barrel = caloDDE->is_lar_em_barrel();
-
-        ATH_MSG_DEBUG( "in execute(TrigEMCluster &)" );
+EgammaReSamp1Fex::EgammaReSamp1Fex(const std::string& type, const std::string& name,
+                                   const IInterface* parent) :
+    IReAlgToolCalo(type, name, parent)
+{}
 
-        // Time to access RegionSelector
-        if (!m_timersvc.empty()) m_timer[1]->start();
+StatusCode EgammaReSamp1Fex::execute(xAOD::TrigEMCluster& rtrigEmCluster, const IRoiDescriptor& roi,
+                                     const CaloDetDescrElement*& caloDDE,
+                                     const EventContext& context) const
+{
+  bool cluster_in_barrel = true;
+  if (caloDDE) cluster_in_barrel = caloDDE->is_lar_em_barrel();
 
-        // Region Selector, sampling 1
-	int sampling = 1;
+  ATH_MSG_DEBUG("in execute(TrigEMCluster &)");
 
-	LArTT_Selector<LArCellCont> sel;
-	LArTT_Selector<LArCellCont>::const_iterator iBegin, iEnd, it;
-        m_dataSvc->loadCollections( context, roi, TTEM, sampling, sel );
-        iBegin = sel.begin();
-        iEnd = sel.end();
-        // Finished to access Collection
-        if (!m_timersvc.empty()) m_timer[2]->stop();
-        // Algorithmic time
-        if (!m_timersvc.empty()) m_timer[3]->start();
+  // Region Selector, sampling 1
+  int sampling = 1;
 
+  LArTT_Selector<LArCellCont> sel;
+  ATH_CHECK( m_dataSvc->loadCollections(context, roi, TTEM, sampling, sel) );
 
   double totalEnergy = 0;
   double etaEnergyS1 = 0;
-  CaloSampling::CaloSample samp;  
+  CaloSampling::CaloSample samp;
 
   double energyEta = rtrigEmCluster.eta();
   double energyPhi = rtrigEmCluster.phi();
-  if ( caloDDE ){
-	energyEta = caloDDE->eta();
-	energyPhi = caloDDE->phi();
+  if (caloDDE) {
+    energyEta = caloDDE->eta();
+    energyPhi = caloDDE->phi();
   }
 
-
-    
   // begin SRA mod: set regions via LAr way
 
   // Fix for 3x7 cluster size
-  double z_etamin = energyEta-(0.075/2.);
-  double z_etamax = energyEta+(0.075/2.);
-  double z_phimin = energyPhi-(7.0*0.09817477/4.0)/2.0;
-  double z_phimax = energyPhi+(7.0*0.09817477/4.0)/2.0;
+  double z_etamin = energyEta - (0.075 / 2.);
+  double z_etamax = energyEta + (0.075 / 2.);
+  double z_phimin = energyPhi - (7.0 * 0.09817477 / 4.0) / 2.0;
+  double z_phimax = energyPhi + (7.0 * 0.09817477 / 4.0) / 2.0;
   // Fix for 5x5 clusters
-  if ( ! cluster_in_barrel ) {
-   z_etamin = energyEta-(0.125/2.);
-   z_etamax = energyEta+(0.125/2.);
-   z_phimin = energyPhi-(5.0*0.09817477/4.0)/2.0;
-   z_phimax = energyPhi+(5.0*0.09817477/4.0)/2.0;
+  if (!cluster_in_barrel) {
+    z_etamin = energyEta - (0.125 / 2.);
+    z_etamax = energyEta + (0.125 / 2.);
+    z_phimin = energyPhi - (5.0 * 0.09817477 / 4.0) / 2.0;
+    z_phimax = energyPhi + (5.0 * 0.09817477 / 4.0) / 2.0;
   }
-  
-  double z_eta = z_etamin + (z_etamax - z_etamin)*0.5;
-  double z_phi = z_phimin + (z_phimax - z_phimin)*0.5;
+
+  double z_eta = z_etamin + (z_etamax - z_etamin) * 0.5;
+  double z_phi = z_phimin + (z_phimax - z_phimin) * 0.5;
 
   // Make sure these boundaries are valid
-  
-  if (z_etamin < -2.4) z_etamin = -2.4 ; 
+
+  if (z_etamin < -2.4) z_etamin = -2.4;
   if (z_etamin < -1.4 && z_etamin > -1.5) z_etamin = -1.4;
-  if (z_etamin >  1.4 && z_etamin <  1.5) z_etamin =  1.5;
-  
-  if (z_etamax >  2.4) z_etamax = 2.4 ;
+  if (z_etamin > 1.4 && z_etamin < 1.5) z_etamin = 1.5;
+
+  if (z_etamax > 2.4) z_etamax = 2.4;
   if (z_etamax < -1.4 && z_etamax > -1.5) z_etamax = -1.5;
-  if (z_etamax >  1.4 && z_etamax <  1.5) z_etamax =  1.4;
+  if (z_etamax > 1.4 && z_etamax < 1.5) z_etamax = 1.4;
 
   bool signals = false;
-  if ( (z_etamin < 0) && (z_etamax>0) ) signals = true;
-
-  // identify region 
-  double etareg[6] = {-2.4,-2.0,-1.8,1.8,2.0,2.4}; 
-  double etagra[5] = {0.025/4,0.025/6,0.025/8,0.025/6,0.025/4}; 
-  int imax = -9; 
-  int icrk = 1 ; 
-  double dgra = 0.; 
-  // find the region, and check if the eta range cross region. 
-  for(int ir=0;ir<5;ir++) {  
+  if ((z_etamin < 0) && (z_etamax > 0)) signals = true;
+
+  // identify region
+  double etareg[6] = {-2.4, -2.0, -1.8, 1.8, 2.0, 2.4};
+  double etagra[5] = {0.025 / 4, 0.025 / 6, 0.025 / 8, 0.025 / 6, 0.025 / 4};
+  int imax = -9;
+  int icrk = 1;
+  double dgra = 0.;
+  // find the region, and check if the eta range cross region.
+  for (int ir = 0; ir < 5; ir++) {
     // make sure you're not outside acceptance of 2.4
-    if(fabs(z_eta)<2.4 && z_eta>=etareg[ir] && z_eta<=etareg[ir+1]) {
-      dgra= etagra[ir];
-      imax = ir; 
-      if(z_etamin>=etareg[ir] && z_etamax<=etareg[ir+1]) icrk=0; 
+    if (fabs(z_eta) < 2.4 && z_eta >= etareg[ir] && z_eta <= etareg[ir + 1]) {
+      dgra = etagra[ir];
+      imax = ir;
+      if (z_etamin >= etareg[ir] && z_etamax <= etareg[ir + 1]) icrk = 0;
     }
   }
   const double inv_dgra = dgra != 0 ? 1. / dgra : 1;
 
   // end SRA modification
 
-      
   // begin SRA mod: pick the eta around which to scan
   int strip_border;
   double etanew;
-  double aeta = fabs(z_eta); 
+  double aeta = fabs(z_eta);
   if (aeta <= 1.4) {
-    strip_border = (int)rint(aeta*inv_dgra);
+    strip_border = (int)rint(aeta * inv_dgra);
     // this is -0.5 in atrecon: qgcshap.F ..   Makes more sense to be +0.5
-    etanew = ((double)strip_border - 0.5)*dgra;
+    etanew = ((double)strip_border - 0.5) * dgra;
   }
   if (aeta <= 1.5) {
     etanew = -99.;
   }
   if (aeta <= 1.8) {
-    strip_border = (int)rint(aeta*inv_dgra);
+    strip_border = (int)rint(aeta * inv_dgra);
     // this is -0.5 in atrecon: qgcshap.F ..   Makes more sense to be +0.5
-    etanew = ((double)strip_border - 0.5)*dgra;
+    etanew = ((double)strip_border - 0.5) * dgra;
   }
   else if (aeta <= 2.0) {
-    strip_border = (int)rint((aeta-1.8)*inv_dgra);
-    etanew = 1.8 + ((double)strip_border - 0.5)*dgra;
+    strip_border = (int)rint((aeta - 1.8) * inv_dgra);
+    etanew = 1.8 + ((double)strip_border - 0.5) * dgra;
   }
   else if (aeta <= 2.4) {
-    strip_border = (int)rint((aeta-2.0)*inv_dgra);
-    etanew = 2.0 + ((double)strip_border - 0.5)*dgra;
+    strip_border = (int)rint((aeta - 2.0) * inv_dgra);
+    etanew = 2.0 + ((double)strip_border - 0.5) * dgra;
   }
   else {
     etanew = -99.;
   }
-  
-  etanew = (z_eta < 0.) ? -etanew : etanew;
 
+  etanew = (z_eta < 0.) ? -etanew : etanew;
 
-  // check border crossing. 
-  int ibin = 0 ;
-  double dgra1 = 0.; 
-  int iadd = 0; 
-  if((icrk==1) && (imax!=-9)){
-    if(imax>0 && z_etamin>etareg[imax-1] && z_etamin<=etareg[imax]){
-      dgra1 = etagra[imax-1]; 
-      ibin=(int)rint((etareg[imax]+0.5*dgra-etanew)*inv_dgra)+20; 
-      iadd=0; 
-    } else{
-      if(imax<4 && z_etamax>etareg[imax+1] && z_etamax<=etareg[imax+2]) {
-	dgra1 = etagra[imax+1]; 
-	ibin = (int)rint((etareg[imax+1]-0.5*dgra-etanew)*inv_dgra)+20; 
-	iadd=1; 
+  // check border crossing.
+  int ibin = 0;
+  double dgra1 = 0.;
+  int iadd = 0;
+  if ((icrk == 1) && (imax != -9)) {
+    if (imax > 0 && z_etamin > etareg[imax - 1] && z_etamin <= etareg[imax]) {
+      dgra1 = etagra[imax - 1];
+      ibin = (int)rint((etareg[imax] + 0.5 * dgra - etanew) * inv_dgra) + 20;
+      iadd = 0;
+    }
+    else {
+      if (imax < 4 && z_etamax > etareg[imax + 1] && z_etamax <= etareg[imax + 2]) {
+        dgra1 = etagra[imax + 1];
+        ibin = (int)rint((etareg[imax + 1] - 0.5 * dgra - etanew) * inv_dgra) + 20;
+        iadd = 1;
       }
     }
-    if ( imax==0 ) {
-		dgra1 = etagra[0];
-		ibin=(int)rint((etareg[0]+0.5*dgra-etanew)*inv_dgra)+20;
-		iadd=1;
+    if (imax == 0) {
+      dgra1 = etagra[0];
+      ibin = (int)rint((etareg[0] + 0.5 * dgra - etanew) * inv_dgra) + 20;
+      iadd = 1;
     }
-    if ( imax==4 ) {
-		 dgra1 = etagra[4];
-		 ibin = (int)rint((etareg[5]-0.5*dgra-etanew)*inv_dgra)+20; 
-		 iadd=0;
+    if (imax == 4) {
+      dgra1 = etagra[4];
+      ibin = (int)rint((etareg[5] - 0.5 * dgra - etanew) * inv_dgra) + 20;
+      iadd = 0;
     }
   }
   const double inv_dgra1 = dgra1 != 0 ? 1. / dgra1 : 1;
-  
+
   // end SRA mod
 
-  double z_enecell[40];  //SRA
-  double z_etacell[40];  //SRA
-  //double z_phicell[40];  //SRA
+  double z_enecell[40]; // SRA
+  double z_etacell[40]; // SRA
+  // double z_phicell[40];  //SRA
 
-  for(int iii=0;iii<40;iii++){
-    z_enecell[iii]=0.;
-    z_etacell[iii]=0.;
-    //z_phicell[iii]=0.;
+  for (int iii = 0; iii < 40; iii++) {
+    z_enecell[iii] = 0.;
+    z_etacell[iii] = 0.;
+    // z_phicell[iii]=0.;
   }
 
-  double deta = 0.;           // eta difference current cell - seed
-  double dphi = 0.;           // phi difference current cell - seed
   int ncells = 0;
 
-  for(it = iBegin;it != iEnd; ++it) {                                       // Should be revised for London scheme
+  for (const LArCell* larcell : sel) { // Should be revised for London scheme
     ncells++;
-    const LArCell* larcell = (*it);
     double etaCell = larcell->caloDDE()->eta_raw();
     double phiCell = larcell->phi();
     double energyCell = larcell->energy();
 
-    if ( fabs(etanew) != 99.) {
-
-	double eta_cell = etaCell; //SRA
-	//double eta_cell = larcell->eta(); //SRA
-	int ieta;                          //SRA
-
-
-	// begin SRA mod 
-	if (eta_cell >= z_etamin && eta_cell <= z_etamax) {
-	  // adjust for possible 2*pi offset. 
-	  double phi_cell0=larcell->phi(); 
-	  double phi_cell = proxim(phi_cell0,z_phi) ;
-	  if (phi_cell >= z_phimin && phi_cell <= z_phimax) {
-	    if(icrk == 0){
-	      // single region
-	      ieta = (int)rint((eta_cell-etanew)*inv_dgra)+20; 
-	      // correction for eta=0 spacing
-              if ( signals && eta_cell < 0 ) 
-		ieta=(int)rint((eta_cell-etanew+0.007)*inv_dgra)+20;
-	    } else {
-	      if(eta_cell>etareg[imax] && eta_cell<etareg[imax+1])
-		{ 
-		  // same region 
-		  ieta = (int)rint((eta_cell-etanew)*inv_dgra)+20; 
-		} else{
-		  // different region 
-		  ieta =
-		    (int)rint((eta_cell-etareg[imax+iadd]-(0.5-iadd)*dgra1)*inv_dgra1)+ibin;
-		}
-	    } //  icrk==0 
-	    
-	    double z_e = energyCell; 
-	  
-	    if(ieta>=1 && ieta<=40){
-	      z_enecell[ieta-1] +=z_e ; 
-	      z_etacell[ieta-1]  =eta_cell ; 
-	      //z_phicell[ieta-1]  =phi_cell0 ; 
-	    }        
-	  } // phi range
-	} // eta range 
-	//end SRA mod
-    } //endif for veto of clusters in crack outside acceptance
-    
-	// Find the standard em cluster energy (3*7 cell, now sampling 1)
-	deta = fabs( etaCell - energyEta );
-	dphi = fabs( phiCell - energyPhi );
-	if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
-
-	bool condition37 = cluster_in_barrel && ( deta <= 0.0375 && dphi <= 0.0875 );
-	bool condition55 = (!cluster_in_barrel) && ( deta <= 0.0625 && dphi <= 0.0625 );
-
-	if ( condition37 || condition55 ) {
-	  totalEnergy += energyCell;
-	  etaEnergyS1 += energyCell * etaCell;
-	  //samp = CaloSampling::getSampling(*larcell);
-	  samp = larcell->caloDDE()->getSampling();
-	  rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp)
-				+ energyCell);
-	  rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp)
-				+ energyCell);
-
-	}
-
-
+    if (fabs(etanew) != 99.) {
+
+      double eta_cell = etaCell; // SRA
+      // double eta_cell = larcell->eta(); //SRA
+
+      // begin SRA mod
+      if (eta_cell >= z_etamin && eta_cell <= z_etamax) {
+        // adjust for possible 2*pi offset.
+        double phi_cell0 = larcell->phi();
+        double phi_cell = proxim(phi_cell0, z_phi);
+        if (phi_cell >= z_phimin && phi_cell <= z_phimax) {
+          int ieta; // SRA
+          if (icrk == 0) {
+            // single region
+            ieta = (int)rint((eta_cell - etanew) * inv_dgra) + 20;
+            // correction for eta=0 spacing
+            if (signals && eta_cell < 0)
+              ieta = (int)rint((eta_cell - etanew + 0.007) * inv_dgra) + 20;
+          }
+          else {
+            if (eta_cell > etareg[imax] && eta_cell < etareg[imax + 1]) {
+              // same region
+              ieta = (int)rint((eta_cell - etanew) * inv_dgra) + 20;
+            }
+            else {
+              // different region
+              ieta = (int)rint((eta_cell - etareg[imax + iadd] - (0.5 - iadd) * dgra1) *
+                               inv_dgra1) +
+                     ibin;
+            }
+          } //  icrk==0
+
+          double z_e = energyCell;
+
+          if (ieta >= 1 && ieta <= 40) {
+            z_enecell[ieta - 1] += z_e;
+            z_etacell[ieta - 1] = eta_cell;
+            // z_phicell[ieta-1]  =phi_cell0 ;
+          }
+        } // phi range
+      }   // eta range
+          // end SRA mod
+    }     // endif for veto of clusters in crack outside acceptance
+
+    // Find the standard em cluster energy (3*7 cell, now sampling 1)
+    double deta = fabs(etaCell - energyEta);
+    double dphi = fabs(phiCell - energyPhi);
+    if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
+
+    bool condition37 = cluster_in_barrel && (deta <= 0.0375 && dphi <= 0.0875);
+    bool condition55 = (!cluster_in_barrel) && (deta <= 0.0625 && dphi <= 0.0625);
+
+    if (condition37 || condition55) {
+      totalEnergy += energyCell;
+      etaEnergyS1 += energyCell * etaCell;
+      // samp = CaloSampling::getSampling(*larcell);
+      samp = larcell->caloDDE()->getSampling();
+      rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
+      rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
+    }
 
   } // end of loop over sampling 1
 
-        // Finished lgorithmic time
-        if (!m_timersvc.empty()) m_timer[3]->stop();
-	// Started Save EMShowerMinimal time
-        if (!m_timersvc.empty()) m_timer[4]->start();
-
-  //SRA mod: Emax!
+  // SRA mod: Emax!
   double z_emax = -999.0;
-    int z_ncmax = -999;
-  for(int ic=0; ic<40; ic++) { 
-    if(z_enecell[ic]>z_emax){
-      z_emax = z_enecell[ic]; 
-      z_ncmax=ic;
+  int z_ncmax = -999;
+  for (int ic = 0; ic < 40; ic++) {
+    if (z_enecell[ic] > z_emax) {
+      z_emax = z_enecell[ic];
+      z_ncmax = ic;
     }
   }
 
@@ -300,110 +263,104 @@ StatusCode EgammaReSamp1Fex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
   double wtot = 0.;
   double etot = 0.;
   double wstot = -9999.;
-  double wstot_deta = (z_etamax-z_etamin)*0.5;
+  double wstot_deta = (z_etamax - z_etamin) * 0.5;
   double eta_center = z_etacell[z_ncmax];
-  if ( caloDDE != 0 ) {
+  if (caloDDE != 0) {
     eta_center = caloDDE->eta();
-    wstot_deta = caloDDE->deta()*2.5;
+    wstot_deta = caloDDE->deta() * 2.5;
   }
-  
-  for(int ic=0; ic<40; ic++) { 
-    if( (z_etacell[ic]>=(eta_center-wstot_deta)) && (z_etacell[ic]<=(eta_center+wstot_deta))  ){
+
+  for (int ic = 0; ic < 40; ic++) {
+    if ((z_etacell[ic] >= (eta_center - wstot_deta)) &&
+        (z_etacell[ic] <= (eta_center + wstot_deta))) {
       wtot += z_enecell[ic] * (ic - z_ncmax) * (ic - z_ncmax);
-      etot += z_enecell[ic] ;
+      etot += z_enecell[ic];
     }
   }
-  if ( etot>0 ) {
-   wtot = wtot/etot;
-   wstot = wtot> 0 ? sqrt(wtot) : -9999.;
+  if (etot > 0) {
+    wtot = wtot / etot;
+    wstot = wtot > 0 ? sqrt(wtot) : -9999.;
   }
 
-  //SRA mod: Emax2!
-  //int z_ncsec1=0;
-  double z_esec1=-999.0;  // energy of strip with second max 2
-
-  double ecand1; 
-  
-  for(int iic=1; iic<39; iic++) { 
-    if( (z_enecell[iic]>z_enecell[iic-1]) && (z_enecell[iic]>z_enecell[iic+1]) ){
-      if(iic!=z_ncmax){
-	ecand1 = z_enecell[iic];
-	if(ecand1>z_esec1){
-	  z_esec1=ecand1; 
-	  //z_ncsec1=iic; 
-	}
+  // SRA mod: Emax2!
+  // int z_ncsec1=0;
+  double z_esec1 = -999.0; // energy of strip with second max 2
+
+  double ecand1;
+
+  for (int iic = 1; iic < 39; iic++) {
+    if ((z_enecell[iic] > z_enecell[iic - 1]) && (z_enecell[iic] > z_enecell[iic + 1])) {
+      if (iic != z_ncmax) {
+        ecand1 = z_enecell[iic];
+        if (ecand1 > z_esec1) {
+          z_esec1 = ecand1;
+          // z_ncsec1=iic;
+        }
       }
     }
   }
 
-
-  if ((z_emax + z_esec1) < 0.) z_emax = -(100./98.)* z_esec1;
+  if ((z_emax + z_esec1) < 0.) z_emax = -(100. / 98.) * z_esec1;
 
   // do frac73 calculation: sum energies +-3 strips
   // and +-1 strip around highest energy strip
-  double strip7 = 0.;  // temporary variables to sum energy
+  double strip7 = 0.; // temporary variables to sum energy
   double strip3 = 0.;
-  double frac73  = 0.;  // (E7-E3)/E3 in layer 1
+  double frac73 = 0.; // (E7-E3)/E3 in layer 1
 
   // use Steve's array to calculate frac73    MW
   //
-  int smax = z_ncmax  ;  
-  if ( z_ncmax>2 && z_ncmax<37 ){
-    strip7 = z_enecell[smax-3]+z_enecell[smax-2]+z_enecell[smax-1]
-      +z_enecell[smax+1]+z_enecell[smax+2]+z_enecell[smax+3]
-      +z_enecell[smax];
-    strip3 = z_enecell[smax-1]+z_enecell[smax]+z_enecell[smax+1];
-  } else if (z_ncmax==2){
-    strip7 = z_enecell[smax-2]+z_enecell[smax-1]
-      +z_enecell[smax+1]+z_enecell[smax+2]+z_enecell[smax+3]
-      +z_enecell[smax];
-    strip3 = z_enecell[smax-1]+z_enecell[smax]+z_enecell[smax+1];
-  } else if (z_ncmax==37){
-    strip7 = z_enecell[smax-3]+z_enecell[smax-2]+z_enecell[smax-1]
-      +z_enecell[smax+1]+z_enecell[smax+2]
-      +z_enecell[smax];
-    strip3 = z_enecell[smax-1]+z_enecell[smax]+z_enecell[smax+1];
-  } else if (z_ncmax==1){
-    strip7 = z_enecell[smax-1]
-      +z_enecell[smax+1]+z_enecell[smax+2]+z_enecell[smax+3]
-      +z_enecell[smax];
-    strip3 = z_enecell[smax-1]+z_enecell[smax]+z_enecell[smax+1];
-  } else if (z_ncmax==38){
-    strip7 = z_enecell[smax-3]+z_enecell[smax-2]+z_enecell[smax-1]
-      +z_enecell[smax+1]
-      +z_enecell[smax];
-    strip3 = z_enecell[smax-1]+z_enecell[smax]+z_enecell[smax+1];
+  int smax = z_ncmax;
+  if (z_ncmax > 2 && z_ncmax < 37) {
+    strip7 = z_enecell[smax - 3] + z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] +
+             z_enecell[smax + 2] + z_enecell[smax + 3] + z_enecell[smax];
+    strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
+  }
+  else if (z_ncmax == 2) {
+    strip7 = z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] + z_enecell[smax + 2] +
+             z_enecell[smax + 3] + z_enecell[smax];
+    strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
+  }
+  else if (z_ncmax == 37) {
+    strip7 = z_enecell[smax - 3] + z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] +
+             z_enecell[smax + 2] + z_enecell[smax];
+    strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
+  }
+  else if (z_ncmax == 1) {
+    strip7 = z_enecell[smax - 1] + z_enecell[smax + 1] + z_enecell[smax + 2] + z_enecell[smax + 3] +
+             z_enecell[smax];
+    strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
+  }
+  else if (z_ncmax == 38) {
+    strip7 = z_enecell[smax - 3] + z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] +
+             z_enecell[smax];
+    strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
   }
-  strip3 > 1.e-6 ?             // protect against small values of strip3
-    frac73 = (strip7 - strip3)/strip3:
-    frac73 = 99.;  
-    
+  strip3 > 1.e-6 ? // protect against small values of strip3
+      frac73 = (strip7 - strip3) / strip3
+                 : frac73 = 99.;
+
   // Update Cluster Variables
-  
-  rtrigEmCluster.setNCells(ncells+rtrigEmCluster.nCells());
+
+  rtrigEmCluster.setNCells(ncells + rtrigEmCluster.nCells());
   rtrigEmCluster.setEmaxs1(z_emax);
   rtrigEmCluster.setWstot(wstot);
   rtrigEmCluster.setE2tsts1(z_esec1);
   rtrigEmCluster.setFracs1(frac73);
-  if ( totalEnergy != 0.0 ) 
-     rtrigEmCluster.setEta1( etaEnergyS1/totalEnergy );
+  if (totalEnergy != 0.0)
+    rtrigEmCluster.setEta1(etaEnergyS1 / totalEnergy);
   else
-     rtrigEmCluster.setEta1( 99.0 );
-  rtrigEmCluster.setRawEnergy( rtrigEmCluster.rawEnergy() + totalEnergy);
+    rtrigEmCluster.setEta1(99.0);
+  rtrigEmCluster.setRawEnergy(rtrigEmCluster.rawEnergy() + totalEnergy);
 
 #ifndef NDEBUG
-  if ( msg().level() <= MSG::DEBUG ) {
-        if ( m_geometryTool->EtaPhiRange(0,1,energyEta, energyPhi))
-                msg() << MSG::ERROR << "problems with EtaPhiRange" << endmsg;
-        PrintCluster(totalEnergy,0,1,CaloSampling::EMB1,CaloSampling::EME1);
+  if (msgLvl(MSG::DEBUG)) {
+    if (m_geometryTool->EtaPhiRange(0, 1, energyEta, energyPhi)) {
+      ATH_MSG_ERROR("problems with EtaPhiRange");
+    }
+    PrintCluster(totalEnergy, 0, 1, CaloSampling::EMB1, CaloSampling::EME1);
   }
 #endif
-        
-	// Finish Save EMShowerMinimal time
-        if (!m_timersvc.empty()) m_timer[4]->stop();
-  // Time total AlgTool time 
-  if (!m_timersvc.empty()) m_timer[0]->stop();      
 
   return StatusCode::SUCCESS;
 }
-
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.cxx b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.cxx
index 9d89baedbafd704d6452020182b479d41a7eeac3..a4e0dd52055b3907ec652fb9fd6564f9a16fd848 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.cxx
@@ -3,73 +3,47 @@
 */
 
 // ********************************************************************
-// 
+//
 // NAME:     EgammaReSamp2Fex.cxx
 // PACKAGE:  Trigger/TrigAlgorithms/TrigT2CaloEgamma
-// 
+//
 // AUTHOR:   M.P. Casado
-// 
+//
 //
 // ********************************************************************
 
-#include "CaloIdentifier/LArEM_ID.h"
-
-//#include "TrigCaloEvent/TrigEMCluster.h"
-#include "xAODTrigCalo/TrigEMCluster.h"
-#include "CaloGeoHelpers/CaloSampling.h"
-
 #include "EgammaReSamp2Fex.h"
-#include "TrigT2CaloCommon/Calo_Def.h"
-
+#include "CaloGeoHelpers/CaloSampling.h"
+#include "CaloIdentifier/LArEM_ID.h"
 #include "IRegionSelector/IRoiDescriptor.h"
+#include "TrigT2CaloCommon/Calo_Def.h"
+#include "xAODTrigCalo/TrigEMCluster.h"
 
-EgammaReSamp2Fex::EgammaReSamp2Fex(const std::string & type, const std::string & name, 
-                   const IInterface* parent): IReAlgToolCalo(type, name, parent)
-		   {
-#ifndef NDEBUG
-	// Create Geometry object
-        // 0 -> CaloType EM, 2 -> Second Layer
-//        m_geometry[0] = new T2Geometry(0,2);
-#endif
-	// By default no restriction is applied
-	declareProperty("MaxDetaHotCell",m_maxHotCellDeta=1.0);
-	declareProperty("MaxDphiHotCell",m_maxHotCellDphi=1.0);
+EgammaReSamp2Fex::EgammaReSamp2Fex(const std::string& type, const std::string& name,
+                                   const IInterface* parent) :
+    IReAlgToolCalo(type, name, parent)
+{
 }
 
-StatusCode EgammaReSamp2Fex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
-				   const IRoiDescriptor& roi,
-				   const CaloDetDescrElement*& caloDDE,
-                                   const EventContext& context ) const {
-  
-	// Time total AlgTool time 
-	if (!m_timersvc.empty()) m_timer[0]->start();      
-
-        ATH_MSG_DEBUG( "in execute(TrigEMCluster&)" );
-
-	// Time to access RegionSelector
-	if (!m_timersvc.empty()) m_timer[1]->start();      
+StatusCode EgammaReSamp2Fex::execute(xAOD::TrigEMCluster& rtrigEmCluster, const IRoiDescriptor& roi,
+                                     const CaloDetDescrElement*& caloDDE,
+                                     const EventContext& context) const
+{
+  ATH_MSG_DEBUG("in execute(TrigEMCluster&)");
 
-	// Region Selector, sampling 2
-	int sampling = 2;
+  // Region Selector, sampling 2
+  int sampling = 2;
 
-	LArTT_Selector<LArCellCont> sel;
-	LArTT_Selector<LArCellCont>::const_iterator iBegin, iEnd, it;
-	m_dataSvc->loadCollections( context, roi, TTEM, sampling, sel );
-	iBegin = sel.begin();
-	iEnd = sel.end();
-	// Finished to access Collection
-	if (!m_timersvc.empty()) m_timer[2]->stop();      
-	// Algorithmic time
-	if (!m_timersvc.empty()) m_timer[3]->start();      
+  LArTT_Selector<LArCellCont> sel;
+  ATH_CHECK( m_dataSvc->loadCollections(context, roi, TTEM, sampling, sel) );
 
   double energyEta = 0.;
   double energyPhi = 0.;
- 
-  // add these variables to take care of phi wrap-around
-  double energyNegPhi = 0.; //SRA
-  double energyNegPhiConv = 0.; //SRA
-  double energyPosPhi = 0.; //SRA
 
+  // add these variables to take care of phi wrap-around
+  double energyNegPhi = 0.;     // SRA
+  double energyNegPhiConv = 0.; // SRA
+  double energyPosPhi = 0.;     // SRA
 
   // 1. Find seed cell (highest Et in ROI .. layer 2)
   // 2. Find Et weighted eta, phi in 3*7 cell (layer 2) (photon + e id)
@@ -79,183 +53,169 @@ StatusCode EgammaReSamp2Fex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
   //		 			         parabolic parametrisation)
   // 5. Find strip energies and eta (2*5 window)
   // 6. Find frac73 (photon id), (E1-E2)/(E1+E2) (e + photon id)
-  
+
   double seedEnergy = 0.;
-  double seedPhi    = 999.;
-  double seedEta    = 999.;
-  double hotPhi    = 999.;
-  double hotEta    = 999.;
+  double seedPhi = 999.;
+  double seedEta = 999.;
+  double hotPhi = 999.;
+  double hotEta = 999.;
   int ncells = 0;
   // LVL1 positions
-  float etaL1=rtrigEmCluster.eta();
-  float phiL1=rtrigEmCluster.phi();
-  
-  const LArEM_ID*   emID  = m_larMgr->getEM_ID();
-  const LArCell* larcell;
-  const LArCell* seedCell = NULL;
-  const LArCell* hotCell = NULL;
-  for(it = iBegin;it != iEnd; ++it) {
-      larcell=(*it);
-      if (larcell->energy() > seedEnergy) { // Hottest cell seach
-	float deta=std::abs(etaL1-larcell->eta());
-	if ( deta < m_maxHotCellDeta ){ // Eta check is faster. Do it First
-           float dphi=std::abs(phiL1-larcell->phi());
-	   dphi = std::abs ( M_PI - dphi );
-	   dphi = std::abs ( M_PI - dphi );
-	   if ( dphi < m_maxHotCellDphi ) {
-        	seedEnergy = larcell->energy();
-		seedCell=larcell;
-	   } // End of dphi check
-	} // End of deta check
-      } // End of if energy 
-      ncells++;
+  float etaL1 = rtrigEmCluster.eta();
+  float phiL1 = rtrigEmCluster.phi();
+
+  const LArEM_ID* emID = m_larMgr->getEM_ID();
+  const LArCell* seedCell = nullptr;
+  const LArCell* hotCell = nullptr;
+  for (const LArCell* larcell : sel) {
+    if (larcell->energy() > seedEnergy) { // Hottest cell seach
+      float deta = std::abs(etaL1 - larcell->eta());
+      if (deta < m_maxHotCellDeta) { // Eta check is faster. Do it First
+        float dphi = std::abs(phiL1 - larcell->phi());
+        dphi = std::abs(M_PI - dphi);
+        dphi = std::abs(M_PI - dphi);
+        if (dphi < m_maxHotCellDphi) {
+          seedEnergy = larcell->energy();
+          seedCell = larcell;
+        } // End of dphi check
+      }   // End of deta check
+    }     // End of if energy
+    ncells++;
   }
-  if (seedCell!=NULL){
-  seedEta    = seedCell->eta();
-  seedPhi    = seedCell->phi();
-  // For the S-shape correction, we store the caloDDE of the hottest cell
-  caloDDE = (seedCell->caloDDE());
-  hotCell = seedCell;
-  hotEta    = hotCell->eta();
-  hotPhi    = hotCell->phi();
-  } else { 
-	if (!m_timersvc.empty()) m_timer[3]->stop();
-	return StatusCode::SUCCESS;
+  if (seedCell != nullptr) {
+    seedEta = seedCell->eta();
+    seedPhi = seedCell->phi();
+    // For the S-shape correction, we store the caloDDE of the hottest cell
+    caloDDE = (seedCell->caloDDE());
+    hotCell = seedCell;
+    hotEta = hotCell->eta();
+    hotPhi = hotCell->phi();
+  }
+  else {
+    return StatusCode::SUCCESS;
   }
 
-    std::map<const LArCell*,float> windows;
-    for(it = iBegin;it != iEnd; ++it) {
-      larcell=(*it);
-        float deta=std::abs(seedEta-larcell->eta());
-        if ( deta < 0.025+0.002 ){ // Eta check is faster. Do it First
-           float dphi=std::abs(seedPhi-larcell->phi());
-           dphi = std::abs ( M_PI - dphi );
-           dphi = std::abs ( M_PI - dphi );
-           if ( dphi < 0.025+0.002 ) {
-		if ( windows.find(larcell) == windows.end() ){
-			windows[larcell]=0.0;
-		} // end of windows check
-           } // End of dphi check
-        } // End of deta check
-      ncells++;
+  std::map<const LArCell*, float> windows;
+  for (const LArCell* larcell : sel) {
+    float deta = std::abs(seedEta - larcell->eta());
+    if (deta < 0.025 + 0.002) { // Eta check is faster. Do it First
+      float dphi = std::abs(seedPhi - larcell->phi());
+      dphi = std::abs(M_PI - dphi);
+      dphi = std::abs(M_PI - dphi);
+      if (dphi < 0.025 + 0.002) {
+        if (windows.find(larcell) == windows.end()) {
+          windows[larcell] = 0.0;
+        } // end of windows check
+      }   // End of dphi check
+    }     // End of deta check
+    ncells++;
   }
-  for(it = iBegin;it != iEnd; ++it) {
 
-    const LArCell* larcell = (*it);
+  for (const LArCell* larcell : sel) {
     double etaCell = larcell->eta();
     double phiCell = larcell->phi();
     double energyCell = larcell->et();
 
     // Find position of current cell w.r.t. seed
-    float deta = fabs( etaCell - seedEta );
-    if ( deta > 0.05+0.002 ) continue;
-    for(std::map<const LArCell*,float>::iterator witer=
-		windows.begin(); witer!=windows.end(); ++witer){
-    float deta1 = fabs( etaCell - witer->first->eta() );
-    float dphi = fabs( phiCell - witer->first->phi() );
-    if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
-
-
-    // Electromagnetic measurements, done by layer
-    // layer 2: Et weighted eta, phi, summed Et in 3*7,
-    //          cluster width in 3*5 cell
-    // emEnergy in 3*7 cell is also calculated, all samplings
-
-    double cellSizeEta;
-    double cellSizePhi;
-    if (emID->is_em_barrel( larcell->ID() ) ) {
-      cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
-      cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
-    } else {
-      cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
-      cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
-    }
+    float deta = fabs(etaCell - seedEta);
+    if (deta > 0.05 + 0.002) continue;
+    for (auto& [cell, energy] : windows) {
+      float deta1 = fabs(etaCell - cell->eta());
+      float dphi = fabs(phiCell - cell->phi());
+      if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
+
+      // Electromagnetic measurements, done by layer
+      // layer 2: Et weighted eta, phi, summed Et in 3*7,
+      //          cluster width in 3*5 cell
+      // emEnergy in 3*7 cell is also calculated, all samplings
+
+      double cellSizeEta;
+      double cellSizePhi;
+      if (emID->is_em_barrel(larcell->ID())) {
+        cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
+        cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
+      }
+      else {
+        cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
+        cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
+      }
 
-    // 3. do the 3*5 stuff
-    int nCellsEta = 3;
-    int nCellsPhi = 5;
-    if ( deta1 <= 0.5*double(nCellsEta-1)*cellSizeEta+0.01 &&
-         dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.01  ){
-		witer->second+= energyCell;
-    } // End of do the 3*5 stuff
-    } // End of windows map loop
-  } // end of the loop
+      // 3. do the 3*5 stuff
+      int nCellsEta = 3;
+      int nCellsPhi = 5;
+      if (deta1 <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.01 &&
+          dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.01) {
+        energy += energyCell;
+      } // End of do the 3*5 stuff
+    }   // End of windows map loop
+  }     // end of the loop
 
   float max = -999;
-  for(std::map<const LArCell*,float>::const_iterator witer=
-		windows.begin(); witer!=windows.end(); ++witer){
-        if ( witer->second > max ) {
-		max = witer->second;
-		seedCell = witer->first;
-	}
+  for (auto const& [cell, energy] : windows) {
+    if (energy > max) {
+      max = energy;
+      seedCell = cell;
+    }
   }
 
-  if (seedCell!=NULL){
-  seedEta    = seedCell->eta();
-  seedPhi    = seedCell->phi();
-  // For the S-shape correction, we store the caloDDE of the hottest cell
-  caloDDE = (seedCell->caloDDE());
-  } else {
-        if (!m_timersvc.empty()) m_timer[3]->stop();
-        return StatusCode::SUCCESS;
+  if (seedCell != nullptr) {
+    seedEta = seedCell->eta();
+    seedPhi = seedCell->phi();
+    // For the S-shape correction, we store the caloDDE of the hottest cell
+    caloDDE = (seedCell->caloDDE());
+  }
+  else {
+    return StatusCode::SUCCESS;
   }
-
-
-
-
 
   bool cluster_in_barrel = true;
-  if ( seedCell && seedCell->caloDDE() )
-	cluster_in_barrel = seedCell->caloDDE()->is_lar_em_barrel();
+  if (seedCell && seedCell->caloDDE()) cluster_in_barrel = seedCell->caloDDE()->is_lar_em_barrel();
 
   // Build desired quantities using the values previously obtained.
 
-  double energy37Lay2  = 0.;  // sum Et in 3*7 cell layer 2
-  double energy37Lay2NegPhi = 0.; //SRA for phi wrap-around
-  double energy37Lay2PosPhi = 0.; //SRA for phi wrap-around
-  double energy77Lay2  = 0.;  // sum Et in 7*7 cell layer 2
-  double energy35Lay2  = 0.;  // sum Et in 3*5 cell layer 2
-  double energy33Lay2  = 0.;  // sum Et in 3*3 cell layer 2
-  double weightEta     = 0.;  // temporary variable for cluster width
-  double weightEta2    = 0.;  // ditto
-  double clusterWidth35= 0.;  // cluster width in eta, 3*5 cell, layer 2
-  int nCellsEta = 0;          // size of cell array in eta
-  int nCellsPhi = 0;          // size of cell array in phi
-  double deta = 0.;           // eta difference current cell - seed
-  double dphi = 0.;           // phi difference current cell - seed
-  double detaH = 0.;           // eta difference current cell - seed
-  double dphiH = 0.;           // phi difference current cell - seed
+  double energy37Lay2 = 0.;       // sum Et in 3*7 cell layer 2
+  double energy37Lay2NegPhi = 0.; // SRA for phi wrap-around
+  double energy37Lay2PosPhi = 0.; // SRA for phi wrap-around
+  double energy77Lay2 = 0.;       // sum Et in 7*7 cell layer 2
+  double energy35Lay2 = 0.;       // sum Et in 3*5 cell layer 2
+  double energy33Lay2 = 0.;       // sum Et in 3*3 cell layer 2
+  double weightEta = 0.;          // temporary variable for cluster width
+  double weightEta2 = 0.;         // ditto
+  double clusterWidth35 = 0.;     // cluster width in eta, 3*5 cell, layer 2
+  int nCellsEta = 0;              // size of cell array in eta
+  int nCellsPhi = 0;              // size of cell array in phi
+  double deta = 0.;               // eta difference current cell - seed
+  double dphi = 0.;               // phi difference current cell - seed
 
   double totalEnergy = 0;
   CaloSampling::CaloSample samp;
 
-  for(it = iBegin;it != iEnd; ++it) {
-
-    const LArCell* larcell = (*it);
+  for (const LArCell* larcell : sel) {
     double etaCell = larcell->eta();
     double phiCell = larcell->phi();
     double energyCell = larcell->energy();
 
     // Find position of current cell w.r.t. seed
-    deta = fabs( etaCell - seedEta );
-    dphi = fabs( phiCell - seedPhi );
-    if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
- 
-    detaH = fabs( etaCell - hotEta );
-    dphiH = fabs( phiCell - hotPhi );
-    if ( dphiH > M_PI ) dphiH = 2.* M_PI - dphiH;   // wrap 0 -> 6.28
- 
+    deta = fabs(etaCell - seedEta);
+    dphi = fabs(phiCell - seedPhi);
+    if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
+
+    double detaH = fabs(etaCell - hotEta); // eta difference current cell - seed
+    double dphiH = fabs(phiCell - hotPhi); // phi difference current cell - seed
+    if (dphiH > M_PI) dphiH = 2. * M_PI - dphiH; // wrap 0 -> 6.28
+
     // Electromagnetic measurements, done by layer
     // layer 2: Et weighted eta, phi, summed Et in 3*7,
     //          cluster width in 3*5 cell
     // emEnergy in 3*7 cell is also calculated, all samplings
-          
+
     double cellSizeEta;
     double cellSizePhi;
-    if (emID->is_em_barrel( larcell->ID() ) ) {
+    if (emID->is_em_barrel(larcell->ID())) {
       cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
       cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
-    } else {
+    }
+    else {
       cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
       cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
     }
@@ -264,200 +224,196 @@ StatusCode EgammaReSamp2Fex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
     // 1. do the 7*7 stuff
     nCellsEta = 7;
     nCellsPhi = 7;
-    if ( detaH <= 0.5*double(nCellsEta-1)*cellSizeEta+0.01 &&
-         dphiH <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.01  ){
-    // 2. do the 3*7 stuff
-    nCellsEta = 3;
-    nCellsPhi = 7;
-    if ( detaH <= 0.5*double(nCellsEta-1)*cellSizeEta+0.01 &&
-         dphiH <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.01  ){
-      energy37Lay2 += energyCell;
-    } // End of do the 3*7 stuff
+    if (detaH <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.01 &&
+        dphiH <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.01) {
+      // 2. do the 3*7 stuff
+      nCellsEta = 3;
+      nCellsPhi = 7;
+      if (detaH <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.01 &&
+          dphiH <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.01) {
+        energy37Lay2 += energyCell;
+      } // End of do the 3*7 stuff
       energy77Lay2 += energyCell;
     } // End of do the 7*7 stuff
-                         
+
     // 1. do the 7*7 stuff
     nCellsEta = 7;
     nCellsPhi = 7;
-    if ( deta <= 0.5*double(nCellsEta-1)*cellSizeEta+0.005 && 
-	 dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.005  ){
-    // 2. do the 3*7 stuff
-    nCellsEta = 3;
-    nCellsPhi = 7;
-    if ( deta <= 0.5*double(nCellsEta-1)*cellSizeEta+0.002 && 
-	 dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.002  ){
-      energyEta += energyCell * etaCell;
-      //energy37Lay2 += energyCell;
-
-      if ( cluster_in_barrel ){
-      //totalEnergy += energyCell;
-      //samp = CaloSampling::getSampling(*larcell);
-	samp = larcell->caloDDE()->getSampling();
-      //rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-      //rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
-      }
-
-      if ( phiCell > 0.) {  // SRA phi wrap-around
-	energyPosPhi += double(energyCell) * phiCell;
-	energy37Lay2PosPhi += energyCell;
-      } else {
-	energyNegPhi += double(energyCell) * phiCell;
-	energyNegPhiConv += double(energyCell) * (phiCell+2.0*M_PI);
-	energy37Lay2NegPhi += energyCell;
-      }
-    // 3. do the 3*5 stuff 
-    nCellsEta = 3;
-    nCellsPhi = 5;
-    if ( deta <= 0.5*double(nCellsEta-1)*cellSizeEta+0.01 && 
-	 dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.01  ){
-      weightEta += energyCell * etaCell; 
-      weightEta2 += energyCell * etaCell * etaCell; 
-      energy35Lay2 += energyCell;
-      // 3a. do the 3*3 stuff 
-      //nCellsEta = 3;
-      nCellsPhi = 3;
-      if ( deta <= 0.5*double(nCellsEta-1)*cellSizeEta+0.01 && 
-	 dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.01  ){
-         energy33Lay2 += energyCell;
-      } // End of do the 3*3 stuff
-    } // End of do the 3*5 stuff
-
-    } // End of do the 3x7 stuff
-    // 4. do the 5*5 stuff
-    nCellsEta = 5;
-    nCellsPhi = 5;
-    if ( (!cluster_in_barrel) && deta <= 0.5*double(nCellsEta-1)*cellSizeEta+0.005 && 
-	 dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.005  ){
-       //totalEnergy += energyCell;
-       //samp = CaloSampling::getSampling(*larcell);
-      samp = larcell->caloDDE()->getSampling();
-       //rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-       //rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
-    } // End of do the 5*5 stuff
-      //energy77Lay2 += energyCell;
-    } // End of do the 7*7 stuff
-
-  }  // end of loop over sampling 2
-    
-  // Normalise energy weighted angles and calculate values  
-
-  // SRA phi wrap-around
-  double AvgNegPhi = 0.;
-  double AvgPosPhi = 0.;
-
-  if ( (energy37Lay2PosPhi + energy37Lay2NegPhi) > 0. ){           // dont divide by zero
-    energyEta /= (energy37Lay2PosPhi + energy37Lay2NegPhi) ;
-
-    if (energy37Lay2NegPhi > 0. ){
-       AvgNegPhi = energyNegPhi / energy37Lay2NegPhi;
-    } else {
+    if (deta <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.005 &&
+        dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.005) {
+      // 2. do the 3*7 stuff
+      nCellsEta = 3;
+      nCellsPhi = 7;
+      if (deta <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.002 &&
+          dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.002) {
+        energyEta += energyCell * etaCell;
+        // energy37Lay2 += energyCell;
+
+        if (cluster_in_barrel) {
+          // totalEnergy += energyCell;
+          // samp = CaloSampling::getSampling(*larcell);
+          samp = larcell->caloDDE()->getSampling();
+          // rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
+          // rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
+        }
+
+        if (phiCell > 0.) { // SRA phi wrap-around
+          energyPosPhi += double(energyCell) * phiCell;
+          energy37Lay2PosPhi += energyCell;
+        }
+        else {
+          energyNegPhi += double(energyCell) * phiCell;
+          energyNegPhiConv += double(energyCell) * (phiCell + 2.0 * M_PI);
+          energy37Lay2NegPhi += energyCell;
+        }
+        // 3. do the 3*5 stuff
+        nCellsEta = 3;
+        nCellsPhi = 5;
+        if (deta <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.01 &&
+            dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.01) {
+          weightEta += energyCell * etaCell;
+          weightEta2 += energyCell * etaCell * etaCell;
+          energy35Lay2 += energyCell;
+          // 3a. do the 3*3 stuff
+          // nCellsEta = 3;
+          nCellsPhi = 3;
+          if (deta <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.01 &&
+              dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.01) {
+            energy33Lay2 += energyCell;
+          } // End of do the 3*3 stuff
+        }   // End of do the 3*5 stuff
+
+      } // End of do the 3x7 stuff
+      // 4. do the 5*5 stuff
+      nCellsEta = 5;
+      nCellsPhi = 5;
+      if ((!cluster_in_barrel) && deta <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.005 &&
+          dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.005) {
+        // totalEnergy += energyCell;
+        // samp = CaloSampling::getSampling(*larcell);
+        samp = larcell->caloDDE()->getSampling();
+        // rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
+        // rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
+      } // End of do the 5*5 stuff
+        // energy77Lay2 += energyCell;
+    }   // End of do the 7*7 stuff
+
+  } // end of loop over sampling 2
+
+  // Normalise energy weighted angles and calculate values
+
+  if ((energy37Lay2PosPhi + energy37Lay2NegPhi) > 0.) { // dont divide by zero
+    // SRA phi wrap-around
+    double AvgNegPhi = 0.;
+    double AvgPosPhi = 0.;
+
+    energyEta /= (energy37Lay2PosPhi + energy37Lay2NegPhi);
+
+    if (energy37Lay2NegPhi > 0.) {
+      AvgNegPhi = energyNegPhi / energy37Lay2NegPhi;
+    }
+    else {
       AvgNegPhi = -999.0;
     }
 
-    if (energy37Lay2PosPhi > 0. ){
-      AvgPosPhi = energyPosPhi / energy37Lay2PosPhi;    
-    } else {
+    if (energy37Lay2PosPhi > 0.) {
+      AvgPosPhi = energyPosPhi / energy37Lay2PosPhi;
+    }
+    else {
       AvgPosPhi = -999.0;
     }
 
-    if (AvgPosPhi==-999.0) {
+    if (AvgPosPhi == -999.0) {
       if (AvgNegPhi != -999.0) {
-	energyPhi = AvgNegPhi;
+        energyPhi = AvgNegPhi;
       }
     }
-    
-    if (AvgNegPhi==-999.0) {
+
+    if (AvgNegPhi == -999.0) {
       if (AvgPosPhi != -999.0) {
-	energyPhi = AvgPosPhi;
+        energyPhi = AvgPosPhi;
       }
     }
-    
+
     if (AvgNegPhi != -999.0 && AvgPosPhi != -999.0) {
-      if ( (AvgNegPhi > (-M_PI/2.0)) && (AvgPosPhi < (M_PI/2.0)) ) {
-	energyPhi = (energyNegPhi + energyPosPhi)/(energy37Lay2NegPhi + energy37Lay2PosPhi);
-      } else {
-	if ((AvgNegPhi < (-M_PI/2.0)) && (AvgPosPhi > (M_PI/2.0))) {
-	  energyPhi = (energyNegPhiConv + energyPosPhi)/(energy37Lay2NegPhi + energy37Lay2PosPhi);
-	  if (energyPhi > M_PI) {
-	    energyPhi = energyPhi - 2*M_PI;
-	  }
-	}
+      if ((AvgNegPhi > (-M_PI / 2.0)) && (AvgPosPhi < (M_PI / 2.0))) {
+        energyPhi = (energyNegPhi + energyPosPhi) / (energy37Lay2NegPhi + energy37Lay2PosPhi);
+      }
+      else {
+        if ((AvgNegPhi < (-M_PI / 2.0)) && (AvgPosPhi > (M_PI / 2.0))) {
+          energyPhi = (energyNegPhiConv + energyPosPhi) / (energy37Lay2NegPhi + energy37Lay2PosPhi);
+          if (energyPhi > M_PI) {
+            energyPhi = energyPhi - 2 * M_PI;
+          }
+        }
       }
     }
-
-  } else {
-    energyEta = 99. ;
-    energyPhi = 0. ;
+  }
+  else {
+    energyEta = 99.;
+    energyPhi = 0.;
   }
 
-  for(it = iBegin;it != iEnd; ++it) {
-
-    const LArCell* larcell = (*it);
+  for (const LArCell* larcell : sel) {
     double etaCell = larcell->eta();
     double phiCell = larcell->phi();
     double energyCell = larcell->energy();
 
     // Find position of current cell w.r.t. seed
-    deta = fabs( etaCell - energyEta );
-    dphi = fabs( phiCell - energyPhi );
-    if ( dphi > M_PI ) dphi = 2.* M_PI - dphi;   // wrap 0 -> 6.28
+    deta = fabs(etaCell - energyEta);
+    dphi = fabs(phiCell - energyPhi);
+    if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap 0 -> 6.28
 
     double cellSizeEta;
     double cellSizePhi;
-    if (emID->is_em_barrel( larcell->ID() ) ) {
+    if (emID->is_em_barrel(larcell->ID())) {
       cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
       cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMBAR);
-    } else {
+    }
+    else {
       cellSizeEta = etaSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
       cellSizePhi = phiSizeLArEMSamp2(etaCell, Calorimeter::EMEND);
     }
 
     nCellsEta = 3;
     nCellsPhi = 7;
-    if ( (deta <= 0.5*double(nCellsEta-1)*cellSizeEta+0.01) &&
-         (dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.01)  ){
-
-      if ( cluster_in_barrel ){
-      totalEnergy += energyCell;
-      //samp = CaloSampling::getSampling(*larcell);
-      samp = larcell->caloDDE()->getSampling();
-      rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-      rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
+    if ((deta <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.01) &&
+        (dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.01)) {
+
+      if (cluster_in_barrel) {
+        totalEnergy += energyCell;
+        // samp = CaloSampling::getSampling(*larcell);
+        samp = larcell->caloDDE()->getSampling();
+        rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
+        rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
       }
     } // End of do the 3x7 stuff
 
     nCellsEta = 5;
     nCellsPhi = 5;
-    if ( (!cluster_in_barrel) && (deta <= 0.5*double(nCellsEta-1)*cellSizeEta+0.01) &&
-         (dphi <= 0.5*double(nCellsPhi-1)*cellSizePhi+0.01)  ){
-       totalEnergy += energyCell;
-       //samp = CaloSampling::getSampling(*larcell);
-       samp = larcell->caloDDE()->getSampling();
-       rtrigEmCluster.setEnergy(samp,rtrigEmCluster.energy(samp) + energyCell);
-       rtrigEmCluster.setRawEnergy(samp,rtrigEmCluster.rawEnergy(samp) + energyCell);
+    if ((!cluster_in_barrel) && (deta <= 0.5 * double(nCellsEta - 1) * cellSizeEta + 0.01) &&
+        (dphi <= 0.5 * double(nCellsPhi - 1) * cellSizePhi + 0.01)) {
+      totalEnergy += energyCell;
+      // samp = CaloSampling::getSampling(*larcell);
+      samp = larcell->caloDDE()->getSampling();
+      rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
+      rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
     } // End of do the 5*5 stuff
 
-  }  // end of loop over sampling 2
-	
+  } // end of loop over sampling 2
+
   // calculate cluster width
 
-  if ( energy35Lay2 > 0. ){ 
+  if (energy35Lay2 > 0.) {
     const double inv_energy35Lay2 = 1. / energy35Lay2;
-    clusterWidth35 = (weightEta2*inv_energy35Lay2) -
-      (weightEta*inv_energy35Lay2)*(weightEta*inv_energy35Lay2);
-    clusterWidth35 > 0.? clusterWidth35 = sqrt(clusterWidth35) :
-      clusterWidth35 = 99.;				
-  } else {
+    clusterWidth35 = (weightEta2 * inv_energy35Lay2) -
+                     (weightEta * inv_energy35Lay2) * (weightEta * inv_energy35Lay2);
+    clusterWidth35 > 0. ? clusterWidth35 = sqrt(clusterWidth35) : clusterWidth35 = 99.;
+  }
+  else {
     clusterWidth35 = 99.;
   }
-  
-	// Finished Algorithmic time
-//	m_timer[0]->propVal((int)floorf(energyEta*100));
-	if (!m_timersvc.empty()) m_timer[3]->stop();      
-	// Save EMShowerMinimal time
-	if (!m_timersvc.empty()) m_timer[4]->start();      
-
-  
+
   // Update cluster Variables
 
   // update stored variables
@@ -465,28 +421,23 @@ StatusCode EgammaReSamp2Fex::execute(xAOD::TrigEMCluster &rtrigEmCluster,
   rtrigEmCluster.setE237(energy37Lay2);
   rtrigEmCluster.setE277(energy77Lay2);
   rtrigEmCluster.setWeta2(clusterWidth35);
-  rtrigEmCluster.setRawEnergy( rtrigEmCluster.rawEnergy() + totalEnergy);
+  rtrigEmCluster.setRawEnergy(rtrigEmCluster.rawEnergy() + totalEnergy);
   rtrigEmCluster.setEta(energyEta);
   rtrigEmCluster.setPhi(energyPhi);
   rtrigEmCluster.setRawEta(energyEta);
   rtrigEmCluster.setRawPhi(energyPhi);
   rtrigEmCluster.setNCells(ncells);
-        
-  // Finished save EMShowerMinimal time
-  if (!m_timersvc.empty()) m_timer[4]->stop();      
 
 #ifndef NDEBUG
   // This will internaly define normal, narrow and large clusters
-  if ( msgLvl(MSG::DEBUG) ) {
-    if ( m_geometryTool->EtaPhiRange(0,2,energyEta, energyPhi))
-      ATH_MSG_ERROR( "problems with EtaPhiRange" );
-    ATH_MSG_DEBUG( "totalEnergy" << totalEnergy );
-    PrintCluster(totalEnergy,0,2, CaloSampling::EMB2,CaloSampling::EME2);
+  if (msgLvl(MSG::DEBUG)) {
+    if (m_geometryTool->EtaPhiRange(0, 2, energyEta, energyPhi)) {
+      ATH_MSG_ERROR("problems with EtaPhiRange");
+    }
+    ATH_MSG_DEBUG("totalEnergy" << totalEnergy);
+    PrintCluster(totalEnergy, 0, 2, CaloSampling::EMB2, CaloSampling::EME2);
   }
 #endif
 
-  // Time total AlgTool time 
-  if (!m_timersvc.empty()) m_timer[0]->stop();      
-
   return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.h b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.h
index 450221dd833cf2c83baeee7ff6ebb95ed7b240ba..b14388a0e05949226dadc78c88bfba5815519715 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/EgammaReSamp2Fex.h
@@ -43,9 +43,9 @@ class EgammaReSamp2Fex: public IReAlgToolCalo {
   private:
     inline double etaSizeLArEMSamp2(const double eta, const int calo) const;
     inline double phiSizeLArEMSamp2(const double eta, const int calo) const;
-    float m_maxHotCellDeta;
-    float m_maxHotCellDphi;
 
+    Gaudi::Property<float> m_maxHotCellDeta{this, "MaxDetaHotCell", 1.0};
+    Gaudi::Property<float> m_maxHotCellDphi{this, "MaxDphiHotCell", 1.0};
 };
 
 inline double EgammaReSamp2Fex::etaSizeLArEMSamp2(double cellEta, int calo) const{
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.cxx b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.cxx
index a911e8a34bdb42ff92144cb3912b5563260351d9..67ae6c69a3d55dfe43e1386435ad6fb6ec70b7b4 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.cxx
@@ -11,326 +11,179 @@
 
 */
 
-#include "GaudiKernel/MsgStream.h"
-#include "GaudiKernel/IToolSvc.h"
 #include "GaudiKernel/StatusCode.h"
-#include "AthLinks/ElementLink.h"
-
-
-#include "xAODTrigCalo/TrigEMClusterContainer.h"
-#include "xAODTrigCalo/TrigEMClusterAuxContainer.h"
 
+#include "AthLinks/ElementLink.h"
 #include "T2CaloEgammaReFastAlgo.h"
 #include "TrigT2CaloCommon/IReAlgToolCalo.h"
-#include "TrigT2CaloCalibration/IEgammaCalibration.h"
 #include "TrigT2CaloCommon/ITrigDataAccess.h"
-
 #include "TrigT2CaloCommon/phiutils.h"
+#include "xAODTrigCalo/TrigEMClusterAuxContainer.h"
+#include "xAODTrigCalo/TrigEMClusterContainer.h"
 
 class ISvcLocator;
 
-T2CaloEgammaReFastAlgo::T2CaloEgammaReFastAlgo(const std::string & name, ISvcLocator* pSvcLocator)
-  : AthReentrantAlgorithm(name, pSvcLocator), 
-    m_log(0), 
-    m_calibsBarrel(this), 
-    m_calibsEndcap(this),
-    m_storeCells(false),
-    m_roiCollection("OutputRoIs"),
-    m_trigEmClusterCollection("CaloClusters"),
+T2CaloEgammaReFastAlgo::T2CaloEgammaReFastAlgo(const std::string& name, ISvcLocator* pSvcLocator) :
+    AthReentrantAlgorithm(name, pSvcLocator),
     m_regionSelector("RegSelSvc", name)
-{
-    declareProperty("L1ForceEta",m_l1eta = -10.0);
-    declareProperty("L1ForcePhi",m_l1phi = -10.0);
-    declareProperty("EtaWidth", m_etaWidth = 0.1,"Eta Width of the Region of Interest");
-    declareProperty("PhiWidth", m_phiWidth = 0.1,"Phi Width of the Region of Interest"); 
-    declareProperty("CalibListBarrel",m_calibsBarrel,"list of calib tools for the Barrel clusters");
-    declareProperty("CalibListEndcap",m_calibsEndcap,"list of calib tools for the EndCap clusters");
-    declareProperty("StoreCells",m_storeCells,"store cells in container attached to RoI");
-    declareProperty("RhoEta",m_rhoEta);
-    declareProperty("ZEta",m_zEta);
-    declareProperty("IReAlgToolList", m_emAlgTools,"list of ReAlgToolCalo. These tools perform FEX.");
-    declareProperty("RoIs", m_roiCollectionKey = std::string("OutputRoIs"), "RoIs to read in");
-    declareProperty("ClustersName", m_clusterContainerKey = std::string("CaloClusters"), "Calo cluster container");
-}
-
-T2CaloEgammaReFastAlgo::~T2CaloEgammaReFastAlgo()
-{
-  delete m_log;
-}
-
+{}
 
 StatusCode T2CaloEgammaReFastAlgo::initialize()
 {
-  if (!m_log) m_log = new MsgStream(msgSvc(), name());
-
-
   m_emAlgTools.retrieve().ignore();
-  ATH_CHECK( m_regionSelector.retrieve());
-  ATH_CHECK( m_clusterContainerKey.initialize() );
-  ATH_CHECK( m_roiCollectionKey.initialize() );
-  ATH_MSG_DEBUG( "Initialize done !" );
+  ATH_CHECK(m_regionSelector.retrieve());
+  ATH_CHECK(m_clusterContainerKey.initialize());
+  ATH_CHECK(m_roiCollectionKey.initialize());
   return StatusCode::SUCCESS;
 }
 
-
 StatusCode T2CaloEgammaReFastAlgo::execute(const EventContext& context) const
 {
-  // Time total T2CaloEgamma execution time.
-//  if ( m_timersvc ) m_timer[0]->start();
-/*
-  m_conversionError=0;
-  m_algorithmError=0;
-  m_monitoredCluster=0;
-*/
-
-#ifndef NDEBUG
-  if ( (*m_log).level() <= MSG::DEBUG ) 
-  (*m_log) << MSG::INFO << "in execute()" << endmsg;
-#endif
-
-  SG::WriteHandle<xAOD::TrigEMClusterContainer> trigEmClusterCollection = SG::WriteHandle<xAOD::TrigEMClusterContainer>( m_clusterContainerKey, context );
-  ATH_CHECK( trigEmClusterCollection.record( CxxUtils::make_unique<xAOD::TrigEMClusterContainer>(), CxxUtils::make_unique<xAOD::TrigEMClusterAuxContainer>() ) );
-
-  auto roisHandle = SG::makeHandle( m_roiCollectionKey );
-  const TrigRoiDescriptorCollection* roiCollection = roisHandle.cptr();
-  //  ATH_CHECK(m_roiCollectionKey.isValid());
-  if ( !roiCollection ) {
-	(*m_log) << MSG::INFO << "no RoI" << endmsg;
-  	return StatusCode::SUCCESS;
-  }
-
-
-  const TrigRoiDescriptor* roiDescriptor = 0;
-  //TrigRoiDescriptor* roiDescriptor = 0;
-
-  // datahandle 
-  TrigRoiDescriptorCollection::const_iterator  roiCollectionIt  = roiCollection->begin(); 
-  for(; roiCollectionIt != roiCollection->end(); ++roiCollectionIt){
-	roiDescriptor = *roiCollectionIt;
-
-  float etaL1, phiL1;
-  // End LVL1 part
-  double etamin, etamax, phimin, phimax;
-  if ( (m_l1eta<-9.9)&&(m_l1phi<-9.9)){
-    etamin = std::max( -2.5, roiDescriptor->eta() - m_etaWidth );
-    etamax = std::min(  2.5, roiDescriptor->eta() + m_etaWidth );
-
-    phimin = HLT::wrap_phi( roiDescriptor->phi() - m_phiWidth );
-    phimax = HLT::wrap_phi( roiDescriptor->phi() + m_phiWidth );
-
-    etaL1 = roiDescriptor->eta();
-    phiL1 = roiDescriptor->phi();
-  } 
-  else {
-    etamin = std::max( -2.5, m_l1eta-m_etaWidth );
-    etamax = std::min(  2.5, m_l1eta+m_etaWidth );
-
-    phimin = HLT::wrap_phi( m_l1phi-m_phiWidth );
-    phimax = HLT::wrap_phi( m_l1phi+m_phiWidth );
-
-    etaL1 =  m_l1eta;
-    phiL1 =  m_l1phi;
+  SG::WriteHandle<xAOD::TrigEMClusterContainer> trigEmClusterCollection(m_clusterContainerKey, context);
+  ATH_CHECK( trigEmClusterCollection.record(std::make_unique<xAOD::TrigEMClusterContainer>(),
+                                            std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
+
+  auto roisHandle = SG::makeHandle(m_roiCollectionKey, context);
+  if (!roisHandle.isValid()) {
+    ATH_MSG_DEBUG("no RoI");
+    return StatusCode::SUCCESS;
   }
 
-  /// if we do ...
-  TrigRoiDescriptor newroi( roiDescriptor->eta(), etamin, etamax, 
-			    roiDescriptor->phi(), phimin, phimax);
+  trigEmClusterCollection->reserve(roisHandle->size());
+  for (const TrigRoiDescriptor* roiDescriptor : *roisHandle) {
+    float etaL1, phiL1;
+    double etamin, etamax, phimin, phimax;
+    if ((m_l1eta < -9.9) && (m_l1phi < -9.9)) {
+      etamin = std::max(-2.5, roiDescriptor->eta() - m_etaWidth);
+      etamax = std::min(2.5, roiDescriptor->eta() + m_etaWidth);
 
-#ifndef NDEBUG
+      phimin = HLT::wrap_phi(roiDescriptor->phi() - m_phiWidth);
+      phimax = HLT::wrap_phi(roiDescriptor->phi() + m_phiWidth);
 
-  if ( (*m_log).level() <= MSG::DEBUG ) {
-  (*m_log) << MSG::DEBUG  << " etamin = "<< etamin << endmsg;
-  (*m_log) << MSG::DEBUG  << " etamax = "<< etamax << endmsg;
-  (*m_log) << MSG::DEBUG  << " phimin = "<< phimin << endmsg;
-  (*m_log) << MSG::DEBUG  << " phimax = "<< phimax << endmsg;
-  }
-#endif
-
-
-#ifndef NDEBUG
-  if ( (*m_log).level() <= MSG::DEBUG ) 
-  (*m_log) << MSG::DEBUG  << " Making TrigEMCluster "<< endmsg;
-#endif
+      etaL1 = roiDescriptor->eta();
+      phiL1 = roiDescriptor->phi();
+    }
+    else {
+      etamin = std::max(-2.5, m_l1eta - m_etaWidth);
+      etamax = std::min(2.5, m_l1eta + m_etaWidth);
 
+      phimin = HLT::wrap_phi(m_l1phi - m_phiWidth);
+      phimax = HLT::wrap_phi(m_l1phi + m_phiWidth);
 
-  xAOD::TrigEMCluster* ptrigEmCluster = new xAOD::TrigEMCluster();
-  trigEmClusterCollection->push_back( ptrigEmCluster );
-  ptrigEmCluster->setEnergy(0.0);
-  ptrigEmCluster->setEt(0.0);
-  ptrigEmCluster->setRawEnergy(0.0);
-  ptrigEmCluster->setRawEt(0.0);
-  ptrigEmCluster->setE277(0);
-  ptrigEmCluster->setEmaxs1(0);
-  ptrigEmCluster->setE2tsts1(0);
-  ptrigEmCluster->setEhad1(-999);
-  ptrigEmCluster->setWeta2(-999);
-  ptrigEmCluster->setFracs1(-999);
-  ptrigEmCluster->setE233(-999);
-  ptrigEmCluster->setE237(-999);
-  ptrigEmCluster->setWstot(-999);
-  ptrigEmCluster->setEta1(-999);
-  ptrigEmCluster->setNCells(0);
-  ptrigEmCluster->setRawEta(-999);
-  ptrigEmCluster->setRawPhi(-999);
-  //m_monitoredCluster = ptrigEmCluster;
-  (*m_log) << MSG::INFO  << " Values of Cluster defined default: "<< endmsg;
-  // It is a good idea to clear the energies
-  for(int i=0;i<CaloSampling::CaloSample::MINIFCAL0;i++){
-    ptrigEmCluster->setEnergy((CaloSampling::CaloSample )i,0.);
-    ptrigEmCluster->setRawEnergy((CaloSampling::CaloSample )i,0.);
-  }
-  // Initial cluster position is the LVL1 position
-  ptrigEmCluster->setEta(etaL1);
-  ptrigEmCluster->setPhi(phiL1);
-  (*m_log) << MSG::INFO  << " Initial cluster position is the LVL1 position : DONE  "<< endmsg;
+      etaL1 = m_l1eta;
+      phiL1 = m_l1phi;
+    }
 
-  // Add RoI word to TrigEMCluster
-  // Dangerous !!!! we need to define a *new* roiDescriptor if we want to 
-  // change the size, so we should be careful about *which* roi descriptor
-  // we save, and *which* "roiWord" (if any) we store if we need to use it 
-  // again
-  (*ptrigEmCluster).setRoIword(roiDescriptor->roiWord());
-  const CaloDetDescrElement * caloDDE = 0;
+    TrigRoiDescriptor newroi(roiDescriptor->eta(), etamin, etamax,
+                             roiDescriptor->phi(), phimin, phimax);
 
-  // zeros the container per RoI
-  //m_Container = 0;
-  (*m_log) << MSG::INFO  << " m_emAlgTools.begin():  "<< endmsg;
+    ATH_MSG_DEBUG(" etamin = " << etamin << " etamax = " << etamax <<
+                  " phimin = " << phimin << " phimax = " << phimax);
 
-  
-  ToolHandleArray<IReAlgToolCalo>::const_iterator it = m_emAlgTools.begin();
-////  if ( m_timersvc ) m_timer[1]->start();
-  uint32_t error = 0;
-  for (; it < m_emAlgTools.end(); it++)  {
-    if ((*it)->execute(*ptrigEmCluster, newroi, caloDDE, context ).isFailure() ) {
-      (*m_log) << MSG::WARNING << "T2Calo AlgToolEgamma returned Failure" << endmsg;
-      return StatusCode::FAILURE;
-    }
-//    uint32_t in_error = (*it)->report_error();
-//    if ( 0x0FFFFFFF & in_error ) m_conversionError++;
-//    if ( 0xF0000000 & in_error ) m_algorithmError++;
-//    error|=in_error;
-  }
-//  // support to new monitoring
-/*
-  m_rCore=0;
-  m_eRatio=0;
-  m_stripRatio=0;
-  m_MonEta=ptrigEmCluster->eta();
-  m_MonPhi=ptrigEmCluster->phi();
-  if ( ptrigEmCluster->e277()!=0 )
-	m_rCore =  ptrigEmCluster->e237()/ptrigEmCluster->e277();
-  if ( ptrigEmCluster->emaxs1()+ptrigEmCluster->e2tsts1() !=0){
-	m_eRatio  =  ptrigEmCluster->emaxs1()-ptrigEmCluster->e2tsts1();
-	m_eRatio /=  ptrigEmCluster->emaxs1()+ptrigEmCluster->e2tsts1();
-  }
-*/
-  (*m_log) << MSG::INFO  << " set m_eRatio : DONE  "<< endmsg; 
-  // Cluster quality is a collection of possible errors
-  // No error quality=0
-  ptrigEmCluster->setClusterQuality(error);
-//  if ( m_timersvc ) m_timer[1]->stop();
-  (*m_log) << MSG::INFO  << " ptrigEmCluster->setClusterQuality(error) : DONE  "<< endmsg;
-  if ( ( error & 0xC0000000 ) || ptrigEmCluster->phi() < -M_PI || ptrigEmCluster->phi() > +M_PI 
-   || fabsf ( ptrigEmCluster->eta() ) > 10.0 ) {
-    // Clustering failed. Transmit ahead L1
-    ptrigEmCluster->setEta(etaL1);
-    ptrigEmCluster->setPhi(phiL1);
+    xAOD::TrigEMCluster* ptrigEmCluster = new xAOD::TrigEMCluster();
+    trigEmClusterCollection->push_back(ptrigEmCluster);
     ptrigEmCluster->setEnergy(0.0);
     ptrigEmCluster->setEt(0.0);
-  }
-  (*m_log) << MSG::INFO  << " ptrigEmCluster->setxxx : DONE  "<< endmsg;
-/*
-  if ( caloDDE != 0 ){
-    if ( caloDDE->is_lar_em_barrel() ){
-      for( ToolHandleArray<IEgammaCalibration>::const_iterator
-  		  ical=m_calibsBarrel.begin();
-  		  ical != m_calibsBarrel.end(); ++ical )
-  	  (*ical)->makeCorrection(ptrigEmCluster,caloDDE);
-    }else{
-    for( ToolHandleArray<IEgammaCalibration>::const_iterator
-  		ical=m_calibsEndcap.begin();
-  		ical != m_calibsEndcap.end(); ++ical )
-  	(*ical)->makeCorrection(ptrigEmCluster,caloDDE);
+    ptrigEmCluster->setRawEnergy(0.0);
+    ptrigEmCluster->setRawEt(0.0);
+    ptrigEmCluster->setE277(0);
+    ptrigEmCluster->setEmaxs1(0);
+    ptrigEmCluster->setE2tsts1(0);
+    ptrigEmCluster->setEhad1(-999);
+    ptrigEmCluster->setWeta2(-999);
+    ptrigEmCluster->setFracs1(-999);
+    ptrigEmCluster->setE233(-999);
+    ptrigEmCluster->setE237(-999);
+    ptrigEmCluster->setWstot(-999);
+    ptrigEmCluster->setEta1(-999);
+    ptrigEmCluster->setNCells(0);
+    ptrigEmCluster->setRawEta(-999);
+    ptrigEmCluster->setRawPhi(-999);
+
+    // It is a good idea to clear the energies
+    for (int i = 0; i < CaloSampling::CaloSample::MINIFCAL0; i++) {
+      ptrigEmCluster->setEnergy((CaloSampling::CaloSample)i, 0.);
+      ptrigEmCluster->setRawEnergy((CaloSampling::CaloSample)i, 0.);
     }
-  }
-*/
-  (*m_log) << MSG::INFO  << " IEgammaCalibration : DONE  "<< endmsg;
-  float calZ0 = 0;
-
-
-  // Print out Cluster produced  
-  if ( (*m_log).level() <= MSG::DEBUG ) {
-    (*m_log) << MSG::DEBUG  << " Values of Cluster produced: "<< endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: emEnergy = "<< (*ptrigEmCluster).energy() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: hadEnergy = "<< (*ptrigEmCluster).ehad1() << endmsg;
-
-    //if ( ptrigEmCluster->e277()!=0. )
-      (*m_log) << MSG::DEBUG  << " REGTEST: e237= "
-	             << (*ptrigEmCluster).e237()  << endmsg;
-     (*m_log) << MSG::DEBUG  << " REGTEST: e277= " << (*ptrigEmCluster).e277() << endmsg;
-    //else (*m_log) << MSG::DEBUG  << " REGTEST: e277 equals to 0" << endmsg;
-    
-/*
-    (*m_log) << MSG::DEBUG  << " REGTEST: energyRatio = "
-	           << (((*ptrigEmCluster).emaxs1()-(*ptrigEmCluster).e2tsts1())/
-		            ((*ptrigEmCluster).emaxs1()+(*ptrigEmCluster).e2tsts1()))
-	           << endmsg;
-*/
-
-    (*m_log) << MSG::DEBUG  << " REGTEST: clusterWidth = " << (*ptrigEmCluster).weta2() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: frac73 = " << (*ptrigEmCluster).fracs1() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: e233 = " << (*ptrigEmCluster).e233() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: wstot = " << (*ptrigEmCluster).wstot() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: eta = "<< (*ptrigEmCluster).eta() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: phi = "<< (*ptrigEmCluster).phi() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: Eta1 = "<< (*ptrigEmCluster).eta1() << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: calZ0 = "<< calZ0 << endmsg;
-    (*m_log) << MSG::DEBUG  << " REGTEST: quality = "<< (*ptrigEmCluster).clusterQuality() << endmsg;
-    (*m_log) << MSG::DEBUG  << std::hex << " REGTEST: roiWord = 0x" << (*ptrigEmCluster).RoIword() << std::dec <<endmsg;
-  }
-  std::string key = "";
-  //hltStatus = recordAndAttachFeature(outputTE, ptrigEmCluster, key, m_trigEmClusterKey);
-
-
-#ifdef DONTDO
-  // Create a new RoiDescriptor with updated eta and phi.
-  // Note that the steering will propagate l1Id and roiId automatically
-  // so no need to set them. (is this true?)
-  TrigRoiDescriptor* newRoiDescriptor = 
-      new TrigRoiDescriptor(roiDescriptor->l1Id(), roiDescriptor->roiId(),
-			    ptrigEmCluster->eta(), ptrigEmCluster->eta()-0.2, 
-			    ptrigEmCluster->eta()+0.2,
-			    ptrigEmCluster->phi(),
-			    HLT::wrap_phi(ptrigEmCluster->phi()-0.2), 
-			    HLT::wrap_phi(ptrigEmCluster->phi()+0.2) );  
-  (*m_log) << MSG::INFO  << "  HLT::wrap_phi(ptrigEmCluster->phi()-0.2) : DONE  "<< endmsg;
-  
-  //  hltStatus = attachFeature(outputTE,newRoiDescriptor,"TrigT2CaloEgamma");
-  (*m_log) << MSG::INFO  << " hltStatus = attachFeature : DONE  "<< endmsg;
-  if ( hltStatus != HLT::OK ) {
-     (*m_log) << MSG::ERROR << "Write of update TrigRoiDescriptor into outputTE failed"
-	   << endmsg;
-//     if ( m_timersvc ) m_timer[0]->stop();
-     return hltStatus;
-  }
-
-#endif
-
+    // Initial cluster position is the LVL1 position
+    ptrigEmCluster->setEta(etaL1);
+    ptrigEmCluster->setPhi(phiL1);
 
+    // Add RoI word to TrigEMCluster
+    // Dangerous !!!! we need to define a *new* roiDescriptor if we want to
+    // change the size, so we should be careful about *which* roi descriptor
+    // we save, and *which* "roiWord" (if any) we store if we need to use it
+    // again
+    ptrigEmCluster->setRoIword(roiDescriptor->roiWord());
+    const CaloDetDescrElement* caloDDE = nullptr;
+
+    uint32_t error = 0;
+    for (const auto& tool : m_emAlgTools) {
+      ATH_CHECK( tool->execute(*ptrigEmCluster, newroi, caloDDE, context) );
+    }
+    //  // support to new monitoring
+    /*
+      m_rCore=0;
+      m_eRatio=0;
+      m_stripRatio=0;
+      m_MonEta=ptrigEmCluster->eta();
+      m_MonPhi=ptrigEmCluster->phi();
+      if ( ptrigEmCluster->e277()!=0 )
+            m_rCore =  ptrigEmCluster->e237()/ptrigEmCluster->e277();
+      if ( ptrigEmCluster->emaxs1()+ptrigEmCluster->e2tsts1() !=0){
+            m_eRatio  =  ptrigEmCluster->emaxs1()-ptrigEmCluster->e2tsts1();
+            m_eRatio /=  ptrigEmCluster->emaxs1()+ptrigEmCluster->e2tsts1();
+      }
+    */
+    // Cluster quality is a collection of possible errors
+    // No error quality=0
+    ptrigEmCluster->setClusterQuality(error);
+    if ((error & 0xC0000000) || ptrigEmCluster->phi() < -M_PI || ptrigEmCluster->phi() > +M_PI ||
+        fabsf(ptrigEmCluster->eta()) > 10.0) {
+      // Clustering failed. Transmit ahead L1
+      ptrigEmCluster->setEta(etaL1);
+      ptrigEmCluster->setPhi(phiL1);
+      ptrigEmCluster->setEnergy(0.0);
+      ptrigEmCluster->setEt(0.0);
+    }
+    /*
+      if ( caloDDE != 0 ){
+        if ( caloDDE->is_lar_em_barrel() ){
+          for( ToolHandleArray<IEgammaCalibration>::const_iterator
+                      ical=m_calibsBarrel.begin();
+                      ical != m_calibsBarrel.end(); ++ical )
+              (*ical)->makeCorrection(ptrigEmCluster,caloDDE);
+        }else{
+        for( ToolHandleArray<IEgammaCalibration>::const_iterator
+                    ical=m_calibsEndcap.begin();
+                    ical != m_calibsEndcap.end(); ++ical )
+            (*ical)->makeCorrection(ptrigEmCluster,caloDDE);
+        }
+      }
+    */
+    float calZ0 = 0;
+
+    // Print out Cluster produced
+    if (msgLvl(MSG::DEBUG)) {
+      ATH_MSG_DEBUG(" Values of Cluster produced: ");
+      ATH_MSG_DEBUG(" REGTEST: emEnergy = " << ptrigEmCluster->energy());
+      ATH_MSG_DEBUG(" REGTEST: hadEnergy = " << ptrigEmCluster->ehad1());
+      ATH_MSG_DEBUG(" REGTEST: e237= " << ptrigEmCluster->e237());
+      ATH_MSG_DEBUG(" REGTEST: e277= " << ptrigEmCluster->e277());
+      ATH_MSG_DEBUG(" REGTEST: clusterWidth = " << ptrigEmCluster->weta2());
+      ATH_MSG_DEBUG(" REGTEST: frac73 = " << ptrigEmCluster->fracs1());
+      ATH_MSG_DEBUG(" REGTEST: e233 = " << ptrigEmCluster->e233());
+      ATH_MSG_DEBUG(" REGTEST: wstot = " << ptrigEmCluster->wstot());
+      ATH_MSG_DEBUG(" REGTEST: eta = " << ptrigEmCluster->eta());
+      ATH_MSG_DEBUG(" REGTEST: phi = " << ptrigEmCluster->phi());
+      ATH_MSG_DEBUG(" REGTEST: Eta1 = " << ptrigEmCluster->eta1());
+      ATH_MSG_DEBUG(" REGTEST: calZ0 = " << calZ0);
+      ATH_MSG_DEBUG(" REGTEST: quality = " << ptrigEmCluster->clusterQuality());
+      ATH_MSG_DEBUG(std::hex << " REGTEST: roiWord = 0x" << ptrigEmCluster->RoIword()
+                             << std::dec);
+    }
 
   } // end of roiCollection iterator
-  
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode T2CaloEgammaReFastAlgo::finalize(){
-
-#ifndef NDEBUG
-  if ( (*m_log).level() <= MSG::DEBUG ) 
-    (*m_log) << MSG::INFO << "in finalize()" << endmsg;
-#endif
 
   return StatusCode::SUCCESS;
 }
-
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.h b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.h
index e8eaf1b5b194d5f9a663ec25bb09d6fe7d440145..34ac06cac561962677cfd485725778463bf33488 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaReFastAlgo.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -9,112 +9,71 @@
 
  AUTHOR:   Denis Oliveira Damazio
 
- PURPOSE:  New Algorithm to play with Future Framework
-	     in reentrand mode
+ PURPOSE:  Reentrant algorithm for egamma reconstruction
+
  **/
 
 #ifndef TRIGT2CALOEGAMMA_T2CALOEGAMMAREFASTALGO_H
 #define TRIGT2CALOEGAMMA_T2CALOEGAMMAREFASTALGO_H
 
-#include <string>
-#include "AthenaBaseComps/AthReentrantAlgorithm.h"
-#include "egammaInterfaces/Iegammaqweta2c.h"
-#include "xAODTrigCalo/TrigEMCluster.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
 
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "IRegionSelector/IRegSelSvc.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "StoreGate/WriteHandleKey.h"
-#include "xAODTrigCalo/TrigEMClusterContainer.h"
 #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
-#include "IRegionSelector/IRegSelSvc.h"
+#include "TrigT2CaloCalibration/IEgammaCalibration.h"
+#include "xAODTrigCalo/TrigEMCluster.h"
+#include "xAODTrigCalo/TrigEMClusterContainer.h"
+#include "xAODTrigCalo/TrigEMClusterAuxContainer.h"
+
+#include <string>
 
 class IReAlgToolCalo;
-class IEgammaCalibration;
-//class ITrigDataAccess;
-class MsgStream;
 
 /** Main LVL2 Algorithm. Processes LVL1 information, call FEX
     IReAlgToolCalos and produces the TrigEMCluster output. */
-class T2CaloEgammaReFastAlgo: public AthReentrantAlgorithm {
-
-
-  public:
-    /** Constructor */
-    T2CaloEgammaReFastAlgo(const std::string & name, ISvcLocator* pSvcLocator);
-    /** Destructor */
-    ~T2CaloEgammaReFastAlgo();
-
-    /** main execute will call FEX IAlgToolCalo::execute() to process RoI.
-	called by the Steering per EMRoI. */
-    StatusCode execute(const EventContext& context ) const;
-    /** initialize. Called by the Steering. */
-    StatusCode initialize();
-    /** hltFinalize. Called by the Steering. */
-    StatusCode finalize();
-    /** calculate zo mass */
-    //float calculateZ0(const float etaLayer1, const float etaLayer2);
-
-  private:
-    /** log output cached to avoid fetching MsgStream once per RoI */
-    MsgStream* m_log;
-    /** To support new monitoring. Values must be copied to
-	this monitored Cluster for each RoI. */
-    //const xAOD::TrigEMCluster* m_monitoredCluster;
-    /** To monitor rCore */
-    //float m_rCore;
-    /** To monitor eRatio */
-    //float m_eRatio;
-    /** To monitor r strips */
-    //float m_stripRatio;
-    /** Forced LVL1 eta */
-    float m_l1eta;
-    /** Forced LVL1 phi */
-    float m_l1phi;
-    /** counter for conversion error */
-    //unsigned int m_conversionError;
-    /** counter for algorithm error */
-    //unsigned int m_algorithmError;
-    /** Monitored Eta and Phi */
-    //float m_MonEta, m_MonPhi;
-
-    //int m_index;
-    /** Calibration tools for the Barrel*/
-    ToolHandleArray<IEgammaCalibration> m_calibsBarrel;
-    /** Calibration tools for the Endcap*/
-    ToolHandleArray<IEgammaCalibration> m_calibsEndcap;
-
-    // Properties:
-    std::string m_trigEmClusterKey;
-    /** Should or not storeCells into a cell container attached to output RoI */
-    bool m_storeCells;
-    /** container pointer */
-    //CaloCellContainer* m_Container;
-    /** Correction tool for the cluster width */
-    //ToolHandle<Iegammaqweta2c> m_egammaqweta2c;
-
-    /* Variables to calculate Z0 position */
-    //std::vector<float> m_rhoFirstLayer, m_rhoMiddleLayer, m_zFirstLayer, m_zMiddleLayer;
-    std::vector<float> m_rhoEta, m_zEta;/* Variables to calculate Z0 position */
-
-    // variables that were in T2CaloBase
-    /** Eta width of Region of Interest. Should be 0.2 for EGamma. */
-    double            m_etaWidth;
-    /** Phi width of Region of Interest. Should be 0.2 for EGamma. */
-    double            m_phiWidth;
-    ToolHandleArray<IReAlgToolCalo>   m_emAlgTools;
-    //ToolHandle<ITrigDataAccess>     m_data;
-    SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiCollectionKey;
-    SG::WriteHandleKey<xAOD::TrigEMClusterContainer> m_clusterContainerKey;
-    SG::ReadHandle<TrigRoiDescriptorCollection> m_roiCollection;
-    SG::WriteHandle<xAOD::TrigEMClusterContainer> m_trigEmClusterCollection;
-    SG::WriteHandle<xAOD::TrigEMClusterAuxContainer> m_trigEmClusterAuxCollection;
-    ServiceHandle<IRegSelSvc>     m_regionSelector; 
-
-
-
-    //    SG::WriteHandleKey<TrigEMClusterContainer> m_clusterContainerKey;
+class T2CaloEgammaReFastAlgo : public AthReentrantAlgorithm {
+
+public:
+  T2CaloEgammaReFastAlgo(const std::string& name, ISvcLocator* pSvcLocator);
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& context) const override;
+  /** calculate zo mass */
+  // float calculateZ0(const float etaLayer1, const float etaLayer2);
+
+private:
+  ServiceHandle<IRegSelSvc> m_regionSelector;
+
+  // Properties:
+  Gaudi::Property<float> m_l1eta{this, "L1ForceEta", -10.0, "Forced LVL1 eta"};
+  Gaudi::Property<float> m_l1phi{this, "L1ForcePhi", -10.0, "Forced LVL1 phi"};
+  Gaudi::Property<double> m_etaWidth{this, "EtaWidth", 0.1, "Eta Width of the Region of Interest"};
+  Gaudi::Property<double> m_phiWidth{this, "PhiWidth", 0.1, "Phi Width of the Region of Interest"};
+
+  Gaudi::Property<bool> m_storeCells{this, "StoreCells", false,
+                                     "store cells in container attached to RoI"};
+
+  ToolHandleArray<IEgammaCalibration> m_calibsBarrel{
+      this, "CalibListBarrel", {}, "list of calib tools for the Barrel clusters"};
+  ToolHandleArray<IEgammaCalibration> m_calibsEndcap{
+      this, "CalibListEndcap", {}, "list of calib tools for the EndCap clusters"};
+
+  Gaudi::Property<std::vector<float>> m_rhoEta{
+      this, "RhoEta", {}, "Variables to calculate Z0 position"};
+  Gaudi::Property<std::vector<float>> m_zEta{
+      this, "ZEta", {}, "Variables to calculate Z0 position"};
+
+  ToolHandleArray<IReAlgToolCalo> m_emAlgTools{
+      this, "IReAlgToolList", {}, "list of ReAlgToolCalos for feature extraction"};
 
+  SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiCollectionKey{
+    this, "RoIs", "OutputRoIs", "input RoIs"};
+  SG::WriteHandleKey<xAOD::TrigEMClusterContainer> m_clusterContainerKey{
+      this, "ClustersName", "CaloClusters", "Calo cluster container"};
 };
 
 #endif
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt
index 533b8282cf561e5270da54f1f8c3aed02a46c67f..7c4a73ed5677e0af1227f4cc5fd5ba5611d1f315 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt
@@ -9,7 +9,6 @@ atlas_subdir( TrigTauRec )
 atlas_depends_on_subdirs( PUBLIC
                           GaudiKernel
                           InnerDetector/InDetConditions/BeamSpotConditionsData
-                          InnerDetector/InDetConditions/InDetBeamSpotService
                           LumiBlock/LumiBlockComps
                           Reconstruction/tauRecTools
                           Trigger/TrigEvent/TrigParticle
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
index 6662b5b02e7c7e651f406d832989cb7d4dffe275..b2e3edd15e186414b5a901a834cb6bf60f714c42 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
+++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py
@@ -715,7 +715,11 @@ def getTauTrackFinder(applyZ0cut=False, maxDeltaZ0=2, noSelector = False, prefix
     
     if _name in cached_instances:
         return cached_instances[_name] 
-    
+
+    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+    from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+    pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+ 
     from tauRecTools.tauRecToolsConf import TauTrackFinder
     TauTrackFinder = TauTrackFinder(name = _name,
                                     MaxJetDrTau = 0.2,
@@ -725,6 +729,7 @@ def getTauTrackFinder(applyZ0cut=False, maxDeltaZ0=2, noSelector = False, prefix
                                     TrackToVertexTool         = getTrackToVertexTool(),
                                     maxDeltaZ0wrtLeadTrk = maxDeltaZ0, #in mm
                                     removeTracksOutsideZ0wrtLeadTrk = applyZ0cut,
+                                    ParticleCaloExtensionTool = pcExtensionTool,
                                     BypassSelector = noSelector,
                                     BypassExtrapolator = True
                                     )
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
index 8a07df35f3ad4678a8c7e07224747870ce518015..fd93b05efc9224f7126c394d58abe95e6e008989 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
+++ b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.cxx
@@ -52,8 +52,7 @@ TrigTauRecMergedMT::TrigTauRecMergedMT(const std::string& name,ISvcLocator* pSvc
   :AthAlgorithm(name, pSvcLocator),
    m_tools(this),
    m_endtools(this),
-   m_lumiBlockMuTool("LumiBlockMuTool/LumiBlockMuTool"),
-   m_beamSpotSvc("BeamCondSvc", name)
+   m_lumiBlockMuTool("LumiBlockMuTool/LumiBlockMuTool")
 {
   declareProperty("Tools", m_tools, "List of ITauToolBase tools" );
   declareProperty("EndTools", m_endtools, "List of End ITauToolBase tools" );
@@ -115,12 +114,7 @@ StatusCode TrigTauRecMergedMT::initialize()
   }
 
   // Retrieve beam conditions
-  if(m_beamSpotSvc.retrieve().isFailure()) {
-    ATH_MSG_WARNING("Unable to retrieve Beamspot service");
-  } 
-  else {
-    ATH_MSG_WARNING("Successfully retrieved Beamspot service");
-  }
+  CHECK(m_beamSpotKey.initialize());
 
   if ( not m_monTool.name().empty() ) {
     ATH_CHECK( m_monTool.retrieve() );
@@ -291,17 +285,18 @@ StatusCode TrigTauRecMergedMT::execute()
   theBeamspot.makePrivateStore();
   const xAOD::Vertex* ptrBeamspot = nullptr;
 
-  if(m_beamSpotSvc){
+  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
+  if(beamSpotHandle.isValid()){
 	
     // Alter the position of the vertex
-    theBeamspot.setPosition(m_beamSpotSvc->beamPos());
+    theBeamspot.setPosition(beamSpotHandle->beamPos());
 	
     beamspot_x=theBeamspot.x();
     beamspot_y=theBeamspot.y();
     beamspot_z=theBeamspot.z();
 
     // Create a AmgSymMatrix to alter the vertex covariance mat.
-    AmgSymMatrix(3) cov = m_beamSpotSvc->beamVtx().covariancePosition();
+    const auto& cov = beamSpotHandle->beamVtx().covariancePosition();
     theBeamspot.setCovariancePosition(cov);
 
     ptrBeamspot = &theBeamspot;
@@ -384,7 +379,7 @@ StatusCode TrigTauRecMergedMT::execute()
   m_tauEventData.setObject("TrackContainer", RoITrackParticleContainer);
   m_tauEventData.setObject("VxPrimaryCandidate", RoIVxContainer);
   if(m_lumiBlockMuTool) m_tauEventData.setObject("AvgInteractions", avg_mu);
-  if(m_beamSpotSvc) m_tauEventData.setObject("Beamspot", ptrBeamspot);
+  if(beamSpotHandle.isValid()) m_tauEventData.setObject("Beamspot", ptrBeamspot);
   if(m_beamType == ("cosmics")) m_tauEventData.setObject("IsCosmics?", true );
 
 
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
index 692cf7ae322287a2b9e7293eff09d610379321bc..fc836c494dd1c00c8a0add72a8d8edacd7cd6e7e 100755
--- a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
+++ b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMergedMT.h
@@ -36,7 +36,7 @@
 #include "tauRecTools/ITauToolBase.h"
 
 #include "LumiBlockComps/ILuminosityTool.h" 
-#include "InDetBeamSpotService/IBeamCondSvc.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
 
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 
@@ -93,8 +93,8 @@ class TrigTauRecMergedMT: public AthAlgorithm {
   /** Luminosity Tool */
   ToolHandle<ILumiBlockMuTool> m_lumiBlockMuTool;
 
-  /** Beam spot service */
-  ServiceHandle<IBeamCondSvc>  m_beamSpotSvc;
+  /** Beam spot Object */
+  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
 
   /** vector of Timers */
   std::vector<TrigTimer* > m_mytimers;
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx
index 7909da2527e71ad979297000184fe3d58b9ae106..3ba9f37a36cd30107595934620ee46f1a289b15a 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx
@@ -50,6 +50,9 @@ TrigEgammaAnalysisBaseTool( const std::string& myname )
     m_lumiTool("LuminosityTool/OnlLuminosityTool"),//online mu
     m_lumiBlockMuTool("LumiBlockMuTool/LumiBlockMuTool") //offline mu
 {
+    declareProperty("ElectronLHVLooseTool"      , m_electronLHVLooseTool        );
+    declareProperty("ElectronIsEMSelector", m_electronIsEMTool);
+    declareProperty("ElectronLikelihoodTool", m_electronLHTool);
     declareProperty("MatchTool",m_matchTool);
     declareProperty("EmulationTool",m_emulationTool);
     declareProperty("doEmulation", m_doEmulation=false)->declareUpdateHandler(&TrigEgammaAnalysisBaseTool::updateEmulation,this);
@@ -169,6 +172,14 @@ StatusCode TrigEgammaAnalysisBaseTool::initialize() {
     try {
         ATH_MSG_DEBUG("child Initialize " << name());
         sc = childInitialize();
+    	if ( (m_electronIsEMTool.retrieve()).isFailure() ){
+    	    ATH_MSG_ERROR( "Could not retrieve Selector Tool! Can't work");
+    	    return StatusCode::FAILURE;
+    	}
+    	if ( (m_electronLHTool.retrieve()).isFailure() ){
+    	    ATH_MSG_ERROR( "Could not retrieve Selector Tool! Can't work");
+    	    return StatusCode::FAILURE;
+    	}
     } catch(const ValidationException &e) {
         ATH_MSG_ERROR("Exception thrown: " << e.msg());
         return StatusCode::FAILURE;
@@ -234,14 +245,14 @@ StatusCode TrigEgammaAnalysisBaseTool::execute() {
     setAvgOnlineMu();
     setAvgOfflineMu();
     try {
-        ATH_MSG_DEBUG("Running execute() for " << name());
+        ATH_MSG_DEBUG("Running execute() "  << name());
         sc = childExecute();
     } catch(const ValidationException &e) {
-        ATH_MSG_ERROR("Exception thrown: " << e.msg() );
+        ATH_MSG_ERROR("Exception thrown: " << e.msg() << " by " << name() );
         return StatusCode::FAILURE;
     } catch(...) {
         sc.ignore();
-        ATH_MSG_WARNING("Unknown exception caught, while filling histograms");
+        ATH_MSG_WARNING("Unknown exception caught, while filling histograms " << name());
         return StatusCode::SUCCESS;
     }
     return sc;
@@ -256,10 +267,10 @@ StatusCode TrigEgammaAnalysisBaseTool::finalize() {
             ATH_MSG_DEBUG("child Finalize " << tool->name());
             sc = tool->childFinalize();
         } catch(const ValidationException &e) {
-            ATH_MSG_ERROR("Exception thrown: " << e.msg());
+            ATH_MSG_ERROR("Exception thrown: " << e.msg() << " for " << tool->name());
             return StatusCode::FAILURE;
         } catch(...) {
-            ATH_MSG_ERROR("Unknown exception caught, while initializing");
+            ATH_MSG_ERROR("Unknown exception caught, while finalizing " << tool->name() );
             return StatusCode::FAILURE;
         }
     
@@ -417,14 +428,15 @@ void TrigEgammaAnalysisBaseTool::parseTriggerName(const std::string trigger, std
             pidname = defaultPid;
             etcut=true;
         }
-        else {
-	    if (type == "electron" && boost::contains(trigger, "ion")){
-		    ATH_MSG_DEBUG("Heavy ion electron chain being used. Using LHMediumHI tune for offline.");
-		        pidname="LHMediumHI";
-	    } else {
-		pidname = getProbePid(strs.at(1));
-	    }
-	}
+	// HI is not working in master any more. So commenting out untill fixed
+        // else {
+	//     if (type == "electron" && boost::contains(trigger, "ion")){
+	// 	    ATH_MSG_DEBUG("Heavy ion electron chain being used. Using LHMediumHI tune for offline.");
+	// 	        pidname="LHMediumHI";
+	//     } else {
+	// 	pidname = getProbePid(strs.at(1));
+	//     }
+	// }
 
         //Get the L1 information
 
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx
index de83d7d794ca60614295a02ab112a9a8c97cba34..c26e62ee4b79198445c6d63689d0d84b227ee6a7 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx
@@ -10,6 +10,7 @@
 #include "xAODTrigger/TrigPassBitsContainer.h"
 #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
 #include "TrigDecisionTool/TrigDecisionTool.h"
+#include "TrigEgammaAnalysisTools/ValidationException.h"
 
 #include "string"
 #include <algorithm>
@@ -344,6 +345,20 @@ void TrigEgammaDistTool::fillShowerShapes(const std::string &dir,const xAOD::Ega
             hist1("topoetcone20_rel")->Fill(getIsolation_topoetcone20(eg)/eg->pt());
             hist1("topoetcone40_shift_rel")->Fill((getIsolation_topoetcone40(eg)-2450)/eg->pt());
         }
+	// Fill the LH discriminant for LH tight medium and loose -> Not working *YET* in master. I'll keep it here so I can uncomment when fixed
+	// ATH_MSG_DEBUG("Computing the lh discriminant!");
+	// auto ctx = Gaudi::Hive::currentContext() ;
+	// try {
+	//     hist1("lhtight_discriminant")->Fill(m_electronLHTool[0]->calculate(ctx, eg));
+	//     hist1("lhmedium_discriminant")->Fill(m_electronLHTool[1]->calculate(ctx, eg));
+	//     hist1("lhloose_discriminant")->Fill(m_electronLHTool[2]->calculate(ctx, eg));
+	// } catch(const ValidationException &e) {
+	//     ATH_MSG_WARNING("Exception thrown: " << e.msg() << " not computing lh discriminants!");
+	// } catch(...) {
+	//     ATH_MSG_WARNING("Unknown exception caught, while computing lh discriminants!. Ignoring");
+	// }
+
+
         
     }
 }
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx
index bf313f2bde985292a10927d26d04d19ff8279c8c..98545bb95a2c48206026f56e37abf7dc267dd15e 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx
@@ -271,7 +271,10 @@ bool TrigEgammaEventSelection::EventSelectionFakes(){
       // Must be higher than 4 GeV
       if( (getEt(elProbe)) < 4*Gaudi::Units::GeV)  continue;
 
-      if(!TrigEgammaNavTPBaseTool::ApplyElectronPid(elProbe,"LHMedium")) continue;
+      if(!TrigEgammaNavTPBaseTool::ApplyElectronPid(elProbe,"LHMedium")) {
+	  ATH_MSG_DEBUG("Probe deas *not* pass LHMedium. Skipping...");
+	  continue;
+      }
 
       //Must be an easy way with IParticle
       TLorentzVector el1;
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx
index b071f53faa5365e5105c9582e00554a7d1e85d68..fc7413f82c6ada710db2204b36cf89ed4db90112 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx
@@ -131,6 +131,7 @@ StatusCode TrigEgammaNavAnalysisTool::childExecute(){
             tool->setEmulation(getEmulation());
             tool->setPVertex(getNPVtx(), getNGoodVertex());
             tool->setAvgMu(getAvgOnlineMu(),getAvgOfflineMu());
+            ATH_MSG_DEBUG("TE Tool...");
             if(tool->toolExecute(m_dir+"/Expert",info,m_objTEList).isFailure())
                 ATH_MSG_DEBUG("TE Tool Fails");// Requires offline match
         }
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx
index a37b23549fdb2ee83dd7bde904e32cf8e705082c..8517eef9349fe41f3f0e7a8a2808e5b23e81285f 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx
@@ -33,8 +33,6 @@ TrigEgammaNavBaseTool( const std::string& myname )
     m_dir(myname)
 {
   declareProperty("Analysis",m_anatype="Analysis");
-  declareProperty("ElectronIsEMSelector"      , m_electronIsEMTool            );
-  declareProperty("ElectronLikelihoodTool"    , m_electronLHTool              );
   declareProperty("TriggerList"               , m_trigInputList               );
   declareProperty("PhotonPid"                 , m_photonPid = "Tight"         );
   declareProperty("doUnconverted"             , m_doUnconverted=false         );
@@ -44,7 +42,6 @@ TrigEgammaNavBaseTool( const std::string& myname )
   declareProperty("ForcePidSelection"         , m_forcePidSelection=true      );
   declareProperty("ForceEtThreshold"          , m_forceEtThr=true             ); 
   declareProperty("ForceVetoVeryLoose"        , m_forceVetoVeryLoose=false    ); 
-  declareProperty("ElectronLHVLooseTool"      , m_electronLHVLooseTool        );
 
   m_offElectrons=nullptr;
   m_offPhotons=nullptr;
@@ -79,14 +76,6 @@ TrigEgammaNavBaseTool::childInitialize() {
         ATH_MSG_ERROR( "Could not retrieve Selector Tool! Can't work");
         return StatusCode::FAILURE;
     }
-    if ( (m_electronLHTool.retrieve()).isFailure() ){
-        ATH_MSG_ERROR( "Could not retrieve Selector Tool! Can't work");
-        return StatusCode::FAILURE;
-    }
-    if ( (m_electronLHVLooseTool.retrieve()).isFailure() ){
-      ATH_MSG_ERROR( "Could not retrieve VeryLoose LH Selector Tool! Can't work");
-      return StatusCode::FAILURE;
-    }
 
     return StatusCode::SUCCESS;
 }
@@ -136,7 +125,7 @@ bool TrigEgammaNavBaseTool::EventWiseSelection( ){
         if(ApplyElectronPid(eg,"LHLoose")) hist1(m_anatype+"_electrons")->AddBinContent(4);
         if(ApplyElectronPid(eg,"LHMedium")) hist1(m_anatype+"_electrons")->AddBinContent(5);
         if(ApplyElectronPid(eg,"LHTight")) hist1(m_anatype+"_electrons")->AddBinContent(6); 
-        if(ApplyElectronPid(eg,"LHMediumHI")) hist1(m_anatype+"_electrons")->AddBinContent(7); 
+        // if(ApplyElectronPid(eg,"LHMediumHI")) hist1(m_anatype+"_electrons")->AddBinContent(7); 
     }
    
     //Calculate number of vertex 
@@ -159,38 +148,43 @@ StatusCode TrigEgammaNavBaseTool::executeNavigation( const TrigInfo info ){
 }
 
 bool TrigEgammaNavBaseTool::ApplyElectronPid(const xAOD::Electron *eg, const std::string pidname){
-    
-    ATH_MSG_DEBUG("Applying Electron PID with pidname =  " << pidname);
-    if (pidname == "Tight"){
-        bool accept = (bool) m_electronIsEMTool[0]->accept(eg);
-        return static_cast<bool>(accept);
-    }
-    else if (pidname == "Medium"){
-        bool accept = (bool) m_electronIsEMTool[1]->accept(eg);
-        return static_cast<bool>(accept);
-    }
-    else if (pidname == "Loose"){
-        bool accept = (bool) m_electronIsEMTool[2]->accept(eg);
-        return static_cast<bool>(accept);
-    }
-    else if (pidname == "LHTight"){
-        bool accept = (bool) m_electronLHTool[0]->accept(eg);
-        return static_cast<bool>(accept);
-    }
-    else if (pidname == "LHMedium"){
-        bool accept = (bool) m_electronLHTool[1]->accept(eg);
-        return static_cast<bool>(accept);
-    }
-    else if (pidname == "LHLoose"){
-        bool accept = (bool) m_electronLHTool[2]->accept(eg);
-        return static_cast<bool>(accept);
-    }
-    else if (pidname == "LHMediumHI"){
-        bool accept = (bool) m_electronLHTool[3]->accept(eg);
-        return static_cast<bool>(accept);
+    try{
+
+	ATH_MSG_DEBUG("Applying Electron PID with pidname =  " << pidname);
+	bool accept=false;
+	if (pidname == "Tight"){
+	    accept = (bool) m_electronIsEMTool[0]->accept(eg);
+	}
+	else if (pidname == "Medium"){
+	    accept = (bool) m_electronIsEMTool[1]->accept(eg);
+	    return static_cast<bool>(accept);
+	}
+	else if (pidname == "Loose"){
+	    accept = (bool) m_electronIsEMTool[2]->accept(eg);
+	}
+	else if (pidname == "LHTight"){
+	    accept = (bool) m_electronLHTool[0]->accept(eg);
+	}
+	else if (pidname == "LHMedium"){
+	    accept = (bool) m_electronLHTool[1]->accept(eg);
+	}
+	else if (pidname == "LHLoose"){
+	    accept = (bool) m_electronLHTool[2]->accept(eg);
+	}
+	// HI lh medium not working in master. Commenting out untill fixed
+	// else if (pidname == "LHMediumHI"){
+	//     bool accept = (bool) m_electronLHTool[3]->accept(eg);
+	//     return static_cast<bool>(accept);
+	// }
+	else {
+	    ATH_MSG_DEBUG("No Pid tool, continue without PID");
+	}
+	ATH_MSG_DEBUG("ElectronLHTool for " << pidname << " = " <<  (int) accept );
+	return accept;
+    } catch (...) {
+        ATH_MSG_WARNING("Failed to apply pid " << pidname);
+	return false;
     }
-    else ATH_MSG_DEBUG("No Pid tool, continue without PID");
-    return false;
 }
 
 
@@ -234,7 +228,7 @@ StatusCode TrigEgammaNavBaseTool::executeElectronNavigation( std::string trigIte
       }
 
       if(m_forceVetoVeryLoose){///default is false
-        bool veto = (bool)m_electronLHVLooseTool->accept(eg);
+        bool veto = (bool)this->m_electronLHVLooseTool->accept(eg);
         if(veto)  continue;
       }
 
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx
index 90610ba04a1ee451369de5d41458e18e498f3d2d..77d38c9de69e8b3f91e76fe63da2bae11615ae88 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx
@@ -38,8 +38,6 @@ TrigEgammaNavTPBaseTool::
 TrigEgammaNavTPBaseTool( const std::string& myname )
 : TrigEgammaAnalysisBaseTool(myname)
 {
-  declareProperty("ElectronIsEMSelector", m_electronIsEMTool);
-  declareProperty("ElectronLikelihoodTool", m_electronLHTool);
   declareProperty("ZeeLowerMass",m_ZeeMassMin=80);
   declareProperty("ZeeUpperMass",m_ZeeMassMax=100);
   declareProperty("OfflineTagSelector",m_offTagTightness="Tight");
@@ -97,14 +95,6 @@ StatusCode
 TrigEgammaNavTPBaseTool::childInitialize() {
 
     ATH_MSG_VERBOSE( "child Initialize tool " << name() );
-    if ( (m_electronIsEMTool.retrieve()).isFailure() ){
-        ATH_MSG_ERROR( "Could not retrieve Selector Tool! Can't work");
-        return StatusCode::FAILURE;
-    }
-    if ( (m_electronLHTool.retrieve()).isFailure() ){
-        ATH_MSG_ERROR( "Could not retrieve Selector Tool! Can't work");
-        return StatusCode::FAILURE;
-    }
     m_offProbeTightness = m_defaultProbeTightness;
 
     return StatusCode::SUCCESS;
@@ -420,12 +410,12 @@ bool TrigEgammaNavTPBaseTool::isTagElectron(const xAOD::Electron *el){
 void TrigEgammaNavTPBaseTool::DressPid(const xAOD::Electron *eg){
     auto ctx = Gaudi::Hive::currentContext() ;
     for(int ipid=0;ipid<3;ipid++){
-        bool accept = (bool) m_electronIsEMTool[ipid]->accept(ctx,eg);
+        bool accept = (bool) this->m_electronIsEMTool[ipid]->accept(ctx,eg);
         const std::string pidname="is"+m_isemname[ipid];
         eg->auxdecor<bool>(pidname)=static_cast<bool>(accept);
     }
     for(int ipid=0;ipid<2;ipid++){
-        bool accept = (bool) m_electronLHTool[ipid]->accept(ctx,eg);
+        bool accept = (bool) this->m_electronLHTool[ipid]->accept(ctx,eg);
         const std::string pidname="is"+m_lhname[ipid];
         eg->auxdecor<bool>(pidname)=static_cast<bool>(accept);
     }
@@ -435,29 +425,27 @@ void TrigEgammaNavTPBaseTool::DressPid(const xAOD::Electron *eg){
 bool TrigEgammaNavTPBaseTool::ApplyElectronPid(const xAOD::Electron *eg, const std::string pidname){
     auto ctx = Gaudi::Hive::currentContext() ;
     if (pidname == "Tight"){
-        return (bool) m_electronIsEMTool[0]->accept(ctx,eg);
+        return (bool) this->m_electronIsEMTool[0]->accept(ctx,eg);
     }
     else if (pidname == "Medium"){
-        return  (bool) m_electronIsEMTool[1]->accept(ctx,eg);
+        return  (bool) this->m_electronIsEMTool[1]->accept(ctx,eg);
     }
     else if (pidname == "Loose"){
-        return (bool) m_electronIsEMTool[2]->accept(ctx,eg);
+        return (bool) this->m_electronIsEMTool[2]->accept(ctx,eg);
     }
     else if (pidname == "LHTight"){
-        return (bool) m_electronLHTool[0]->accept(ctx,eg);
+        return (bool) this->m_electronLHTool[0]->accept(ctx,eg);
     }
     else if (pidname == "LHMedium"){
-        return (bool) m_electronLHTool[1]->accept(ctx,eg);
+        return (bool) this->m_electronLHTool[1]->accept(ctx,eg);
     }
     else if (pidname == "LHLoose"){
-        return (bool) m_electronLHTool[2]->accept(ctx,eg);
-    }
-    else if (pidname == "LHMediumHI"){
-        return (bool) m_electronLHTool[3]->accept(ctx,eg);
-    }
-    else if (pidname == "LHMediumHI"){
-        return (bool) m_electronLHTool[3]->accept(ctx,eg);
+        return (bool) this->m_electronLHTool[2]->accept(ctx,eg);
     }
+    // LHMediumHI not working in master. Commenting out untill fixed 
+    //else if (pidname == "LHMediumHI"){
+    //    return (bool) this->m_electronLHTool[3]->accept(ctx,eg);
+    //}
     else ATH_MSG_DEBUG("No Pid tool, continue without PID");
     return false;
 }
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx
index f384b20e234476eef0a3f3ba83ba72a45fe2d792..a50f2e7c8693faf0e8431b0ff352871d3c5bb2b9 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx
@@ -1038,6 +1038,9 @@ void TrigEgammaPlotTool::bookElectronDistributionHistos(const std::string &direc
     addHistogram(new TH1F("ptcone20_rel", "ptcone20/pt; ptcone20/pt; Count", 50, 0.0, 1.0));
     addHistogram(new TH1F("ptvarcone20", "ptcone20; ptcone20; Count", 50, 0.0, 5.0));
     addHistogram(new TH1F("ptvarcone20_rel", "ptcone20/pt; ptcone20/pt; Count", 50, 0.0, 1.0));
+    addHistogram(new TH1F("lhtight_discriminant", "lh tight discriminant; lh tight discriminant; Count", 50, -5.,2.));
+    addHistogram(new TH1F("lhmedium_discriminant", "lh medium discriminant; lh medium discriminant; Count", 50, -5.,2.));
+    addHistogram(new TH1F("lhloose_discriminant", "lh loose discriminant; lh loose discriminant; Count", 50, -5.,2.));
     
     if(m_detailedHists){
         addHistogram(new TH2F("deta1_vs_clusterEta", "HLT deta1 as function of cluster #eta; #eta; deta1; Count",
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h
index 2057c3376397b60fce660b5311c7b3b89a75d7e8..21d9e0f593c20c5c387e96cb88934a6f5e9f413c 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h
@@ -37,6 +37,9 @@
 #include "xAODCaloRings/CaloRings.h"                   
 #include "xAODCaloRings/CaloRingsContainer.h"          
 #include "xAODCaloRings/tools/getCaloRingsDecorator.h" 
+#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
 
 class TrigEgammaAnalysisBaseTool
 : public asg::AsgTool,
@@ -121,8 +124,14 @@ private:
   ToolHandle<Trig::ITrigEgammaEmulationTool> m_emulationTool;
   ToolHandle<ITrigEgammaPlotTool> m_plot;
 
+
 protected:
   // Methods
+  ///*! Offline isEM Selectors */
+  ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool;
+  /*! Offline LH Selectors */
+  ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool;
+  ToolHandle<IAsgElectronLikelihoodTool> m_electronLHVLooseTool;
   /*! Simple setter to pick up correct probe PID for given trigger */
   void parseTriggerName(const std::string,const std::string, bool&, std::string &,float &, float &, std::string &,std::string &, bool&, bool&);
   /*! Split double object trigger in two simple object trigger */
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h
index 4af0cb9400c19d7b61c4e6922113b9b1c76921bd..d4bd4be006074e21073b8ae5bb7e86d603b8a928 100755
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h
@@ -32,9 +32,6 @@
 #include "xAODCaloEvent/CaloClusterAuxContainer.h"
 #include "xAODJet/JetContainer.h"
 #include "xAODTrigger/EmTauRoIContainer.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
-#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
 
 
 namespace Trig{
@@ -98,12 +95,7 @@ private:
   // Offline ++ selectors
   // In python order will matter. Should always be tight, medium, loose
   // Order no longer important since using a map
-  ///*! Offline isEM Selectors */
-  ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool;
-  /*! Offline LH Selectors */
-  ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool; 
 
-  ToolHandle<IAsgElectronLikelihoodTool> m_electronLHVLooseTool;
   /*! Event Wise offline ElectronContainer Access and end iterator */
   const xAOD::ElectronContainer* m_offElectrons;
   /*! Event Wise offline PhotonContainer Access and end iterator */
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h
index aa6a54f060ec62062a82269b26b8afee1a1e8b00..5a07d7ad8b3a84433ed127891206b435456db712 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h
@@ -31,9 +31,6 @@
 #include "xAODJet/JetContainer.h"
 #include "xAODMissingET/MissingETContainer.h"
 #include "xAODTrigger/EmTauRoIContainer.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
-#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
 
 namespace Trig{
             class FeatureContainer;
@@ -143,10 +140,6 @@ class TrigEgammaNavTPBaseTool: public TrigEgammaAnalysisBaseTool,
 
     // In python order will matter. Should always be tight, medium, loose
     // Order no longer important since using a map
-    ///*! Offline isEM Selectors */
-    ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool;
-    /*! Offline LH Selectors */
-    ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool;
   
     std::map< std::string, unsigned int > m_PidToolMap; /*! Pass a string to pick up correct selector */
     //std::map< std::string, std::string > m_PidMap; /*! Map trigger pid to selector pid */ 
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py
index a6304730e3e54ae375cb27d1b5fc5c2511f08cfa..45a892308a06936ec949541f7996e6dc470f3370 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py
@@ -21,7 +21,7 @@ from TrigEgammaHypo.TrigEgammaPidTools import ElectronToolName
 ElectronPidTools()
 PhotonPidTools()
 
-from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronIsEMSelector
+from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronIsEMSelector, AsgElectronLikelihoodTool
 from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import ElectronIsEMMap,electronPIDmenu
 
 # Offline selectors -- taken from latest conf
@@ -32,7 +32,7 @@ LooseLHSelector                   = CfgMgr.AsgElectronLikelihoodTool("T0HLTLoose
 MediumLHSelector                  = CfgMgr.AsgElectronLikelihoodTool("T0HLTMediumLHSelector")
 TightLHSelector                   = CfgMgr.AsgElectronLikelihoodTool("T0HLTTightLHSelector")
 VeryLooseLHSelector               = CfgMgr.AsgElectronLikelihoodTool("T0HLTVeryLooseLHSelector")
-MediumLHHISelector                  = CfgMgr.AsgElectronLikelihoodTool("T0HLTMediumLHHISelector")
+# MediumLHHISelector                  = CfgMgr.AsgElectronLikelihoodTool("T0HLTMediumLHHISelector")
 
 # see the configuration calib paths below
 LooseElectronSelector.ConfigFile  = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMLooseSelectorCutDefs.conf"
@@ -43,7 +43,7 @@ LooseLHSelector.ConfigFile        = "ElectronPhotonSelectorTools/offline/mc16_20
 MediumLHSelector.ConfigFile       = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodMediumOfflineConfig2017_Smooth.conf"
 TightLHSelector.ConfigFile        = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodTightOfflineConfig2017_Smooth.conf"
 VeryLooseLHSelector.ConfigFile    = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf"
-MediumLHHISelector.ConfigFile     = "ElectronPhotonSelectorTools/offline/mc15_20160907_HI/ElectronLikelihoodMediumOfflineConfig2016_HI.conf"
+# MediumLHHISelector.ConfigFile     = "ElectronPhotonSelectorTools/offline/mc15_20160907_HI/ElectronLikelihoodMediumOfflineConfig2016_HI.conf"
 
 
 
@@ -55,7 +55,7 @@ ToolSvc+=LooseLHSelector
 ToolSvc+=MediumLHSelector
 ToolSvc+=TightLHSelector
 ToolSvc+=VeryLooseLHSelector
-ToolSvc+=MediumLHHISelector
+# ToolSvc+=MediumLHHISelector
 
 
 #from LumiBlockComps.LuminosityToolDefault import LuminosityToolOnline
@@ -77,6 +77,7 @@ from TrigEgammaAnalysisTools.TrigEgammaProbelist import monitoringTP_electron, m
 from TrigEgammaMatchingTool.TrigEgammaMatchingToolConf import Trig__TrigEgammaMatchingTool
 
 EgammaMatchTool = Trig__TrigEgammaMatchingTool()
+EgammaMatchTool.OutputLevel=2
 ToolSvc += EgammaMatchTool
 
 # Plot Tool sets the base path for histograms of all tools
@@ -126,7 +127,7 @@ TrigEgammaNavTPAnalysisTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.Trig
         isEMResultNames=["Tight","Medium","Loose"],
         LHResultNames=["LHTight","LHMedium","LHLoose"],
         ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector],
-        ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector,MediumLHHISelector], 
+        ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], 
         ZeeLowerMass=80,
         ZeeUpperMass=100,
         OfflineTagSelector='Tight', # 1=tight, 2=medium, 3=loose 
@@ -158,7 +159,7 @@ TrigEgammaNavTPJpsieeAnalysisTool = PublicToolFactory(TrigEgammaAnalysisToolsCon
         isEMResultNames=["Tight","Medium","Loose"],
         LHResultNames=["LHTight","LHMedium","LHLoose"],
         ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector],
-        ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector,MediumLHHISelector], 
+        ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], 
         ZeeLowerMass=2,
         ZeeUpperMass=5,
         OfflineTagSelector='Tight', # 1=tight, 2=medium, 3=loose 
@@ -187,7 +188,7 @@ TrigEgammaNavAnalysisTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEg
         #EmulationTool=EmulationTool,
         Tools=[EfficiencyTool,ResolutionTool,DistTool],
         ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector],
-        ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector,MediumLHHISelector], 
+        ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], 
         ElectronLHVLooseTool=VeryLooseLHSelector,
         IsEMLabels=IneffLabels,
         TriggerList=monitoring_electron + monitoring_photon,
@@ -314,7 +315,7 @@ def getEventSelectionTool(runFlag):
           HLTElectronLikelihoodSelector=HLTLikelihoodSelectorList,
           HLTElectronIsEMSelector=HLTIsEMSelectorList,
           ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector],
-          ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector,MediumLHHISelector], 
+          ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], 
  
           )
   
diff --git a/Trigger/TrigAnalysis/TrigEgammaMatchingTool/Root/TrigEgammaMatchingTool.cxx b/Trigger/TrigAnalysis/TrigEgammaMatchingTool/Root/TrigEgammaMatchingTool.cxx
index 86c68dba7f2c626dee6512659f311a7b5a4c5f0f..da0dbfd2e1fecdc13541722da7232fb6ff6fb67c 100644
--- a/Trigger/TrigAnalysis/TrigEgammaMatchingTool/Root/TrigEgammaMatchingTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaMatchingTool/Root/TrigEgammaMatchingTool.cxx
@@ -250,10 +250,12 @@ namespace Trig {
                 deltaR = dR(eg->eta(),eg->phi(), el->eta(),el->phi());
                 if(deltaR < m_dR){
                     finalFC = (feat.te());
+		    ATH_MSG_DEBUG("Electron finalFC matches offline");
                     return true;
                 }
             }
         }
+	ATH_MSG_DEBUG("Reached the end in matchHLTElectron. So didn't match!");
         return false;
     }
 
@@ -460,7 +462,10 @@ namespace Trig {
         ATH_MSG_DEBUG("Match objec with trigger " << trigger);
         if(xAOD::EgammaHelpers::isElectron(eg)){
             const xAOD::Electron* el =static_cast<const xAOD::Electron*> (eg);
-            if( matchHLTElectron(el,trigger,finalFC) ) return true;
+            if( matchHLTElectron(el,trigger,finalFC) ) {
+		ATH_MSG_DEBUG("Matchched!");
+		return true;
+	    }
         }
         else if(xAOD::EgammaHelpers::isPhoton(eg)){
             const xAOD::Photon* ph =static_cast<const xAOD::Photon*> (eg);
@@ -478,6 +483,7 @@ namespace Trig {
         }
         if( matchL2Calo(eg,trigger,finalFC) ) return true;
         if( matchL1(eg,trigger,finalFC) ) return true;
+	ATH_MSG_DEBUG("match() failed!");
         return false;// otherwise, someone matched!*/
     }
 
diff --git a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt
index 3ac51195b01f70f12bc47c8d7b7576e85c513597..26d23aee47a7749da09aa4d6f9b8901b2f50af83 100644
--- a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt
+++ b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/CMakeLists.txt
@@ -9,7 +9,6 @@ atlas_subdir( TrigSerializeCnvSvc )
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthContainers
                           Control/AthenaBaseComps
-                          Control/SGTools
                           Control/StoreGate
                           GaudiKernel
                           PRIVATE
@@ -26,10 +25,10 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_library( TrigSerializeCnvSvcLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigSerializeCnvSvc
-                   LINK_LIBRARIES AthContainers AthenaBaseComps SGTools GaudiKernel StoreGateLib SGtests TrigSerializeResultLib TrigSerializeTPLib
+                   LINK_LIBRARIES AthContainers AthenaBaseComps GaudiKernel StoreGateLib SGtests TrigSerializeResultLib TrigSerializeTPLib
                    PRIVATE_LINK_LIBRARIES AthenaKernel DataModelRoot StorageSvc PersistentDataModel )
 
 atlas_add_component( TrigSerializeCnvSvc
                      src/components/*.cxx
-                     LINK_LIBRARIES AthContainers AthenaBaseComps SGTools StoreGateLib SGtests GaudiKernel AthenaKernel DataModelRoot StorageSvc PersistentDataModel TrigSerializeResultLib TrigSerializeTPLib TrigSerializeCnvSvcLib )
+                     LINK_LIBRARIES AthContainers AthenaBaseComps StoreGateLib SGtests GaudiKernel AthenaKernel DataModelRoot StorageSvc PersistentDataModel TrigSerializeResultLib TrigSerializeTPLib TrigSerializeCnvSvcLib )
 
diff --git a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/TrigSerializeCnvSvc/TrigSerializeConverter.h b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/TrigSerializeCnvSvc/TrigSerializeConverter.h
index 8a13f6b306e643ff1b9b1ace5b19fc663cca6860..d9814c2a445f5859577b2ad63db0c471709bb78a 100755
--- a/Trigger/TrigDataAccess/TrigSerializeCnvSvc/TrigSerializeCnvSvc/TrigSerializeConverter.h
+++ b/Trigger/TrigDataAccess/TrigSerializeCnvSvc/TrigSerializeCnvSvc/TrigSerializeConverter.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -12,8 +12,8 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 
-#include "SGTools/ClassID_traits.h"
-#include "SGTools/StorableConversions.h"
+#include "AthenaKernel/ClassID_traits.h"
+#include "AthenaKernel/StorableConversions.h"
 #include "StoreGate/StoreGateSvc.h"
 
 #include "TrigSerializeCnvSvc/TrigStreamAddress.h"
@@ -23,7 +23,6 @@
 #include "AthContainers/normalizedTypeinfoName.h"
 #include "AthContainers/ViewVector.h"
 #include "CxxUtils/no_sanitize_undefined.h"
-#include "CxxUtils/make_unique.h"
 
 #include <memory>
 
@@ -90,7 +89,7 @@ template <class DV>
 ViewVector<DV>* prepareForWrite (ViewVector<DV>* d,
                                  std::unique_ptr<ViewVector<DV> >& holder)
 {
-  holder = CxxUtils::make_unique<ViewVector<DV> > (*d);
+  holder = std::make_unique<ViewVector<DV> > (*d);
   holder->setClearOnPersistent();
   return holder.get();
 }
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py
index 12d357f2b61c7f39e10950fed1cdde53864a2c1b..0304bd8780e863cc0c8c209643ab4e6a527317b2 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py
@@ -10,6 +10,10 @@ from AthenaCommon.SystemOfUnits import GeV, mm
 
 from AthenaCommon.AppMgr import ToolSvc
 
+from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+ParticleCaloExtensionTool= Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+
 # ---------------------------------------------------------------
 # class for common setups (like monitoring)
 class L2ElectronFexBase(TrigL2ElectronFex):
@@ -36,6 +40,8 @@ class L2ElectronFexBase(TrigL2ElectronFex):
         self.CaloTrackdEoverPLow  = 0.0
         self.CaloTrackdEoverPHigh = 999.0
 
+        self.ParticleCaloExtensionTool = ParticleCaloExtensionTool
+
 # ---------------------------------------------------------------
 # TrigL2ElectronFex configurations
 # ---------------------------------------------------------------
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexMTConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexMTConfig.py
index 7b4fee6ad2080cca47c37d287ecdc324ca0472e4..c088b716bad080e45ffeb65adf9ade6b23bb7dd4 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexMTConfig.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexMTConfig.py
@@ -12,6 +12,10 @@ from AthenaCommon.AppMgr import ToolSvc
 
 from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool,defineHistogram
 
+from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+ParticleCaloExtensionTool= Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+
 # ---------------------------------------------------------------
 # class for common setups (like monitoring)
 class L2ElectronFexBase(TrigL2ElectronFexMT):
@@ -31,6 +35,8 @@ class L2ElectronFexBase(TrigL2ElectronFexMT):
         self.CaloTrackdEoverPLow  = 0.0
         self.CaloTrackdEoverPHigh = 999.0
 
+        self.ParticleCaloExtensionTool = ParticleCaloExtensionTool
+
         from TriggerJobOpts.TriggerFlags import TriggerFlags
         if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in  TriggerFlags.enableMonitoring():
             monTool = GenericMonitoringTool('MonTool')
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx
index bedcb8853bcf71c1f4fc7a33c0070a6f296942ea..5735e501fe0e2b845ff4872cc4dfb4b9c2821b1c 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx
@@ -36,7 +36,7 @@ inline const DataVector<xAOD::TrigElectron>** dvec_cast(SRC** ptr) {
 
 TrigL2ElectronFex::TrigL2ElectronFex(const std::string & name, ISvcLocator* pSvcLocator)
     : HLT::FexAlgo(name, pSvcLocator),
-    m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool")
+      m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this)
 {
     declareProperty( "AcceptAll",            m_acceptAll  = false );
     declareProperty( "ClusEt",              m_clusEtthr = 20.0*CLHEP::GeV );
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.h
index e7e508e9eab48989f2b1539dad658e7697790691..fae84c9e14debd3926f3ed8203e25e570602c22c 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.h
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.h
@@ -107,7 +107,7 @@ class TrigL2ElectronFexMT : public AthAlgorithm  {
   Gaudi::Property<float> m_RCAL {this,  "RCalBarrelFace",  1470.0*CLHEP::mm , "Radius of inner face of the barrel calorimeter"};
   Gaudi::Property<float> m_ZCAL {this,  "ZCalEndcapFace",     3800.0*CLHEP::mm, "z of the inner face of endcap calorimeter"};
   // Too be changed Public Tools depreciated
-  PublicToolHandle<Trk::IParticleCaloExtensionTool > m_caloExtensionTool {this,  "ParticleCaloExtensionTool",  "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", "Tool to extrapolate Track to Calo inner surface"};
+  ToolHandle<Trk::IParticleCaloExtensionTool > m_caloExtensionTool {this,  "ParticleCaloExtensionTool",  "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", "Tool to extrapolate Track to Calo inner surface"};
  
   SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiCollectionKey { this, 
       "RoIs",                             // property name
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.cxx
index 3e5223e42d9c5468972a16bb6773534c06ac7526..b8f76e1035e7124d103966cb0352af6726ae95fb 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.cxx
@@ -25,8 +25,9 @@ AndHelperTool::AndHelperTool(const std::string& type,
 }
 
 
-bool AndHelperTool::pass(HypoJetVector& jets,
-                         ITrigJetHypoInfoCollector* collector) const {
+bool
+AndHelperTool::pass(HypoJetVector& jets,
+		    const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
   ATH_MSG_DEBUG("AndHelperTool::pass... " << jets.size() << " jets");
 
   JetTrigTimer timer;
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.h
index 911580800352cacc3dd4327080f3ae00f38fe6c7..de26a2061166757b901c183584a58a653e5b0190 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.h
@@ -17,7 +17,7 @@
 #include "ITrigJetHypoToolHelperMT.h"
 #include "ITrigJetHypoToolConfig.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
-
+#include "./ITrigJetHypoInfoCollector.h"
 class ITrigJetHypoInfoCollector;
 
 class AndHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> {
@@ -29,7 +29,7 @@ class AndHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> {
                 const IInterface* parent);
   
   bool pass(HypoJetVector&,
-            ITrigJetHypoInfoCollector*) const override;
+            const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
 
   virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override;
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.cxx
index 2d27c39eac1789bc731c8ab3bbdb305254c97f42..7aed9ac1003e36e8f7cea96b55fbf1c950bcd45f 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.cxx
@@ -7,7 +7,7 @@
 #include "./ITrigJetHypoInfoCollector.h"
 #include "./nodeIDPrinter.h"
 #include "./JetTrigTimer.h"
-#include "./ConditionDebugVisitor.h"
+#include "./DebugInfoCollector.h"
 
 #include <sstream>
 
@@ -15,14 +15,14 @@ CombinationsHelperTool::CombinationsHelperTool(const std::string& type,
                                                const std::string& name,
                                                const IInterface* parent) :
   base_class(type, name, parent){
-
+  
 }
 
 StatusCode CombinationsHelperTool::initialize() {
-
+  
   m_conditions = m_config->getConditions();
   m_grouper  = std::move(m_config->getJetGrouper());
-
+  
   return StatusCode::SUCCESS;
 }
 
@@ -30,20 +30,19 @@ StatusCode CombinationsHelperTool::initialize() {
 void
 CombinationsHelperTool::collectData(const std::string& setuptime,
                                     const std::string& exetime,
-                                    ITrigJetHypoInfoCollector* collector,
-                                    std::unique_ptr<IConditionVisitor>& cVstr,
-
+                                    const std::unique_ptr<ITrigJetHypoInfoCollector>& collector,
+				    
                                     bool pass) const {
   if(!collector){return;}
+  for(auto c: m_conditions){
+    collector->collect("Condition", c.toString());
+  }
   auto helperInfo = nodeIDPrinter(name(),
-                                  m_nodeID,
-                                  m_parentNodeID,
-                                  pass,
-                                  exetime + setuptime
-                                  );
-
-
-  helperInfo += cVstr->toString();
+				  m_nodeID,
+				  m_parentNodeID,
+				  pass,
+				  exetime + setuptime
+				  );
 
   collector->collect(name(), helperInfo);
 }
@@ -52,16 +51,16 @@ CombinationsHelperTool::collectData(const std::string& setuptime,
 struct HypoJetSelector{
   // Selector jets according to OR of ocnditions objects.
   // This predicate is intended to be used with an STL algorithm
-  HypoJetSelector(const ConditionsMT& c,
-                  std::unique_ptr<IConditionVisitor>&v ):m_conditions(c),
-                                                         m_visitor(v){
+  HypoJetSelector(const ConditionsMT& conditions,
+                  const std::unique_ptr<ITrigJetHypoInfoCollector>&collector ):
+    m_conditions(conditions), m_collector(collector){
   }
   
   bool operator()(pHypoJet j){
     std::vector<pHypoJet> v{j};
     for(const auto& c : m_conditions)
       {
-        if (c.isSatisfied(v, m_visitor))  // there is a satisfied condition
+        if (c.isSatisfied(v, m_collector))  // there is a satisfied condition
           {
             return true;
           }
@@ -70,43 +69,40 @@ struct HypoJetSelector{
     return false;   // no condition  satisfied
   }
   ConditionsMT m_conditions;
-  std::unique_ptr<IConditionVisitor>& m_visitor;
+  const std::unique_ptr<ITrigJetHypoInfoCollector>& m_collector;
 };
-
  
-bool CombinationsHelperTool::pass(HypoJetVector& jets,
-                                  ITrigJetHypoInfoCollector* collector) const {
+ 
+bool
+CombinationsHelperTool::pass(HypoJetVector& jets,
+			     const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
   /* seek first jet group that passes all children  */
   
   // create vector of vector of jets
-
+  
   JetTrigTimer exeTimer;
   JetTrigTimer setupTimer;
-
+  
   setupTimer.start();
-
-  std::unique_ptr<IConditionVisitor> cVisitor(nullptr); 
-  if (collector){
-    cVisitor.reset(new ConditionDebugVisitor);
-  }
   
-  HypoJetSelector selector(m_conditions, cVisitor);
-
+  
+  HypoJetSelector selector(m_conditions, collector);
+  
   // use conditions objects to select jets
   auto end_iter = std::partition(jets.begin(),
-                                 jets.end(),
-                                 selector);
+				 jets.end(),
+				 selector);
   
   // auto grouper = CombinationsGrouper(m_size);
   auto begin = jets.begin();
   auto jetGroups = m_grouper->group(begin, end_iter);
-
+  
   ATH_MSG_DEBUG("No of groups" << jetGroups.size());
-
+  
   bool pass = true;
   setupTimer.stop();
   exeTimer.start();
-
+  
   for(auto& gjets : jetGroups){
     if (testGroup(gjets, collector)){
       pass = true;
@@ -114,7 +110,6 @@ bool CombinationsHelperTool::pass(HypoJetVector& jets,
       collectData(setupTimer.readAndReset(),
                   exeTimer.readAndReset(),
                   collector,
-                  cVisitor,
                   pass);
       
       return pass;
@@ -126,17 +121,15 @@ bool CombinationsHelperTool::pass(HypoJetVector& jets,
   collectData(setupTimer.readAndReset(),
               exeTimer.readAndReset(),
               collector,
-              cVisitor,
               pass);
   
   return pass;
 }
 
 
-
 bool
 CombinationsHelperTool::testGroup(HypoJetVector& jets,
-                                  ITrigJetHypoInfoCollector* collector) const {
+				  const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
   for(auto child : m_children){
     auto childPass =  child->pass(jets, collector);
     if (!childPass){
@@ -149,7 +142,9 @@ CombinationsHelperTool::testGroup(HypoJetVector& jets,
 
 std::string CombinationsHelperTool::toString() const{
   std::stringstream ss;
-  return nodeIDPrinter(name(), m_nodeID, m_parentNodeID);
+  std::string msg =  nodeIDPrinter(name(), m_nodeID, m_parentNodeID) + "\n";
+  for(const auto& cond : m_conditions){ msg += cond.toString() + "\n";}
+  return msg;
 }
 
 StatusCode
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.h
index 01880f822ac9892257dffd5052ea23ccf018e653..352ce238e06a5ba9c6470ce3ac51b46085450398 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.h
@@ -26,7 +26,8 @@ class CombinationsHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperM
 
   StatusCode initialize() override;
 
-  bool pass(HypoJetVector&, ITrigJetHypoInfoCollector*) const;
+  bool pass(HypoJetVector&,
+	    const std::unique_ptr<ITrigJetHypoInfoCollector>&) const;
 
   virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override;
 
@@ -59,11 +60,11 @@ class CombinationsHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperM
     m_nodeID {this, "node_id", {}, "hypo tool tree node id"};
 
 
-  bool testGroup(HypoJetVector&, ITrigJetHypoInfoCollector*) const;
+  bool testGroup(HypoJetVector&,
+		 const std::unique_ptr<ITrigJetHypoInfoCollector>&) const;
   void collectData(const std::string& setuptime,
                    const std::string& exetime,
-                   ITrigJetHypoInfoCollector*,
-                   std::unique_ptr<IConditionVisitor>& cVstr,
+		   const std::unique_ptr<ITrigJetHypoInfoCollector>&,
                    bool) const;
 
   std::string toString() const;
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionBridgeMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionBridgeMT.h
index e2d9f03557e314c9141e303a565cecde0ef97b69..52de8f2c0d220d959b0b386cea374239441a4ba8 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionBridgeMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionBridgeMT.h
@@ -18,7 +18,7 @@
 #include <memory>
 #include <ostream>
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class ConditionBridgeMT{
   // Bridge object: convert polymorphic pointer to monomorphic class
@@ -28,12 +28,12 @@ class ConditionBridgeMT{
   m_pCondition(condition){}
   
   bool isSatisfied(const HypoJetVector& ips,
-                   std::unique_ptr<IConditionVisitor>& v) const{
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>& v) const{
     return m_pCondition -> isSatisfied(ips, v);
   }
 
   bool operator()(const HypoJetVector& ips,
-                  std::unique_ptr<IConditionVisitor> v) const{
+                  std::unique_ptr<ITrigJetHypoInfoCollector> v) const{
     return isSatisfied(ips, v);
   }
 
@@ -41,6 +41,7 @@ class ConditionBridgeMT{
     return m_pCondition -> toString();
   }
 
+  unsigned int capacity() const {return m_pCondition->capacity();}
  private:
   std::shared_ptr<IConditionMT> m_pCondition;
 };
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionDebugVisitor.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionDebugVisitor.cxx
deleted file mode 100644
index 0da099a7dbe6cd8376a732bc880f19dea61a6617..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionDebugVisitor.cxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./ConditionDebugVisitor.h"
-
-#include "./EtaEtConditionMT.h"
-#include "./EtaEtAsymmetricConditionMT.h"
-#include "./DijetConditionMT.h"
-#include "./HTConditionMT.h"
-#include "./TLAConditionMT.h"
-
-void ConditionDebugVisitor::visit(const EtaEtConditionMT*,
-                                  const std::string& s){
-  std::string key{"EtaEt"};
-  m_debugStrings[key]  += s;
-}
-
-void ConditionDebugVisitor::visit(const EtaEtAsymmetricConditionMT*,
-                                  const std::string& s){
-  std::string key{"EtaEtAsymmetric"};
-  m_debugStrings[key]  = m_debugStrings[key] + s;
-}
-
-void ConditionDebugVisitor::visit(const DijetConditionMT*,
-                                  const std::string& s){
-std::string key{"Dijet"};
-m_debugStrings[key]  = m_debugStrings[key] + s;
-}
-
-void ConditionDebugVisitor::visit(const HTConditionMT*,
-                                  const std::string& s){
-  std::string key{"HT"};
-  m_debugStrings[key]  = m_debugStrings[key] + s;
-}
-
-
-void ConditionDebugVisitor::visit(const TLAConditionMT*, 
-                                  const std::string& s){
-std::string key{"TLA"};
-  m_debugStrings[key]  = m_debugStrings[key] + s;
-}
-
-std::string ConditionDebugVisitor::toString() const {
-  std::string s;
-  for(const auto& kv : m_debugStrings){
-    if (!(kv.first).empty()){
-      s += kv.first + '\n' + kv.second;
-    }
-  }
-  return s; 
-}
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionDebugVisitor.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionDebugVisitor.h
deleted file mode 100644
index c541bdce2d6420150c2556ff3e371776ceda6b73..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ConditionDebugVisitor.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGHLTJETHYPO_CONDITIONDEBUGVISITOR_H
-#define TRIGHLTJETHYPO_CONDITIONDEBUGVISITOR_H
-
-#include <map>
-#include <string>
-#include "./IConditionVisitor.h"
-
-class EtaEtConditionMT;
-class EtaEtAsymmetricConditionMT;
-class DijetConditionMT;
-class HTConditionMT;
-class TLAConditionMT;
-
-class ConditionDebugVisitor: public IConditionVisitor{
-  public:
-  virtual void visit(const EtaEtConditionMT*,
-                     const std::string&) override;
-  
-  virtual void visit(const EtaEtAsymmetricConditionMT*,
-                     const std::string&) override;
-  
-  virtual void visit(const DijetConditionMT*,
-                     const std::string&) override;
-  
-  virtual void visit(const HTConditionMT*,
-                     const std::string&) override;
-  
-  virtual void visit(const TLAConditionMT*,
-                     const std::string&) override;
-
-  virtual std::string toString() const override;
-
- private:
-  std::map<std::string, std::string> m_debugStrings;
-};
-
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.cxx
index f7ae03a6963255495d0b4dbe57d1b61574c0b5ce..f4f7f432aeb6b357968ef681ccea386f0e2526ea 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.cxx
@@ -5,15 +5,18 @@
 #include "./DebugInfoCollector.h"
 #include <sstream>
 #include <fstream>
+
+DebugInfoCollector::DebugInfoCollector(const std::string& name):m_name(name){}
+
 void DebugInfoCollector::collect(const std::string& key,
                                  const std::string& info){
   m_info[key] += info;
   m_calls[key] += 1;
 }
 
-std::string DebugInfoCollector::toString() const noexcept{
+std::string DebugInfoCollector::toString() const {
   std::stringstream ss;
-  ss << "DEBUGInfoCollector:\n";
+  ss << "DEBUGInfoCollector: " << m_name << '\n';
   for(const auto& i: m_info){
     ss << i.first << '\n';
     ss << "   "  << i.second << " calls " << m_calls.at(i.first) << '\n';
@@ -22,22 +25,9 @@ std::string DebugInfoCollector::toString() const noexcept{
 }
 
 
-void DebugInfoCollector::write(std::string name,
-                                      uint32_t run,
-                                      uint32_t event) const {
+void DebugInfoCollector::write() const{
   auto report = this->toString();
-  std::stringstream ss;
-  ss << "jetHypo_" << name << "_" << run << "_" << event;
-  std::ofstream out(ss.str());
+  std::ofstream out(m_name);
   out << report;   
 }
 
-
-void DebugInfoCollector::write(std::string name, std::size_t id) const {
-  auto report = this->toString();
-  std::stringstream ss;
-  ss << "jetHypo_" << name << "_" << id;
-  std::ofstream out(ss.str());
-  out << report;
-  out.close();
-}
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.h
index e887115de2c4e8f9243edd1e3b9439cdbb517552..8f47aed7509e5221cd912dc72900234be2539b10 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DebugInfoCollector.h
@@ -11,15 +11,16 @@
 class DebugInfoCollector: public ITrigJetHypoInfoCollector {
     
 public:
+  DebugInfoCollector(const std::string& name="Unknown");
   virtual void collect(const std::string&, const std::string&) override;
 
-  std::string toString() const noexcept;
-  void write(std::string, uint32_t run, uint32_t event) const;
-  void write(std::string, std::size_t) const;
+  virtual std::string toString() const override;
+  virtual void write() const override;
 
  private:
   std::map<std::string, std::string> m_info;
-  std::map<std::string, std::size_t> m_calls;  
+  std::map<std::string, std::size_t> m_calls;
+  std::string m_name;
 
 };
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx
index 406b2544a94e61b6f21cce9210aaa4f1ec0d573a..fd4ff76cdeb6e97e1fe1eb64816f4a5146b239f2 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "./DijetConditionMT.h"
-#include "./IConditionVisitor.h"
+#include "./ITrigJetHypoInfoCollector.h"
 #include <sstream>
 #include <stdexcept>
 #include <TLorentzVector.h>
@@ -27,7 +27,7 @@ DijetConditionMT::DijetConditionMT(double massMin,
 
 bool
 DijetConditionMT::isSatisfied(const HypoJetVector& ips,
-                              std::unique_ptr<IConditionVisitor>& visitor) const{
+                              const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const{
 
   if(ips.size() != 2){
     std::stringstream ss;
@@ -60,7 +60,7 @@ DijetConditionMT::isSatisfied(const HypoJetVector& ips,
   if (m_massMin > mass or mass >= m_massMax){pass = false;}
   if (m_detaMin > adeta or adeta >= m_detaMax){pass = false;}
 
-   if(visitor){
+   if(collector){
      std::stringstream ss;
      const void* address = static_cast<const void*>(this);
      ss << "Condition: " << address << " "
@@ -71,7 +71,7 @@ DijetConditionMT::isSatisfied(const HypoJetVector& ips,
        ss << address << " ";  
      }
      ss << '\n';
-     visitor->visit(this, ss.str());
+     collector->collect("DijetConditionMT", ss.str());
    }
   return pass;
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h
index 49da0f108e6a2a5d2ed8fea79d684dbe1446e78b..7a1be3e9d7c94a89e293617bcffeab58d69d443a 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h
@@ -21,7 +21,7 @@
 #include <vector>
 #include <string>
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class DijetConditionMT: public IConditionMT{
  public:
@@ -36,10 +36,12 @@ class DijetConditionMT: public IConditionMT{
   ~DijetConditionMT() override {}
 
   bool isSatisfied(const HypoJetVector&,
-                   std::unique_ptr<IConditionVisitor>&) const override;
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
   
   std::string toString() const noexcept override;
 
+  virtual unsigned int capacity() const override{return s_capacity;}
+
  private:
 
   bool passJetCuts(pHypoJet, pHypoJet) const;
@@ -55,6 +57,9 @@ class DijetConditionMT: public IConditionMT{
   
   double m_dphiMin;
   double m_dphiMax;
+
+  const static unsigned int s_capacity{2};
+
 };
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx
index db12f2d35124aec8fb9c4ca0fa88fa06f09e6f36..3ab1a910ac888dd0f66b537b25635bf255cedd14 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx
@@ -4,7 +4,7 @@
 
 #include "./EtaEtAsymmetricConditionMT.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
-#include "./IConditionVisitor.h"
+#include "./ITrigJetHypoInfoCollector.h"
 
 #include <sstream>
 #include <cmath>
@@ -21,7 +21,7 @@ EtaEtAsymmetricConditionMT::EtaEtAsymmetricConditionMT(double etaMin,
 
 bool
 EtaEtAsymmetricConditionMT::isSatisfied(const pHypoJet& ip,
-                                        std::unique_ptr<IConditionVisitor>&) const {
+                                        const std::unique_ptr<ITrigJetHypoInfoCollector>&) const {
   auto eta = ip->eta();
   auto et = ip->et();
   return 
@@ -33,7 +33,7 @@ EtaEtAsymmetricConditionMT::isSatisfied(const pHypoJet& ip,
 
 bool
 EtaEtAsymmetricConditionMT::isSatisfied(const HypoJetVector& ips,
-                                        std::unique_ptr<IConditionVisitor>& v) const {
+                                        const std::unique_ptr<ITrigJetHypoInfoCollector>& v) const {
   return isSatisfied(ips[0], v);
 }
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h
index b5f40fec6dbcd95fd5aa6c0514515a3960ff4509..d3dea0101289f2b8d6a78e6090040bde28fd4512 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h
@@ -20,7 +20,7 @@ namespace HypoJet{
   class IJet;
 }
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class EtaEtAsymmetricConditionMT: public IConditionMT{
  public:
@@ -31,9 +31,12 @@ class EtaEtAsymmetricConditionMT: public IConditionMT{
   ~EtaEtAsymmetricConditionMT() override {}
 
   bool isSatisfied(const HypoJetVector&,
-                   std::unique_ptr<IConditionVisitor>&) const override;
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
   std::string toString() const noexcept override;
 
+  virtual unsigned int capacity() const override {return s_capacity;}
+
+
  private:
 
   double m_etaMin;
@@ -41,7 +44,10 @@ class EtaEtAsymmetricConditionMT: public IConditionMT{
   double m_threshold;
 
   bool isSatisfied(const pHypoJet&,
-                   std::unique_ptr<IConditionVisitor>&) const;
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>&) const;
+
+  const static  unsigned int s_capacity{1};
+
 };
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx
index 396b94da81a7ad4698d292f5e3d25acf9e79cc86..0b45a4a78fb1e98d10a57e319bd86254e1cc180d 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx
@@ -3,7 +3,7 @@
 */
 #
 #include "./EtaEtConditionMT.h"
-#include "./IConditionVisitor.h"
+#include "./ITrigJetHypoInfoCollector.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
 
 #include <sstream>
@@ -18,18 +18,18 @@ EtaEtConditionMT::EtaEtConditionMT(double etaMin,
 
 
 bool EtaEtConditionMT::isSatisfied(const pHypoJet& ip,
-                                   std::unique_ptr<IConditionVisitor>& visitor) const {
+                                   const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
   auto abseta = std::abs(ip->eta());
   auto et = ip->et();
   bool result =
     m_etaMin <= abseta and
     m_etaMax > abseta and
     m_threshold <= et;
-  if(visitor){
-    visitor->visit(this,
-                   std::to_string(abseta) + " " +
-                   std::to_string(et) + " " +
-                   std::to_string(result) + '\n');
+  if(collector){
+    collector->collect("EtaEtConditionMT",
+		       std::to_string(abseta) + " " +
+		       std::to_string(et) + " " +
+		       std::to_string(result) + '\n');
   }
   return result;
 }
@@ -37,15 +37,15 @@ bool EtaEtConditionMT::isSatisfied(const pHypoJet& ip,
 
 bool 
 EtaEtConditionMT::isSatisfied(const HypoJetVector& ips,
-                              std::unique_ptr<IConditionVisitor>& v) const {
-  auto result =  isSatisfied(ips[0], v);
+                              const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const {
+  auto result =  isSatisfied(ips[0], c);
   return result;
 }
 
 
 std::string EtaEtConditionMT::toString() const noexcept {
   std::stringstream ss;
-  ss << "Eta Et ConditionMT: etaMin "
+  ss << "EtaEtConditionMT: etaMin "
      <<  m_etaMin 
      << " etaMax " 
      << m_etaMax 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h
index a1f4187fa47eea093c617f36189d4717a0cb9584..aa8deb723636fb06d5f958e8262b64e8acd2cd61 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h
@@ -20,7 +20,7 @@ namespace HypoJet{
   class IJet;
 }
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class EtaEtConditionMT: public IConditionMT{
  public:
@@ -30,7 +30,9 @@ class EtaEtConditionMT: public IConditionMT{
   ~EtaEtConditionMT() override {}
 
   bool isSatisfied(const HypoJetVector&,
-                   std::unique_ptr<IConditionVisitor>&) const override;
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
+
+  virtual unsigned int capacity() const override{return s_capacity;}
 
   std::string toString() const noexcept override;
  private:
@@ -38,9 +40,12 @@ class EtaEtConditionMT: public IConditionMT{
   double m_etaMin;
   double m_etaMax;
   double m_threshold;
-
+  
   bool isSatisfied(const pHypoJet&,
-                   std::unique_ptr<IConditionVisitor>&) const;
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>&) const;
+  
+  const static  unsigned int s_capacity{1};
+  
 };
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx
index 11d80a657bcff799f25032352f8c96c40bdc91b3..897f1a57e52310b6fcbe8dd957d4683498e9706a 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "./HTConditionMT.h"
-#include "./IConditionVisitor.h"
+#include "./ITrigJetHypoInfoCollector.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
 
 #include <sstream>
@@ -16,7 +16,7 @@ HTConditionMT::HTConditionMT(double htMin): m_htMin(htMin){
 
 
 bool HTConditionMT::isSatisfied(const HypoJetVector& ips,
-                                std::unique_ptr<IConditionVisitor>&) const {
+                                const std::unique_ptr<ITrigJetHypoInfoCollector>&) const {
   return std::accumulate(ips.begin(),
                          ips.end(),
                          0.0,
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h
index f62408c12f056699a8dcc8d2c563f4c6dbeb3e4b..2cd2bf145bec10c592223d2b009bff46cb37a1ae 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h
@@ -20,7 +20,7 @@ namespace HypoJet{
   class IJet;
 }
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class HTConditionMT: public IConditionMT{
  public:
@@ -28,15 +28,21 @@ class HTConditionMT: public IConditionMT{
   ~HTConditionMT() override {}
 
   bool isSatisfied(const HypoJetVector&,
-                   std::unique_ptr<IConditionVisitor>&) const override;
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
 
   std::string toString() const noexcept override;
 
+  virtual unsigned int capacity() const override {return s_capacity;}
+
  private:
 
-  bool isSatisfied(const pHypoJet&, IConditionVisitor*) const;
+  bool isSatisfied(const pHypoJet&,
+		std::unique_ptr<ITrigJetHypoInfoCollector>& ) const;
 
   double m_htMin;
+
+  const static  unsigned int s_capacity{1};
+
 };
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HypoTreeInfoCollector.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HypoTreeInfoCollector.cxx
deleted file mode 100644
index 576273a51314436952519738d988593aa3e88fcf..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HypoTreeInfoCollector.cxx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./HypoTreeInfoCollector.h"
-#include <sstream>
-#include <fstream>
-
-void HypoTreeInfoCollector::collect(const std::string& key,
-                                 const std::string& info){
-  m_info[key] += info;
-}
-
-std::string HypoTreeInfoCollector::toString() const {
-  std::stringstream ss;
-  ss << "HypoTreeInfoCollector:\n";
-  for(const auto& i: m_info){
-    ss << i.first << "\n   "  << i.second << '\n';
-  }
-  return ss.str();
-}
-
-
-void HypoTreeInfoCollector::write(std::string name) const {
-  auto report = this->toString();
-  std::stringstream ss;
-  ss << "HypoTree_" << name;
-  std::ofstream out(ss.str());
-  out << report;
-  out.close();
-}
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HypoTreeInfoCollector.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HypoTreeInfoCollector.h
deleted file mode 100644
index cede8c92d29888f569fafb2cfe36cdd6052842ec..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HypoTreeInfoCollector.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGHLTJETHYPO_HYPOTREEINFOCOLLECTOR_H
-#define TRIGHLTJETHYPO_HYPOTREEINFOCOLLECTOR_H
-
-#include "./ITrigJetHypoInfoCollector.h"
-#include <map>
-
-class HypoTreeInfoCollector: public ITrigJetHypoInfoCollector {
-    
-public:
-  virtual void collect(const std::string&, const std::string&) override;
-
-  std::string toString() const;
-  void write(std::string) const;
-
- private:
-  std::map<std::string, std::string> m_info;
-
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h
index 383cf8078e122fe393604cb418e221434fbcf5cb..a6a1842d7511627136e6348074d8ddc879eb7006 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h
@@ -17,13 +17,15 @@
 #include <string>
 
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class IConditionMT {
  public:
   virtual ~IConditionMT(){}
   virtual bool isSatisfied(const HypoJetVector&,
-                           std::unique_ptr<IConditionVisitor>&) const = 0;
+                           const std::unique_ptr<ITrigJetHypoInfoCollector>&) const = 0;
+  
+  virtual unsigned int capacity() const = 0;
   virtual std::string toString() const noexcept = 0;
 };
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionVisitor.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionVisitor.h
deleted file mode 100644
index 4aa7a9fe1473e880c07c1e303cfab6a6ecd711df..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionVisitor.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGHLTJETHYPO_ICONDITIONVISITOR_H
-#define TRIGHLTJETHYPO_ICONDITIONVISITOR_H
-
-#include <string>
-
-class EtaEtConditionMT;
-class EtaEtAsymmetricConditionMT;
-class DijetConditionMT;
-class HTConditionMT;
-class TLAConditionMT;
-
-class IConditionVisitor{
-    
-public:
-  virtual void visit(const EtaEtConditionMT*, const std::string&) = 0;
-  virtual void visit(const EtaEtAsymmetricConditionMT*, const std::string&) = 0;
-  virtual void visit(const DijetConditionMT*, const std::string&) = 0;
-  virtual void visit(const HTConditionMT*, const std::string&) = 0;
-  virtual void visit(const TLAConditionMT*, const std::string&) = 0;
-  virtual std::string toString() const = 0;
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IGroupsMatcherMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IGroupsMatcherMT.h
index 9582ecc66a4d5206f5519d5b01007f0c55ee70a4..f660d26dd73557ee72e9c0e51c8e31e2733b4162 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IGroupsMatcherMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IGroupsMatcherMT.h
@@ -1,3 +1,4 @@
+
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
@@ -21,7 +22,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
 #include <string>
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class IGroupsMatcherMT{
  public:
@@ -29,9 +30,11 @@ class IGroupsMatcherMT{
   virtual ~IGroupsMatcherMT(){}
   virtual bool match(const HypoJetGroupCIter&,
                      const HypoJetGroupCIter&,
-                     std::unique_ptr<IConditionVisitor>&) = 0;
+                     const std::unique_ptr<ITrigJetHypoInfoCollector>&,
+		     bool debug=false) = 0;
+  
   virtual ConditionsMT getConditions() const noexcept = 0;
-  virtual std::string toString() const noexcept = 0;
+  virtual std::string toString() const = 0;
 };
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoHelperVisitor.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoHelperVisitor.h
deleted file mode 100644
index d1fdab8af1c80572f081331a23e4faa63b2bd80b..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoHelperVisitor.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGHLTJETHYPO_ITRIGJETHYPOHELPERVISITOR_H
-#define TRIGHLTJETHYPO_ITRIGJETHYPOHELPERVISITOR_H
-#include <string>
-
-class TrigJetHypoToolHelperMT;
-class AndHelperTool;
-class OrHelperTool;
-class NotHelperTool;
-class CombinationsHelperTool;
-
-class ITrigJetHypoHelperVisitor{
-    
-public:
-  virtual void visit(const TrigJetHypoToolHelperMT*, const std::string&) = 0;
-  virtual void visit(const AndHelperTool*, const std::string&) = 0;
-  virtual void visit(const OrHelperTool*, const std::string&) = 0;
-  virtual void visit(const NotHelperTool*, const std::string&) = 0;
-  virtual void visit(const CombinationsHelperTool*, const std::string&) = 0;
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoInfoCollector.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoInfoCollector.h
index 45b4ff1ab43528be7b10089455573f532a254753..6df22086f8813c20020306516636b9b20b1fa4c0 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoInfoCollector.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoInfoCollector.h
@@ -10,5 +10,7 @@ class ITrigJetHypoInfoCollector{
     
 public:
   virtual void collect(const std::string&, const std::string&) = 0;
+  virtual std::string toString() const = 0;
+  virtual void write() const = 0;
 };
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoToolHelperMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoToolHelperMT.h
index 274d960a0dbdcbffe9b24a58ab3de5294321b64f..9aadde0ceaffeb5d39b937bf764cf625602babd0 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoToolHelperMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetHypoToolHelperMT.h
@@ -22,8 +22,8 @@ public:
   // generated at L1.
 
   virtual bool pass(HypoJetVector& jets,
-                    ITrigJetHypoInfoCollector*) const = 0;
-
+                    const std::unique_ptr<ITrigJetHypoInfoCollector>&) const = 0;
+  
   virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const = 0;
    
 };
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.cxx
index eaccf3773043efeb7756e2d60d13d9aa4241c367..5dd0bc8e9a744759247d28041a3dfa2e356d9ae6 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.cxx
@@ -15,125 +15,227 @@
 #include "./MaximumBipartiteGroupsMatcherMT.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/FlowNetwork.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/FordFulkerson.h"
-#include <map>
+#include "./ITrigJetHypoInfoCollector.h"
 #include <cmath>
 #include <sstream>
-#include <stdexcept>
+#include <fstream>
+#include <algorithm>
+#include <map>
 
 MaximumBipartiteGroupsMatcherMT::MaximumBipartiteGroupsMatcherMT(const ConditionsMT& cs):
   m_conditions(cs), 
   m_pass(false),
   m_G(FlowNetwork(0)){
+  // FIXME enforce !m_conditions.empty();
+  if (!m_conditions.empty()){
+    m_compound = m_conditions.front().capacity() > 1;
+  } 
 }
   
 bool
-MaximumBipartiteGroupsMatcherMT::match(const HypoJetGroupCIter& jets_b,
-                                       const HypoJetGroupCIter& jets_e,
-                                       std::unique_ptr<IConditionVisitor>& visitor){
-  // setup a FlowNetwork with number of nodes = number of conditions
-  // + number of jets + 2 (source and sink)
-  int n_conditions = m_conditions.size();
-  int n_jets = jets_e - jets_b;
-
-  if (n_conditions > n_jets){  // caller guarantees n_conditions > 0 
+MaximumBipartiteGroupsMatcherMT::match(const HypoJetGroupCIter& groups_b,
+                                       const HypoJetGroupCIter& groups_e,
+                                       const std::unique_ptr<ITrigJetHypoInfoCollector>& collector,
+				       bool debug){
+  /* setup a FlowNetwork. 
+     if group size == 1:
+     nodes include source, conditions, jets groups, sink
+     otherwise:
+     nodes include source, conditions, jets groups, jets, sink
+     
+     Then solve the network (FordFulkerson)
+  */
+  
+  auto out = std::unique_ptr<std::ofstream>(nullptr);
+  if (debug){
+    std::string fn = "MatcherDebug.log";
+    out.reset(new std::ofstream(fn));
+    *out << "sent 0\n";
+  }
+  
+  if(m_conditions.empty()){
+    if(collector){
+      collector->collect("MaximumBipartiteGroupsMatcherMT", "No conditions");
+    }
     return false;
   }
-    
-  int V = n_conditions + n_jets + 2;
-  m_G = FlowNetwork(V);
 
-  constexpr double capacity = 1.0;
-
-  // add in edges - source node to each condition node
-  // the condition labels start at 1. 0 is reserved for the source node.  
-  std::map<int, ConditionsMT::value_type*> conditionsmap;
-  int inode = 1;
-  for(auto c = m_conditions.begin(); c != m_conditions.end(); ++c){
-    m_G.addEdge(std::make_shared<FlowEdge>(0, inode, capacity));
-    conditionsmap[inode] = &(*c);
-    /*
-    std::cout << "FordFulkerson stored condition "
-              << inode << " "
-              << *c
-              <<" "
-              << &(*c)
-              << '\n';
-    */
-    ++inode;
-  }
+  
+  // Determine jet group - condition satisfaction.
+  
+  constexpr double unitCapacity = 1.0;
+  if(out){*out << "sent 100\n";}
 
-  /*
-  for(const auto& c : conditionsmap){
-      std::cout << "FordFulkerson condition "
-                << c.first << " "
-                << c.second << " "
-                << *(c.second)
-                << '\n';
+  if((groups_e - groups_b) <= 0) {
+    if(collector){
+      collector->collect("MaximumBipartiteGroupsMatcherMT", "No jet groups");
+    }
+    return false;
   }
-  */
-  // add in edges - jet node to sink node of the jet meet a condition.
-  // the jet labels start after the conditions labels.
-  std::map<int, HypoJetVector> jetmap;
-  for (auto c = jets_b; c != jets_e;  ++c){
-    jetmap[inode] = *c;
-    m_G.addEdge(std::make_shared<FlowEdge>(inode, V-1, capacity));
-    ++inode;
+
+  if(out){*out << "sent 120\n";}
+
+  std::map<int, const HypoJetVector*>jet_groups;  //index - jet group for matches
+  std::vector<std::shared_ptr<FlowEdge>> edges;
+  std::size_t jetGroupOffset = m_conditions.size();
+  std::size_t icond{0};
+
+  int sourceCapacity{0};  // used for viability check before running FF.
+  
+  for(const auto& cond : m_conditions){
+    ++icond;
+    bool c_is_satisfied = false;
+    std::size_t ijg{jetGroupOffset};
+    for (auto jg = groups_b; jg != groups_e; ++jg){
+      ++ijg;
+      if (cond.isSatisfied(*jg, collector)){
+	// add edge source - condition once only.
+	if(!c_is_satisfied){
+	  c_is_satisfied = true;
+	  // add source-condition link if condition satisfied
+	  edges.push_back(std::make_shared<FlowEdge>(0,
+						     icond,
+						     cond.capacity()));
+	  sourceCapacity += cond.capacity();
+	  if(collector){
+	    std::stringstream ss;
+	    ss << 0 << "->" << icond << '\n';
+	    collector->collect("MatcherMT", ss.str());
+	  }
+	}
+
+	// keep track of satisfying groups
+	jet_groups[ijg] = &(*jg);  
+	// add condition- group link if condition satisfied
+	edges.push_back(std::make_shared<FlowEdge>(icond,
+						   ijg,
+						   cond.capacity()));
+	if(collector){
+	  std::stringstream ss;
+	  ss << icond << "->" << ijg << '\n';
+	  collector->collect("MatcherMT", ss.str());
+	}
+      }
+    }
+    
+    if(out){*out << "sent 300\n";}
+    if(!c_is_satisfied){
+      if(collector){
+	collector->collect("MaximumBipartiteGroupsMatcherMT",
+			   "Unsatisfied Condition" + cond.toString());
+      }
+      return false;
+    }
   }
+  if(out){*out << "sent 500\n";}
 
-  if (inode != V-1){
-    throw std::runtime_error("Last node in flow graph not the sink node");
+  std::map<pHypoJet, int> jets;  //contains jets found in groups (nb type order)
+
+  int jnode{jetGroupOffset + (groups_e-groups_b)}; // node = 0 four the source node.
+
+  if(collector){
+    collector->collect("MaximumBipartiteGroupsMatcherMT",
+		       "Νο of matched jet groups: " + std::to_string(jet_groups.size()));
   }
+  
+  for(const auto& jg : jet_groups){
+    for(const auto& j : *(jg.second)){
 
-  // add in edges - condition node to jet node for each jet-condition pair where
-  //    the jet satisfies the condition
-
-  for(auto c : conditionsmap){
-    for (auto j : jetmap){
-        //NEEDSFIX START
-      // HypoJetVector v{j.second}; // load the jet into a container
-      if (c.second->isSatisfied(j.second, visitor)){
-        //NEEDSFIX end
-        // if (c.second->isSatisfied(v)){
-        m_G.addEdge(std::make_shared<FlowEdge>(c.first, j.first, capacity));
+      auto iter = jets.find(j);
+      if (iter == jets.end()){
+	jets[j] = ++jnode;
+	edges.push_back(std::make_shared<FlowEdge>(jg.first,
+						   jnode,
+						   unitCapacity));
+	if(collector){
+	  std::stringstream ss;
+	  ss << jg.first << "->" << jnode << '\n';
+	  collector->collect("MatcherMT", ss.str());
+	}
+      } else {
+	edges.push_back(std::make_shared<FlowEdge>(jg.first,
+						   iter->second,
+						   unitCapacity));
+	if(collector){
+	  std::stringstream ss;
+	  ss << jg.first << "->" << iter->first << '\n';
+	  collector->collect("MatcherMT", ss.str());
+	}
       }
     }
   }
 
-  // std::cout << "FlowNetwork:\n " << G <<'\n';
+  if(collector){
+    collector->collect("MaximumBipartiteGroupsMatcherMT - fn before",
+		       "Νο of matched jets in matched groups: " + std::to_string(jets.size())+ "\n");
+  }
+  if(out){*out << "sent 600\n";}
+  
+  int V = jnode + 2;  // now we have all the nodes, can index the sink
+  if(out){*out << "sent 600 " << V << '\n';}
+  for(const auto j: jets){
+    edges.push_back(std::make_shared<FlowEdge>(j.second,
+					       V-1,
+					       unitCapacity));
+    if(collector){
+      std::stringstream ss;
+      ss << j.first << "->" << V-1 << '\n';
+      collector->collect("MatcherMT", ss.str());
+    }
+  }
 
+  if(out){*out << "sent 700 " << V << "\n";}
+  
+  m_G = FlowNetwork(V);
+  for(const auto & edge: edges){
+    m_G.addEdge(edge);
+  }
+  
+  if(collector){
+    std::stringstream ss;
+    ss << m_G;
+    collector->collect("MaximumBipartiteGroupsMatcher -before", ss.str());
+  }
+		     
+  if(out){*out << "sent 800\n";}
+  
   FordFulkerson ff (m_G, 0, V-1);
-  bool pass = std::round(ff.value()) == m_conditions.size();
-  /*
-  std::cout<<"FordFulkerson value: " 
-           << ff.value() 
-           << " conditions: "  
-           << m_conditions.size()
-           << " pass: "
-           << std::boolalpha
-           << m_pass
-           << '\n';
-  */
-  // record which jets participate in the pass decision
-  auto mapend = jetmap.end();
 
+  if(collector){
+    std::stringstream ss;
+    ss << m_G;
+    collector->collect("MaximumBipartiteGroupsMatcher - after", ss.str());
+  }
+  if(out){*out << "sent 900\n";}
+  
+  double totalCapacity = 0;
+  for(const auto& cond : m_conditions){
+    totalCapacity += cond.capacity();
+  }
+  bool pass = std::round(ff.value()) == totalCapacity;
+  
+  
   // loop over edges, figure out if it is a condition - jet edge
   // figure out if it the jet is used (flow == 1)
   // add the jet to passing_jets. As this is a set, duplicates
   // will be removed (each edge appears twice in G).
+  
+  HypoJetVector passing_jets;
+  std::map<int, pHypoJet> nodeToJet;
 
-  HypoJetSet passing_jets;
+  // record which jets participate in the pass decision
+  auto mapend = nodeToJet.end();
   
+  for(const auto& nj : jets){
+    nodeToJet.insert(std::map<int, pHypoJet>::value_type(nj.second,
+							 nj.first));
+  }
   for(auto edge : m_G.edges()){
-    auto it = jetmap.find(edge->to());  // label corresponds ot jet?
-      if (it == mapend){continue;}  
-      if (std::round(edge->flow()) == 1){ // jet participates in hypo decision?
-        //NEEDSFIX START
-        // passing_jets.insert(it->second);
-        for(auto j : it->second){passing_jets.insert(j);}
-        //NEEDSFIX end
-
-        jetmap.erase(it);  // remove passing jets from map
-      }
+    auto nj = nodeToJet.find(edge->to());  // index corresponds ot jet?
+    if (nj == mapend){continue;} // no 
+    if (std::round(edge->flow()) == 1){ // jet participates in hypo decision?
+      passing_jets.push_back(nj->second);
+    }
   }
   
   return pass;
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.h
index b0b7823e02514c2ecacc284c09d836104f690562..acb29828c6f9fa48b2c9959551713766df570cb2 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MaximumBipartiteGroupsMatcherMT.h
@@ -23,7 +23,7 @@
 #include <utility>  // std::pair
 #include <set>
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 class MaximumBipartiteGroupsMatcherMT:
 virtual public IGroupsMatcherMT {
@@ -39,11 +39,13 @@ public:
   ~MaximumBipartiteGroupsMatcherMT(){}
   bool match(const HypoJetGroupCIter&,
              const HypoJetGroupCIter&,
-             std::unique_ptr<IConditionVisitor>&) override;
+             const std::unique_ptr<ITrigJetHypoInfoCollector>&,
+	     bool debug=false) override;
   std::string toString() const noexcept override;
   ConditionsMT getConditions() const noexcept override;
 private:
   ConditionsMT m_conditions;
+  bool m_compound;  // true if jet group size >1 
   bool m_pass;
   FlowNetwork m_G;
 };
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.cxx
index 32db6e7da78427a231e824b23082ec85fcdfc75c..9cbd5c8c05e87ff9562884b832264f56772e2574 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.cxx
@@ -25,8 +25,9 @@ NotHelperTool::NotHelperTool(const std::string& type,
   base_class(type, name, parent){
 }
 
-bool NotHelperTool::pass(HypoJetVector& jets,
-                         ITrigJetHypoInfoCollector* collector) const {
+bool
+NotHelperTool::pass(HypoJetVector& jets,
+		    const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
   ATH_MSG_DEBUG("NotHelperTool::pass... " << jets.size() << " jets");
 
   JetTrigTimer timer;
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.h
index 83b53b48dc9ee755a144ecd02364cfb1215b02c6..21b762b0f9c464281d83b1d27d2e8be84cfe041e 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.h
@@ -30,7 +30,7 @@ class NotHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> {
                 const IInterface* parent);
   
   bool pass(HypoJetVector&,
-            ITrigJetHypoInfoCollector*) const override;
+            const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
 
 
   virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override;
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.cxx
index 7b1114acf67e21f552a5f83c65ed597d8cf6a1f1..e9db2ff8b78fdb231ad15997091c9233f9120654 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.cxx
@@ -25,8 +25,9 @@ OrHelperTool::OrHelperTool(const std::string& type,
 }
 
 
-bool OrHelperTool::pass(HypoJetVector& jets,
-                        ITrigJetHypoInfoCollector* collector) const {
+bool
+OrHelperTool::pass(HypoJetVector& jets,
+		   const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
   ATH_MSG_DEBUG("OrHelperTool::pass... " << jets.size() << " jets");
 
  JetTrigTimer timer;
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.h
index 17b5d6487f4d3cf3baac934e7e04e9bc7e9e366a..6d970bd36ee4d6684f730188f43fd0ad2a95f1ed 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.h
@@ -27,7 +27,7 @@ class OrHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> {
                const IInterface* parent);
   
   bool pass(HypoJetVector&,
-            ITrigJetHypoInfoCollector*) const override;
+	    const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
 
   virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override;
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.cxx
index e3da340f00808f1e0aa3d7af11b5cd2cac458f17..937dd2495895dabc6233862846bdab098f9def10 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.cxx
@@ -22,7 +22,8 @@ SingleConditionMatcherMT::SingleConditionMatcherMT(const ConditionBridgeMT& cb):
   
 bool SingleConditionMatcherMT::match(const HypoJetGroupCIter& jets_b,
                                      const HypoJetGroupCIter& jets_e,
-                                     std::unique_ptr<IConditionVisitor>& v) {
+                                     const std::unique_ptr<ITrigJetHypoInfoCollector>& v,
+				     bool) {
 
   
   for(auto i=jets_b; i != jets_e; ++i){
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.h
index 023f7998470cb56a96c649d7e2d9e46ea99f163e..2080941082137d0e24146787febb2f48bb5c2a15 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SingleConditionMatcherMT.h
@@ -37,7 +37,9 @@ public:
   ~SingleConditionMatcherMT(){}
   bool match(const HypoJetGroupCIter&,
              const HypoJetGroupCIter&,
-             std::unique_ptr<IConditionVisitor>&) override;
+	     const std::unique_ptr<ITrigJetHypoInfoCollector>&,
+	     bool debug) override;
+  
   std::string toString() const noexcept override;
   ConditionsMT getConditions() const noexcept override;
 private:
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx
index 0a73274113096388df7bab01cace47d8e4d896e9..3cee408cd192b5ac6d97bbd4bba72819b6fc0537 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "./TLAConditionMT.h"
-#include "./IConditionVisitor.h"
+#include "./ITrigJetHypoInfoCollector.h"
 
 #include <sstream>
 #include <stdexcept>
@@ -57,7 +57,7 @@ TLAConditionMT::TLAConditionMT(double etaMin,
 }
 
 bool TLAConditionMT::isSatisfied(const HypoJetVector& ips,
-                                 std::unique_ptr<IConditionVisitor>&) const{
+                                 const std::unique_ptr<ITrigJetHypoInfoCollector>&) const{
   if(ips.size() != 2){
     std::stringstream ss;
     ss << "TLA::isSatisfied must see exactly 2 particles, but recieved "
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h
index d97e25b4a1eb2021679946c1d636ae9e99077b1b..4b2389f0adc70d8718a0f7da833eb6c3b5c20b26 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h
@@ -17,7 +17,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
 #include "./IConditionMT.h"
 
-class IConditionVisitor;
+class ITrigJetHypoInfoCollector;
 
 
 class TLAConditionMT: public IConditionMT{
@@ -39,9 +39,11 @@ class TLAConditionMT: public IConditionMT{
   ~TLAConditionMT() override {}
 
   bool isSatisfied(const HypoJetVector&,
-                   std::unique_ptr<IConditionVisitor>&) const override;
+                   const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override;
   std::string toString() const noexcept override;
 
+  virtual unsigned int capacity() const override {return s_capacity;}
+
  private:
   double m_etaMin;
   double m_etaMax;
@@ -49,6 +51,9 @@ class TLAConditionMT: public IConditionMT{
   double m_ystarMax;
   double m_massMin;
   double m_massMax;
+
+  const static unsigned int s_capacity{1};
+
 };
 
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TreeInfoCollector.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TreeInfoCollector.h
deleted file mode 100644
index dbdcaa561d6fa339bd67b3ddceb6de671e36a2a9..0000000000000000000000000000000000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TreeInfoCollector.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGHLTJETHYPO_HYPOTREEINFOCOLLECTOR_H
-#ifndef TRIGHLTJETHYPO_HYPOTREEINFOCOLLECTOR_H
-
-#include "./ITrigJetHypoInfoCollector.h"
-#include <map>
-
-class HypoTreeInfoCollector: public ITrigJetHypoInfoCollector {
-    
-public:
-  virtual void collect(const std::string&, const std::string&) override;
-
-  std::string toString() const noexcept;
-  void write(std::string, uint32_t run, uint32_t event) const;
-  void write(std::string, std::size_t) const;
-
- private:
-  std::map<std::string, std::string> m_info;
-
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.cxx
index 39746f5dea76a7fc06cf6809da035c148a9a26df..3bb04fefd63f945286ecf20dbd16061b2ed00a6b 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.cxx
@@ -9,7 +9,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerFactory.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJet.h"  // TLorentzVec
 #include "./nodeIDPrinter.h"
-#include "./ConditionDebugVisitor.h"
+#include "./DebugInfoCollector.h"
 #include <algorithm>
 #include <sstream>
 
@@ -31,8 +31,7 @@ StatusCode TrigJetHypoToolHelperMT::initialize() {
 
 void
 TrigJetHypoToolHelperMT::collectData(const std::string& exetime,
-                                     ITrigJetHypoInfoCollector* collector,
-                                     std::unique_ptr<IConditionVisitor>& cVisitor,
+                                     const std::unique_ptr<ITrigJetHypoInfoCollector>& collector,
                                      bool pass) const {
   if(!collector){return;}
   auto helperInfo = nodeIDPrinter(name(),
@@ -42,21 +41,14 @@ TrigJetHypoToolHelperMT::collectData(const std::string& exetime,
                                   exetime
                                   );
   
-  helperInfo += cVisitor->toString();
-  
   collector->collect(name(), helperInfo);
 }
       
 
-bool TrigJetHypoToolHelperMT::pass(HypoJetVector& jets,
-                                   ITrigJetHypoInfoCollector* collector) const {
-
+bool
+TrigJetHypoToolHelperMT::pass(HypoJetVector& jets,
+			      const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
 
-  // visit conditions if debugging
-  std::unique_ptr<IConditionVisitor> cVisitor(nullptr); 
-  if (collector){
-    cVisitor.reset(new ConditionDebugVisitor);
-  }
 
   JetTrigTimer timer;
   timer.start();
@@ -64,7 +56,7 @@ bool TrigJetHypoToolHelperMT::pass(HypoJetVector& jets,
   if(jets.empty()){   
     timer.stop();
     bool pass = false;
-    collectData(timer.readAndReset(), collector, cVisitor, pass);
+    collectData(timer.readAndReset(), collector, pass);
     return pass;
   }
 
@@ -79,10 +71,10 @@ bool TrigJetHypoToolHelperMT::pass(HypoJetVector& jets,
   }
 
   auto jetGroups = m_grouper->group(begin, end);
-  bool pass = m_matcher->match(jetGroups.begin(), jetGroups.end(), cVisitor);
+  bool pass = m_matcher->match(jetGroups.begin(), jetGroups.end(), collector);
   timer.stop();
 
-  collectData(timer.readAndReset(), collector, cVisitor, pass);
+  collectData(timer.readAndReset(), collector, pass);
   return pass;
 }
   
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.h
index c8552d278d49a7365f241503f4eb2f2fcca457c4..fffd58cc5284b98ad1a73ec511794f7083d688c4 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolHelperMT.h
@@ -40,7 +40,7 @@ public extends<AthAlgTool, ITrigJetHypoToolHelperMT> {
 
   StatusCode initialize() override;
   bool  pass(HypoJetVector&,
-             ITrigJetHypoInfoCollector*) const;
+             const std::unique_ptr<ITrigJetHypoInfoCollector>&) const;
 
   virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override;
 
@@ -76,8 +76,7 @@ Gaudi::Property<bool>
 
 
  void collectData(const std::string& exetime,
-                  ITrigJetHypoInfoCollector* collector,
-                  std::unique_ptr<IConditionVisitor>&,
+                  const std::unique_ptr<ITrigJetHypoInfoCollector>&,
                   bool pass) const;
 
  std::string toString() const;
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
index 266550420939c30542a32eb591fb14d673e2150e..9843c2a622e7cf5552c799be9886c72ec0d71e5c 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
@@ -18,7 +18,6 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJetFactory.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/lineSplitter.h"
 #include "./DebugInfoCollector.h"
-#include "./HypoTreeInfoCollector.h"
 
 #include "DecisionHandling/HLTIdentifier.h"
 #include "DecisionHandling/TrigCompositeUtils.h"
@@ -41,7 +40,7 @@ TrigJetHypoToolMT::~TrigJetHypoToolMT(){
 
 StatusCode TrigJetHypoToolMT::initialize(){
   CHECK(m_evt.initialize());
-  HypoTreeInfoCollector collector;
+  DebugInfoCollector collector(name());
   CHECK(m_helper->getDescription(collector));
   auto s = collector.toString();
   
@@ -50,7 +49,7 @@ StatusCode TrigJetHypoToolMT::initialize(){
   }
   
   if (m_visitDebug){
-    collector.write(name());
+    collector.write();
   }
   return StatusCode::SUCCESS;
 }
@@ -77,7 +76,11 @@ StatusCode TrigJetHypoToolMT::decide(const xAOD::JetContainer* jets,
                 << "...");
 
   // steady_clock::time_point t =  steady_clock::now();
-  auto infocollector = m_visitDebug? new DebugInfoCollector : nullptr;
+  std::unique_ptr<ITrigJetHypoInfoCollector> infocollector(nullptr);
+  if(m_visitDebug){
+    auto collectorName = name() + std::to_string(m_eventSN->getSN());
+    infocollector.reset(new  DebugInfoCollector(collectorName));
+  } 
 
   try{
     pass = m_helper->pass(hypoJets, infocollector);
@@ -88,7 +91,7 @@ StatusCode TrigJetHypoToolMT::decide(const xAOD::JetContainer* jets,
   }
   
   if (infocollector){
-    infocollector->write(name(), m_eventSN->getSN());
+    infocollector->write();
   }
 
   // accumulateTime(steady_clock::now() - t);
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest.cxx
index 6f217f14b3f2588465824b2d1dd57691c26da1de..a13d842fd5d3131d8ba2dd36decd80ed3c158b0d 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest.cxx
@@ -6,7 +6,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
 #include "TrigHLTJetHypo/../src/ConditionsDefsMT.h"
 #include "TrigHLTJetHypo/../src/conditionsFactoryMT.h"
-#include "TrigHLTJetHypo/../src/ConditionDebugVisitor.h"
+#include "TrigHLTJetHypo/../src/DebugInfoCollector.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CombinationsGrouper.h"
 
 #include "./MockJetWithLorentzVector.h"
@@ -69,7 +69,7 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, zeroInputJets){
 
   HypoJetVector jets;
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
-  auto visitor = std::unique_ptr<IConditionVisitor>(nullptr);
+  auto visitor = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
   
   bool pass = matcher.match(groups.begin(), groups.end(), visitor);
   
@@ -89,13 +89,20 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, tooFewSelectedJets){
   MockJetWithLorentzVector jet0(tl);
   MockJetWithLorentzVector jet1{tl};
 
+  EXPECT_CALL(jet0, eta()).Times(1);
+  EXPECT_CALL(jet0, et()).Times(1);
+
+  EXPECT_CALL(jet1, eta()).Times(1);
+  EXPECT_CALL(jet1, et()).Times(1);
+ 
   HypoJetVector jets{&jet0, &jet1};
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
-  auto visitor = std::unique_ptr<IConditionVisitor>(nullptr);
+  auto visitor = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
 
   MaximumBipartiteGroupsMatcherMT matcher(m_conditions);
   bool pass = matcher.match(groups.begin(), groups.end(), visitor);
 
+ 
   EXPECT_FALSE(pass);
 }
 
@@ -120,22 +127,29 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, oneSelectedJet){
 
   HypoJetVector jets{&jet0, &jet1, &jet2, &jet3};
 
-  EXPECT_CALL(jet0, eta()).Times(m_nconditions);
-  EXPECT_CALL(jet1, eta()).Times(m_nconditions);
-  EXPECT_CALL(jet2, eta()).Times(m_nconditions);
-  EXPECT_CALL(jet3, eta()).Times(m_nconditions);
+  EXPECT_CALL(jet0, eta()).Times(3);
+  EXPECT_CALL(jet0, et()).Times(3);
+
+  EXPECT_CALL(jet1, eta()).Times(3);
+  EXPECT_CALL(jet1, et()).Times(3);
+
+  
+  EXPECT_CALL(jet2, eta()).Times(3);
+  EXPECT_CALL(jet2, et()).Times(3);
 
-  EXPECT_CALL(jet0, et()).Times(m_nconditions);
-  EXPECT_CALL(jet1, et()).Times(m_nconditions);
-  EXPECT_CALL(jet2, et()).Times(m_nconditions);
-  EXPECT_CALL(jet3, et()).Times(m_nconditions);
 
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
-  auto visitor = std::unique_ptr<IConditionVisitor>(nullptr);
+  
+  std::unique_ptr<ITrigJetHypoInfoCollector>
+    collector(new DebugInfoCollector("oneSelectedJet.log"));
+								      
 
+  EXPECT_TRUE(groups.end() - groups.begin() == 4);
+  auto groups_b = groups.begin();
+  auto groups_e = groups.end();
   MaximumBipartiteGroupsMatcherMT matcher(m_conditions);
-  bool pass = matcher.match(groups.begin(), groups.end(), visitor);
-
+  bool pass = matcher.match(groups_b, groups_e, collector, true);
+  collector->write();
   EXPECT_FALSE(pass);
 }
 
@@ -184,7 +198,7 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, twoSelectedJets){
 
   MaximumBipartiteGroupsMatcherMT matcher(m_conditions);
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
-  auto visitor = std::unique_ptr<IConditionVisitor>(nullptr);
+  auto visitor = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
 
   bool pass = matcher.match(groups.begin(), groups.end(), visitor);
 
@@ -237,7 +251,7 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, threeSelectedJets){
 
   MaximumBipartiteGroupsMatcherMT matcher(m_conditions);
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
-  auto visitor = std::unique_ptr<IConditionVisitor>(nullptr);
+  auto visitor = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
 
   bool pass = matcher.match(groups.begin(), groups.end(), visitor);
 
@@ -289,7 +303,7 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, fourSelectedJets){
 
   MaximumBipartiteGroupsMatcherMT matcher(m_conditions);
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
-  auto visitor = std::unique_ptr<IConditionVisitor>(nullptr);
+  auto visitor = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
 
   bool pass = matcher.match(groups.begin(), groups.end(), visitor);
 
@@ -351,7 +365,7 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, overlappingEtaRegions){
 
   MaximumBipartiteGroupsMatcherMT matcher(conditions);
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
-  auto visitor = std::unique_ptr<IConditionVisitor>(nullptr);
+  auto visitor = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
   
   bool pass = matcher.match(groups.begin(), groups.end(), visitor);
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest_BadConfig.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest_BadConfig.cxx
index 0d63c0c18c794417b3251643c2613d6029a1f7f2..d49e89d62190f0395f86a91cd899de122dbd125d 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest_BadConfig.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/MaximumBipartiteGroupsMatcherMTTest_BadConfig.cxx
@@ -6,7 +6,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
 #include "TrigHLTJetHypo/../src/ConditionsDefsMT.h"
 #include "TrigHLTJetHypo/../src/conditionsFactoryMT.h"
-#include "TrigHLTJetHypo/../src/ConditionDebugVisitor.h"
+#include "TrigHLTJetHypo/../src/DebugInfoCollector.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CombinationsGrouper.h"
 
 #include "./MockJetWithLorentzVector.h"
@@ -135,18 +135,14 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_BadConfig, bad0){
   MaximumBipartiteGroupsMatcherMT matcher(m_conditions);
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
   EXPECT_TRUE(groups.size() == 6);
-  auto visitor = std::unique_ptr<IConditionVisitor>();
-  visitor.reset(new ConditionDebugVisitor);
+  auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>();
+  collector.reset(new DebugInfoCollector("bad0"));
   
-  bool pass = matcher.match(groups.begin(), groups.end(), visitor);
+  bool pass = matcher.match(groups.begin(), groups.end(), collector);
+  collector->write();
 
-  if(out){
-    *out << "dumping visitor\n";
-    *out << visitor->toString();   
-  }
-  
   for(auto j : jets){delete j;}
-  EXPECT_TRUE(pass);
+  EXPECT_FALSE(pass);
 }
 
 
@@ -181,18 +177,14 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_BadConfig, bad1){
   MaximumBipartiteGroupsMatcherMT matcher(m_conditions);
   auto groups = makeJetGroupsMT(jets.begin(), jets.end());
   EXPECT_TRUE(groups.size() == 6);
-  auto visitor = std::unique_ptr<IConditionVisitor>();
-  visitor.reset(new ConditionDebugVisitor);
+  auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>();
+  collector.reset(new DebugInfoCollector("bad1"));
   
-  bool pass = matcher.match(groups.begin(), groups.end(), visitor);
-
-  if(out){
-    *out << "dumping visitor\n";
-    *out << visitor->toString();   
-  }
+  bool pass = matcher.match(groups.begin(), groups.end(), collector);
+  collector->write();
   
   for(auto j : jets){delete j;}
-  EXPECT_TRUE(pass);
+  EXPECT_FALSE(pass);
 }
 
 
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/python/TrigMuonHypoMTConfig.py b/Trigger/TrigHypothesis/TrigMuonHypoMT/python/TrigMuonHypoMTConfig.py
index 0a050915deb74401cd63a3807056c082b81ddce8..72aa1aa71c20f0bc353478edc7faf627881a6e58 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/python/TrigMuonHypoMTConfig.py
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/python/TrigMuonHypoMTConfig.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
-from TrigMuonHypoMT.TrigMuonHypoMTConf import TrigMufastHypoAlg, TrigMufastHypoTool, TrigmuCombHypoAlg, TrigmuCombHypoTool, TrigMuonEFMSonlyHypoAlg, TrigMuonEFMSonlyHypoTool, TrigMuisoHypoAlg, TrigMuisoHypoTool, TrigMuonEFCombinerHypoAlg, TrigMuonEFCombinerHypoTool
+from TrigMuonHypoMT.TrigMuonHypoMTConf import TrigMufastHypoAlg, TrigMufastHypoTool, TrigmuCombHypoAlg, TrigmuCombHypoTool, TrigMuonEFMSonlyHypoAlg, TrigMuonEFMSonlyHypoTool, TrigMuisoHypoAlg, TrigMuisoHypoTool, TrigMuonEFCombinerHypoAlg, TrigMuonEFCombinerHypoTool, TrigMuonEFTrackIsolationHypoAlg, TrigMuonEFTrackIsolationHypoTool
 from TrigMuonHypoMT.TrigMuonHypoMonitoringMT import *
 from AthenaCommon.SystemOfUnits import GeV
 from AthenaCommon.AppMgr import ToolSvc
@@ -175,6 +175,18 @@ muFastThresholdsForECWeakBRegion = {
     }
 
 
+# Working points for EF track isolation algorithm
+# syntax is:
+# 'WPname' : cut on 0.3 cone
+# put < 0 for no cut
+trigMuonEFTrkIsoThresholds = {
+    'ivarmedium'      : 0.07, #ivarmedium
+    'ivartight'       : 0.06, #ivartight
+    'ivarverytight'  : 0.04   #ivarverytight
+    }
+
+
+
 def addMonitoring(tool, monClass, name, thresholdHLT ):
     try:
         if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in TriggerFlags.enableMonitoring() or 'Cosmic' in TriggerFlags.enableMonitoring():
@@ -465,6 +477,46 @@ class TrigMuonEFCombinerHypoConfig():
 
 
 
+def TrigMuonEFTrackIsolationHypoToolFromDict( chainDict ) :
+    cparts = [i for i in chainDict['chainParts'] if i['signature'] is 'Muon']
+    thresholds = cparts[0]['isoInfo']
+    config = TrigMuonEFTrackIsolationHypoConfig()
+    tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds )
+    return tool
+
+class TrigMuonEFTrackIsolationHypoConfig() :
+
+    def ConfigurationHypoTool(self, toolName, isoCut):
+
+        tool=TrigMuonEFTrackIsolationHypoTool(toolName)
+
+        try:
+            ptcone03 = trigMuonEFTrkIsoThresholds[ isoCut ]
+
+            self.PtCone02Cut = -1.0
+            self.PtCone03Cut = ptcone03
+            self.AcceptAll = False
+
+            if 'MS' in isoCut:
+                self.RequireCombinedMuon = False
+            else:
+                self.RequireCombinedMuon = True
+
+            self.DoAbsCut = True
+            if 'var' in isoCut :
+                self.useVarIso = True
+            else :
+                self.useVarIso = False                                
+        except LookupError:
+            if(isoCut=='passthrough') :
+                print 'Setting passthrough'
+                self.AcceptAll = True
+            else:
+                print 'isoCut = ', isoCut
+                raise Exception('TrigMuonEFTrackIsolation Hypo Misconfigured')
+        return tool
+
+
 
 if __name__ == '__main__':
     # normaly this tools are private and have no clash in naming, for the test we create them and never assign so they are like public,
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py
index fc11acd47f6efc9f3b12b928b684f16bcee10f3e..c65d45f7317a73b41f8ff71ef608b0eefaf37c6a 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py
@@ -2,9 +2,9 @@
 
 #Categories currently used by offline Egamma TO monitoring tool
 #Important to keep lists updated
-primary_single_ele = ['HLT_e24_lhtight_nod0','HLT_e26_lhtight_nod0','HLT_e28_lhtight_nod0','HLT_e60_lhmedium_nod0_L1EM24VHI','HLT_e80_lhmedium_nod0_L1EM24VHI','HLT_e140_lhloose_nod0_L1EM24VHI']
-primary_single_ele_iso =['HLT_e24_lhtight_nod0_ivarloose','HLT_e26_lhtight_nod0_ivarloose','HLT_e28_lhtight_nod0_ivarloose']
-monitoring_Zee = ['HLT_e28_lhtight_nod0_e15_etcut_L1EM7_Zee','HLT_e26_lhtight_nod0_e15_etcut_L1EM7_Zee']
+primary_single_ele = ['HLT_e24_lhtight_nod0','HLT_e26_lhtight_nod0','HLT_e60_lhmedium_nod0_L1EM24VHI','HLT_e80_lhmedium_nod0_L1EM24VHI','HLT_e140_lhloose_nod0_L1EM24VHI']
+primary_single_ele_iso =['HLT_e24_lhtight_nod0_ivarloose','HLT_e26_lhtight_nod0_ivarloose']
+monitoring_Zee = ['HLT_e26_lhtight_nod0_e15_etcut_L1EM7_Zee']
 monitoring_Jpsiee = ['HLT_e5_lhtight_nod0_e4_etcut','HLT_e5_lhtight_nod0_e4_etcut_Jpsiee']
 primary_single_pho = ['HLT_g140_tight','HLT_g200_loose']
 
@@ -42,10 +42,7 @@ monitoring_tags = ['HLT_e5_lhloose',
                    'HLT_e26_lhtight_nod0_ivarloose',
                    'HLT_e28_lhtight_nod0_ivarloose',
                    'HLT_e60_lhmedium_nod0_L1EM24VHI',
-                   'HLT_e5_lhloose_gsf',
-                   'HLT_e17_lhvloose_nod0_gsf',
-                   'HLT_e28_lhtight_nod0_gsf_ivarloose',
-                   'HLT_e60_lhmedium_nod0_gsf_L1EM24VHI']
+                   ]
 
 monitoring_jpsitags = [
     'HLT_e5_lhtight_nod0_e4_etcut',
@@ -73,19 +70,11 @@ monitoring_electron = ['HLT_e60_lhmedium_nod0_L1EM24VHI',
 # monitoring_electron += commission_electron
 
 # 2018 single electrons triggers to monitor from Zee TP, includes rerun
-commissionTP_electron = ['HLT_e28_lhtight_nod0_sc_ivarloose',
-                         'HLT_e28_lhtight_nod0_gsf_ivarloose',
-                         'HLT_e28_lhtight_nod0_sc_gsf_ivarloose',
-                         'HLT_e24_lhvloose_nod0_gsf',
-                         'HLT_e24_lhvloose_nod0_sc',
-                         'HLT_e24_lhvloose_nod0_sc_gsf',
+commissionTP_electron = [
                          'HLT_e5_lhloose',
                          'HLT_e28_lhtight_nod0_ivarloose',
                          'HLT_e60_lhmedium_nod0_L1EM24VHI',
-                         'HLT_e5_lhloose_gsf',
-                         'HLT_e17_lhvloose_nod0_gsf',
-                         'HLT_e28_lhtight_nod0_gsf_ivarloose',
-                         'HLT_e60_lhmedium_nod0_gsf_L1EM24VHI']
+                         ]
 
 monitoringTP_electron = [
                          'HLT_e28_lhtight_nod0_ivarloose',                        
@@ -100,7 +89,6 @@ monitoringTP_Jpsiee = ["HLT_e5_lhtight_nod0"]
 monitoring_photon = ['HLT_g25_medium_L1EM20VH',
                      'HLT_g35_loose',
                      'HLT_g120_loose',
-                     'HLT_g25_medium_sc_L1EM20VH',
                      'HLT_g20_tight_icalovloose_L1EM15VHI',
                      'HLT_g200_loose']
 
diff --git a/Trigger/TrigTools/TrigInDetRecoTools/src/TrigL2PattRecoStrategyC.cxx b/Trigger/TrigTools/TrigInDetRecoTools/src/TrigL2PattRecoStrategyC.cxx
index 58befccb444752b77b03db50011b7e49aaa7f80e..9575d2708baa69af546fde0f32e5db6f1d66fdec 100644
--- a/Trigger/TrigTools/TrigInDetRecoTools/src/TrigL2PattRecoStrategyC.cxx
+++ b/Trigger/TrigTools/TrigInDetRecoTools/src/TrigL2PattRecoStrategyC.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -283,8 +283,7 @@ HLT::ErrorCode TrigL2PattRecoStrategyC::findTracks(const std::vector<const TrigS
 
     if(m_timers) m_timer[9]->start();
 
-    m_zvertexmaker->newRegion(listOfPixIds,listOfSCTIds,roi);
-    VZ = m_zvertexmaker->getVertices();
+    VZ = std::move(m_zvertexmaker->newRegion(listOfPixIds,listOfSCTIds,roi));
     std::for_each(VZ.begin(),VZ.end(),ZVertexCopyFunctor(m_zVertices));
     if(m_timers) m_timer[9]->stop();
     if (outputLevel <= MSG::DEBUG) 
@@ -439,8 +438,7 @@ HLT::ErrorCode TrigL2PattRecoStrategyC::findTracks(const std::vector<const TrigS
   if( m_useZvertexTool ) {    
 
     if(m_timers) m_timer[9]->start();
-    m_zvertexmaker->newEvent(); 
-    VZ = m_zvertexmaker->getVertices();
+    VZ = std::move(m_zvertexmaker->newEvent());
     std::for_each(VZ.begin(),VZ.end(),ZVertexCopyFunctor(m_zVertices));
     if(m_timers) m_timer[9]->stop();   
     if (outputLevel <= MSG::DEBUG) 
diff --git a/Trigger/TrigTools/TrigVKalFitter/TrigVKalFitter/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigVKalFitter/TrigVKalFitter/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..db2371d6f89ae9f3869910acdf7f1e42644b2c02
--- /dev/null
+++ b/Trigger/TrigTools/TrigVKalFitter/TrigVKalFitter/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigTools/TrigVKalFitter
diff --git a/Trigger/TrigTools/TrigVKalFitter/TrigVKalFitter/TrigVKalFitter.h b/Trigger/TrigTools/TrigVKalFitter/TrigVKalFitter/TrigVKalFitter.h
index 888a0eace67c58f1b3d7f267f31f60361c8a6233..87ddf48a4ae27a5137cce47725d5f3793977f114 100755
--- a/Trigger/TrigTools/TrigVKalFitter/TrigVKalFitter/TrigVKalFitter.h
+++ b/Trigger/TrigTools/TrigVKalFitter/TrigVKalFitter/TrigVKalFitter.h
@@ -17,7 +17,7 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "MagFieldInterfaces/IMagFieldSvc.h"
 //
-
+#include "TrkVKalVrtCore/ForCFT.h"
 
 namespace {
 static const int NTRMAXTRIG=300;
@@ -228,7 +228,7 @@ private:
 
    TrigAtlasMagFld *  m_fitField;
    Trk::VKalVrtControl  *  m_vkalFitControl;
-
+   Trk::ForCFT      m_coreFit;
    //      
    // Private functions (technicalities)
    //
diff --git a/Trigger/TrigTools/TrigVKalFitter/src/SetFitOptions.cxx b/Trigger/TrigTools/TrigVKalFitter/src/SetFitOptions.cxx
index be9cec2750a2d0a17615daf54a70b2f6a20cc85a..b456ca4b250be7763635abe7ba894d8aa9d703df 100755
--- a/Trigger/TrigTools/TrigVKalFitter/src/SetFitOptions.cxx
+++ b/Trigger/TrigTools/TrigVKalFitter/src/SetFitOptions.cxx
@@ -9,15 +9,6 @@
 #include<iostream>
 
 
-namespace Trk {
-   extern void prcfit(long int *,double *,double* ,
-                      double* , double* , double* );           
-   extern void setmasscnst_(long int* , long int* , double* );
-   extern void vksetIterationNum(long int Iter);
-   extern void vksetIterationPrec(double Prec);
-   extern void vksetRobustness(long int Rob);
-}
-
 //
 // Option setting for VKalVrt core
 //
@@ -68,7 +59,7 @@ void TrigVKalFitter::VKalVrtSetOptions(long int ntrk)
       m_TrackCharge.clear();
    }
    //---
-   Trk::prcfit(&ntrk,m_wm,&MFit,&m_BMAG,m_VrtCst,m_CovVrtCst);
+   m_coreFit.prcfit(&ntrk,m_wm,&MFit,&m_BMAG,m_VrtCst,m_CovVrtCst);
    //---
    //   Additional change of settings 
    //---
@@ -78,19 +69,19 @@ void TrigVKalFitter::VKalVrtSetOptions(long int ntrk)
          long int NTrk=m_PartMassCnstTrk[ic].size();
          for(int it=0; it<NTrk; it++) Index[it]=m_PartMassCnstTrk[ic][it];
          double CnstMass= (double) m_PartMassCnst[ic];
-         Trk::setmasscnst_(&NTrk,Index,&CnstMass);
+         m_coreFit.setmasscnst_(&NTrk,Index,&CnstMass);
       }
    }
    //---
    if(m_IterationNumber > 0) {
-      Trk::vksetIterationNum(int(m_IterationNumber));
+      m_coreFit.vksetIterationNum(int(m_IterationNumber));
    }
    //---
    if(m_IterationPrecision > 0.) {
-      Trk::vksetIterationPrec(double(m_IterationPrecision));
+      m_coreFit.vksetIterationPrec(double(m_IterationPrecision));
    }
    //---
-   if(m_Robustness > 0) Trk::vksetRobustness( Rob );
+   if(m_Robustness > 0) m_coreFit.vksetRobustness( Rob );
 
 }
 
@@ -118,7 +109,7 @@ void TrigVKalFitter::setMassForConstraint(double MASS)
 void TrigVKalFitter::setMassForConstraint(double MASS, std::vector<int> TrkIndex)
 {  
    m_PartMassCnst.push_back(MASS);
-   m_PartMassCnstTrk.push_back(TrkIndex);
+   m_PartMassCnstTrk.push_back(std::move(TrkIndex));
 }
 
 void TrigVKalFitter::setMomCovCalc(int TYPE)
diff --git a/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx b/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx
index e450b80511063522c5359645912680e1fea0c11a..89c8aa1e7ae22b22eb056f75ce97ad4016fa6d45 100755
--- a/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx
+++ b/Trigger/TrigTools/TrigVKalFitter/src/TVKalFitter.cxx
@@ -15,7 +15,7 @@
 
 namespace Trk {
 
-extern void cfpest( int ntrk, double *vrt, long int *Charge, double (*part)[5], double (*par0)[3]);
+extern void cfpest( int ntrk, double *vrt, long int *Charge, double (*part)[5], double (*par0)[3]);
 extern void xyztrp( long int* Charge, double* vrt, double* Mom, double* CovVrtMom, double BMAG, double* Perig, double* CovPerig);
 
 extern int CFit(VKalVrtControl *FitCONTROL, int ifCovV0, int NTRK, 
@@ -45,7 +45,7 @@ TrigVKalFitter:: TrigVKalFitter(const std::string& type,
    m_Constraint(0),
    m_CalcMomCovariance(0),
    m_MassForConstraint(0.),
-   m_magFieldAthenaSvc("AtlasDefault", name)            //Athena magnetic field
+   m_magFieldAthenaSvc("AtlasDefault", name), m_coreFit()            //Athena magnetic field
 {
    //
    // Declare additional interface
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromCells.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromCells.py
index f3b533ff6e13b0cdbe15c7819b0ccc2f8717607c..cb9d92de554c62fb43117a61846fdd0b38cefbc8 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromCells.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromCells.py
@@ -34,18 +34,17 @@ topSequence += cellMakerAlgo
 # Add EFMissingETFrom** algorithm
 #################################################
 
-from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromCellsMT, EFMissingETFromHelper
+from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromCellsMT, EFMissingETFromHelperMT, EFMissingETFlagsMT
 
 cellTool = EFMissingETFromCellsMT( name="METFromCellsTool" )
 cellTool.CellsCollection = "cells"
 
-helperTool = EFMissingETFromHelper("theHelperTool") 
+helperTool = EFMissingETFromHelperMT("theHelperTool") 
+flagTool = EFMissingETFlagsMT("theFlagsTool") 
 
 metAlg = EFMissingETAlgMT( name="EFMET" )
 metAlg.METContainerKey="HLT_MET"
-
-metAlg.METTools=[ cellTool ]
-metAlg.HelperTool= helperTool 
+metAlg.METTools=[ cellTool, helperTool, flagTool ]
 
 metMon = GenericMonitoringTool("METMonTool")
 metMon.Histograms = [ defineHistogram( "TIME_Total", path='EXPERT', title="Time spent Alg", xbins=100, xmin=0, xmax=100 ),
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClusters.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClusters.py
index badf7c8b2483ae0764cb8c04b06111c3f6d21d7f..a433466cbefe27a10f62b497fbff285077dc10e3 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClusters.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClusters.py
@@ -34,17 +34,15 @@ topSequence += clusterSequence
 # Add EFMissingETFrom** algorithm
 #################################################
 
-from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromClustersMT, EFMissingETFromHelper
+from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromClustersMT, EFMissingETFromHelperMT
 
 clusterTool = EFMissingETFromClustersMT( name="METFromClustersTool" )
 clusterTool.ClustersCollection = clusterContainer
 
-helperTool = EFMissingETFromHelper("theHelperTool") 
-metAlg = EFMissingETAlgMT( name="EFMET" )
-
+helperTool = EFMissingETFromHelperMT("theHelperTool") 
 
-metAlg.METTools=[ clusterTool ]
-metAlg.HelperTool= helperTool 
+metAlg = EFMissingETAlgMT( name="EFMET" )
+metAlg.METTools=[ clusterTool, helperTool ]
 metAlg.METContainerKey = "HLT_MET_Clusters"
 
 metMon = GenericMonitoringTool("METMonTool")
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClustersPufit.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClustersPufit.py
index 1bff215bacba09d8827d3b9427e53eb4bf93c07e..755e6d8d3a1669183699aff52b7745f5152a92a3 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClustersPufit.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClustersPufit.py
@@ -27,17 +27,15 @@ topSequence += clusterSequence
 # Add EFMissingETFrom** algorithm
 #################################################
 
-from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromClustersPufitMT, EFMissingETFromHelper
+from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromClustersPufitMT, EFMissingETFromHelperMT
 
 clusterTool = EFMissingETFromClustersPufitMT( name="METFromClustersPufitTool" )
 clusterTool.ClustersCollection = clusterContainer
 
-helperTool = EFMissingETFromHelper("theHelperTool") 
-metAlg = EFMissingETAlgMT( name="EFMET" )
-
+helperTool = EFMissingETFromHelperMT("theHelperTool") 
 
-metAlg.METTools=[ clusterTool ]
-metAlg.HelperTool= helperTool 
+metAlg = EFMissingETAlgMT( name="EFMET" )
+metAlg.METTools=[ clusterTool, helperTool ]
 metAlg.METContainerKey = "HLT_MET_ClustersPufit"
 
 metMon = GenericMonitoringTool("METMonTool")
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromJets.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromJets.py
index 2ca339a3bc07ee1692924eb8072c7ca6a161a017..7a4dfb1662fa1c0dc1af176f61516c7f5bc9041a 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromJets.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromJets.py
@@ -34,17 +34,16 @@ topSequence += jetSequence
 # Add EFMissingETFrom** algorithm
 #################################################
 
-from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromJetsMT, EFMissingETFromHelper
+from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromJetsMT, EFMissingETFromHelperMT
 
 metAlg = EFMissingETAlgMT( name="EFMET" )
 
 mhtTool = EFMissingETFromJetsMT( name="METFromJetsTool" )
 mhtTool.JetsCollection = jetsKey
-metAlg.METTools=[ mhtTool ]
 
-helperTool = EFMissingETFromHelper("theHelperTool") 
-metAlg.HelperTool= helperTool 
+helperTool = EFMissingETFromHelperMT("theHelperTool") 
 
+metAlg.METTools=[ mhtTool, helperTool ]
 metAlg.METContainerKey="HLT_MET_mht"
 
 metMon = GenericMonitoringTool("METMonTool")
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_grid.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_grid.sh
index 2111c44519e37c589454252d9fa2120be87c8c01..3863165902b5aa30b272b559b9e098013c258c1f 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_grid.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_grid.sh
@@ -7,7 +7,7 @@
 # art-output: *.txt
 # art-output: *.root
 
-export NAME="TrigUpgradeTest_full_menu_grid"
+export NAME="full_menu_grid"
 export INPUT="run2dataFTK" # FTK doesn't matter here - using this dataset because of larger stats
 export EVENTS=1000
 export THREADS=1
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_ftk_build.sh
similarity index 82%
rename from Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_build.sh
rename to Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_ftk_build.sh
index 1635ce0c5b00ebdbfa325a6c588913f443dac37e..54b02ab4a906bb02ce33f718d9b0d22bcc0eab6a 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_build.sh
+++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_ftk_build.sh
@@ -1,9 +1,10 @@
 #!/bin/bash
 
-# art-description: MC v7 no prescales TriggerTest on FTK MC to AOD
+# art-description: Physics_pp_v7_primaries TriggerTest on FTK MC
 # art-type: build
 # art-include: 21.1/AthenaP1
 # art-include: 21.0/Athena
+# art-include: 21.3/Athena
 # art-include: 21.0-TrigMC/Athena
 # art-include: master/Athena
 # art-output: HLTChain.txt
@@ -20,10 +21,9 @@
 # art-output: TotalEventsProcessed.txt
 # art-output: *.regtest.new
 
-export NAME="mc_pp_v7_nops_aod_ftk_build"
+export NAME="physics_pp_v7_primaries_ftk_build"
 export MENU="Physics_pp_v7_primaries"
 export INPUT="ftk"
-export JOBOPTIONS="TriggerTest/testCommonSliceAthenaTrigRDOtoAOD.py"
 export EVENTS="5"
 export COST_MONITORING="False"
 export EXTRA="from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True;from RecExConfig.RecFlags import rec;rec.doFTK.set_Value_and_Lock(True);"
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_ftk_grid.sh
similarity index 82%
rename from Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_grid.sh
rename to Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_ftk_grid.sh
index febbdbe9c4592d5506355a2958b89ed8a59c4867..861f7ddad48b42e9d00c7cc2d4e71ba0d1599da7 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_grid.sh
+++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_ftk_grid.sh
@@ -1,9 +1,10 @@
 #!/bin/bash
 
-# art-description: MC v7 no prescales TriggerTest on FTK MC to AOD
+# art-description: Physics_pp_v7_primaries TriggerTest on FTK MC
 # art-type: grid
 # art-include: 21.1/AthenaP1
 # art-include: 21.0/Athena
+# art-include: 21.3/Athena
 # art-include: 21.0-TrigMC/Athena
 # art-include: master/Athena
 # art-output: HLTChain.txt
@@ -20,10 +21,9 @@
 # art-output: TotalEventsProcessed.txt
 # art-output: *.regtest.new
 
-export NAME="mc_pp_v7_nops_aod_ftk_grid"
+export NAME="physics_pp_v7_primaries_ftk_grid"
 export MENU="Physics_pp_v7_primaries"
 export INPUT="ftk"
-export JOBOPTIONS="TriggerTest/testCommonSliceAthenaTrigRDOtoAOD.py"
 export EXTRA="from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True;from RecExConfig.RecFlags import rec;rec.doFTK.set_Value_and_Lock(True);"
 
 source exec_athena_art_trigger_validation.sh
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_aod_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_aod_grid.sh
deleted file mode 100755
index a789a520c4d76680cb75ac5f3972d477832f3982..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_aod_grid.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# art-description: Bphysics slice TriggerTest on MC using Jpsimu6mu6 to AOD
-# art-type: grid
-# art-include: 21.1/AthenaP1
-# art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
-# art-include: master/Athena
-# art-output: HLTChain.txt
-# art-output: HLTTE.txt
-# art-output: L1AV.txt
-# art-output: HLTconfig*.xml
-# art-output: L1Topoconfig*.xml
-# art-output: LVL1config*.xml
-# art-output: *.log
-# art-output: costMonitoring_*
-# art-output: *.root
-# art-output: ntuple.pmon.gz
-# art-output: *perfmon*
-# art-output: TotalEventsProcessed.txt
-# art-output: *.regtest.new
-
-export NAME="slice_bphysics_aod_grid"
-export SLICE="bphysics"
-export INPUT="bphysics"
-export JOBOPTIONS="TriggerTest/testCommonSliceAthenaTrigRDOtoAOD.py"
-
-source exec_athena_art_trigger_validation.sh
-source exec_art_triggertest_post.sh
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh
index 458eada11c99723630afaf44115f515b02a05865..91b6df915fbc25382da28ad67a54c7d35cf26432 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh
+++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh
@@ -23,7 +23,7 @@
 export NAME="slice_bphysicsexo_aod_grid"
 export SLICE="mubphysics"
 export INPUT="mubphysics"
-export JOBOPTIONS="TriggerTest/testCommonSliceAthenaTrigRDOtoAOD.py"
+export JOBOPTION="TriggerTest/testCommonSliceAthenaTrigRDOtoAOD.py"
 
 source exec_athena_art_trigger_validation.sh
 source exec_art_triggertest_post.sh
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
index 26fda712573d983076bba545110fea73ac8596b6..a31fc917f0556f4dfcaef0b9a135be18d13fdd01 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
@@ -131,7 +131,7 @@ def createTriggerFlags():
                         ver2017='v12phiflip_noecorrnogap')( prevFlags.Trigger.run2Config )
     )
     # tune of MVA
-    flags.addFlag('Trigger.egamma.calibMVAVersiona',
+    flags.addFlag('Trigger.egamma.calibMVAVersion',
                   lambda prevFlags:
                   __tunes(default='egammaMVACalib/online/v3',
                           ver2016='egammaMVACalib/online/v3',
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py
index 31b494acc9303fe4a3b6a2204d629d17ff191bf6..d963373270464a13a57a91ac7b242afb25e4af1e 100755
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py
@@ -534,6 +534,7 @@ class ItemDef:
 
         #FTK items
         LVL1MenuItem('L1_4J15_FTK'   ).setLogic( J15.x(4)    & physcond).setTriggerType(TT.ftk)
+        LVL1MenuItem('L1_4J20_FTK'   ).setLogic( J20.x(4)    & physcond).setTriggerType(TT.ftk)
         LVL1MenuItem('L1_4J15.0ETA25_FTK' ).setLogic( J150ETA25.x(4) & physcond).setTriggerType(TT.ftk) 
         LVL1MenuItem('L1_J100_FTK'  ).setLogic( J100 & physcond).setTriggerType(TT.ftk)
         LVL1MenuItem('L1_J15_FTK'   ).setLogic( J15  & physcond).setTriggerType(TT.ftk)
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py
index 57b67588ca4f8fbd63a18c17e11ae7a1800319c0..e70fe735b55d3312a6af04ce42938b3751d646ba 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py
@@ -1,4 +1,19 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+# Run this file in order to print out the empty slots
+
+def print_available():
+    from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
+    defineMenu()
+    available = []
+    for i in range(512):
+      if i==463: continue #reserved for L1_RD2_BGRP14, L1_RD3_BGRP15 now assigned to 510 for partition 3 ATR-17737
+      if i>=509 and i<=511: continue #reserved for CALREQ
+      if not i in Lvl1Flags.CtpIdMap().values(): available.append(i)
+    available.sort()
+    print "There are %d available CTP IDs:"%len(available),",".join(map(str,available))
+    print "IDs >= 472 go in partition 2, IDs >= 492 go in partition 3"
+
 
 def defineMenu():
     """
@@ -869,6 +884,7 @@ def defineMenu():
         'L1_DR-TAU20ITAU12I-J25_FTK',
         'L1_4J15_FTK',
         'L1_4J15.0ETA25_FTK',
+        'L1_4J20_FTK',
         'L1_J15_FTK',
         'L1_J40_FTK',
         'L1_J100_FTK'
@@ -1526,6 +1542,7 @@ def defineMenu():
         'L1_DR-TAU20ITAU12I-J25_FTK'           : 503,
         'L1_4J15_FTK'                          : 504,
         'L1_4J15.0ETA25_FTK'                   : 505,
+        'L1_4J20_FTK'                          : 488,
         'L1_J15_FTK'                           : 506,
         'L1_J40_FTK'                           : 507,
         'L1_J100_FTK'                          : 508,           
@@ -1548,3 +1565,4 @@ def defineMenu():
 
     Lvl1Flags.prescales = {}
 
+if __name__ == "__main__": print_available()
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7_primaries.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7_primaries.py
index b344fdb8508b4825d7b0f2e36464087238ac288d..1f1b965a83a5e1db2b3c3b03bddf96beee38f189 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7_primaries.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7_primaries.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 #----------phy--------------------------------------------------------------#
 #------------------------------------------------------------------------#
@@ -41,6 +41,9 @@ def setupMenu():
 
     TriggerFlags.MuonSlice.signatures = [
         # single muon
+        ['mu6_idperf',             'L1_MU6',            [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+        ['mu24_idperf',            'L1_MU20',   ['L1_MU20'], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+
         ['mu26_ivarmedium',	     'L1_MU20', 	  [], [PhysicsStream, 'express'], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ['mu28_ivarmedium',	     'L1_MU20', 	  [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
 
@@ -82,7 +85,9 @@ def setupMenu():
 
     if TriggerFlags.doFTK():
         TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
-
+            ['mu6_idperf_FTK_L1MU6_FTK',             'L1_MU6_FTK',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+            ['mu6_idperf_FTKRefit_L1MU6_FTK',        'L1_MU6_FTK',            [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
+            ['mu26_ivarmedium_FTK_L1MU20MU21_FTK',   'L1_MU20_FTK', ['L1_MU20_FTK'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
             ['mu6_idperf_FTK_L1MU6_FTK',             'L1_MU6_FTK',            [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
             ['mu6_idperf_FTKRefit_L1MU6_FTK',        'L1_MU6_FTK',            [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Muon', 'BW:ID'], -1],
 #            ['mu22_mu8noL1_FTKFS_L1MU20MU21_FTK',    'L1_MU20MU21_FTK', ['L1_MU20_FTK',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu22','mu8noL1_FTKFS']]],
@@ -164,16 +169,29 @@ def setupMenu():
         ['j175',                   'L1_J50',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
         ['j45_320eta490', 'L1_J15.31ETA49', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j260_nojcalib',           'L1_J50',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+        ['j35_nojcalib',           'L1_RD0_FILLED',  [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+#        ['j460_a10t_lcw_jes_L1J100',        'L1_J100', [], [PhysicsStream], ['Primary:17000','RATE:SingleJet', 'BW:Jet'], -1],
+#        ['2j330_a10t_lcw_jes_35smcINF_L1J100',              'L1_J100', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
 
         
     ]
 
+    if TriggerFlags.doFTK():
+        TriggerFlags.JetSlice.signatures = TriggerFlags.JetSlice.signatures() + [        
+            ['j0_perf_ftk_L1RD0_FILLED',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+            ['j0_perf_ftkrefit_L1RD0_FILLED',   'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleJet', 'BW:Jet'], -1],
+            
+        ]
+        
     TriggerFlags.BjetSlice.signatures = [
+        ['j45_gsc55_boffperf_split', 'L1_J15', [], [PhysicsStream,'express'], ['RATE:SingleBJet', 'BW:BJet'], -1],
+        ['j35_boffperf_split',  'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j175_gsc225_bmv2c2050_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc275_bmv2c2060_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
         ['j225_gsc360_bmv2c2085_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],                   
         ['j55_gsc75_bmv2c2060_split_3j55_gsc75_boffperf_split_L14J20',       'L1_4J20',        [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
-        ['3j35_gsc55_bmv2c2070_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
+        ['3j45_gsc55_bmv2c2070_split_L13J35.0ETA23', 'L1_3J35.0ETA23', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1],
 
         #low pT
         ['j35_gsc45_boffperf_split_L1J15', 'L1_J15', [], [PhysicsStream,'express'], ['RATE:SingleBJet', 'BW:BJet'], -1],
@@ -184,7 +202,6 @@ def setupMenu():
 
     if TriggerFlags.doFTK():
         TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [
- 
            ['j35_boffperf_split_FTK_L1J15_FTK', 'L1_J15_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
            ['j35_boffperf_split_FTKVtx_L1J15_FTK', 'L1_J15_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
            ['j35_boffperf_split_FTKRefit_L1J15_FTK', 'L1_J15_FTK', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1],
@@ -207,12 +224,18 @@ def setupMenu():
         TriggerFlags.METSlice.signatures = TriggerFlags.METSlice.signatures() + [
             
             ['xe35_trkmht_FTK', 'L1_XE35',[], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe0noL1_l2fsperf_trktc_lcw_FTK', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe110_trkmht_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe110_trktc_lcw_FTK_L1XE50', 'L1_XE50', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
+            ['xe0noL1_l2fsperf_trkmht_FTK', '', [], [PhysicsStream], ['RATE:MET', 'BW:MET'], -1],
             
             ]
  
     
     TriggerFlags.TauSlice.signatures = [
         ['tau25_idperf_tracktwo',                  'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Tau', 'BW:ID'], -1],
+        ['tau25_idperf_tracktwoEF',                      'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
+        ['tau25_idperf_tracktwoMVA',                      'L1_TAU12IM', [], [PhysicsStream, 'express'], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau160_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
         ['tau200_medium1_tracktwo_L1TAU100',       'L1_TAU100', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
 
@@ -232,14 +255,15 @@ def setupMenu():
     if TriggerFlags.doFTK():
             TriggerFlags.TauSlice.signatures = TriggerFlags.TauSlice.signatures() + [
               
-                #['tau12_idperf_FTK',              'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
+                ['tau12_idperf_FTK',              'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
                 #['tau12_perf_FTKNoPrec',          'L1_TAU12IM_FTK', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1],
 
                 ]
 
 
     TriggerFlags.EgammaSlice.signatures = [
-
+        ['e5_lhtight_idperf',                     'L1_EM3',       [], [PhysicsStream], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
+        ['e28_lhtight_idperf',        'L1_EM24VHI',    [], [PhysicsStream, 'express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
         ['g300_etcut',                    'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
         ['g300_etcut_L1EM24VHI',          'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
         ['g300_etcut_L1EM26VHI',          'L1_EM26VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], 
@@ -294,12 +318,22 @@ def setupMenu():
 
     TriggerFlags.BphysicsSlice.signatures = [
         # ATR-19062
-        ['mu6_mu4_bJpsimumu',             'L1_MU6_2MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
-        ['mu6_mu4_bUpsimumu',             'L1_MU6_2MU4', ['L1_MU6','L1_MU4'], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
-
+        ['2mu6_bJpsimumu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',  'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',     ['L1_2MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['2mu4_bBmumuxv2',                'L1_2MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+        ['2mu6_bUpsimumu_L1BPH-8M15-2MU6_BPH-0DR22-2MU6', 'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',     ['L1_2MU6'], [PhysicsStream, 'express'], ['Primary:20000','RATE:Bphysics','BW:Bphys'], -1, False],
+        ['2mu6_bBmumu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',     'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',     ['L1_2MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1, False],
+        ['mu6_2mu4_bJpsi', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [BPhysicsStream, 'express'], [RATE_BphysTag, BW_BphysTag], -1],
+        ['mu11_mu6_bDimu',                 'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1],
         ['mu11_mu6_bTau',                  'L1_MU11_2MU6', ['L1_MU11','L1_MU6'], [BPhysicsStream, 'express'], [RATE_BphysTag,BW_BphysTag], -1],
 
-]
+    ]
+
+
+    if TriggerFlags.doFTK():
+        TriggerFlags.BphysicsSlice.signatures = TriggerFlags.BphysicsSlice.signatures() + [
+            ['2mu4_bBmumuxv2_Ftk',                'L1_2MU4', [], [BPhysicsStream], [RATE_BphysTag,BW_BphysTag], -1],
+            ]
+
 
     TriggerFlags.CombinedSlice.signatures = [
 
@@ -401,6 +435,9 @@ def setupMenu():
     if TriggerFlags.doFTK():
         TriggerFlags.BeamspotSlice.signatures = TriggerFlags.BeamspotSlice.signatures() + [
 
+            ['beamspot_idperf_FTK_L14J20_FTK',      'L1_4J20_FTK', [], ["BeamSpot"], ['RATE:BeamSpot',  'BW:BeamSpot'], -1],
+            ['beamspot_idperf_FTKRefit_L14J20_FTK', 'L1_4J20_FTK', [], ["BeamSpot"], ['RATE:BeamSpot', 'BW:BeamSpot'], -1],
+
 ]
 
 
@@ -491,6 +528,14 @@ class Prescales:
     #     the default value of pass-through (=0) will be used
     #----------------------------------------------------------
     HLTPrescales = {}
+    chain_list=[ #chains that can't be ported to 21.3 but produce crash if removed from master
+        'g300_etcut_L1EM26VHI',
+        'e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo',
+        'e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25',
+        'e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_xe50',
+        'e17_lhmedium_nod0_tau25_medium1_tracktwo_xe50',
+        ]
+    HLTPrescales.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0, -1] ])))
 
     L1Prescales_cosmics  = {}
     HLTPrescales_cosmics = {}
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/metDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/metDefs.py
index bb43723fe6eb0191b4e0808847b1423084f5583c..6396488289080813d69864d353abedcafede898d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/metDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/metDefs.py
@@ -23,10 +23,10 @@ def metCellRecoSequence():
     #################################################
     # Add EFMissingETAlg and associated tools
     #################################################
-    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromHelper
+    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromHelperMT, EFMissingETFlagsMT
     metAlg = EFMissingETAlgMT( name="EFMET" )
-    helperTool = EFMissingETFromHelper("theHelperTool")
-    metAlg.HelperTool= helperTool 
+    helperTool = EFMissingETFromHelperMT("theHelperTool")
+    flagsTool = EFMissingETFlagsMT("theFlagsTool")
     metAlg.METContainerKey = "HLT_MET"
     
     #///////////////////////////////////////////
@@ -59,6 +59,8 @@ def metCellRecoSequence():
 
     
     metAlg.METTools.append(cellTool)
+    metAlg.METTools.append(helperTool)
+    metAlg.METTools.append(flagsTool)
 
     metCellRecoSequence += metAlg
 
@@ -84,10 +86,9 @@ def metClusterRecoSequence():
     #################################################
     # Add EFMissingETAlg and associated tools
     #################################################
-    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromHelper
+    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromHelperMT
     metAlg = EFMissingETAlgMT( name="EFMET" )
-    helperTool = EFMissingETFromHelper("theHelperTool")
-    metAlg.HelperTool= helperTool 
+    helperTool = EFMissingETFromHelperMT("theHelperTool")
     metAlg.METContainerKey = "HLT_MET"
     
         #///////////////////////////////////////////
@@ -120,6 +121,7 @@ def metClusterRecoSequence():
 
     
     metAlg.METTools.append(clusterTool)
+    metAlg.METTools.append(helperTool)
 
     metClusterRecoSequence += metAlg
 
@@ -144,10 +146,9 @@ def metJetRecoSequence(RoIs = 'FSJetRoI'):
     #################################################
     # Add EFMissingETAlg and associated tools
     #################################################
-    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromHelper
+    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromHelperMT
     metAlg = EFMissingETAlgMT( name="EFMET" )
-    helperTool = EFMissingETFromHelper("theHelperTool")
-    metAlg.HelperTool= helperTool 
+    helperTool = EFMissingETFromHelperMT("theHelperTool")
     metAlg.METContainerKey = "HLT_MET_mht"
     
     #///////////////////////////////////////////
@@ -180,6 +181,7 @@ def metJetRecoSequence(RoIs = 'FSJetRoI'):
     mhtTool.JetsCollection=JetsName
     
     metAlg.METTools.append(mhtTool)
+    metAlg.METTools.append(helperTool)
 
     recoSequence += metAlg
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index c190a997d42180b270cffa9f0b2f07a801fbefa3..0a824bf9359011aa01832fd445ceb5a8a041664f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -190,7 +190,7 @@ MuonChainParts = {
     'threshold'      : '',
     'extra'          : ['noL1', 'Comb', 'fast', 'msonly'],
     'IDinfo'         : [],
-    'isoInfo'        : ['ivar',],
+    'isoInfo'        : ['ivar','ivarmedium'],
     'reccalibInfo'   : [],
     'trkInfo'        : [],
     'hypoInfo'       : [],
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py
index 592193776b0cbf3d8da5865fb85ac2e27df347b0..07275b9c0347877e83456d35d2d39a0c7081d7f0 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py
@@ -12,7 +12,7 @@ log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Muon.MuonDef")
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase, RecoFragmentsPool
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep
 
-from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFMSSequence, muEFSASequence, muIsoSequence, muEFCBSequence, muEFSAFSSequence, muEFCBFSSequence
+from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFMSSequence, muEFSASequence, muIsoSequence, muEFCBSequence, muEFSAFSSequence, muEFCBFSSequence, muEFIsoSequence
 
 from TrigUpgradeTest.InDetSetup import inDetSetup
 
@@ -43,6 +43,9 @@ def FSmuEFSASequenceCfg(flags):
 def FSmuEFCBSequenceCfg(flags):
     return muEFCBFSSequence()
 
+def muEFIsoSequenceCfg(flags):
+    return muEFIsoSequence()
+
 
 ############################################# 
 ###  Class/function to configure muon chains 
@@ -73,6 +76,7 @@ class MuonChainConfiguration(ChainConfigurationBase):
             "ivar":[self.getmuFast(), self.getmuComb(), self.getmuIso()],
             "noL1":[self.getFSmuEFSA(), self.getFSmuEFCB()],
             "msonly":[self.getmuFast(), self.getmuEFMS()],
+            "ivarmedium":[self.getmuFast(), self.getmuComb(), self.getmuEFSA(), self.getmuEFCB(), self.getmuEFIso()],
         }
 
         key = self.chainPart['extra']+self.chainPart['isoInfo']
@@ -141,5 +145,12 @@ class MuonChainConfiguration(ChainConfigurationBase):
         muSeq = RecoFragmentsPool.retrieve( FSmuEFCBSequenceCfg, None)
         return ChainStep(stepName, [muSeq])
 
+    #---------------------
+    def getmuEFIso(self):
+        stepName = 'Step1_muEFIso'
+        log.debug("Configuring step " + stepName)
+        muSeq = RecoFragmentsPool.retrieve( muEFIsoSequenceCfg, None)
+        return ChainStep(stepName, [muSeq])
+
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonMenuConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonMenuConfig.py
index db4c8a8426c966ebe8c64ee2f00a1c72e24cf1b4..bff2662afaa4830f1b6d98ea67931b3cecc3d0db 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonMenuConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonMenuConfig.py
@@ -7,309 +7,6 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 ### Output Name ###
 muFastInfo = "MuonL2SAInfo"
 
-# Get Rpc data decoder for MuFast data preparator 
-def RpcDataPreparatorCfg( flags, roisKey ):
-
-    acc = ComponentAccumulator()
-
-    # Get BS decoder 
-    from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg
-    rpcAcc = RpcBytestreamDecodeCfg( flags, forTrigger=True )
-    #rpcAcc.getEventAlgo("RpcRawDataProvider").RoIs = roisKey
-    acc.merge( rpcAcc )
-
-    # Get BS->RDO convertor
-    from MuonConfig.MuonRdoDecodeConfig import RpcRDODecodeCfg    
-    rpcAcc = RpcRDODecodeCfg( flags, forTrigger=True )
-    #rpcAcc.getEventAlgo("RpcRdoToRpcPrepData").RoIs = roisKey
-    acc.merge( rpcAcc )
-
-    # Set Rpc data preparator for MuFast data preparator
-    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__RpcDataPreparator
-    RpcDataPreparator = TrigL2MuonSA__RpcDataPreparator( RpcPrepDataProvider  = acc.getPublicTool( "RpcRdoToRpcPrepDataTool" ),
-                                                         RpcRawDataProvider   = acc.getPublicTool( "RPC_RawDataProviderTool" ),
-                                                         #DecodeBS = DetFlags.readRDOBS.RPC_on() ) # This should be used flags
-                                                         DecodeBS = True )
-    acc.addPublicTool( RpcDataPreparator, primary=True ) # Now this is needed, but should be removed
- 
-    return acc, RpcDataPreparator
-
-# Get Tgc data decoder for MuFast data preparator 
-def TgcDataPreparatorCfg( flags, roisKey ):
-
-    acc = ComponentAccumulator()
-
-    # Get BS decoder 
-    from MuonConfig.MuonBytestreamDecodeConfig import TgcBytestreamDecodeCfg
-    tgcAcc = TgcBytestreamDecodeCfg( flags, forTrigger=True )
-    #TgcRawDataProvider.RoIs = roisKey
-    acc.merge( tgcAcc )
-
-    # Get BS->RDO convertor
-    from MuonConfig.MuonRdoDecodeConfig import TgcRDODecodeCfg    
-    tgcAcc = TgcRDODecodeCfg( flags, forTrigger=True )
-    #tgcAcc.getEventAlgo("TgcRdoToTgcPrepData").RoIs = roisKey
-    acc.merge( tgcAcc )
-
-    # Set Tgc data preparator for MuFast data preparator
-    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__TgcDataPreparator
-    TgcDataPreparator = TrigL2MuonSA__TgcDataPreparator( TgcPrepDataProvider  = acc.getPublicTool( "TgcRdoToTgcPrepDataTool" ) )
-                                                         #DecodeBS = DetFlags.readRDOBS.TGC_on() ) # This should be used flags
- 
-    return acc, TgcDataPreparator
-
-# Get Mdt data decoder for MuFast data preparator 
-def MdtDataPreparatorCfg( flags, roisKey ):
-
-    acc = ComponentAccumulator()
-
-    # Get BS decoder 
-    from MuonConfig.MuonBytestreamDecodeConfig import MdtBytestreamDecodeCfg
-    mdtAcc = MdtBytestreamDecodeCfg( flags, forTrigger=True )
-    #MdtRawDataProvider.RoIs = roisKey
-    acc.merge( mdtAcc )
-
-    # Get BS->RDO convertor
-    from MuonConfig.MuonRdoDecodeConfig import MdtRDODecodeCfg    
-    mdtAcc = MdtRDODecodeCfg( flags, forTrigger=True )
-    #mdtAcc.getEventAlgo("MdtRdoToMdtPrepData").RoIs = roisKey
-    acc.merge( mdtAcc )
-
-    # Set Mdt data preparator for MuFast data preparator
-    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MdtDataPreparator
-    MdtDataPreparator = TrigL2MuonSA__MdtDataPreparator( MdtPrepDataProvider  = acc.getPublicTool( "MdtRdoToMdtPrepDataTool" ),
-                                                         MDT_RawDataProvider   = acc.getPublicTool( "MDT_RawDataProviderTool" ),
-                                                         #DecodeBS = DetFlags.readRDOBS.MDT_on() ) # This should be used flags
-                                                         DecodeBS = True )
- 
-    return acc, MdtDataPreparator
-
-# Get Csc data decoder for MuFast data preparator 
-def CscDataPreparatorCfg( flags, roisKey ):
-
-    acc = ComponentAccumulator()
-
-    # Get BS decoder 
-    from MuonConfig.MuonBytestreamDecodeConfig import CscBytestreamDecodeCfg
-    cscAcc = CscBytestreamDecodeCfg( flags, forTrigger=True )
-    #CscRawDataProvider.RoIs = roisKey
-    acc.merge( cscAcc )
-
-    # Get BS->RDO convertor
-    from MuonConfig.MuonRdoDecodeConfig import CscRDODecodeCfg    
-    cscAcc = CscRDODecodeCfg( flags, forTrigger=True )
-    #cscAcc.getEventAlgo("CscRdoToCscPrepData").RoIs = roisKey
-    acc.merge( cscAcc )
-
-    # Get cluster builder
-    from MuonConfig.MuonRdoDecodeConfig import CscClusterBuildCfg
-    cscAcc = CscClusterBuildCfg( flags, forTrigger=True )
-    acc.merge( cscAcc )
-
-    # Set Csc data preparator for MuFast data preparator
-    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__CscDataPreparator
-    CscDataPreparator = TrigL2MuonSA__CscDataPreparator( CscPrepDataProvider  = acc.getPublicTool( "CscRdoToCscPrepDataTool" ),
-                                                         CscClusterProvider   = acc.getPublicTool( "CscThesholdClusterBuilderTool" ) )
-                                                         #DecodeBS = DetFlags.readRDOBS.CSC_on() ) # This should be used flags
-    acc.addPublicTool( CscDataPreparator, primary=True ) # This should be removed
- 
-    return acc, CscDataPreparator
-
-# Based on TrigL2MuonSAMTConfig at TrigL2MuonSA/TrigL2MuonSAConfig.py
-def muFastSteeringCfg( flags, roisKey, setup="" ):
-
-    acc = ComponentAccumulator()
-
-    # Get RPC decoder
-    rpcAcc, RpcDataPreparator = RpcDataPreparatorCfg( flags, roisKey )
-    acc.merge( rpcAcc )
-
-    # Get TGC decoder
-    tgcAcc, TgcDataPreparator = TgcDataPreparatorCfg( flags, roisKey )
-    acc.merge( tgcAcc )
-
-    # Get MDT decoder
-    mdtAcc, MdtDataPreparator = MdtDataPreparatorCfg( flags, roisKey )
-    acc.merge( mdtAcc )
-
-    # Get CSC decoder
-    cscAcc, CscDataPreparator = CscDataPreparatorCfg( flags, roisKey )
-    acc.merge( cscAcc )
-
-    # Set MuFast data preparator
-    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MuFastDataPreparator
-    MuFastDataPreparator = TrigL2MuonSA__MuFastDataPreparator( CSCDataPreparator = CscDataPreparator,
-                                                               MDTDataPreparator = MdtDataPreparator,
-                                                               RPCDataPreparator = RpcDataPreparator,
-                                                               TGCDataPreparator = TgcDataPreparator )
-
-    # Setup the station fitter
-    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MuFastStationFitter,TrigL2MuonSA__PtFromAlphaBeta
-    PtFromAlphaBeta = TrigL2MuonSA__PtFromAlphaBeta()
-    if flags.Trigger.run2Config == '2016':
-        PtFromAlphaBeta.useCscPt = False
-        PtFromAlphaBeta.AvoidMisalignedCSCs = True
-    else:
-        PtFromAlphaBeta.useCscPt = True
-        PtFromAlphaBeta.AvoidMisalignedCSCs = True
-
-    MuFastStationFitter = TrigL2MuonSA__MuFastStationFitter( PtFromAlphaBeta = PtFromAlphaBeta )
-
-    from TrigL2MuonSA.TrigL2MuonSAConf import TrigL2MuonSA__MuFastPatternFinder,TrigL2MuonSA__MuFastTrackFitter,TrigL2MuonSA__MuFastTrackExtrapolator,TrigL2MuonSA__MuCalStreamerTool,TrigL2MuonSA__CscSegmentMaker
-    MuFastPatternFinder     = TrigL2MuonSA__MuFastPatternFinder()
-    MuFastTrackFitter       = TrigL2MuonSA__MuFastTrackFitter()
-    MuFastTrackExtrapolator = TrigL2MuonSA__MuFastTrackExtrapolator()
-    MuCalStreamerTool       = TrigL2MuonSA__MuCalStreamerTool()
-    CscSegmentMaker         = TrigL2MuonSA__CscSegmentMaker()
-
-    # Set Reco alg of muFast step
-    from TrigL2MuonSA.TrigL2MuonSAMonitoring import TrigL2MuonSAMonitoring
-    from TrigL2MuonSA.TrigL2MuonSAConf import MuFastSteering
-    muFastAlg = MuFastSteering( name                   = "MuFastSteering_Muon"+setup,
-                                DataPreparator         = MuFastDataPreparator,
-                                StationFitter          = MuFastStationFitter,
-                                PatternFinder          = MuFastPatternFinder,
-                                TrackFitter            = MuFastTrackFitter,
-                                TrackExtrapolator      = MuFastTrackExtrapolator,
-                                CalibrationStreamer    = MuCalStreamerTool, 
-                                CscSegmentMaker        = CscSegmentMaker,
-                                R_WIDTH_TGC_FAILED     = 200,
-                                R_WIDTH_RPC_FAILED     = 400,
-                                DoCalibrationStream    = False,
-                                USE_ROIBASEDACCESS_CSC = True,
-                                RpcErrToDebugStream    = True,
-                                Timing                 = False,
-                                MonTool                = TrigL2MuonSAMonitoring() )
-
-    # Default backextrapolator is for MC Misaligned Detector
-    # Based on MuonBackExtrapolatorForMisalignedDet at TrigMuonBackExtrapolator/TrigMuonBackExtrapolatorConfig.py
-    from TrigMuonBackExtrapolator.TrigMuonBackExtrapolatorConf import TrigMuonBackExtrapolator
-    muFastAlg.BackExtrapolator = TrigMuonBackExtrapolator( name        = "MisalignedBackExtrapolator",
-                                                           Aligned     = False,
-                                                           DataSet     = False )
-
-    if flags.Trigger.run2Config == '2016':
-        muFastAlg.UseEndcapInnerFromBarrel = False
-    else: 
-        muFastAlg.UseEndcapInnerFromBarrel = True
-
-    if setup == '900GeV':
-        muFastAlg.WinPt = 4.0
-        muFastAlg.Scale_Road_BarrelInner  = 3
-        muFastAlg.Scale_Road_BarrelMiddle = 3
-        muFastAlg.Scale_Road_BarrelOuter  = 3
-    else:
-        muFastAlg.WinPt = 6.0
-        muFastAlg.Scale_Road_BarrelInner  = 1
-        muFastAlg.Scale_Road_BarrelMiddle = 1
-        muFastAlg.Scale_Road_BarrelOuter  = 1
-
-    if setup == 'MuonCalib':
-        muFastAlg.DoCalibrationStream = True
-        muFastAlg.MuonCalDataScouting = False
-        muFastAlg.MuonCalBufferSize   = 1024*1024
-
-    if setup == 'MuonCalibDataScouting':
-        muFastAlg.DoCalibrationStream = True
-        muFastAlg.MuonCalDataScouting = True
-        muFastAlg.MuonCalBufferSize   = 1024*1024
-
-    return acc, muFastAlg
-
-def PtBarrelLUTSvcCfg( flags ):
-
-    acc = ComponentAccumulator()
-    from TrigL2MuonSA.TrigL2MuonSAConfig import PtBarrelLUTSvc
-    ptBarrelLUTSvc = PtBarrelLUTSvc()
-    acc.addService( ptBarrelLUTSvc )
-
-    return acc, ptBarrelLUTSvc
-
-def PtBarrelLUTSvcCfg_MC( flags ):
-
-    acc = ComponentAccumulator()
-    from TrigL2MuonSA.TrigL2MuonSAConfig import PtBarrelLUTSvc_MC
-    ptBarrelLUTSvc_MC = PtBarrelLUTSvc_MC() 
-    acc.addService( ptBarrelLUTSvc_MC )
-
-    return acc, ptBarrelLUTSvc_MC
-
-def PtEndcapLUTSvcCfg( flags ):
-
-    acc = ComponentAccumulator()
-    from TrigL2MuonSA.TrigL2MuonSAConfig import PtEndcapLUTSvc
-    ptEndcapLUTSvc = PtEndcapLUTSvc()
-    acc.addService( ptEndcapLUTSvc )
-
-    return acc, ptEndcapLUTSvc
-
-def PtEndcapLUTSvcCfg_MC( flags ):
-
-    acc = ComponentAccumulator()
-    from TrigL2MuonSA.TrigL2MuonSAConfig import PtEndcapLUTSvc_MC
-    ptEndcapLUTSvc_MC = PtEndcapLUTSvc_MC() 
-    acc.addService( ptEndcapLUTSvc_MC )
-
-    return acc, ptEndcapLUTSvc_MC
-
-
-def AlignmentBarrelLUTSvcCfg( flags ):
-
-    acc = ComponentAccumulator()
-    from TrigL2MuonSA.TrigL2MuonSAConfig import AlignmentBarrelLUTSvc
-    alignmentBarrelLUTSvc = AlignmentBarrelLUTSvc()
-    acc.addService( alignmentBarrelLUTSvc )
-
-    return acc, alignmentBarrelLUTSvc
-
-# In the future, above functions should be moved to TrigL2MuonSA package(?)
-
-def l2MuFastAlgCfg( flags, roisKey="MURoIs" ):
-
-    acc = ComponentAccumulator()
-
-    # Get Reco alg of muFast step
-    muFastAcc, muFastFex = muFastSteeringCfg( flags, roisKey )  
-    muFastFex.MuRoIs = roisKey
-    muFastFex.RecMuonRoI = "RecMURoIs"
-    muFastFex.MuonL2SAInfo = muFastInfo
-    muFastFex.forID = "forID"
-    muFastFex.forMS = "forMS"
-    acc.merge( muFastAcc )
-
-    # Get services of the Reco alg
-    acc.merge( PtBarrelLUTSvcCfg(flags)[0] )   
-    acc.merge( PtBarrelLUTSvcCfg_MC(flags)[0] )   
-    acc.merge( PtEndcapLUTSvcCfg(flags)[0] )   
-    acc.merge( PtEndcapLUTSvcCfg_MC(flags)[0] )   
-    acc.merge( AlignmentBarrelLUTSvcCfg(flags)[0] )
-
-    return acc, muFastFex
-
-
-def l2MuFastRecoCfg( flags ):
-
-    # Set EventViews for muFast step
-    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco
-    reco = InViewReco("L2MuFastReco")
-
-    # Get Reco alg of muFast Step in order to set into the view
-    algAcc, alg = l2MuFastAlgCfg( flags, roisKey=reco.name+"RoIs")
-
-    reco.addRecoAlg( alg )
-    reco.merge( algAcc )
-
-    return reco
-
-def l2MuFastHypoCfg( flags, name="UNSPECIFIED", muFastInfo="UNSPECIFIED" ):
-
-    from TrigMuonHypoMT.TrigMuonHypoMTConf import TrigMufastHypoAlg
-    muFastHypo = TrigMufastHypoAlg( name )
-    muFastHypo.MuonL2SAInfoFromMuFastAlg = muFastInfo 
-
-    return muFastHypo
- 
-
 def generateMuonsCfg( flags ):
 
     acc = ComponentAccumulator()
@@ -323,6 +20,7 @@ def generateMuonsCfg( flags ):
     muFastHypo.MuonL2SAInfoFromMuFastAlg = muFastInfo
 
     # Set Reco alg of muFast step
+    from TrigL2MuonSA.TrigL2MuonSAConfig_newJO import l2MuFastRecoCfg
     l2MuFastReco = RecoFragmentsPool.retrieve( l2MuFastRecoCfg, flags )
     acc.merge( l2MuFastReco )
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
index 789f411c6d7fae41699e2bfbb74b9462b1382cf2..2e77f025e09ec1d558197c9a81a744e05086164b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
@@ -315,6 +315,51 @@ def muIsoSequence():
                          Maker       = l2muIsoViewsMaker,
                          Hypo        = trigmuIsoHypo,
                          HypoToolGen = TrigMuisoHypoToolFromDict )
+
+
+
+######################
+### efMuiso step ###
+######################
+def muEFIsoAlgSequence(ConfigFlags):
+    from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithmWithMuons
+    efmuIsoViewsMaker = EventViewCreatorAlgorithmWithMuons("efmuIsoViewsMaker")
+    efmuIsoViewsMaker.ViewFallThrough = True
+    efmuIsoViewsMaker.ViewPerRoI = True
+    efmuIsoViewsMaker.RoIsLink = "roi" # -||-
+    efmuIsoViewsMaker.InViewRoIs = "MUEFIsoRoIs" # contract with the consumer
+    efmuIsoViewsMaker.Views = "MUEFIsoViewRoIs"
+    efmuIsoViewsMaker.InViewMuons = "MuonsIso"
+    efmuIsoViewsMaker.MuonsLink = "feature"
+    efmuIsoViewsMaker.RoIEtaWidth=0.15
+    efmuIsoViewsMaker.RoIPhiWidth=0.15
+
+    ### get EF reco sequence ###    
+    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup  import efmuisoRecoSequence
+    efmuisoRecoSequence, sequenceOut = efmuisoRecoSequence( efmuIsoViewsMaker.InViewRoIs )
+ 
+    efmuIsoViewsMaker.ViewNodeName = efmuisoRecoSequence.name()
+     
+    ### Define a Sequence to run for muIso ### 
+    efmuIsoSequence = seqAND("efmuIsoSequence", [ efmuIsoViewsMaker, efmuisoRecoSequence ] )
+
+    return (efmuIsoSequence, efmuIsoViewsMaker, sequenceOut)
+
+def muEFIsoSequence():
+ 
+    (efmuIsoSequence, efmuIsoViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(muEFIsoAlgSequence, ConfigFlags)
+
+    # set up hypo    
+    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFTrackIsolationHypoAlg
+    trigmuefIsoHypo = TrigMuonEFTrackIsolationHypoAlg("EFMuisoHypoAlg")
+    trigmuefIsoHypo.EFMuonsName = sequenceOut
+   
+    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFTrackIsolationHypoToolFromDict
+
+    return MenuSequence( Sequence    = efmuIsoSequence,
+                         Maker       = efmuIsoViewsMaker,
+                         Hypo        = trigmuefIsoHypo,
+                         HypoToolGen = TrigMuonEFTrackIsolationHypoToolFromDict )
   
   
 ######################
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index e62cf9b62a972a11d9e5be94bd53b397af2e7a7a..58e0938fca662227d3132c92ea35489a1c79e56e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -10,6 +10,7 @@ from TrigEDMConfig.TriggerEDMRun3 import recordable
 muFastInfo = "MuonL2SAInfo"
 muCombInfo = "MuonL2CBInfo"
 muEFSAInfo = "Muons"
+muEFCBInfo = "MuonsCB"
 muL2ISInfo = "MuonL2ISInfo"
 TrackParticlesName = recordable("HLT_xAODTracks_Muon")
 
@@ -160,8 +161,10 @@ def makeMuonPrepDataAlgs(forFullScan=False):
                                             RoIs             = "MURoIs")
 
   from MuonByteStream.MuonByteStreamConf import Muon__TgcRawDataProvider
-  TgcRawDataProvider = Muon__TgcRawDataProvider(name         = "TgcRawDataProvider",
-                                                ProviderTool = MuonTgcRawDataProviderTool )
+  TgcRawDataProvider = Muon__TgcRawDataProvider(name         = "TgcRawDataProvider" + postFix,                                                
+                                                ProviderTool = MuonTgcRawDataProviderTool,
+                                                DoSeededDecoding = not forFullScan,
+                                                RoIs             = "MURoIs" )
 
   eventAlgs_MuonPRD.append( TgcRawDataProvider )
   eventAlgs_MuonPRD.append( TgcRdoToTgcPrepData )
@@ -530,6 +533,7 @@ def muEFSARecoSequence( RoIs, name ):
 
 
 def muEFCBRecoSequence( RoIs, name ):
+  global TrackParticlesName
 
   from AthenaCommon.AppMgr import ToolSvc
   import AthenaCommon.CfgGetter as CfgGetter
@@ -565,7 +569,6 @@ def muEFCBRecoSequence( RoIs, name ):
       if viewAlg.name() == "InDetTrigTrackParticleCreatorAlg":
         TrackParticlesName = viewAlg.TrackParticlesName  # noqa: F841
   else:
-    global TrackParticlesName
     ViewVerifyTrk = CfgMgr.AthViews__ViewDataVerifier("muonCBIDViewDataVerifier")
     ViewVerifyTrk.DataObjects = [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+'+TrackParticlesName ),
                                  ( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData' ),
@@ -603,7 +606,15 @@ def muEFCBRecoSequence( RoIs, name ):
   trackParticles = PTTrackParticles[-1]
 
   #Make InDetCandidates
-  theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg_"+name,TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = [trackParticles],ForwardParticleLocation=trackParticles)
+  from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
+  from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool
+  from MuonTGRecTools.MuonTGRecToolsConf import Muon__MuonSystemExtensionTool
+  pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = AtlasExtrapolator())
+  
+  muonExtTool = Muon__MuonSystemExtensionTool(Extrapolator = AtlasExtrapolator(),
+                                              ParticleCaloExtensionTool = pcExtensionTool)
+
+  theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg_"+name,TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = [trackParticles],ForwardParticleLocation=trackParticles, MuonSystemExtensionTool=muonExtTool)
 
   #MuonCombinedCandidates
   theCaloMeasTool = getPublicToolClone("TrigCaloMeasTool_"+name, "MuidCaloEnergyMeas", CaloNoiseTool="", UseCaloNoiseTool=False,CellContainerLocation="")
@@ -646,7 +657,7 @@ def muEFCBRecoSequence( RoIs, name ):
   themuoncbcreatoralg.MuonCreatorTool=thecreatortoolCB
   themuoncbcreatoralg.MakeClusters=False
   themuoncbcreatoralg.ClusterContainerName=""
-  themuoncbcreatoralg.MuonContainerLocation = "CBMuons"
+  themuoncbcreatoralg.MuonContainerLocation = muEFCBInfo
   themuoncbcreatoralg.SegmentContainerName = "CBSegments"
   themuoncbcreatoralg.ExtrapolatedLocation = "CBExtrapolatedMuons"
   themuoncbcreatoralg.MSOnlyExtrapolatedLocation = "CBMSOnlyExtrapolatedMuons"
@@ -667,3 +678,47 @@ def muEFCBRecoSequence( RoIs, name ):
 
 
   return muEFCBRecoSequence, eventAlgs, sequenceOut
+
+
+def efmuisoRecoSequence( RoIs ):
+
+  from AthenaCommon.CFElements import parOR
+
+  efmuisoRecoSequence = parOR("efmuIsoViewNode")
+
+  from TriggerMenuMT.HLTMenuConfig.CommonSequences.InDetSetup import makeInDetAlgs
+  (viewAlgs, eventAlgs) = makeInDetAlgs("MuonIso")
+
+  from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_MuonIso
+  theFTF_Muon = TrigFastTrackFinder_MuonIso()
+  theFTF_Muon.isRoI_Seeded = True
+  viewAlgs.append(theFTF_Muon)
+
+  #TrackParticlesName = ""
+  for viewAlg in viewAlgs:
+    efmuisoRecoSequence += viewAlg
+    if "RoIs" in viewAlg.properties():
+      viewAlg.RoIs = RoIs
+    if "roiCollectionName" in viewAlg.properties():
+      viewAlg.roiCollectionName = RoIs
+
+  #Precision Tracking
+  PTAlgs = [] #List of precision tracking algs
+  PTTracks = [] #List of TrackCollectionKeys
+  PTTrackParticles = [] #List of TrackParticleKeys
+  
+  from TrigUpgradeTest.InDetPT import makeInDetPrecisionTracking
+  PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking( "muonsIso")
+
+  # set up algs
+  from TrigMuonEF.TrigMuonEFConfig import TrigMuonEFTrackIsolationMTConfig
+  trigEFmuIso = TrigMuonEFTrackIsolationMTConfig("TrigEFMuIso")
+  trigEFmuIso.MuonEFContainer = muEFCBInfo
+  trackParticles = PTTrackParticles[-1]
+  trigEFmuIso.IdTrackParticles = trackParticles
+
+  efmuisoRecoSequence += trigEFmuIso
+
+  sequenceOut = trigEFmuIso.MuonContName
+
+  return efmuisoRecoSequence, sequenceOut
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
index 04a2a0c0e15ecb33742fd7557fb6c214f04d8290..cf53ac08f091846fee445a63c3218788da49f980 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
@@ -3,7 +3,7 @@
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, ChainStep, Chain, getChainStepName, createStepView
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
-from TriggerMenuMT.HLTMenuConfig.Muon.MuonMenuConfig import l2MuFastRecoCfg, l2MuFastHypoCfg
+from TrigL2MuonSA.TrigL2MuonSAConfig_newJO import l2MuFastRecoCfg, l2MuFastHypoCfg
 from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMufastHypoToolFromDict
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
index 03ffb881ece7e8df37ecf7b4888752f178e37c62..799b925f8791d4a604b7c73dd1626e27291b7894 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
@@ -1,5 +1,10 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+# Disable flake8 checking due to the use of 'exec':
+# flake8: noqa
+#
 
+from Limits import Limits
 from AthenaCommon.Logging import logging
 log = logging.getLogger("Cabling")
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
index 7a418f44c3a2f5be0240a7bf31345537c1a00592..8e736ba7bdb744491a08f761ebb7336f75560099 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
@@ -9,8 +9,9 @@ from TriggerJobOpts.TriggerFlags import TriggerFlags
 # The trigger types
 from TriggerMenuMT.LVL1MenuConfig.LVL1.TriggerTypeDef import TT
 from TriggerMenuMT.LVL1MenuConfig.LVL1.Limits import Limits
-from TriggerMenuMT.LVL1MenuConfig.LVL1.Logic import Not
+from TriggerMenuMT.LVL1MenuConfig.LVL1.Logic import Logic, Not
 from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1MenuItems import LVL1MenuItem
+from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Condition import ThrCondition, Lvl1InternalTrigger
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger('TriggerMenuMT.Lvl1.py')