diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/DecisionPropagation_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/DecisionPropagation_jo.py
index ec56a8509d87c696e2017a140220fe39b94ad112..738c24f3d9dcede1fca31c82df60bc17780f91fe 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/DecisionPropagation_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/DecisionPropagation_jo.py
@@ -19,6 +19,8 @@ from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
 alg = xAODMaker__EventInfoCnvAlg()
 topSequence += alg
 
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
 
 from AthenaCommon.AppMgr import theApp
 theApp.EvtMax = 200000
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventNoSplit_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventNoSplit_jo.py
index e1470163db97d16a08eac261e83f13f9d97297c2..a264e9e70212aa2749e589e16f72e3135eeab963 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventNoSplit_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventNoSplit_jo.py
@@ -24,6 +24,8 @@ from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
 alg = xAODMaker__EventInfoCnvAlg()
 topSequence += alg
 
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
 
 from AthenaCommon.AppMgr import theApp
 theApp.EvtMax = 200000
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
index 3a9c4157cd1fb790bf86d638c1afff5483594960..b106e24a2f2f906b0e47220ae8902cde80d47182 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
@@ -19,6 +19,8 @@ from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
 alg = xAODMaker__EventInfoCnvAlg()
 topSequence += alg
 
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
 
 from AthenaCommon.AppMgr import theApp
 theApp.EvtMax = 200000
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
index 4d604280b5f2d86f1b9e4a178d37c0fa7022d848..ed96960dd342c6aee0983abc4150825771123dbc 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
@@ -24,6 +24,8 @@ from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
 alg = xAODMaker__EventInfoCnvAlg()
 topSequence += alg
 
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
 
 from AthenaCommon.AppMgr import theApp
 theApp.EvtMax = 200000
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py
index f2c5c32905b998aa54579914f1565c678d4c2610..b05c5dc842aa3bff764cf4a2c9dc0e4a549df138 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/SplittableData_jo.py
@@ -85,6 +85,9 @@ svcMgr += AthenaPoolCnvSvc()
 
 include( "AthenaPoolMultiTest/ExampleStreamConfig.py" )
 
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
+
 from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
 DataStream = AthenaPoolOutputStream( "DataStream" , "AthenaPoolMultiTest_Splittable0.root", False, noTag=False )
 DataStream.ItemList    = exampleItemList  # comes from ExampleStreamConfig
diff --git a/Calorimeter/CaloEvent/src/CaloTowerContainer.cxx b/Calorimeter/CaloEvent/src/CaloTowerContainer.cxx
index 37b789093893420b158960a5bc3785ac42404769..d5fdd39fb8d2fa2c5f845cb088e251c7bda71026 100644
--- a/Calorimeter/CaloEvent/src/CaloTowerContainer.cxx
+++ b/Calorimeter/CaloEvent/src/CaloTowerContainer.cxx
@@ -124,6 +124,10 @@ void CaloTowerContainer::init()
   double deltaPhi = m_towerSeg.dphi();
   double minPhi   = CaloPhiRange::fix (m_towerSeg.phimin() + deltaPhi / 2.);
 
+#ifdef CALOTOWERCONTAINER_USES_DATAPOOL
+  DataPool<CaloTower> towersPool (etaBins * phiBins);
+#endif
+
   // insert empty towers
   // NOTE: eta/phi indexing is 1-based.
   for (index_t etaIndex = 1; etaIndex <= etaBins; ++etaIndex) {
@@ -132,7 +136,6 @@ void CaloTowerContainer::init()
       double thePhi = CaloPhiRange::fix (minPhi + (phiIndex-1) * deltaPhi);
       index_t towerIndex   = this->getTowerIndex(etaIndex,phiIndex);
 #ifdef CALOTOWERCONTAINER_USES_DATAPOOL
-      DataPool<CaloTower> towersPool (etaBins * phiBins);
       CaloTower& tower = *towersPool.nextElementPtr();
       Base::operator[] (towerIndex) = &tower;
       tower.removeCells();
diff --git a/Calorimeter/CaloTriggerTool/CaloTriggerTool/ATLAS_CHECK_THREAD_SAFETY b/Calorimeter/CaloTriggerTool/CaloTriggerTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..05f38f68266ce36e233727fdd707a88c4bac6092
--- /dev/null
+++ b/Calorimeter/CaloTriggerTool/CaloTriggerTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Calorimeter/CaloTriggerTool
diff --git a/Calorimeter/CaloTriggerTool/CaloTriggerTool/CaloTriggerTowerService.h b/Calorimeter/CaloTriggerTool/CaloTriggerTool/CaloTriggerTowerService.h
index 68da164d38b210e8d1bdb95be1a989048889a9a9..4bf4e23a10c2184a2540e92b122b7bbb562535e3 100644
--- a/Calorimeter/CaloTriggerTool/CaloTriggerTool/CaloTriggerTowerService.h
+++ b/Calorimeter/CaloTriggerTool/CaloTriggerTool/CaloTriggerTowerService.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CALOTRIGGERTOWERSERVICE_H
@@ -7,7 +7,6 @@
 
 // Gaudi
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/DataHandle.h"
 #include "GaudiKernel/MsgStream.h"
 
 #include "AthenaKernel/IOVSvcDefs.h"
@@ -26,6 +25,7 @@
 
 #include "TrigT1CaloCalibConditions/L1CaloCoolChannelId.h"
 #include "TrigT1CaloCalibConditions/L1CaloRxCoolChannelId.h"
+#include "CxxUtils/CachedPointer.h"
 
 
 class Identifier;
@@ -34,7 +34,6 @@ class LArOnlineID;
 class LArEM_ID;
 class TTOnlineID;
 class CaloLVL1_ID;
-class LArCablingLegacyService;
 
 static const InterfaceID IID_CaloTriggerTowerService("CaloTriggerTowerService", 1 , 0);
 
@@ -145,26 +144,6 @@ class CaloTriggerTowerService : public AthAlgTool
   //======================= Trigger Tower - cell/channel mapping methods ==================================
   //
 
-  /**
-     Return a vector of LArOnlineID for a TTOnlineID   (online-online TT-cell mapping)
-
-     @param extTt used to decide wether the 'layer' info should be used or not <br>
-     extTt = 0 : the full TT is returned <br>
-     else      : the 'extended'TT (only 1 layer) is returned.
-
-     @warning the actual mapping is offline-offline, so this method is CPU expensive.
-     @warning this method is valid only for LAr Id so far
-  */
-  std::vector<HWIdentifier> createChannelIDvec(const HWIdentifier & id, int extTt) const;
-
-  /**
-     return the TTOnlineID of the TT to which a LArOnlineID belongs   (online-online TT-cell mapping)
-
-     @warning the actual mapping is offline-offline, so this method is CPU expensive.
-     @warning this method is valid only for LAr Id so far
-  */
-  HWIdentifier whichTTChannelID(const HWIdentifier & id) const;
-
   /**
      Return a vector of offline Identifiers (corresponding helpers =
      LArEM_ID, LArHEC_ID, LArFCAL_ID) for a TT offline id (helper=CaloLVL1_ID)
@@ -187,11 +166,6 @@ class CaloTriggerTowerService : public AthAlgTool
   */
   Identifier whichTTID(const Identifier & id) const;
 
-  /**
-     return true if the channel is in the lvl1 sums; <br>
-     some channels mapped to TT are only in HLT (last HEC compartment and last cells of barrel PS)
-  */
-  bool is_in_lvl1(const HWIdentifier & id) const;
   /**
      return true if the cell is in the lvl1 sums; <br>
      some channels mapped to TT are only in HLT (last HEC compartment and last cells of barrel PS)
@@ -200,9 +174,11 @@ class CaloTriggerTowerService : public AthAlgTool
 
 
  private:
+    const LArTTCellMap*      getTTCellMap() const;
+    const CaloTTOnOffIdMap*  getCaloTTOnOffIdMap() const;
+    const CaloTTOnAttrIdMap* getCaloTTOnAttrIdMap() const;
+    const CaloTTPpmRxIdMap*  getCaloTTPpmRxIdMap() const;
 
-    /** pointer to the LArCablingSvc tool */
-    LArCablingLegacyService   * m_larcablingSvc;
     /** pointer to the LAr Online Id helper */
     const LArOnlineID   * m_onlineHelper ;
     /** pointer to the LArEM  offline Id helper */
@@ -212,10 +188,10 @@ class CaloTriggerTowerService : public AthAlgTool
     /** pointer to the Calo TT online Id helper */
     const TTOnlineID    * m_ttonlineHelper;
 
-    const DataHandle<LArTTCellMap>      m_TTCellMap;
-    const DataHandle<CaloTTOnOffIdMap>  m_caloTTOnOffIdMap;
-    const DataHandle<CaloTTOnAttrIdMap> m_caloTTOnAttrIdMap;
-    const DataHandle<CaloTTPpmRxIdMap>  m_caloTTPpmRxIdMap;
+    CxxUtils::CachedPointer<const LArTTCellMap>  m_TTCellMap;
+    CxxUtils::CachedPointer<const CaloTTOnOffIdMap>  m_caloTTOnOffIdMap;
+    CxxUtils::CachedPointer<const CaloTTOnAttrIdMap> m_caloTTOnAttrIdMap;
+    CxxUtils::CachedPointer<const CaloTTPpmRxIdMap>  m_caloTTPpmRxIdMap;
 
     std::string       m_TTCellMapKey;
     std::string       m_caloTTOnOffIdMapKey;
diff --git a/Calorimeter/CaloTriggerTool/doc/packagedoc.h b/Calorimeter/CaloTriggerTool/doc/packagedoc.h
index d1d0d747740b552c03465783e1b95f21501217a2..86afd8fb4c0925d0b6abda235683a0bdd15f5e5a 100644
--- a/Calorimeter/CaloTriggerTool/doc/packagedoc.h
+++ b/Calorimeter/CaloTriggerTool/doc/packagedoc.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -67,26 +67,6 @@ NOTA BENE: the mapping is actually stored in terms of offline<->offline correspo
 therefore the offline<->offline conversion is faster than the online<->online conversion below. <br>
 Example:<br>
 
-<pre>
-//
-//... to which TT does this (cell's) channel belong
-//
-HWIdentifier channelId = ...;
-HWIdentifier ttOnl = m_cablingService->whichTTChannelID(channelId);
-</pre>
-
-Trigger Tower online to cell channel online correspondance, example:
-
-<pre>
-//
-//... fill a vector with online identifier of cells belonging to tower ttChannel (online id with layer info)
-//
-HWIdentifier ttChannel=...;
-std::vector < HWIdentifier > channelIdVec = m_cablingService->createChannelIDvec(ttChannel,0);
-</pre>
-
-
-
 
 
 
diff --git a/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx b/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx
index 314ebce2c04fd9d5e2f5dac98b59e6244b5c1581..5ca29e644f9fd6044cd2f48583ca15874441ab56 100644
--- a/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx
+++ b/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx
@@ -14,7 +14,7 @@
 #include "LArIdentifier/LArOnlID_Exception.h"
 #include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloLVL1_ID.h"
-#include "LArCabling/LArCablingLegacyService.h"
+#include "CaloIdentifier/LArEM_ID.h"
 #include "GaudiKernel/IToolSvc.h"
 #include "GaudiKernel/ServiceHandle.h"
 
@@ -23,7 +23,6 @@ CaloTriggerTowerService::CaloTriggerTowerService( const std::string& type,
 						const std::string& name,
 						const IInterface* parent )
   : AthAlgTool(type,name,parent),
-    m_larcablingSvc(nullptr) ,
     m_onlineHelper(nullptr) ,
     m_emHelper(nullptr) ,
     m_lvl1Helper(nullptr) ,
@@ -95,50 +94,6 @@ StatusCode CaloTriggerTowerService::initialize ()
     msg() << MSG::DEBUG << "Successfully accessed LArOnlineID helper" << endmsg;
   }
 
-
-  status= detStore()->regFcn(&CaloTriggerTowerService::iovCallBack,this,
-			     m_TTCellMap,m_TTCellMapKey);
-  if (status.isFailure()) {
-    msg() << MSG::ERROR << "Unable to regFcn for "<<m_TTCellMapKey << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-
-  status= detStore()->regFcn(&CaloTriggerTowerService::iovCallBack,this,
-			     m_caloTTOnOffIdMap,m_caloTTOnOffIdMapKey);
-  if (status.isFailure()) {
-    msg() << MSG::ERROR << "Unable to regFcn for "<<m_caloTTOnOffIdMapKey << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-
-  status= detStore()->regFcn(&CaloTriggerTowerService::iovCallBack,this,
-			     m_caloTTOnAttrIdMap,m_caloTTOnAttrIdMapKey);
-  if (status.isFailure()) {
-    msg() << MSG::ERROR << "Unable to regFcn for "<< m_caloTTOnAttrIdMapKey << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  status= detStore()->regFcn(&CaloTriggerTowerService::iovCallBack,this,
-			     m_caloTTPpmRxIdMap,m_caloTTPpmRxIdMapKey);
-  if (status.isFailure()) {
-    msg() << MSG::ERROR << "Unable to regFcn for "<< m_caloTTPpmRxIdMapKey << endmsg;
-    return StatusCode::FAILURE;
-  }
-
-  IToolSvc* toolSvc;
-  status   = service( "ToolSvc",toolSvc  );
-  if(status.isSuccess()) {
-    status = toolSvc->retrieveTool("LArCablingLegacyService",m_larcablingSvc);
-    if(status.isFailure()) {
-      msg() << MSG::ERROR << "Could not retrieve LArCablingLegacyService"<< endmsg;
-      return(StatusCode::FAILURE);
-    }
-  } else    {
-    msg() << MSG::ERROR << "Could not get ToolSvc"<< endmsg;
-    return(StatusCode::FAILURE);
-  }
-
   msg()<<MSG::INFO<<" ====> ...CaloTriggerTowerService::init() OK "<< endmsg;
   return StatusCode::SUCCESS;
 }
@@ -155,7 +110,7 @@ StatusCode CaloTriggerTowerService::finalize ()
 //===========================================================
 bool CaloTriggerTowerService::is_initialized () const
 {
-  return m_TTCellMap.isValid()&&m_caloTTOnOffIdMap.isValid()&&m_caloTTOnAttrIdMap.isValid();
+  return getTTCellMap() != nullptr && getCaloTTOnOffIdMap() != nullptr && getCaloTTOnAttrIdMap() != nullptr;
 }
 
 
@@ -165,7 +120,8 @@ HWIdentifier  CaloTriggerTowerService::createTTChannelID(const Identifier & id,
 
 	HWIdentifier invalidId (0);
 
-	if(!m_caloTTOnOffIdMap ) {// no mapping object
+        const CaloTTOnOffIdMap* caloTTOnOffIdMap = getCaloTTOnOffIdMap();
+	if(!caloTTOnOffIdMap ) {// no mapping object
 		msg() << MSG::ERROR << " No CaloTTOnOffIdMap !" << endmsg;
 		msg() << MSG::ERROR << " Has the DB folder holding the CaloTTOnOffIdMap been added to IOVDbSvc ? " << endmsg;
 		msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
@@ -174,7 +130,7 @@ HWIdentifier  CaloTriggerTowerService::createTTChannelID(const Identifier & id,
 	} else {
 
 		// have mapping object, forward the call
-		HWIdentifier sid = m_caloTTOnOffIdMap->createSignalChannelID( id ) ;
+                HWIdentifier sid = caloTTOnOffIdMap->createSignalChannelID( id ) ;
 		if(bQuiet) {
 			return sid;
 
@@ -196,7 +152,8 @@ Identifier  CaloTriggerTowerService::cnvToIdentifier(const HWIdentifier & id, bo
 {
 	Identifier invalidId (0);
 
-	if(!m_caloTTOnOffIdMap ) {
+        const CaloTTOnOffIdMap* caloTTOnOffIdMap = getCaloTTOnOffIdMap();
+	if(!caloTTOnOffIdMap ) {
 		msg() << MSG::ERROR << " No CaloTTOnOffIdMap !" << endmsg;
 		msg() << MSG::ERROR << " Has the DB folder holding the CaloTTOnOffIdMap been added to IOVDbSvc ? " << endmsg;
 		msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
@@ -204,13 +161,12 @@ Identifier  CaloTriggerTowerService::cnvToIdentifier(const HWIdentifier & id, bo
 
 	} else {
 		// mapping object exist, forward the call
-		Identifier offid = m_caloTTOnOffIdMap->cnvToIdentifier(id, bQuiet);
+                Identifier offid = caloTTOnOffIdMap->cnvToIdentifier(id, bQuiet);
 		if(bQuiet) {
 			return offid;
 
 		} else {
-			static Identifier def = Identifier()  ;
-			if(offid==def) {
+			if(!offid.is_valid()) {
 				CaloID_Exception except;
 				except.code(6) ;
 				except.message(" Online ID not found in map ") ;
@@ -225,7 +181,8 @@ L1CaloCoolChannelId CaloTriggerTowerService::cnvRxIdToCoolChannelId(const L1Calo
 
    L1CaloCoolChannelId invalidId;
 
-   if(!m_caloTTPpmRxIdMap ) {
+   const CaloTTPpmRxIdMap* caloTTPpmRxIdMap = getCaloTTPpmRxIdMap();
+   if(!caloTTPpmRxIdMap ) {
      msg() << MSG::ERROR << " No CaloTTPpmRxIdMap !" << endmsg;
      msg() << MSG::ERROR << " Has the DB folder holding the CaloTTPpmRxIdMap been added to IOVDbSvc ? " << endmsg;
      msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
@@ -233,7 +190,7 @@ L1CaloCoolChannelId CaloTriggerTowerService::cnvRxIdToCoolChannelId(const L1Calo
 
    } else {
      // mapping object exist, forward the call
-     L1CaloCoolChannelId ppmId = m_caloTTPpmRxIdMap->rxToPpmId(rxCoolChannelId);
+     L1CaloCoolChannelId ppmId = caloTTPpmRxIdMap->rxToPpmId(rxCoolChannelId);
      if(ppmId==L1CaloCoolChannelId()) {
          CaloID_Exception except;
          except.code(6) ;
@@ -246,7 +203,8 @@ L1CaloCoolChannelId CaloTriggerTowerService::cnvRxIdToCoolChannelId(const L1Calo
 
 std::vector<L1CaloRxCoolChannelId> CaloTriggerTowerService::cnvCoolChannelIdToRxId(const L1CaloCoolChannelId& ppmCoolChannelId) const {
 
-   if(!m_caloTTPpmRxIdMap ) {
+   const CaloTTPpmRxIdMap* caloTTPpmRxIdMap = getCaloTTPpmRxIdMap();
+   if(!caloTTPpmRxIdMap ) {
      msg() << MSG::ERROR << " No CaloTTPpmRxIdMap !" << endmsg;
      msg() << MSG::ERROR << " Has the DB folder holding the CaloTTPpmRxIdMap been added to IOVDbSvc ? " << endmsg;
      msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
@@ -254,7 +212,7 @@ std::vector<L1CaloRxCoolChannelId> CaloTriggerTowerService::cnvCoolChannelIdToRx
 
    } else {
      // mapping object exist, forward the call
-     std::vector<L1CaloRxCoolChannelId> rxChannels = m_caloTTPpmRxIdMap->ppmToRxId(ppmCoolChannelId);
+     std::vector<L1CaloRxCoolChannelId> rxChannels = caloTTPpmRxIdMap->ppmToRxId(ppmCoolChannelId);
      if(rxChannels.empty()) {
          CaloID_Exception except;
          except.code(6) ;
@@ -268,13 +226,14 @@ std::vector<L1CaloRxCoolChannelId> CaloTriggerTowerService::cnvCoolChannelIdToRx
 //==========================================================================
 unsigned int CaloTriggerTowerService::barrel_endcap_fcal(const HWIdentifier & id) const {
 
-    if(!m_caloTTOnAttrIdMap) {
+  const CaloTTOnAttrIdMap* caloTTOnAttrIdMap = getCaloTTOnAttrIdMap();
+  if(!caloTTOnAttrIdMap) {
      msg() << MSG::ERROR << " No TTOnAttrIdMap !" << endmsg;
      msg() << MSG::ERROR << " Has the DB folder holding the TTOnAttrIdMap been added to IOVDbSvc ? " << endmsg;
      msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
      return (0);
     } else {
-        unsigned int barrel_endcap_fcal = m_caloTTOnAttrIdMap->barrel_endcap_fcal(id);
+        unsigned int barrel_endcap_fcal = caloTTOnAttrIdMap->barrel_endcap_fcal(id);
         return barrel_endcap_fcal;
     }
 }
@@ -282,13 +241,14 @@ unsigned int CaloTriggerTowerService::barrel_endcap_fcal(const HWIdentifier & id
 //==========================================================================
 unsigned int CaloTriggerTowerService::em_had(const HWIdentifier & id) const {
 
-    if(!m_caloTTOnAttrIdMap) {
+    const CaloTTOnAttrIdMap* caloTTOnAttrIdMap = getCaloTTOnAttrIdMap();
+    if(!caloTTOnAttrIdMap) {
      msg() << MSG::ERROR << " No TTOnAttrIdMap !" << endmsg;
      msg() << MSG::ERROR << " Has the DB folder holding the TTOnAttrIdMap been added to IOVDbSvc ? " << endmsg;
      msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
      return (0);
     } else {
-        unsigned int em_had = m_caloTTOnAttrIdMap->em_had(id);
+        unsigned int em_had = caloTTOnAttrIdMap->em_had(id);
         return em_had;
     }
 }
@@ -296,13 +256,14 @@ unsigned int CaloTriggerTowerService::em_had(const HWIdentifier & id) const {
 //==========================================================================
 unsigned int CaloTriggerTowerService::pos_neg(const HWIdentifier & id) const {
 
-    if(!m_caloTTOnAttrIdMap) {
+    const CaloTTOnAttrIdMap* caloTTOnAttrIdMap = getCaloTTOnAttrIdMap();
+    if(!caloTTOnAttrIdMap) {
      msg() << MSG::ERROR << " No TTOnAttrIdMap !" << endmsg;
      msg() << MSG::ERROR << " Has the DB folder holding the TTOnAttrIdMap been added to IOVDbSvc ? " << endmsg;
      msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
      return (0);
     } else {
-        unsigned int pos_neg = m_caloTTOnAttrIdMap->pos_neg(id);
+        unsigned int pos_neg = caloTTOnAttrIdMap->pos_neg(id);
         return pos_neg;
     }
 }
@@ -310,13 +271,14 @@ unsigned int CaloTriggerTowerService::pos_neg(const HWIdentifier & id) const {
 unsigned int CaloTriggerTowerService::module_type(const HWIdentifier & id) const {
 
 
-    if(!m_caloTTOnAttrIdMap) {
+    const CaloTTOnAttrIdMap* caloTTOnAttrIdMap = getCaloTTOnAttrIdMap();
+    if(!caloTTOnAttrIdMap) {
      msg() << MSG::ERROR << " No TTOnAttrIdMap !" << endmsg;
      msg() << MSG::ERROR << " Has the DB folder holding the TTOnAttrIdMap been added to IOVDbSvc ? " << endmsg;
      msg() << MSG::ERROR << " IOVDbSvc.Folders+=[ FolderName + DBConnection + \"<tag>\"+TagSpec+\"</tag>\" ] " << endmsg;
      return (0);
     } else {
-        unsigned int module_type = m_caloTTOnAttrIdMap->module_type(id);
+        unsigned int module_type = caloTTOnAttrIdMap->module_type(id);
         return module_type;
     }
 }
@@ -325,14 +287,15 @@ unsigned int CaloTriggerTowerService::module_type(const HWIdentifier & id) const
 //===========================================================
 L1CaloCoolChannelId CaloTriggerTowerService::createL1CoolChannelId( const HWIdentifier & id ) const {
 
-    if(m_caloTTOnAttrIdMap) {
+    const CaloTTOnAttrIdMap* caloTTOnAttrIdMap = getCaloTTOnAttrIdMap();
+    if(caloTTOnAttrIdMap) {
 
         unsigned int crate       = m_ttonlineHelper->crate(id);
         unsigned int module      = m_ttonlineHelper->module(id); // this returns the physical slot position !
         unsigned int submodule   = m_ttonlineHelper->submodule(id);
         unsigned int channel     = m_ttonlineHelper->channel(id);
 
-        unsigned int module_type = m_caloTTOnAttrIdMap->module_type(id);
+        unsigned int module_type = caloTTOnAttrIdMap->module_type(id);
 
 		// since the module argument is the physical position and not the logical one, the logical flag is set to false
         return L1CaloCoolChannelId(crate, L1CaloModuleType( (L1CaloModuleType::L1CaloModuleEnum) module_type), module, submodule, channel, false);
@@ -362,77 +325,6 @@ HWIdentifier CaloTriggerTowerService::cnvCoolChannelIdToHWID( const L1CaloCoolCh
 }
 
 
-//==========================================================================
-std::vector<HWIdentifier> CaloTriggerTowerService::createChannelIDvec(const HWIdentifier & id, int extTt) const 
-{
-  std::vector<HWIdentifier> channel_id_vec;
-  std::vector<HWIdentifier> febs_of_tt;
-  std::vector<Identifier> cell_id_vec;
-
-  if(m_emHelper->dictionaryVersion() == "fullAtlas" ||
-     m_emHelper->dictionaryVersion() == "H8TestBeam") {
-
-    if(!m_TTCellMap) {
-      msg() << MSG::ERROR << " No TTCellMap  !" << endmsg;
-      return channel_id_vec;
-    }
-
-    Identifier ttId=cnvToIdentifier(id);
-    if(extTt) {
-      cell_id_vec=createCellIDvecLayer(ttId);
-    } else {
-      cell_id_vec=createCellIDvecTT(ttId);
-    }
-    std::vector<Identifier>::const_iterator it  = cell_id_vec.begin();
-    std::vector<Identifier>::const_iterator it_e  = cell_id_vec.end();
-    for (; it!=it_e; ++it)      {
-      HWIdentifier onlId=m_larcablingSvc->createSignalChannelID(*it);
-      channel_id_vec.push_back(onlId);
-    }
-
-  }
-
-  return channel_id_vec;
-}
-
-
-
-//==========================================================================
-HWIdentifier CaloTriggerTowerService::whichTTChannelID(const HWIdentifier & id) const
-{
-//==========================================================================
-//
-// Input : channel Online identifier
-// Output: trigger tower Online identifier
-//
-//==========================================================================
-
-  HWIdentifier triggerTower(0);
-
-  if(m_emHelper->dictionaryVersion() == "fullAtlas" ||
-     m_emHelper->dictionaryVersion() == "H8TestBeam") {
-
-    if(!m_TTCellMap) {
-      msg() << MSG::ERROR << " No TTCellMap  !" << endmsg;
-      return triggerTower;
-    }
-
-    Identifier cellId=m_larcablingSvc->cnvToIdentifier(id);
-    //Identifier ttId=whichTTID(cellId);
-
-    // WhichTTID returns a layer_id which embed the layer information
-    // while createTTChannelID expect a tower_id
-    Identifier ttLayerId=whichTTID(cellId);
-    Identifier ttId = m_lvl1Helper->tower_id(ttLayerId);
-
-    triggerTower=createTTChannelID(ttId);
-
-  }
-
-  return triggerTower;
-}
-
-
 //==========================================================================
 std::vector<Identifier>
 CaloTriggerTowerService::createCellIDvecTT(const Identifier& id) const 
@@ -443,7 +335,8 @@ CaloTriggerTowerService::createCellIDvecTT(const Identifier& id) const
   if(m_emHelper->dictionaryVersion() == "fullAtlas" ||
      m_emHelper->dictionaryVersion() == "H8TestBeam") {
 
-    if(!m_TTCellMap) {
+    const LArTTCellMap* TTCellMap = getTTCellMap();
+    if(!TTCellMap) {
       msg() << MSG::ERROR << " No TTCellMap  !" << endmsg;
       return vec;
     }
@@ -455,7 +348,7 @@ CaloTriggerTowerService::createCellIDvecTT(const Identifier& id) const
     for(int iLay=0;iLay<=maxLay;++iLay) {
       // Rem: not all iLay correspond to physically existing layers
       Identifier layId = m_lvl1Helper->layer_id(ttId,iLay);
-      std::vector<Identifier> vecp = m_TTCellMap->createCellIDvec(layId);
+      std::vector<Identifier> vecp = TTCellMap->createCellIDvec(layId);
       std::vector<Identifier>::const_iterator it  = vecp.begin();
       std::vector<Identifier>::const_iterator it_e  = vecp.end();
       for (; it!=it_e; ++it)      {
@@ -474,14 +367,15 @@ CaloTriggerTowerService::createCellIDvecLayer(const Identifier& id) const
 //==========================================================================
 {
   std::vector<Identifier> vec ;
+  const LArTTCellMap* TTCellMap = getTTCellMap();
 
   if(m_emHelper->dictionaryVersion() == "fullAtlas" ||
      m_emHelper->dictionaryVersion() == "H8TestBeam") {
-    if(!m_TTCellMap) {
+    if(!TTCellMap) {
       msg() << MSG::ERROR << " No TTCellMap  !" << endmsg;
       return vec;
     }
-    vec = m_TTCellMap->createCellIDvec(id);
+    vec = TTCellMap->createCellIDvec(id);
   }
 
   return vec;
@@ -496,11 +390,12 @@ Identifier CaloTriggerTowerService::whichTTID(const Identifier & id) const
   if(m_emHelper->dictionaryVersion() == "fullAtlas" ||
      m_emHelper->dictionaryVersion() == "H8TestBeam") {
 
-    if(!m_TTCellMap) {
+    const LArTTCellMap* TTCellMap = getTTCellMap();
+    if(!TTCellMap) {
       msg() << MSG::ERROR << " No TTCellMap  !" << endmsg;
       return sid;
     }
-    sid = m_TTCellMap->whichTTID( id ) ;
+    sid = TTCellMap->whichTTID( id ) ;
     Identifier invalidId (0);
     if(sid == invalidId ){
       LArID_Exception except;
@@ -513,24 +408,6 @@ Identifier CaloTriggerTowerService::whichTTID(const Identifier & id) const
 }
 
 
-//=============================================================
-bool CaloTriggerTowerService::is_in_lvl1(const HWIdentifier & id) const
-//=============================================================
-//
-// input = channel online id
-// some channels are mapped to a TT although not in lvl1
-// 2 cases: barrel end and last compartment of hec.
-//
-//=============================================================
-{
-
-  Identifier cellId=m_larcablingSvc->cnvToIdentifier(id);
-  bool lvl1 = is_in_lvl1(cellId);
-
-  return lvl1;
-
-}
-
 //=============================================================
 bool CaloTriggerTowerService::is_in_lvl1(const Identifier & id) const
 //=============================================================
@@ -580,3 +457,50 @@ StatusCode CaloTriggerTowerService::iovCallBack(IOVSVC_CALLBACK_ARGS) {
 
 }
 
+
+const LArTTCellMap* CaloTriggerTowerService::getTTCellMap() const
+{
+  if (!m_TTCellMap.get()) {
+    const LArTTCellMap* TTCellMap = nullptr;
+    if (detStore()->retrieve (TTCellMap, m_TTCellMapKey).isSuccess()) {
+      m_TTCellMap.set (TTCellMap);
+    }
+  }
+  return m_TTCellMap.get();
+}
+
+
+const CaloTTOnOffIdMap* CaloTriggerTowerService::getCaloTTOnOffIdMap() const
+{
+  if (!m_caloTTOnOffIdMap.get()) {
+    const CaloTTOnOffIdMap* caloTTOnOffIdMap = nullptr;
+    if (detStore()->retrieve (caloTTOnOffIdMap, m_caloTTOnOffIdMapKey).isSuccess()) {
+      m_caloTTOnOffIdMap.set (caloTTOnOffIdMap);
+    }
+  }
+  return m_caloTTOnOffIdMap.get();
+}
+
+
+const CaloTTOnAttrIdMap* CaloTriggerTowerService::getCaloTTOnAttrIdMap() const
+{
+  if (!m_caloTTOnAttrIdMap.get()) {
+    const CaloTTOnAttrIdMap* caloTTOnAttrIdMap = nullptr;
+    if (detStore()->retrieve (caloTTOnAttrIdMap, m_caloTTOnAttrIdMapKey).isSuccess()) {
+      m_caloTTOnAttrIdMap.set (caloTTOnAttrIdMap);
+    }
+  }
+  return m_caloTTOnAttrIdMap.get();
+}
+
+
+const CaloTTPpmRxIdMap* CaloTriggerTowerService::getCaloTTPpmRxIdMap() const
+{
+  if (!m_caloTTPpmRxIdMap.get()) {
+    const CaloTTPpmRxIdMap* caloTTPpmRxIdMap = nullptr;
+    if (detStore()->retrieve (caloTTPpmRxIdMap, m_caloTTPpmRxIdMapKey).isSuccess()) {
+      m_caloTTPpmRxIdMap.set (caloTTPpmRxIdMap);
+    }
+  }
+  return m_caloTTPpmRxIdMap.get();
+}
diff --git a/Calorimeter/CaloTriggerTool/src/LArTTCellMap.cxx b/Calorimeter/CaloTriggerTool/src/LArTTCellMap.cxx
index 3efc00530d33598e4a78fff8edb88970af5422ec..dae9643d1b2c939a4701e9b5e8e025984f9f7203 100755
--- a/Calorimeter/CaloTriggerTool/src/LArTTCellMap.cxx
+++ b/Calorimeter/CaloTriggerTool/src/LArTTCellMap.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloTriggerTool/LArTTCellMap.h"
@@ -215,7 +215,7 @@ LArTTCellMap::createCellIDvec(const Identifier & sid) const
    (*m_msg) <<MSG::VERBOSE<<" vector of offline cell ID not found, TT id = " <<sid.get_compact()<< endmsg;
  }
 
- static std::vector<Identifier> v;
+ static const std::vector<Identifier> v;
  return  v ;
 
 }
diff --git a/Control/CxxUtils/share/OptionalContainer_test.ref b/Control/CxxUtils/share/OptionalContainer_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/DataQuality/dqm_algorithms/dqm_algorithms/LastBinThresholdAction.h b/DataQuality/dqm_algorithms/dqm_algorithms/LastBinThresholdAction.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e25fd315d9f7c97389090b7c29f05c92ad84db1
--- /dev/null
+++ b/DataQuality/dqm_algorithms/dqm_algorithms/LastBinThresholdAction.h
@@ -0,0 +1,62 @@
+/*
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef DQM_ALGORITHMS_LASTBINTHRESHOLDACTION_H
+#define DQM_ALGORITHMS_LASTBINTHRESHOLDACTION_H
+
+#include <dqm_core/Algorithm.h>
+
+namespace dqm_algorithms {
+
+  class LessThan {
+  public:
+    bool operator() (double a, double b, double /*error = 0.*/) const {
+      return a < b;
+    }
+  };
+
+  class GreaterThan {
+  public:
+    bool operator() (double a, double b, double /*error = 0.*/) const {
+      return a > b;
+    }
+  };
+
+  class DifferentThan {
+  public:
+    bool operator() (double a, double b, double error = 0.) const {
+      return std::abs(a - b) > error;
+    }
+  };
+
+  class NoAction {
+  public:
+    void operator() (const std::string&, std::string&, double, double) const {}
+  };
+
+  class TileDQAction {
+  public:
+    void operator() (const std::string& histogramName, std::string action,
+                     double averageBinContent, double lastBinContent) const;
+  };
+
+  template<class Exceed, class Action>
+  class LastBinThresholdAction : public dqm_core::Algorithm  {
+  public:
+    LastBinThresholdAction(const std::string & name);
+
+    // Overwrites virtual functions
+    virtual LastBinThresholdAction* clone( ) override;
+    virtual dqm_core::Result* execute( const std::string& , const TObject& , const dqm_core::AlgorithmConfig& ) override;
+    using dqm_core::Algorithm::printDescription;
+    virtual void printDescription(std::ostream& out) const;
+
+  private:
+    std::string m_name;
+    Exceed m_exceeds;
+    Action m_doAction;
+  };
+}
+
+#endif // DQM_ALGORITHMS_LASTBINTHRESHOLDACTION_H
diff --git a/DataQuality/dqm_algorithms/dqm_algorithms/dqm_algorithmsDict.h b/DataQuality/dqm_algorithms/dqm_algorithms/dqm_algorithmsDict.h
index 11f524549c01043562ae1a5b8e38d780bddd236a..840bf73b5e8a8668ad84d16cb998ac6e20887f59 100644
--- a/DataQuality/dqm_algorithms/dqm_algorithms/dqm_algorithmsDict.h
+++ b/DataQuality/dqm_algorithms/dqm_algorithms/dqm_algorithmsDict.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DQM_ALGORITHMS_DQM_ALGORITHMSDICT_H
@@ -158,5 +158,5 @@
 #include "dqm_algorithms/TRTCheckPeakSimple.h"
 #include "dqm_algorithms/TRTHistogramHasNonZeroEntries.h"
 #include "dqm_algorithms/TripleGaussCollFit.h"
-
+#include "dqm_algorithms/LastBinThresholdAction.h"
 #endif // DQM_ALGORITHMS_DQM_ALGORITHMSDICT_H
diff --git a/DataQuality/dqm_algorithms/dqm_algorithms/selection.xml b/DataQuality/dqm_algorithms/dqm_algorithms/selection.xml
index 81a54ea9f04b5cc65881c30d3863614628bbb5bc..36778865916ca4cdd1a3073aba87cf069c04bde0 100644
--- a/DataQuality/dqm_algorithms/dqm_algorithms/selection.xml
+++ b/DataQuality/dqm_algorithms/dqm_algorithms/selection.xml
@@ -104,6 +104,10 @@
   <class name="dqm_algorithms::KurtosisTest_LessThan"/>
   <class name="dqm_algorithms::KurtosisTest_LessThanAbs"/>
   <class name="dqm_algorithms::LastBinThreshold"/>
+  <class name="dqm_algorithms::LastBinThresholdAction<dqm_algorithms::LessThan,dqm_algorithms::NoAction>"/>
+  <class name="dqm_algorithms::LastBinThresholdAction<dqm_algorithms::GreaterThan,dqm_algorithms::NoAction>"/>
+  <class name="dqm_algorithms::LastBinThresholdAction<dqm_algorithms::DifferentThan,dqm_algorithms::NoAction>"/>
+  <class name="dqm_algorithms::LastBinThresholdAction<dqm_algorithms::DifferentThan,dqm_algorithms::TileDQAction>"/>
   <class name="dqm_algorithms::L1Calo_OutlierAndFlatnessTest"/>
   <class name="dqm_algorithms::MDTADCSpectrum"/>
   <class name="dqm_algorithms::MDTChi2"/>
@@ -149,6 +153,7 @@
   <class name="dqm_algorithms::SkewnessTest_GreaterThanAbs"/>
   <class name="dqm_algorithms::SkewnessTest_LessThan"/>
   <class name="dqm_algorithms::SkewnessTest_LessThanAbs"/>
+  <class name="dqm_algorithms::TileDQAction"/>
   <class name="dqm_algorithms::TRTCheckPeakSimple"/>
   <class name="dqm_algorithms::TRTHistogramHasNonZeroEntries"/>
   <class name="dqm_algorithms::TripleGaussCollFit"/>
diff --git a/DataQuality/dqm_algorithms/src/LastBinThresholdAction.cxx b/DataQuality/dqm_algorithms/src/LastBinThresholdAction.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a4a9e6e0fbd1983288d89ca507675a2a8cee2c0a
--- /dev/null
+++ b/DataQuality/dqm_algorithms/src/LastBinThresholdAction.cxx
@@ -0,0 +1,203 @@
+/*
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include <dqm_core/AlgorithmConfig.h>
+#include <dqm_algorithms/LastBinThresholdAction.h>
+#include <dqm_algorithms/tools/AlgorithmHelper.h>
+#include <TH1.h>
+#include <TF1.h>
+#include <TProfile.h>
+#include <TClass.h>
+#include <ers/ers.h>
+
+#include <iostream>
+#include <cstdlib>
+#include <regex>
+
+#include <dqm_core/AlgorithmManager.h>
+
+namespace {
+
+
+  dqm_algorithms::LastBinThresholdAction<dqm_algorithms::GreaterThan, dqm_algorithms::NoAction>
+  LastBinGreaterThanThreshold("LastBinGreaterThanThreshold");
+
+  dqm_algorithms::LastBinThresholdAction<dqm_algorithms::LessThan, dqm_algorithms::NoAction>
+  LastBinLessThanThreshold("LastBinLessThanThreshold");
+
+  dqm_algorithms::LastBinThresholdAction<dqm_algorithms::DifferentThan, dqm_algorithms::NoAction>
+  LastBinDifferentThanThreshold("LastBinDifferentThanThreshold");
+
+  dqm_algorithms::LastBinThresholdAction<dqm_algorithms::GreaterThan, dqm_algorithms::TileDQAction>
+  TileDataCorruptionFractionGreaterThanThreshold("TileDataCorruptionGreaterThanThreshold");
+}
+
+void dqm_algorithms::TileDQAction::operator() (const std::string& histogramName, std::string action,
+                                               double averageBinContent, double lastBinContent) const {
+
+  const char* actionPath = std::getenv("TILE_DQ_ACTION_PATH");
+  if (actionPath != nullptr) action = std::string(actionPath) + "/" + action;
+
+  std::smatch match;
+  std::regex expression (".*([LE]B[AC]\\d\\d).*");
+
+  std::string module("UNKNOWN");
+  if (std::regex_search(histogramName, match, expression) && match.size() > 1) {
+    module = match.str(1);
+  }
+
+  action += " ";
+  action += histogramName;
+  action += " ";
+  action += module;
+  action += " ";
+  action += std::to_string(lastBinContent);
+  action += " ";
+  action += std::to_string(averageBinContent);
+  action += " &";
+  std::system(action.c_str());
+}
+
+
+template<class Exceed, class Action>
+dqm_algorithms::LastBinThresholdAction<Exceed, Action>::LastBinThresholdAction(const std::string& name)
+  : m_name( name )
+{
+  dqm_core::AlgorithmManager::instance().registerAlgorithm(name, this);
+}
+
+template<class Exceed, class Action>
+dqm_algorithms::LastBinThresholdAction<Exceed, Action>*
+dqm_algorithms::LastBinThresholdAction<Exceed, Action>::clone() {
+  return new LastBinThresholdAction(m_name);
+}
+
+
+template<class Exceed, class Action> dqm_core::Result*
+dqm_algorithms::LastBinThresholdAction<Exceed, Action>::execute(const std::string&  name,
+                                                                const TObject& object,
+                                                                const dqm_core::AlgorithmConfig& config )
+{
+  const TProfile* histogram;
+
+  if( object.IsA()->InheritsFrom( "TProfile" ) ) {
+    histogram = dynamic_cast<const TProfile*>(&object);
+    if (histogram->GetDimension() > 1){
+      throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 2 " );
+    }
+  } else {
+    throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TProfile" );
+  }
+
+  const double minStat = dqm_algorithms::tools::GetFirstFromMap( "MinStat", config.getParameters(), -1);
+  const double fixedError = dqm_algorithms::tools::GetFirstFromMap( "FixedError", config.getParameters(), -1);
+  const bool ignoreEmpty = static_cast<bool>( dqm_algorithms::tools::GetFirstFromMap( "IgnoreEmpty", config.getParameters(), 1) );
+  const bool publish = static_cast<bool>( dqm_algorithms::tools::GetFirstFromMap( "PublishBins", config.getParameters(), 0) );
+  const int maxPublish = static_cast<int>( dqm_algorithms::tools::GetFirstFromMap( "MaxPublish", config.getParameters(), 20) );
+  const int nBinsToWatch = static_cast<int>( dqm_algorithms::tools::GetFirstFromMap( "NBinsToWatch", config.getParameters(), -1) );
+  const int nBinsForAction = static_cast<int>( dqm_algorithms::tools::GetFirstFromMap( "NBinsForAction", config.getParameters(), 99999) );
+
+  std::string action("");
+  std::map<std::string, std::string>::const_iterator itAction = config.getGenericParameters().find("Action");
+  if (itAction != config.getGenericParameters().end()) {
+    action = itAction->second;
+  }
+
+  if (histogram->GetEntries() < minStat ) {
+    dqm_core::Result *result = new dqm_core::Result(dqm_core::Result::Undefined);
+    result->tags_["InsufficientEntries"] = histogram->GetEntries();
+    return result;
+  }
+
+  double binThreshold;
+  double greenThreshold;
+  double redThreshold;
+  try {
+    binThreshold = dqm_algorithms::tools::GetFirstFromMap( "BinThreshold", config.getParameters() );
+    redThreshold = dqm_algorithms::tools::GetFromMap( "NBins", config.getRedThresholds() );
+    greenThreshold = dqm_algorithms::tools::GetFromMap( "NBins", config.getGreenThresholds() );
+  } catch ( dqm_core::Exception & ex ) {
+    throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
+  }
+
+  dqm_core::Result* result = new dqm_core::Result();
+
+  int nBinsOverThreshold = 0;
+
+  int firstBin = 1;
+  int lastBin = histogram->GetNbinsX();
+
+  if (nBinsToWatch > 0) {
+    while ((histogram->GetBinEntries(lastBin) == 0) && (lastBin > 1)) --lastBin;
+    firstBin = (lastBin > nBinsToWatch) ? (lastBin - nBinsToWatch + 1) : 1;
+
+    result->tags_["LastBinNumber"] = lastBin; // report where we began the checks (mostly for debugging)
+    result->tags_["LastBinCenter"] = histogram->GetBinCenter(lastBin); // report where that is on the x-axis
+  }
+
+  double lastBinOverThresholdContent(0.0);
+  double binsOverThresholdContent(0.0);
+
+  for (int bin = firstBin; bin <= lastBin; ++bin) {
+    if (ignoreEmpty && (histogram->GetBinEntries(bin) == 0)) {
+      continue;
+    }
+    double content = histogram->GetBinContent(bin);
+    if (m_exceeds(content, binThreshold, fixedError)) {
+      ++nBinsOverThreshold;
+      lastBinOverThresholdContent = content;
+      binsOverThresholdContent += content;
+      if (publish && nBinsOverThreshold < maxPublish){
+        dqm_algorithms::tools::PublishBin(histogram, bin, 1, content, result);
+      }
+    }
+  }
+
+  ERS_DEBUG(1,"Number of bins exceeded threshold of " << binThreshold << " is " << nBinsOverThreshold );
+  ERS_DEBUG(1,"Green threshold: "<< greenThreshold << " bin(s);   Red threshold : " << redThreshold << " bin(s) ");
+
+  result->tags_["NBins"] = nBinsOverThreshold;
+  if (greenThreshold > redThreshold) {
+    if (nBinsOverThreshold >= greenThreshold) {
+      result->status_ = dqm_core::Result::Green;
+    } else if (nBinsOverThreshold > redThreshold) {
+      result->status_ = dqm_core::Result::Yellow;
+    } else {
+      result->status_ = dqm_core::Result::Red;
+    }
+  } else {
+    if (nBinsOverThreshold <= greenThreshold) {
+      result->status_ = dqm_core::Result::Green;
+    } else if (nBinsOverThreshold < redThreshold) {
+      result->status_ = dqm_core::Result::Yellow;
+    } else {
+      result->status_ = dqm_core::Result::Red;
+    }
+  }
+
+  if (!action.empty() && nBinsOverThreshold >= nBinsForAction) {
+    double averageBinContent = binsOverThresholdContent / nBinsOverThreshold;
+    std::string histogramName(histogram->GetName());
+    m_doAction(histogramName, action, lastBinOverThresholdContent, averageBinContent);
+  }
+
+  return result;
+
+}
+
+template<class Exceed, class Action>
+void dqm_algorithms::LastBinThresholdAction<Exceed, Action>::printDescription(std::ostream& out) const {
+
+  out << m_name + ": Checks for number of bins exceded threshold value" << std::endl;
+  out << "Mandatory Parameter: BinThreshold: Look for bins exceeded BinTreshold; Count number of bins satifying requirement" << std::endl;
+  out << "Mandatory Green/Red Threshold: NBins: Number of bins satifying BinThreshold constraint to give Green/Red result" << std::endl;
+
+  out << "Optional Parameter: FixedError: override the histogram errors with this value" << std::endl;
+  out << "Optional Parameter: IgnoreEmpty: Ignore bins which have zero entries in histogram" << std::endl;
+  out << "Optional Parameter: PublishBins: Save bins which are different from average in Result (set to 1)" << std::endl;
+  out << "Optional Parameter: MaxPublish: Max number of bins to save (default 20)" << std::endl;
+  out << "Optional Parameter: MinStat: Minimum histogram statistics needed to perform Algorithm" << std::endl;
+  out << "Optional parameter: NBinsToWatch - number of final bins that will be checked. (NBinsToWatch >= 1, default = -1)" << std::endl;
+}
+
diff --git a/DataQuality/dqm_algorithms/workbench/TestLastBinThresholdAction.C b/DataQuality/dqm_algorithms/workbench/TestLastBinThresholdAction.C
new file mode 100644
index 0000000000000000000000000000000000000000..c4f8963930caef99f0d1c7b90749401ad4761da6
--- /dev/null
+++ b/DataQuality/dqm_algorithms/workbench/TestLastBinThresholdAction.C
@@ -0,0 +1,143 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+void printHistogram(const TH1* histogam, std::string name) {
+  std::cout << "===========>  BEGIN Histogram: " << name << "  <============" << std::endl;
+  histogam->Print("All");
+  std::cout << "------------>  END Histogram: " << name << "  <--------------" << std::endl;
+}
+
+template<class Exceed>
+bool testLastBinThresholdNoAction(std::string name, double value, std::array<double, 3> badValues, double error = -999.) {
+  using LastBinThresholdNoAction = dqm_algorithms::LastBinThresholdAction<Exceed,dqm_algorithms::NoAction>;
+  auto algorithm = new LastBinThresholdNoAction(name);
+
+  std::unique_ptr<TProfile> histogram(new TProfile("histogram", "Simple Profile", 5, 0, 5));
+  histogram->SetDirectory(0);
+  for (int i = 0; i < 3; ++i) {
+    histogram->Fill(i, value);
+  }
+
+  std::unique_ptr<dqm_core::test::DummyAlgorithmConfig> config(new dqm_core::test::DummyAlgorithmConfig());
+
+  config->addParameter("NBinsToWatch", 3);
+  config->addParameter("BinThreshold", value);
+  if (error > 0.) {
+    config->addParameter("FixedError", error);
+  }
+
+  // Threshold for number of bins aways from threshold
+  config->addGreenThreshold("NBins", 1);
+  config->addRedThreshold("NBins", 3);
+
+  std::cout << "Config [" << name << "]: ";
+  config->print(std::cout);
+
+  bool isTestOk = true;
+
+  std::cout << std::endl << std::endl;
+  histogram->Fill(0., badValues[0]);
+  printHistogram(histogram.get(), "Green");
+  std::unique_ptr<dqm_core::Result> greenResult(algorithm->execute( "test", *histogram, *config));
+  std::cout << "Result: " << *(greenResult.get()) << std::endl;
+  isTestOk &= (greenResult->status_ == dqm_core::Result::Green);
+
+  std::cout << std::endl;
+  histogram->Fill(1., badValues[1]);
+  printHistogram(histogram.get(), "Yellow");
+  std::unique_ptr<dqm_core::Result> yellowResult(algorithm->execute( "test", *histogram, *config));
+  std::cout << "Result: " << *(yellowResult.get()) << std::endl;
+  isTestOk &= (yellowResult->status_ == dqm_core::Result::Yellow);
+
+  std::cout << std::endl;
+  histogram->Fill(2., badValues[2]);
+  printHistogram(histogram.get(), "Red");
+  std::unique_ptr<dqm_core::Result> redResult(algorithm->execute( "test", *histogram, *config));
+  std::cout << "Result: " << *(redResult.get()) << std::endl;
+  isTestOk &= (redResult->status_ == dqm_core::Result::Red);
+
+  return isTestOk;
+}
+
+
+
+bool testTileDataCorruption(std::string name, double value, std::array<double, 3> badValues) {
+  using TileDataCorruption = dqm_algorithms::LastBinThresholdAction<dqm_algorithms::GreaterThan,dqm_algorithms::TileDQAction>;
+  auto algorithm = new TileDataCorruption(name);
+
+  std::unique_ptr<TProfile> histogram(new TProfile("TileDigiErrFracLBA56", "Simple Profile", 5, 0, 5));
+  histogram->SetDirectory(0);
+  for (int i = 0; i < 4; ++i) {
+    histogram->Fill(i, value);
+  }
+
+  std::unique_ptr<dqm_core::test::DummyAlgorithmConfig> config(new dqm_core::test::DummyAlgorithmConfig());
+
+  config->addParameter("NBinsToWatch", 3);
+  config->addParameter("BinThreshold", value);
+  config->addParameter("NBinsForAction", 3);
+  config->addGenericParameter("Action", "echo");
+
+  // Threshold for number of bins aways from threshold
+  config->addGreenThreshold("NBins", 1);
+  config->addRedThreshold("NBins", 4); // Given NBins > NBinsToWatch, do not give red status
+
+  std::cout << "Config [" << name << "]: ";
+  config->print(std::cout);
+
+  bool isTestOk = true;
+
+  std::cout << std::endl << std::endl;
+  histogram->Fill(1., badValues[0]);
+  histogram->Fill(2., badValues[1]);
+  histogram->Fill(3., badValues[2]);
+  printHistogram(histogram.get(), "Yellow");
+  std::unique_ptr<dqm_core::Result> yellowResult(algorithm->execute( "test", *histogram, *config));
+  std::cout << "Result: " << *(yellowResult.get()) << std::endl;
+  isTestOk &= (yellowResult->status_ == dqm_core::Result::Yellow);
+
+  return isTestOk;
+}
+
+
+
+
+void printTestStatus(std::string test, bool isTestOk) {
+  std::cout << "------------------------------------------------------------" << std::endl;
+  std::cout << "TEST [" << test << "]:\t" << (isTestOk ? "PASSED" : "FAILED") << std::endl;
+  std::cout << "------------------------------------------------------------" << std::endl;
+}
+
+void TestLastBinThresholdAction(void) {
+
+  bool isAllTestOk = true;
+
+  std::string test = "LastBinLessThanThreshold";
+  std::cout << std::endl << "=== >>>  TEST: " << test << " <<< ===" << std::endl;
+  bool isTestOk = testLastBinThresholdNoAction<dqm_algorithms::LessThan>(test, 100., {10., 20., 30.});
+  printTestStatus(test, isTestOk);
+  isAllTestOk &= isTestOk;
+
+  test = "LastBinGreaterThanThreshold";
+  std::cout << std::endl << "=== >>>  TEST: " << test << " <<< ===" << std::endl;
+  isTestOk = testLastBinThresholdNoAction<dqm_algorithms::GreaterThan>(test, 100., {200., 300., 400.});
+  printTestStatus(test, isTestOk);
+  isAllTestOk &= isTestOk;
+
+  test = "LastBinDifferentThanThreshold";
+  std::cout << std::endl << "=== >>>  TEST: " << test << " <<< ===" << std::endl;
+  isTestOk = testLastBinThresholdNoAction<dqm_algorithms::DifferentThan>(test, 100., {10., 200., 50.}, 10);
+  printTestStatus(test, isTestOk);
+  isAllTestOk &= isTestOk;
+
+  test = "TileDataCorruptionThanThreshold";
+  std::cout << std::endl << "=== >>>  TEST: " << test << " <<< ===" << std::endl;
+  isTestOk = testTileDataCorruption(test, 0., {10., 10., 10.});
+  printTestStatus(test, isTestOk);
+  isAllTestOk &= isTestOk;
+
+  std::cout << endl;
+  std::cout << "===================== >>>  SUMMARY <<< =====================" << std::endl;
+  printTestStatus("ALL", isAllTestOk);
+}
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WriteJobOptions.py b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WriteJobOptions.py
index 8cf09a1f04c767e7b4a16bbfdc057be59db642cb..08f1e5ceb931867b5978c9719e149b4776a562af 100755
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WriteJobOptions.py
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WriteJobOptions.py
@@ -100,6 +100,10 @@ svcMgr.EventSelector.RunNumber = 1
 #--------------------------------------------------------------
 # Private Application Configuration options
 #--------------------------------------------------------------
+# Load CutFlowSvc
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
+
 # Load "user algorithm" top algorithms to be run, and the libraries that house them
 from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__WriteData
 topSequence += AthPoolEx__WriteData( "WriteData" )
diff --git a/Event/EventBookkeeperTools/CMakeLists.txt b/Event/EventBookkeeperTools/CMakeLists.txt
index 3878dd2fec896cc6d1a75c893ebd572cbadbcada..74e9349837c443c7b90f0bc6d19ca4a4b3b92dcb 100644
--- a/Event/EventBookkeeperTools/CMakeLists.txt
+++ b/Event/EventBookkeeperTools/CMakeLists.txt
@@ -10,7 +10,7 @@ if( XAOD_STANDALONE )
    set( xaod_access_lib xAODRootAccess )
 # ... for AthAnalysisBase (Athena calls this POOLRootAccess)
 else()
-   set( extra_libs GaudiKernel AthenaKernel AthenaPoolUtilities EventInfo IOVDbDataModel )
+   set( extra_libs GaudiKernel AthenaKernel AthenaPoolUtilities EventInfo IOVDbDataModel StoreGateLib )
    set( xaod_access_lib POOLRootAccessLib )
 endif()
 
@@ -34,8 +34,7 @@ if( NOT XAOD_STANDALONE )
    atlas_add_component( EventBookkeeperTools
                         src/*.cxx
                         src/components/*.cxx
-                        LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel EventBookkeeperToolsLib
-                                       SGTools StoreGateLib EventBookkeeperMetaData )
+                        LINK_LIBRARIES GaudiKernel AthenaKernel EventBookkeeperToolsLib)
 endif()
 
 atlas_add_executable( dump-cbk
diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperDumperTool.h b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperDumperTool.h
index c9339ba270e547999d7782010869724cd60572af..150e2acfd49e09fe0307fc1ed50cabbafa61bae3 100644
--- a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperDumperTool.h
+++ b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperDumperTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef EVENT_BOOKKEEPER_TOOLS__BOOKKEEPER_DUMPER_TOOL_H
@@ -46,6 +46,7 @@ public:
   virtual StatusCode endInputFile(const SG::SourceID &) final { return StatusCode::SUCCESS; }
 #endif
 
+  Gaudi::Property<bool> m_allVariations{this, "AllVariations", false, "Dump all variations"};
   Gaudi::Property<bool> m_standaloneMode{this, "StandaloneMode", false, "Dump on initialize when running standalone"};
 };
 
diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/CutFlowSvc.h b/Event/EventBookkeeperTools/EventBookkeeperTools/CutFlowSvc.h
index 09a30f7ed3a5afe31130b3ba0e8ad33eb62e0b3c..2c6697964222884850b71d54695c9cfd95b9dcbd 100644
--- a/Event/EventBookkeeperTools/EventBookkeeperTools/CutFlowSvc.h
+++ b/Event/EventBookkeeperTools/EventBookkeeperTools/CutFlowSvc.h
@@ -110,6 +110,9 @@ private:
   xAOD::CutBookkeeper* getCutBookkeeper(const CutIdentifier cutID,
                                         size_t index) const;
 
+  /// CutFlow service should be explicitly configured
+  Gaudi::Property<bool> m_configured{this, "Configured", false, ""};
+
   /// The input meta-data store
   ServiceHandle<StoreGateSvc> m_inMetaDataStore{this, "InputMetaDataStore", "StoreGateSvc/InputMetaDataStore", ""};
 
diff --git a/Event/EventBookkeeperTools/Root/BookkeeperDumperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperDumperTool.cxx
index e3c7770d6ee0ab477253dcc28ff507ab68da16bd..b7bf2183ef589b1001de5615a84ad87947872372 100644
--- a/Event/EventBookkeeperTools/Root/BookkeeperDumperTool.cxx
+++ b/Event/EventBookkeeperTools/Root/BookkeeperDumperTool.cxx
@@ -1,12 +1,12 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
  * @file BookkeeperDumperTool.cxx
  * @brief Implementation of class BookkeeperDumperTool
  */
- 
+
 #include <xAODCutFlow/CutBookkeeperContainer.h>
 
 #include <EventBookkeeperTools/BookkeeperDumperTool.h>
@@ -34,41 +34,77 @@ StatusCode BookkeeperDumperTool::initialize()
 StatusCode BookkeeperDumperTool::beginInputFile()
 {
   // Complete CutBookkeepers
-  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>("CutBookkeepers")) {
-    const xAOD::CutBookkeeperContainer* completeBookkeepers = nullptr;
-    ATH_CHECK(inputMetaStore()->retrieve(completeBookkeepers, "CutBookkeepers"));
+  size_t index{};
+  while (true)
+  {
+    std::string name{"CutBookkeepers"};
+    if (index > 0) {
+      name.append("_weight_");
+      name.append(std::to_string(index));
+    }
 
-    ATH_MSG_INFO("Complete CBK size = " << completeBookkeepers->size());
-    for (const xAOD::CutBookkeeper *cbk : *completeBookkeepers) {
-      ATH_MSG_INFO("Complete CBK"
-                   << " name= " << cbk->name()
-                   << " cycle=" << cbk->cycle()
-                   << " stream=" << cbk->inputStream()
-                   << " N=" << cbk->nAcceptedEvents()
-                   << " W=" << cbk->sumOfEventWeights()
-                   << " nc=" << cbk->nChildren());
+    if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(name)) {
+      const xAOD::CutBookkeeperContainer* completeBookkeepers{};
+      ATH_CHECK(inputMetaStore()->retrieve(completeBookkeepers, name));
+
+      ATH_MSG_INFO("Complete CBK " << name << " size = " << completeBookkeepers->size());
+      for (const xAOD::CutBookkeeper *cbk : *completeBookkeepers) {
+        ATH_MSG_INFO("Complete CBK"
+                    << " name= " << cbk->name()
+                    << " cycle=" << cbk->cycle()
+                    << " stream=" << cbk->inputStream()
+                    << " N=" << cbk->nAcceptedEvents()
+                    << " W=" << cbk->sumOfEventWeights()
+                    << " nc=" << cbk->nChildren());
+      }
+      index++;
+    } else {
+      if (index == 0) {
+        ATH_MSG_INFO("No complete CutBookkeepers found");
+      }
+      break;
+    }
+
+    if (!m_allVariations) {
+      break;
     }
-  } else {
-    ATH_MSG_INFO("No complete CutBookkeepers found");
   }
 
   // Incomplete CutBookkeepers
-  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>("IncompleteCutBookkeepers")) {
-    const xAOD::CutBookkeeperContainer* incompleteBookkeepers = nullptr;
-    ATH_CHECK(inputMetaStore()->retrieve(incompleteBookkeepers, "IncompleteCutBookkeepers"));
+  index = 0;
+  while (true)
+  {
+    std::string name{"IncompleteCutBookkeepers"};
+    if (index > 0) {
+      name.append("_weight_");
+      name.append(std::to_string(index));
+    }
 
-    ATH_MSG_INFO("Incomplete CBK size = " << incompleteBookkeepers->size());
-    for (const xAOD::CutBookkeeper *cbk : *incompleteBookkeepers) {
-      ATH_MSG_INFO("Incomplete CBK"
-                   << " name= " << cbk->name()
-                   << " cycle=" << cbk->cycle()
-                   << " stream=" << cbk->inputStream()
-                   << " N=" << cbk->nAcceptedEvents()
-                   << " W=" << cbk->sumOfEventWeights()
-                   << " nc=" << cbk->nChildren());
+    if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(name)) {
+      const xAOD::CutBookkeeperContainer* incompleteBookkeepers{};
+      ATH_CHECK(inputMetaStore()->retrieve(incompleteBookkeepers, name));
+
+      ATH_MSG_INFO("Incomplete CBK " << name << " size = " << incompleteBookkeepers->size());
+      for (const xAOD::CutBookkeeper *cbk : *incompleteBookkeepers) {
+        ATH_MSG_INFO("Incomplete CBK"
+                    << " name= " << cbk->name()
+                    << " cycle=" << cbk->cycle()
+                    << " stream=" << cbk->inputStream()
+                    << " N=" << cbk->nAcceptedEvents()
+                    << " W=" << cbk->sumOfEventWeights()
+                    << " nc=" << cbk->nChildren());
+      }
+      index++;
+    } else {
+      if (index == 0) {
+        ATH_MSG_INFO("No incomplete CutBookkeepers found");
+      }
+      break;
+    }
+
+    if (!m_allVariations) {
+      break;
     }
-  } else {
-    ATH_MSG_INFO("No incomplete CutBookkeepers found");
   }
 
   // Complete PDF CutBookkeepers
@@ -89,9 +125,9 @@ StatusCode BookkeeperDumperTool::beginInputFile()
   } else {
     ATH_MSG_INFO("No PDF CutBookkeepers found");
   }
-  
+
   // Incomplete PDF CutBookkeepers
-  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>("IncompletePDFSumOfWeights")) {    
+  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>("IncompletePDFSumOfWeights")) {
     const xAOD::CutBookkeeperContainer* pdfBookkeepers = nullptr;
     ATH_CHECK(inputMetaStore()->retrieve(pdfBookkeepers, "IncompletePDFSumOfWeights"));
 
diff --git a/Event/EventBookkeeperTools/Root/CutFlowSvc.cxx b/Event/EventBookkeeperTools/Root/CutFlowSvc.cxx
index c23155dce2a06828831178729a2844338d95550b..099b1caf0002e4c95354192a056f63f7bc20ebc1 100644
--- a/Event/EventBookkeeperTools/Root/CutFlowSvc.cxx
+++ b/Event/EventBookkeeperTools/Root/CutFlowSvc.cxx
@@ -33,6 +33,12 @@ CutFlowSvc::initialize()
 {
   ATH_MSG_DEBUG( "Initializing " << name() );
 
+  // Only run if explicitly configured
+  if (m_configured.value() == false) {
+    ATH_MSG_ERROR("CutFlowSvc should be explicitly configured!");
+    return StatusCode::FAILURE;
+  }
+
   //Get input MetaData StoreGate
   ATH_CHECK( m_inMetaDataStore.retrieve() );
 
diff --git a/Event/EventBookkeeperTools/python/CutFlowHelpers.py b/Event/EventBookkeeperTools/python/CutFlowHelpers.py
index 351ed7a8ee1b749cb36a1fe0215c6a5d52238430..dcef71543bda4465b81759d79badbb5adf0b7f7b 100644
--- a/Event/EventBookkeeperTools/python/CutFlowHelpers.py
+++ b/Event/EventBookkeeperTools/python/CutFlowHelpers.py
@@ -44,7 +44,8 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", seq=None, addMetaDataToAllOutputFile
     # Create the CutFlowSvc instance
     import AthenaCommon.CfgMgr as CfgMgr
     if not hasattr(svcMgr,"CutFlowSvc"): svcMgr += CfgMgr.CutFlowSvc()
-    svcMgr.CutFlowSvc.InputStream   = inputStreamName
+    svcMgr.CutFlowSvc.Configured  = True
+    svcMgr.CutFlowSvc.InputStream = inputStreamName
 
     # Make sure MetaDataSvc is ready
     if not hasattr(svcMgr,'MetaDataSvc'):
diff --git a/Event/EventBookkeeperTools/python/EventBookkeeperToolsConfig.py b/Event/EventBookkeeperTools/python/EventBookkeeperToolsConfig.py
index 4359575d21a835125751551448988605c7a5cf63..0465d1f5b3cf36371b4df6340a5489d4c2cf4db5 100644
--- a/Event/EventBookkeeperTools/python/EventBookkeeperToolsConfig.py
+++ b/Event/EventBookkeeperTools/python/EventBookkeeperToolsConfig.py
@@ -27,7 +27,7 @@ def CutFlowSvcCfg(flags):
     # Determine current input stream name
     # inputStreamName = GetCurrentStreamName( msg=msg )
 
-    acc.addService(CompFactory.CutFlowSvc())
+    acc.addService(CompFactory.CutFlowSvc(Configured=True))
     # svcMgr.CutFlowSvc.InputStream   = inputStreamName
 
     acc.merge(BookkeeperToolCfg(flags))
diff --git a/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py b/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py
index f821ab9361299dba824b9043ea43229dd54e388b..311c938002af6d53899c1a033a6640fe53b6236a 100644
--- a/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py
+++ b/Event/EventBookkeeperTools/share/TestCutFlowSvcDummyAlg.py
@@ -1,8 +1,27 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+# setup the input
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+if 'inputFiles' in dir():
+    athenaCommonFlags.FilesInput = inputFiles.split(',')
+    del inputFiles
+else:
+    athenaCommonFlags.FilesInput = [
+        '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1'
+    ]
+
+theApp.EvtMax = 10
+
 from AthenaCommon.AlgSequence import AlgSequence
-from EventBookkeeperTools.PyFilterTester import PyFilterTester
 topSequence = AlgSequence()
-topSequence += PyFilterTester('myFilter')
 
-theApp.EvtMax = 10
+from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
+topSequence += xAODMaker__EventInfoCnvAlg()
+
+# setup the CutFlowSvc
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc(svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True)
+
+# setup the test alg
+from EventBookkeeperTools.PyFilterTester import PyFilterTester
+topSequence += PyFilterTester('myFilter')
diff --git a/Event/EventBookkeeperTools/src/FillEBCFromFlat.cxx b/Event/EventBookkeeperTools/src/FillEBCFromFlat.cxx
deleted file mode 100644
index 1c130f6c004cc19f48c1f634d039ef4e8e266e62..0000000000000000000000000000000000000000
--- a/Event/EventBookkeeperTools/src/FillEBCFromFlat.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "FillEBCFromFlat.h"
-
-#include <iostream>
-
-FillEBCFromFlat::FillEBCFromFlat(StoreGateSvc_t &inputStore, EventBookkeeperCollection *coll, int wantIsComplete)
-  : m_inputStore(inputStore), m_coll(coll), m_wantIsComplete(wantIsComplete)
-{
-  if (m_wantIsComplete) {
-    m_offset = 0;
-  } else {
-    m_offset = *(m_inputStore->retrieve<int>("CutFlowTree/CutFlow_Nb"));
-  }
-  initialise();
-}
-
-void FillEBCFromFlat::initialise()
-{
-  //std::cout << "FillEBCFromFlat::initialise()" << std::endl;
-
-  m_name = m_inputStore->retrieve<std::vector<std::string> >("CutFlowTree/name");
-  m_inputstream = m_inputStore->retrieve<std::vector<std::string> >("CutFlowTree/inputstream");
-  m_outputstream = m_inputStore->retrieve<std::vector<std::string> >("CutFlowTree/outputstream");
-  m_description = m_inputStore->retrieve<std::vector<std::string> >("CutFlowTree/description");
-  m_logic = m_inputStore->retrieve<std::vector<std::string> >("CutFlowTree/logic");
-  m_nAcceptedEvents = m_inputStore->retrieve<std::vector<ULong_t> >("CutFlowTree/nAcceptedEvents");
-  m_nWeightedAcceptedEvents = m_inputStore->retrieve<std::vector<Double_t> >("CutFlowTree/nWeightedAcceptedEvents");
-  m_isComplete = m_inputStore->retrieve<std::vector<Int_t> >("CutFlowTree/isComplete");
-  m_cycle = m_inputStore->retrieve<std::vector<Int_t> >("CutFlowTree/cycle");
-  m_parentIndex = m_inputStore->retrieve<std::vector<Int_t> >("CutFlowTree/parentIndex");
-  m_nbChildren = m_inputStore->retrieve<std::vector<Int_t> >("CutFlowTree/nbChildren");
-  m_childrenIndices = m_inputStore->retrieve<std::vector< std::vector<UInt_t> > >("CutFlowTree/childrenIndices");
-}
-
-void FillEBCFromFlat::fill()
-{
-  //std::cout << "FillEBCFromFlat::fill()" << std::endl;
-
-  unsigned int nCuts = m_name->size();
-
-  for (unsigned int i = 0; i < nCuts; ++i) {
-    if (m_isComplete->at(i) != m_wantIsComplete) continue;
-    
-    // Only add top level EventBookkeepers here 
-    if (m_parentIndex->at(i) != -1) continue;
-
-    EventBookkeeper *eb = newEventBookkeeper(i);
-    m_coll->push_back(eb);
-
-    if (m_nbChildren->at(i) > 0) {
-      addChildren(eb, i);
-    }
-  }
-}
-
-EventBookkeeper *FillEBCFromFlat::newEventBookkeeper(unsigned int index) const
-{
-  //std::cout << "FillEBCFromFlat::newEventBookkeeper(" << index << ") - " << m_name->at(index) << std::endl;
-
-  EventBookkeeper *eb = new EventBookkeeper(m_name->at(index));
-  eb->setInputStream(m_inputstream->at(index));
-  eb->setOutputStream(m_outputstream->at(index));
-  eb->setDescription(m_description->at(index));
-  eb->setLogic(m_logic->at(index));
-  eb->setNAcceptedEvents(m_nAcceptedEvents->at(index));
-  eb->setNWeightedAcceptedEvents(m_nWeightedAcceptedEvents->at(index));
-  eb->setCycle(m_cycle->at(index));
-  return eb;
-}
-
-void FillEBCFromFlat::addChildren(EventBookkeeper *eb, unsigned int indexOfEb) const
-{
-  //std::cout << "FillEBCFromFlat::addChildren(@" << eb << ", " << indexOfEb <<")" << std::endl;
-
-  for (std::vector<UInt_t>::const_iterator childIndex = m_childrenIndices->at(indexOfEb).begin(); childIndex != m_childrenIndices->at(indexOfEb).end(); ++childIndex) {
-    unsigned int corrChildIndex = (*childIndex) + m_offset;
-    if (corrChildIndex == indexOfEb) {
-      std::cout << "FillEBCFromFlat::addChildren() WARNING - corrChildIndex == indexOfEb == " << indexOfEb << std::endl;
-      continue;
-    }
-
-    EventBookkeeper *ebChild = newEventBookkeeper(corrChildIndex);
-    if (m_nbChildren->at(corrChildIndex) > 0) {
-      addChildren(ebChild, corrChildIndex);
-    }
-    eb->AddChild(ebChild);
-  }
-}
-
diff --git a/Event/EventBookkeeperTools/src/FillEBCFromFlat.h b/Event/EventBookkeeperTools/src/FillEBCFromFlat.h
deleted file mode 100644
index 468a67c6379823bb6b0251df898eff43bc75c357..0000000000000000000000000000000000000000
--- a/Event/EventBookkeeperTools/src/FillEBCFromFlat.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef FILL_EBC_FROM_FLAT_H
-#define FILL_EBC_FROM_FLAT_H
-
-#include "GaudiKernel/ServiceHandle.h"
-#include "StoreGate/StoreGateSvc.h"
-
-#include "SGTools/StlVectorClids.h"
-#include "SGTools/BuiltinsClids.h"
-
-#include <string>
-#include <vector>
-
-#include <TTree.h>
-
-#include "EventBookkeeperMetaData/EventBookkeeperCollection.h"
-
-class FillEBCFromFlat {
-  public:
-    typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t;
-
-    FillEBCFromFlat(StoreGateSvc_t &inputStore, EventBookkeeperCollection *coll, int wantIsComplete);
-    void fill();
-
-  private:
-    void initialise();
-    EventBookkeeper *newEventBookkeeper(unsigned int index) const;
-    void addChildren(EventBookkeeper *eb, unsigned int indexOfEb) const;
-
-  private:
-    StoreGateSvc_t m_inputStore;
-    EventBookkeeperCollection *m_coll;
-    int m_wantIsComplete;
-
-    unsigned int m_offset;
-
-    std::vector<std::string> *m_name;
-    std::vector<std::string> *m_inputstream;
-    std::vector<std::string> *m_outputstream;
-    std::vector<std::string> *m_description;
-    std::vector<std::string> *m_logic;
-    std::vector<ULong_t> *m_nAcceptedEvents;
-    std::vector<Double_t> *m_nWeightedAcceptedEvents;
-    std::vector<Int_t> *m_isComplete;
-    std::vector<Int_t> *m_cycle;
-    std::vector<Int_t> *m_parentIndex;
-    std::vector<Int_t> *m_nbChildren;
-    std::vector< std::vector<UInt_t> > *m_childrenIndices;
-};
-
-#endif // FILL_EBC_FROM_FLAT_H
diff --git a/Event/EventBookkeeperTools/src/SkimDecisionMultiFilter.cxx b/Event/EventBookkeeperTools/src/SkimDecisionMultiFilter.cxx
deleted file mode 100644
index f5a9fe805ea47f17ec96bdaa8374295d0b60db84..0000000000000000000000000000000000000000
--- a/Event/EventBookkeeperTools/src/SkimDecisionMultiFilter.cxx
+++ /dev/null
@@ -1,229 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// SkimDecisionMultiFilter.cxx 
-// Implementation file for class SkimDecisionMultiFilter
-// Author: Karsten Koeneke <karsten.koeneke@cern.ch>
-// Description: This filter allows to make an event decision based
-//              on a list of SkimDecisions to ask.
-/////////////////////////////////////////////////////////////////// 
-
-// EventBookkeeperTools includes
-#include "SkimDecisionMultiFilter.h"
-
-// STL includes
-
-// FrameWork includes
-#include "Gaudi/Property.h"
-
-// Handy definitions for error checking
-#include "AthenaKernel/errorcheck.h"
-
-// Event includes
-#include "EventBookkeeperMetaData/SkimDecisionCollection.h"
-#include "EventBookkeeperMetaData/SkimDecision.h"
-
-
-
-/////////////////////////////////////////////////////////////////// 
-// Public methods: 
-/////////////////////////////////////////////////////////////////// 
-
-// Constructors
-////////////////
-SkimDecisionMultiFilter::SkimDecisionMultiFilter( const std::string& name, 
-                                                  ISvcLocator* pSvcLocator ) : 
-  ::AthFilterAlgorithm( name, pSvcLocator )
-{
-  //
-  // Property declaration
-  // 
-  declareProperty( "SkimDecisionCollection",      m_skimDecContName, "The name (key) of the SkimDecisionCollection to use" );
-  declareProperty( "AcceptSkimDecisionNameList",  m_accSkimDecNameList, "The list of SkimDecision names to accept (logical OR)" );
-  declareProperty( "RequireSkimDecisionNameList", m_reqSkimDecNameList, "The list of SkimDecision names to require (logical AND)" );
-  declareProperty( "VetoSkimDecisionNameList",    m_vetoSkimDecNameList, "The list of SkimDecision names to veto (logical NOT)" );
-
-}
-
-// Destructor
-///////////////
-SkimDecisionMultiFilter::~SkimDecisionMultiFilter()
-{}
-
-// Athena Algorithm's Hooks
-////////////////////////////
-StatusCode SkimDecisionMultiFilter::initialize()
-{
-  ATH_MSG_INFO ("Initializing " << name() << "...");
-  ATH_MSG_INFO (" using SkimDecisionCollection      = " << m_skimDecContName );
-  ATH_MSG_INFO (" using AcceptSkimDecisionNameList  = " << m_accSkimDecNameList );
-  ATH_MSG_INFO (" using RequireSkimDecisionNameList = " << m_reqSkimDecNameList );
-  ATH_MSG_INFO (" using VetoSkimDecisionNameList    = " << m_vetoSkimDecNameList );
-
-  // Initialize the index vectors to -1
-  for ( unsigned int i=0; i<m_accSkimDecNameList.size(); ++i )  m_accIdxList.push_back(-1);
-  for ( unsigned int i=0; i<m_reqSkimDecNameList.size(); ++i )  m_reqIdxList.push_back(-1);
-  for ( unsigned int i=0; i<m_vetoSkimDecNameList.size(); ++i ) m_vetoIdxList.push_back(-1);
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode SkimDecisionMultiFilter::finalize()
-{
-  ATH_MSG_INFO ("Finalizing " << name() << "...");
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode SkimDecisionMultiFilter::execute()
-{  
-  ATH_MSG_DEBUG ("Executing " << name() << "...");
-
-  // Get the SkimDecisionCollection
-  const SkimDecisionCollection* skimDecCont(NULL);
-  CHECK( evtStore()->retrieve( skimDecCont, m_skimDecContName ) );
-
-
-  // Run the accept determination
-  bool passAccept(false);
-  if ( m_accSkimDecNameList.size() == 0 ) passAccept = true;
-  for ( unsigned int i=0; i<m_accSkimDecNameList.size(); ++i )
-    {
-      if ( skimDecisionNameIsAccepted( skimDecCont, m_accSkimDecNameList[i], m_accIdxList, i ) )
-        {
-          ATH_MSG_DEBUG( "Found SkimDecision with name " << m_accSkimDecNameList[i]
-                         << " from AcceptSkimDecisionNameList in SkimDecisionCollection with key " << m_skimDecContName );
-          passAccept = true;
-          break;
-        }
-    } // End: loop over all accept requests
-
-
-  // Run the require determination
-  bool passRequire(true);
-  for ( unsigned int i=0; i<m_reqSkimDecNameList.size(); ++i )
-    {
-      passRequire = passRequire && skimDecisionNameIsAccepted( skimDecCont, m_reqSkimDecNameList[i], m_reqIdxList, i );
-      ATH_MSG_DEBUG( "Found SkimDecision with name " << m_reqSkimDecNameList[i]
-                     << " from RequireSkimDecisionNameList in SkimDecisionCollection with key " << m_skimDecContName );
-    } // End: loop over all require requests
-
-
-  // Run the veto determination
-  bool veto(false);
-  for ( unsigned int i=0; i<m_vetoSkimDecNameList.size(); ++i )
-    {
-      if ( skimDecisionNameIsAccepted( skimDecCont, m_vetoSkimDecNameList[i], m_vetoIdxList, i ) )
-        {
-          ATH_MSG_DEBUG( "Found SkimDecision with name " << m_vetoSkimDecNameList[i]
-                         << " from VetoSkimDecisionNameList in SkimDecisionCollection with key " << m_skimDecContName );
-          veto = true;
-          break;
-        }
-    } // End: loop over all veto requests
-  bool passVeto = !veto;
-
-
-  // Determine the global event passing decision
-  setFilterPassed( passAccept && passRequire && passVeto );
-
-
-  return StatusCode::SUCCESS;
-}
-
-
-
-
-// Private helper method to find the SkimDecision isAccepted() answer
-bool SkimDecisionMultiFilter::skimDecisionNameIsAccepted( const SkimDecisionCollection* skimDecCont,
-                                                          std::string& skimDecName,
-                                                          std::vector<int>& skimDecIdxList,
-                                                          unsigned int idx )
-{
-  // Pointer check
-  if ( !skimDecCont )
-    {
-      ATH_MSG_WARNING( "Got a zero pointer of type SkimDecisionCollection with key " << m_skimDecContName );
-      return false;
-    }
-
-  // Get the size of the SkimDecisionCollection
-  const unsigned int skimCollSize = skimDecCont->size();
-
-  // If we already have an index, choose the fast path 
-  if ( skimDecIdxList[idx] >= 0 && skimDecIdxList[idx] < (int)skimCollSize )
-    {
-      const SkimDecision* skimDec = skimDecCont->at(skimDecIdxList[idx]);
-      if ( !skimDec )
-        {
-          ATH_MSG_WARNING( "Couldn't find SkimDecision with name " << skimDecName
-                           << " in SkimDecisionCollection with key " << m_skimDecContName );
-          return false;
-        }
-
-      // If the name is correct for the given index
-      if ( skimDec->getName() == skimDecName )
-        {
-          return skimDec->isAccepted();
-        }
-      else // The index was wrong and we need to search for the name 
-        {
-          // Loop over all SkimDecisions in the SkimDecisionCollection
-          bool foundSkimDec(false);
-          for ( unsigned int i=0; i<skimCollSize; ++i )
-            {
-              // Get the current SkimDecision
-              const SkimDecision* skimDec = skimDecCont->at(i);
-              if ( !skimDec ) continue;
-
-              // Found the right skim decision
-              if ( skimDecName == skimDec->getName() )
-                {
-                  skimDecIdxList[idx] = (int)i; // Set the index to the found one
-                  foundSkimDec = true;
-                  return skimDec->isAccepted();
-                }
-            }
-          // If none of the SkimDecision names matched
-          if ( !foundSkimDec )
-            {
-              ATH_MSG_WARNING( "Couldn't find SkimDecision with name " << skimDecName
-                               << " in SkimDecisionCollection with key " << m_skimDecContName );
-              return false;
-            }
-        }
-    } // End: if we have a valid index
-  else // The index was wrong and we need to search for the name 
-    {
-      // Loop over all SkimDecisions in the SkimDecisionCollection
-      bool foundSkimDec(false);
-      for ( unsigned int i=0; i<skimCollSize; ++i )
-        {
-          // Get the current SkimDecision
-          const SkimDecision* skimDec = skimDecCont->at(i);
-          if ( !skimDec ) continue;
-          
-          // Found the right skim decision
-          if ( skimDecName == skimDec->getName() )
-            {
-              skimDecIdxList[idx] = (int)i; // Set the index to the found one
-              foundSkimDec = true;
-              return skimDec->isAccepted();
-            }
-        }
-      // If none of the SkimDecision names matched
-      if ( !foundSkimDec )
-        {
-          ATH_MSG_WARNING( "Couldn't find SkimDecision with name " << skimDecName
-                           << " in SkimDecisionCollection with key " << m_skimDecContName );
-          return false;
-        }
-    }
-  // If we got to here, something went wrong
-  ATH_MSG_WARNING( "We should have never reached this part of the code! Tried to search for SkimDecision with name " << skimDecName
-                   << " in SkimDecisionCollection with key " << m_skimDecContName );
-  return false;
-}
diff --git a/Event/EventBookkeeperTools/src/SkimDecisionMultiFilter.h b/Event/EventBookkeeperTools/src/SkimDecisionMultiFilter.h
deleted file mode 100644
index 2328beedb5bb095a7be7ddad70218c42069dbf22..0000000000000000000000000000000000000000
--- a/Event/EventBookkeeperTools/src/SkimDecisionMultiFilter.h
+++ /dev/null
@@ -1,104 +0,0 @@
-///////////////////////// -*- C++ -*- /////////////////////////////
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// SkimDecisionMultiFilter.h 
-// Header file for class SkimDecisionMultiFilter
-// Author: Karsten Koeneke <karsten.koeneke@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-#ifndef EVENTBOOKKEEPERTOOLS_SKIMDECISIONMULTIFILTER_H
-#define EVENTBOOKKEEPERTOOLS_SKIMDECISIONMULTIFILTER_H 1
-
-// STL includes
-#include <string>
-
-// FrameWork includes
-#include "AthenaBaseComps/AthFilterAlgorithm.h"
-
-// Forward declarations
-class SkimDecisionCollection;
-
-
-
-class SkimDecisionMultiFilter
-  : public ::AthFilterAlgorithm
-{ 
-
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
-public: 
-
-  // Copy constructor: 
-
-  /// Constructor with parameters: 
-  SkimDecisionMultiFilter( const std::string& name, ISvcLocator* pSvcLocator );
-
-  /// Destructor: 
-  virtual ~SkimDecisionMultiFilter(); 
-
-  // Athena algorithm's Hooks
-  virtual StatusCode  initialize();
-  virtual StatusCode  execute();
-  virtual StatusCode  finalize();
-
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  ///////////////////////////////////////////////////////////////////
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
-private:
-
-  /// Private method to determine the accept decission
-  bool skimDecisionNameIsAccepted( const SkimDecisionCollection* skimDecCont,
-                                   std::string& skimDecName,
-                                   std::vector<int>& skimDecIdxList,
-                                   unsigned int idx );
-
-
-  /////////////////////////////////////////////////////////////////// 
-  // Private data: 
-  /////////////////////////////////////////////////////////////////// 
-private: 
-
-  /// Default constructor: 
-  //SkimDecisionMultiFilter();
-
-  /// SkimDecisionCollection name
-  std::string m_skimDecContName;
-
-  /// The list of SkimDecision names to accept (logical OR)
-  std::vector< std::string > m_accSkimDecNameList;
-
-  /// The list of SkimDecision names to require (logical AND)
-  std::vector< std::string > m_reqSkimDecNameList;
-
-  /// The list of SkimDecision names to veto (logical NOT)
-  std::vector< std::string > m_vetoSkimDecNameList;
-
-
-  /// List of the indices where the correct SkimDecision is in the container for the accept (logical OR) method
-  std::vector<int> m_accIdxList;
-
-  /// List of the indices where the correct SkimDecision is in the container for the require (logical AND) method
-  std::vector<int> m_reqIdxList;
-
-  /// List of the indices where the correct SkimDecision is in the container for the veto (logical NOT) method
-  std::vector<int> m_vetoIdxList;
-
-
-}; 
-
-// I/O operators
-//////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Inline methods: 
-/////////////////////////////////////////////////////////////////// 
-
-
-#endif //> !EVENTBOOKKEEPERTOOLS_SKIMDECISIONMULTIFILTER_H
diff --git a/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx b/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx
index ee4de188dabf50acc8cbd20fc9aa75c3ed3da4a7..464b2a0f96de15e774fd72a97bf6d9f1643a5bc3 100644
--- a/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx
+++ b/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx
@@ -4,7 +4,6 @@
 
 #include "../AllExecutedEventsCounterAlg.h"
 #include "../EventCounterAlg.h"
-#include "../SkimDecisionMultiFilter.h"
 #include "../TestFilterReentrantAlg.h"
 
 DECLARE_COMPONENT( AllExecutedEventsCounterAlg )
@@ -12,5 +11,4 @@ DECLARE_COMPONENT( BookkeeperDumperTool )
 DECLARE_COMPONENT( BookkeeperTool )
 DECLARE_COMPONENT( CutFlowSvc )
 DECLARE_COMPONENT( EventCounterAlg )
-DECLARE_COMPONENT( SkimDecisionMultiFilter )
 DECLARE_COMPONENT( TestFilterReentrantAlg )
diff --git a/Event/EventBookkeeperTools/util/dump-cbk.cxx b/Event/EventBookkeeperTools/util/dump-cbk.cxx
index cb72ff2fbece5ae630faddd95d884a724fa2ae18..2f50576eb833d759894bd114faaeeb10461b8231 100644
--- a/Event/EventBookkeeperTools/util/dump-cbk.cxx
+++ b/Event/EventBookkeeperTools/util/dump-cbk.cxx
@@ -66,6 +66,7 @@ int main(int argc, char **argv)
   // Retrieve the tool
   asg::AnaToolHandle<asg::AsgMetadataTool> tool("BookkeeperDumperTool/BookkeeperDumperTool");
   ANA_CHECK(tool.setProperty("StandaloneMode", true));
+  ANA_CHECK(tool.setProperty("AllVariations", true));
   ANA_CHECK(tool.retrieve());
 
   // Trigger finalization of all services and tools created by the Gaudi Application
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
index 8718714de1eaa92575a46bb6b16ff456cb3b9943..c5042bb5469ff22353e29838607cf351510a4bdc 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
@@ -134,6 +134,7 @@ StatusCode HltEventLoopMgr::initialize()
   ATH_MSG_INFO(" ---> forceRunNumber            = " << m_forceRunNumber.value());
   ATH_MSG_INFO(" ---> forceStartOfRunTime       = " << m_forceSOR_ns.value());
   ATH_MSG_INFO(" ---> RewriteLVL1               = " << m_rewriteLVL1.value());
+  ATH_MSG_INFO(" ---> PopAllMode                = " << m_popAll.value());
   ATH_MSG_INFO(" ---> EventContextWHKey         = " << m_eventContextWHKey.key());
   ATH_MSG_INFO(" ---> EventInfoRHKey            = " << m_eventInfoRHKey.key());
 
@@ -1212,10 +1213,12 @@ HltEventLoopMgr::DrainSchedulerStatusCode HltEventLoopMgr::drainScheduler()
     return DrainSchedulerStatusCode::SCHEDULER_EMPTY;
   }
 
-  // Try to pop other events
-  while (m_schedulerSvc->tryPopFinishedEvent(finishedEvtContext).isSuccess()) {
-    ATH_MSG_DEBUG("Scheduler returned a finished event: " << finishedEvtContext);
-    finishedEvtContexts.push_back(finishedEvtContext);
+  if (m_popAll) {
+    // Try to pop other events
+    while (m_schedulerSvc->tryPopFinishedEvent(finishedEvtContext).isSuccess()) {
+      ATH_MSG_DEBUG("Scheduler returned a finished event: " << finishedEvtContext);
+      finishedEvtContexts.push_back(finishedEvtContext);
+    }
   }
 
   //----------------------------------------------------------------------------
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
index f3ff73ae52cab366d06ddb37957537e65fe8ab25..19f8c538a8e3da6fc6fdda434483cc6f1a2b9d3a 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
@@ -245,6 +245,10 @@ private:
     this, "RewriteLVL1", false,
     "Encode L1 results to ByteStream and write to the output. Possible only with athenaHLT, not online."};
 
+  Gaudi::Property<bool> m_popAll{
+    this, "PopAllMode", true, "If true, pop all finished events from scheduler and process all results before filling "
+    "the slots again. If false, pop only one and refill the slot before popping another finished event."};
+
   Gaudi::Property<bool> m_monitorScheduler{
     this, "MonitorScheduler", false, "Enable SchedulerMonSvc to collect scheduler status data in online histograms"};
 
diff --git a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/CMakeLists.txt b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/CMakeLists.txt
index 17b92b402c590c8a8d32ce3c804c7167ddf9a06c..a576777fc8c6a9632599e103f9b503c03c0e416a 100644
--- a/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/TRT_ReadoutGeometry/CMakeLists.txt
@@ -5,6 +5,7 @@ atlas_subdir( TRT_ReadoutGeometry )
 
 # External dependencies:
 find_package( CLHEP )
+find_package( GeoModelCore )
 
 # Component(s) in the package:
 atlas_add_library( TRT_ReadoutGeometry
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index 0a1b04b1e3b5ca52fb2e167fdc26d588f2696ca0..a0e427f4fa5121c0bfaefb9ea3764c85befe6780 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -962,13 +962,13 @@ class pixelClusterSplitProb1 (InDetFlagsJobProperty):
    """ Cut value for splitting clusters into two parts """
    statusOn = True
    allowedTypes = ['float']
-   StoredValue = 0.6
+   StoredValue = 0.55
 
 class pixelClusterSplitProb2 (InDetFlagsJobProperty):
    """ Cut value for splitting clusters into three parts """
    statusOn = True
    allowedTypes = ['float']
-   StoredValue = 0.2
+   StoredValue = 0.45
 
 class pixelClusterSplitProb1_run1 (InDetFlagsJobProperty):
    """ Cut value for splitting clusters into two parts """
@@ -1152,10 +1152,10 @@ class doNNToTCalibration(InDetFlagsJobProperty):
   StoredValue  = False
 
 class useNNTTrainedNetworks(InDetFlagsJobProperty):
-  """Use older NNs stored as TTrainedNetworks in place of default MDNs/other more recent networks. This is necessary for older configuration tags where the trainings were not available."""
+  """Use older NNs stored as TTrainedNetworks in place of default MDNs/other more recent networks. This is necessary for older configuration tags where the trainings were not available. True gives rel21 (Run 2) configuration."""
   statusOn     = True
   allowedTypes = ['bool']
-  StoredValue  = True
+  StoredValue  = False
 
 class keepAdditionalHitsOnTrackParticle(InDetFlagsJobProperty): 
   """Do not drop first/last hits on track (only for special cases - will blow up TrackParticle szie!!!)""" 
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index 68302473537b4af138bf709348b2022e21e78754..d9549e51a2256aacf24b9daa3db4d81a5e35b092 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -343,9 +343,9 @@ def getNnClusterizationFactory(name='NnClusterizationFactory', **kwargs) :
         from IOVDbSvc.CondDB import conddb
 
       if (conddb.dbmc == "OFLP200" or (conddb.dbdata=="OFLP200" and globalflags.DataSource=='data')) :
-        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-SIM-RUN2-000-00")
+        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-SIM-RUN2-000-01")
       if ((conddb.dbmc == "CONDBR2" and globalflags.DataSource!='data') or conddb.dbdata == "CONDBR2") :
-        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-DATA-RUN2-000-00")
+        conddb.addOverride("/PIXEL/PixelClustering/PixelNNCalibJSON","PixelNNCalibJSON-DATA-RUN2-000-01")
       ## End of temporary code
 
       log.debug("Setting up lwtnn system")
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthErrorMonAlgCfg.py b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthErrorMonAlgCfg.py
index a3a2d5505c409c2a48a42ee57fad4924fe196567..4533d2756024db169bedb16515e06c121cd5995d 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthErrorMonAlgCfg.py
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthErrorMonAlgCfg.py
@@ -9,10 +9,10 @@
 from PixelMonitoring.PixelAthMonitoringBase import define2DProfHist
 from PixelMonitoring.PixelAthMonitoringBase import defineMapVsLumiLayers
 from PixelMonitoring.PixelAthMonitoringBase import define1DProfLumiLayers
-from PixelMonitoring.PixelAthMonitoringBase import layers
+from PixelMonitoring.PixelAthMonitoringBase import layers, fei3layers, fei4layers
 from PixelMonitoring.PixelAthMonitoringBase import fullDressTitle
 from PixelMonitoring.PixelAthMonitoringBase import errbbinsy, errbminsy, errbbsizy, errtbinsy
-from PixelMonitoring.PixelAthMonitoringBase import ErrBitLabels, ErrCatRODModLabels, ErrCatLabels, ErrCatRODModLabelsNorm, ErrCatLabelsNorm
+from PixelMonitoring.PixelAthMonitoringBase import ErrCatRODModLabels, ErrCatLabels, ErrCatRODModLabelsNorm, ErrCatLabelsNorm
 from PixelMonitoring.PixelAthMonitoringBase import ErrStateLabelsFEI3, ErrStateLabelsFEI4
 
 def PixelAthErrorMonAlgCfg(helper, alg, **kwargs):
@@ -22,8 +22,10 @@ def PixelAthErrorMonAlgCfg(helper, alg, **kwargs):
          alg     -- algorithm Configurable object returned from addAlgorithm
          kwargs  -- jo agruments
     '''
+    doLumiBlock = kwargs.get('doLumiBlock', False)
     path        = '/Pixel/Errors/'
     pathExpert  = '/Pixel/ErrorsExpert/'
+    pathLowStat = '/Pixel/LumiBlock/'
 
     errorGroup = helper.addGroup(alg, 'Error')
 
@@ -32,9 +34,12 @@ def PixelAthErrorMonAlgCfg(helper, alg, **kwargs):
     yaxistext      = ';# errors/event'
     define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
 
-    histoGroupName = 'ErrorBit_per_lumi'
-    title          = 'Average Errors by Error Bits'
-    defineMapVsLumiLayers(helper, alg, histoGroupName, title, path, ';lumi block', ';error bit', ybins=errbbinsy, ymins=errbminsy, binsizes=errbbsizy, ylabels=ErrBitLabels, type='TProfile2D')
+    histoGroupName = 'ErrorState_per_lumi'
+    title          = 'Average Errors by Error States'
+    ylabels        = [[i[1] for i in ErrStateLabelsFEI3]]*len(layers)
+    defineMapVsLumiLayers(helper, alg, histoGroupName, title, path, ';lumi block', ';error state', ybins=errbbinsy, ymins=errbminsy, binsizes=errbbsizy, ylabels=ylabels, type='TProfile2D', onlylayers=fei3layers)
+    ylabels        = [[i[1] for i in ErrStateLabelsFEI4]]*len(layers)
+    defineMapVsLumiLayers(helper, alg, histoGroupName, title, path, ';lumi block', ';error state', ybins=errbbinsy, ymins=errbminsy, binsizes=errbbsizy, ylabels=ylabels, type='TProfile2D', onlylayers=fei4layers)
 
     histoGroupName = 'ErrorCatRODMod_per_lumi'
     title          = 'Average Errors by Error Types'
@@ -66,47 +71,49 @@ def PixelAthErrorMonAlgCfg(helper, alg, **kwargs):
 
     histoGroupName = "femcc_errorwords"
     title          = "Average FE/MCC Error Words"
-    define2DProfHist(helper, alg, histoGroupName, title, path, type='TProfile2D')
+    define2DProfHist(helper, alg, histoGroupName, title, path, type='TProfile2D', onlylayers=fei3layers)
 
-    histoGroupName = "Errors_LB"
-    title          = "Errors"
-    define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F', lifecycle='lowStat')
+    if doLumiBlock:
+        histoGroupName = "Errors_LB"
+        title          = "Errors"
+        define2DProfHist(helper, alg, histoGroupName, title, pathLowStat, type='TH2F', doWeight=True, lifecycle='lowStat')
 
-    histoGroupName = "Errors_ModSync_LB"
-    title          = "Errors_ModSync"
-    define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F', lifecycle='lowStat')
+        histoGroupName = "Errors_ModSync_LB"
+        title          = "Errors_ModSync"
+        define2DProfHist(helper, alg, histoGroupName, title, pathLowStat, type='TH2F', lifecycle='lowStat')
 
-    histoGroupName = "Errors_RODSync_LB"
-    title          = "Errors_RODSync"
-    define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F', lifecycle='lowStat')
+        histoGroupName = "Errors_RODSync_LB"
+        title          = "Errors_RODSync"
+        define2DProfHist(helper, alg, histoGroupName, title, pathLowStat, type='TH2F', lifecycle='lowStat')
 
     for state in ErrStateLabelsFEI3:
         histoGroupName = state[0]+"_Map"
         title          = state[1]+" per event per LB"
-        define2DProfHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F')
+        define2DProfHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F', doWeight=True)
         histoGroupName = state[0]+"_per_lumi"
         title          = 'Average '+state[1]
         yaxistext      = ';# errors/event'
-        define1DProfLumiLayers(helper, alg, histoGroupName, title, pathExpert, yaxistext, type='TProfile')
+        define1DProfLumiLayers(helper, alg, histoGroupName, title, pathExpert, yaxistext, type='TProfile', onlylayers=fei3layers)
 
     for state in ErrStateLabelsFEI4:
         histoGroupName = state[0]+"_Map"
         title          = state[1]+" per event per LB"
-        define2DProfHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F')
+        define2DProfHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F', doWeight=True)
         histoGroupName = state[0]+"_per_lumi"
         title          = 'Average '+state[1]
         yaxistext      = ';# errors/event'
-        define1DProfLumiLayers(helper, alg, histoGroupName, title, pathExpert, yaxistext, type='TProfile')
+        define1DProfLumiLayers(helper, alg, histoGroupName, title, pathExpert, yaxistext, type='TProfile', onlylayers=fei4layers)
 
     varName = 'ServiceRecord_val'
     title = fullDressTitle('IBL ServiceRecord Unweighted', False, ';SR',';# errors/event')
     varName += ';ServiceRecord_Unweighted_IBL'
     errorGroup.defineHistogram(varName, 
                                type='TH1F', path=pathExpert, title=title,
-                               xbins=40, xmin=-0.5, xmax=39.5)
+                               xbins=32, xmin=-0.5, xmax=31.5)
     varName = 'ServiceRecord_val'
     title = fullDressTitle('IBL ServiceRecord Weighted with Payload', False, ';SR',';# errors/event')
     varName += ';ServiceRecord_Weighted_IBL'
     errorGroup.defineHistogram(varName, weight='ServiceRecord_wgt',
                                type='TH1F', path=pathExpert, title=title,
-                               xbins=40, xmin=-0.5, xmax=39.5)
+                               xbins=32, xmin=-0.5, xmax=31.5)
+ 
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py
index 829b7e0aa7305bfab3245332e29aaaf2a2b9721a..b55e4994056249cfb3171274f8b26028f41f65df 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py
@@ -50,7 +50,7 @@ xbinstotz= [    3,    3,  13,  13,  13,   20,     3,     3]
 xminstotz= [ -0.5, -0.5,-0.5,-0.5,-0.5, -0.5,  -0.5,  -0.5]
 ztotbinsy= [   20,   20,  20,  20,  20,   20,    20,    20]
 ztotminsy= [ 19.5, 19.5, 7.5,19.5,19.5, -0.5,  -0.5,  -0.5]
-errbbinsy= [   32,   32,  32,  32,  32,   40,    40,    40]
+errbbinsy= [   17,   17,  17,  17,  17,   27,    27,    27]
 errbminsy= [    0,    0,   0,   0,   0,    0,     0,     0]
 errbbsizy= [    1,    1,   1,   1,   1,    1,     1,     1]
 errtbinsy= [    7,    7,   7,   7,   7,    7,     7,     7]
@@ -58,6 +58,9 @@ errtbinsy= [    7,    7,   7,   7,   7,    7,     7,     7]
 pp0layers= ["ECA","ECC","B0","B1","B2","IBLA","IBLC"]
 pp0xbins = [   24,   24,  22,  38,  52,   14,     14]
 
+fei3layers= ["ECA","ECC","B0","B1","B2"]
+fei4layers= ["IBL","DBMA","DBMC"]
+
 lumitext  = ";lumi block"
 lumibinsx = 3000
 
@@ -145,76 +148,53 @@ PP0sEC = [
 PP0LabelX = [PP0sEC, PP0sEC, StavesL0, StavesL1, StavesL2, StavesIBL, StavesIBL]
 
 #Errors
-ErrBitsFEI3 = [
-    "ROD Overflow Trunc",        "ROD H/T Limit Trunc",       "2",                     "3",
-    "FE/MCC EoC Trunc",          "SEU Hit Parity",            "SEU Register Parity",   "SEU Hamming Code",
-    "FE Warning (Bit Flip)",     "9",                         "10",                    "11",
-    "FE/MCC Hit Overflow Trunc", "FE/MCC EoE Overflow Trunc", "FE/MCC BCID1 Sync",     "FE/MCC BCID2 Sync",
-    "FE/MCC LVL1ID Sync",        "17",                        "18",                    "19",
-    "ROD BCID Sync",             "ROD LVL1ID Sync",           "ROD Formatter Timeout", "Preamble/Header",
-    "24",                        "25",                        "26",                    "27",
-    "28",                        "29",                        "30",                    "31"]
-
-ErrBitsFEI4 = [
-    "Row/ Column Error",         "Limit Error",          "Trailer Error",        "BCID Error",
-    "LVL1ID Error",              "Preamble Error",       "Masked Link",          "Timeout Error",
-    "BCID counter",              "Hamming code 0",       "Hamming code 1",       "Hamming code 2",
-    "L1_in counter",             "L1 request counter",   "L1 register",          "L1 Trigger ID",
-    "Readout processor",         "17",                   "18",                   "19",
-    "20",                        "21",                   "22",                   "Skipped trig counter",
-    "Truncated event flag",      "25",                   "26",                   "27",
-    "28",                        "29",                   "30"                    "31"
-    "Triple redundant CNFGMEM",  "Write reg data",       "Address error",        "Other CMD decoder",
-    "CMD decoder bit flip",      "CMD decoder SEU",      "Data bus address",     "Triple redundant EFUSE"]
-
-ErrBitLabels = [ErrBitsFEI3, ErrBitsFEI3, ErrBitsFEI3, ErrBitsFEI3, ErrBitsFEI3, ErrBitsFEI4, ErrBitsFEI4, ErrBitsFEI4]
-
 ErrStateLabelsFEI3 = [
-      ("Mod_Sync_BCID1_errors", "FE/MCC BCID1 Sync Errors"),
-      ("Mod_Sync_BCID2_errors", "FE/MCC BCID2 Sync Errors"),
-      ("Mod_Sync_LVL1ID_errors", "FE/MCC LVL1ID Sync Errors"),
-      ("ROD_Sync_BCID_errors", "ROD BCID Sync Errors"),
-      ("ROD_Sync_LVL1ID_errors", "ROD LVL1ID Sync Errors"),
-      ("Mod_Trunc_EOC_errors", "FE/MCC EoC Trunc Errors"),
-      ("Mod_Trunc_Hit_Overflow_errors", "FE/MCC Hit Overflow Trunc Errors"),
-      ("Mod_Trunc_EoE_Overflow_errors", "FE/MCC EoE Overflow Trunc Errors"),
-      ("ROD_Trunc_HT_Limit_errors", "ROD H/T Limit Trunc Errors"),
-      ("ROD_Trunc_ROD_OF_errors", "ROD Overflow Trunc Errors"),
-      ("Optical_Errors", "Preamble/Header Errors"),
-      ("SEU_Hit_Parity", "SEU Hit Parity Errors"),
-      ("SEU_Register_Parity", "SEU Register Parity Errors"),
-      ("SEU_Hamming", "SEU Hamming Code Errors"),
-      ("ROD_Timeout", "ROD Formatter Timeout Errors"),
-      ("FE_Warning", "FE Warning Errors"),
+      ("ROD_Timeout", "ROD Formatter Timeout"),
+      ("ROD_Sync_BCID_errors", "ROD BCID Sync"),
+      ("ROD_Sync_LVL1ID_errors", "ROD LVL1ID Sync"),
+      ("Optical_Errors", "Preamble/Header"),
+      ("Mod_Sync_LVL1ID_errors", "FE/MCC LVL1ID Sync"),
+      ("Mod_Sync_BCID2_errors", "FE/MCC BCID2 Sync"),
+      ("Mod_Sync_BCID1_errors", "FE/MCC BCID1 Sync"),
+      ("Mod_Trunc_EoE_Overflow_errors", "FE/MCC EoE Overflow Trunc"),
+      ("Mod_Trunc_Hit_Overflow_errors", "FE/MCC Hit Overflow Trunc"),
+      ("FE_Warning", "FE Warning"),
+      ("SEU_Hit_Parity", "SEU Hit Parity"),
+      ("SEU_Register_Parity", "SEU Register Parity"),
+      ("SEU_Hamming", "SEU Hamming Code"),
+      ("Mod_Trunc_EOC_errors", "FE/MCC EoC Trunc"),
+      ("ROD_Trailer_Bit_errors", "ROD Trailer Bit"),
+      ("ROD_Trunc_HT_Limit_errors", "ROD H/T Limit Trunc"),
+      ("ROD_Trunc_ROD_OF_errors", "ROD Overflow Trunc")
 ]
 ErrStateLabelsFEI4 = [
-      ("ROD_BCID_errors", "ROD BCID synchronization errors"),
-      ("ROD_LVL1ID_errors", "ROD LVL1ID synchronization errors"),
-      ("SR_BCID_counter_errors", "SR BCID counter errors"),
-      ("SR_L1_in_counter_errors", "SR L1 in counter errors"),
-      ("SR_L1_request_counter_errors", "SR L1 request counter errors"),
-      ("SR_L1_register_errors", "SR L1 register errors"),
-      ("SR_L1_Trigger_ID_errors", "SR L1 trigger ID errors"),
-      ("SR_Skippped_trig_count_errors", "SR Skipped trigger counter errors"),
-      ("SR_Row-Column_errors", "SR row-column errors"),
-      ("SR_Limit_errors", "SR Header Trailer limit errors"),
-      ("SR_Truncated_event_flag_errors", "SR Truncated event errors"),
-      ("ROD_Preamble_errors", "ROD Preamble errors"),
-      ("SR_Hamming_code_0_errors", "SR Hamming code in word 0 errors"),
-      ("SR_Hamming_code_1_errors", "SR Hamming code in word 1 errors"),
-      ("SR_Hamming_code_2_errors", "SR Hamming code in word 2 errors"),
-      ("SR_Triple_redundant_errors_CNFGMEM", "SR Triple redundant errors CNFGMEM"),
-      ("SR_CMD_decoder_bitflip_errors", "SR CMD decoder bit flip errors"),
-      ("SR_Triple_redundant_errors_CMD", "SR Triple redundant errors CMD"),
-      ("SR_Triple_redundant_errors_EFUSE", "SR Triple redundant errors EFUSE"),
-      ("ROD_Trailer_errors", "ROD Trailer errors"),
-      ("ROD_Timeout_errors", "ROD Timeout errors"),
-      ("SR_Masked_link", "SR Masked link errors"),
-      ("SR_FE_readout_process_errors", "SR FE readout process errors"),
-      ("SR_Write_reg_data_errors", "SR Write register data errors"),
-      ("SR Address_errors", "SR Address errors"),
-      ("SR_Other_CMD_decoder_errors", "SR CMD decoder errors"),
-      ("SR_Data_bus_address_errors", "SR Data bus address errors")
+      ("ROD_Timeout_errors", "ROD Timeout"),
+      ("ROD_BCID_errors", "ROD BCID synchronization"),
+      ("ROD_LVL1ID_errors", "ROD LVL1ID synchronization"),
+      ("ROD_Preamble_errors", "ROD Preamble"),
+      ("ROD_Trailer_errors", "ROD Trailer"),
+      ("ROD_Row-Column_errors", "ROD row-column"),
+      ("ROD_Masked_link", "ROD Masked link"),
+      ("ROD_Limit_errors", "ROD Header Trailer limit"),
+      ("SR0_BCID_counter_errors", "SR0 BCID counter"),
+      ("SR1_Hamming_code_0_errors", "SR1 Hamming code in word 0"),
+      ("SR2_Hamming_code_1_errors", "SR2 Hamming code in word 1"),
+      ("SR3_Hamming_code_2_errors", "SR3 Hamming code in word 2"),
+      ("SR4_L1_in_counter_errors", "SR4 L1 in counter"),
+      ("SR5_L1_request_counter_errors", "SR5 L1 request counter"),
+      ("SR6_L1_register_errors", "SR6 L1 register"),
+      ("SR7_L1_Trigger_ID_errors", "SR7 L1 trigger ID"),
+      ("SR8_FE_readout_process_errors", "SR8 FE readout process"),
+      ("SR15_Skippped_trig_count_errors", "SR15 Skipped trigger counter"),
+      ("SR16_Truncated_event_flag_errors", "SR16 Truncated event"),
+      ("SR24_Triple_redundant_errors_CNFGMEM", "SR24 Triple redundant CNFGMEM"),
+      ("SR25_Write_reg_data_errors", "SR25 Write register data"),
+      ("SR26_Address_errors", "SR26 Address"),
+      ("SR27_Other_CMD_decoder_errors", "SR27 CMD decoder"),
+      ("SR28_CMD_decoder_bitflip_errors", "SR28 CMD decoder bit flip"),
+      ("SR29_Triple_redundant_errors_CMD", "SR29 Triple redundant CMD"),
+      ("SR30_Data_bus_address_errors", "SR30 Data bus address"),
+      ("SR31_Triple_redundant_errors_EFUSE", "SR31 Triple redundant EFUSE")
 ]
 
 ErrCatRODModLabels = [
@@ -259,7 +239,7 @@ def getLayerGroup(helper, alg, layer):
     return layergroups[alg][layer]
 
 
-def define2DProfHist(helper, alg, name, title, path, type='TProfile2D', doWeight=False, lifecycle='run', zmin=None, zmax=None, opt='', histname=None):
+def define2DProfHist(helper, alg, name, title, path, type='TProfile2D', doWeight=False, lifecycle='run', zmin=None, zmax=None, opt='', histname=None, onlylayers=layers):
     '''
     This function configures 2D (Profile) histograms (or maps) for Pixel layers.
 
@@ -273,20 +253,25 @@ def define2DProfHist(helper, alg, name, title, path, type='TProfile2D', doWeight
          lifecycle  -- global life duration of histograms (run, lowstat [i.e. 20 LB], lumiblock) - APPLIES to MonGroup only
          zmin(zmax) -- fix the displayed range - simply chopping the range!!!
          opt        -- history depth of a histogram e.g. 'kLBNHistoryDepth=10'
-         histname   -- another way of naming the histogram(s), useful when multiple histograms are filled from exactly the same variables, but in a different way 
+         histname   -- another way of naming the histogram(s), useful when multiple histograms are filled from exactly the same variables, but in a different way
+         onlylayers -- sublist of layers 
     '''
+    assert(set(onlylayers).issubset(layers))
     if histname is None:
         histname = name
     for i, layer in enumerate(layers):
+        if layer not in onlylayers: 
+            continue
         fulltitle   = title + ' {0}'.format(layer) + runtext + etatxt[i] + phitext
         layerGroup = getLayerGroup(helper, alg, layer)
 
         fullvarstring = '{0}_{1},{0}_{2}'.format(name, 'em', 'pm')
-        if 'Profile' in type: fullvarstring += ',{0}_{1}'.format(name, 'val')
-        if doWeight:
-            weightvar = '{0}_{1}'.format(name, 'wgt')
-        else :
-            weightvar = ''
+        weightvar = ''
+        if 'Profile' in type: 
+            fullvarstring += ',{0}_{1}'.format(name, 'val')
+        elif doWeight:
+            weightvar = '{0}_{1}'.format(name, 'val') # re-use the same variable for TH2 for now.
+            
         fullvarstring += ';' + histname + '_{0}'.format(layer)
         layerGroup.defineHistogram(fullvarstring, 
                                     type=type, path=path, title=fulltitle, weight=weightvar,
@@ -331,7 +316,7 @@ def definePP0Histos(helper, alg, name, title, path, opt=''):
 
 
 
-def define1DProfLumiLayers(helper, alg, name, title, path, yaxistext, type='TProfile', histname=None):
+def define1DProfLumiLayers(helper, alg, name, title, path, yaxistext, type='TProfile', histname=None, onlylayers=layers):
     '''
     This function configures 1D (Profile) vs lumi histograms for Pixel layers.
 
@@ -344,11 +329,14 @@ def define1DProfLumiLayers(helper, alg, name, title, path, yaxistext, type='TPro
          yaxistext -- Text on the y-axis
          type      -- Type of histogram (TH1D, TProfile)
          histname  -- another way of naming the histogram(s), useful when multiple histograms are filled from exactly the same variables, but in a different way 
+         onlylayers -- sublist of layers
     '''
-
+    assert(set(onlylayers).issubset(layers))
     if histname is None:
         histname = name
     for layer in layers:
+        if layer not in onlylayers: 
+            continue
         fulltitle   = title + ' {0}'.format(layer) + runtext + lumitext + yaxistext
         layerGroup = getLayerGroup(helper, alg, layer)
         fullvarstring = '{0}_{1}'.format(name,'lb')
@@ -358,7 +346,7 @@ def define1DProfLumiLayers(helper, alg, name, title, path, yaxistext, type='TPro
                                     type=type, path=path, title=fulltitle,
                                     xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx)
 
-def defineMapVsLumiLayers(helper, alg, name, title, path, xaxistext, yaxistext, ybins, ymins, binsizes=[1.0], ylabels=None, type='TH2F', histname=None):
+def defineMapVsLumiLayers(helper, alg, name, title, path, xaxistext, yaxistext, ybins, ymins, binsizes=[1.0], ylabels=None, type='TH2F', histname=None, onlylayers=layers):
     '''
     This function configures 2D histograms vs lumi for Pixel layers.
 
@@ -371,12 +359,15 @@ def defineMapVsLumiLayers(helper, alg, name, title, path, xaxistext, yaxistext,
          ybins, ymin, ymax, yaxistext
                  -- Configure Y-axis
          type    -- Type of histogram (TH2I, TH2F, TProfile2D)
-         histname-- alternative root name of the histogram (to be filled with the same variables defined by 'name' above)  
+         histname-- alternative root name of the histogram (to be filled with the same variables defined by 'name' above)
+         onlylayers -- sublist of layers
     '''
-
+    assert(set(onlylayers).issubset(layers))
     if histname is None:
         histname = name
     for idx,layer in enumerate(layers):
+        if layer not in onlylayers: 
+            continue
         fulltitle   = title + ' {0}'.format(layer) + runtext + lumitext + yaxistext
         layerGroup = getLayerGroup(helper, alg, layer)
         fullvarstring = '{0}_{1}'.format(name,'lb')
@@ -395,7 +386,7 @@ def defineMapVsLumiLayers(helper, alg, name, title, path, xaxistext, yaxistext,
                                        ybins=ybins[idx], ymin=ymins[idx], ymax=ymins[idx]+binsizes[idx]*ybins[idx], ylabels=ylabels[idx])
 
 
-def define1DLayers(helper, alg, name, title, path, xaxistext, yaxistext, xbins, xmins, binsizes=[1.0], type='TH1F', histname=None):
+def define1DLayers(helper, alg, name, title, path, xaxistext, yaxistext, xbins, xmins, binsizes=[1.0], type='TH1F', histname=None, onlylayers=layers):
     '''
     This function configures 1D (Profile) histograms for Pixel layers.
 
@@ -408,12 +399,15 @@ def define1DLayers(helper, alg, name, title, path, xaxistext, yaxistext, xbins,
          xaxistext  -- X-axis title
          yaxistext  -- Y-axis title
          type       -- Type of histogram
-         histname   -- alternative root name of the histogram (to be filled with the same variables defined by 'name' above)  
+         histname   -- alternative root name of the histogram (to be filled with the same variables defined by 'name' above)
+         onlylayers -- sublist of layers
     '''
-
+    assert(set(onlylayers).issubset(layers))
     if histname is None:
         histname = name
     for idx,layer in enumerate(layers):
+        if layer not in onlylayers: 
+            continue
         fulltitle   = title + ' {0}'.format(layer) + runtext + xaxistext + yaxistext
         layerGroup = getLayerGroup(helper, alg, layer)
         fullvarstring = '{0}_{1}'.format(name,'val')
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx
index ff05823a9a7bb66289b2f8df4954ebf30ab54d67..0ad4962b00f1a9524389d94e5649ce9577b6b8ec 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx
@@ -8,8 +8,7 @@ PixelAthErrorMonAlg::PixelAthErrorMonAlg( const std::string& name, ISvcLocator*
   AthMonitorAlgorithm(name, pSvcLocator),
   m_pixelid(nullptr)
 {
-  //jo flags
-  // declareProperty("ErrorsTool", m_pixelErrorTool);
+  // jo flags
   declareProperty("doOnline", m_doOnline = false);
   declareProperty("doModules", m_doModules = false);
   declareProperty("doLumiBlock", m_doLumiBlock = false);
@@ -32,6 +31,53 @@ StatusCode PixelAthErrorMonAlg::initialize() {
 
 
 StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const {
+  using namespace Monitored;
+
+  int lb = GetEventInfo(ctx)->lumiBlock();
+  auto errorGroup = getGroup("Error");
+
+  ATH_MSG_DEBUG("Filling Error Monitoring Histograms");
+
+  // Generate a vector of error maps for all different error states.
+  std::vector<VecAccumulator2DMap> error_maps_per_state;
+  error_maps_per_state.reserve(kNumErrorStatesFEI3 + kNumErrorStatesFEI4);
+  for (const auto& state : error_names_stateFEI3) {
+    error_maps_per_state.emplace_back(state + std::string("_Map"));
+  }
+  for (const auto& state : error_names_stateFEI4) {
+    error_maps_per_state.emplace_back(state + std::string("_Map"));
+  }
+  std::vector<VecAccumulator2DMap> error_maps_per_cat_rodmod; 
+  // only first four rodmod histos are unique, others are covered by 
+  // the overall, rod/mod-agnostic categories below
+  for (unsigned int cat = 0; cat < ErrorCategoryRODMOD::kTruncROD+1; ++cat) {
+    error_maps_per_cat_rodmod.emplace_back(error_names_cat_rodmod[cat]);
+  }
+  std::vector<VecAccumulator2DMap> error_maps_per_cat;
+  for (unsigned int cat = 0; cat < ErrorCategory::COUNT; ++cat) {
+    error_maps_per_cat.emplace_back(error_names_cat[cat]);
+  }
+
+  // containers to keep IBL service records info
+  std::vector<int>          flagged_ibl_error_bits;
+  std::vector<unsigned int> weights_of_flagged_ibl_error_bits;
+
+  int nActive_layer[PixLayers::COUNT] = {0};
+
+  // Array to count number of errors occurring in all layers.
+  float num_errors[PixLayers::COUNT] = {0};
+  float num_errors_per_state[std::max(kNumErrorStatesFEI3, kNumErrorStatesFEI4)][PixLayers::COUNT] = {{0}};
+
+  // Counters for erroneous modules in a layer, per
+  // error category, w/ and w/o ROD/MOD distinction.
+  float num_errormodules_per_cat[ErrorCategory::COUNT][PixLayers::COUNT] = {{0}};
+  float num_errormodules_per_cat_rodmod[ErrorCategoryRODMOD::COUNT][PixLayers::COUNT] = {{0}};
+
+  // Generate femcc_errwords and per LB maps, all _per module_, including IBL.
+  VecAccumulator2DMap femcc_errwords_maps("femcc_errorwords", true);
+  VecAccumulator2DMap all_errors_maps("Errors_LB", true);
+  VecAccumulator2DMap modsync_errors_maps("Errors_ModSync_LB", true);
+  VecAccumulator2DMap rodsync_errors_maps("Errors_RODSync_LB", true);
 
   //====================================================================================
   // This is an example how to read the Error informaiton.
@@ -43,6 +89,9 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
   //    m_pixelCondSummaryTool->getBSErrorWord(i,ctx) 
   // where
   //    i= [    0,  2047] : module error
+  //        ( [0, 11] - DBMC, [12, 155] - ECC, [156, 435] - IBL,
+  //         [436, 721] - B0, [722, 1215] - B1, [1216, 1891] - B2,
+  //         [1892, 2035] - ECA, [2036, 2047] - DBMA )    
   //
   //  for PIXEL(FEI3):
   //     = [ 2048,  4095] :   FE-0 error
@@ -56,311 +105,136 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
   //  for IBL(FEI4):
   //     = [ 2048,  4095] :   FE-0 error
   //     = [ 4096,  6143] :   FE-1 error
-  //     = [34816, 35095] :  Error counter in bit#=1 from ServiceRecords
-  //     = [35096, 35375] :  Error counter in bit#=2 from ServiceRecords
+  //     = [34816, 35375] :  Error counter in bit#=0 from ServiceRecords (shift: modHash*nFE+iFE)
+  //     = [35376, 35935] :  Error counter in bit#=1 from ServiceRecords
   //          ...    ...      ...
   //          ...    ...      ...
-  //     = [43496, 43776] :  Error counter in bit#=32 from ServiceRecords
+  //     = [52176, 52735] :  Error counter in bit#=31 from ServiceRecords
   //
   //====================================================================================
   //
-  // Print all Module/FE errors
-  int maxHash = m_pixelid->wafer_hash_max();
-
-  for (int i=0; i<maxHash; i++) {
-    // Get accumulated errors (Module)
-    uint64_t kErrorWord = m_pixelCondSummaryTool->getBSErrorWord(i,ctx);
-
-    ATH_MSG_DEBUG("Module hash=" << i << " has");
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::TimeOut           )) { ATH_MSG_DEBUG("      TimeOut            state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::BCID              )) { ATH_MSG_DEBUG("      BCID               state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::LVL1ID            )) { ATH_MSG_DEBUG("      LVL1ID             state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Preamble          )) { ATH_MSG_DEBUG("      Preamble           state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Trailer           )) { ATH_MSG_DEBUG("      Trailer            state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Flagged           )) { ATH_MSG_DEBUG("      Flagged            state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::BadFE             )) { ATH_MSG_DEBUG("      BadFE              state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Decoding          )) { ATH_MSG_DEBUG("      Decoding           state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Invalid           )) { ATH_MSG_DEBUG("      Invalid            state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::LinkMaskedByPPC   )) { ATH_MSG_DEBUG("      LinkMaskedByPPC    state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Limit             )) { ATH_MSG_DEBUG("      Limit              state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::TruncatedROB      )) { ATH_MSG_DEBUG("      TruncatedROB       state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MaskedROB         )) { ATH_MSG_DEBUG("      MaskedROB          state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCUndefined      )) { ATH_MSG_DEBUG("      MCCUndefined       state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCLVL1IDEoECheck )) { ATH_MSG_DEBUG("      MCCLVL1IDEoECheck  state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCBCIDEoECheck   )) { ATH_MSG_DEBUG("      MCCBCIDEoECheck    state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCLVL1IDCheck    )) { ATH_MSG_DEBUG("      MCCLVL1IDCheck     state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCEoEOverflow    )) { ATH_MSG_DEBUG("      MCCEoEOverflow     state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCHitOverflow    )) { ATH_MSG_DEBUG("      MCCHitOverflow     state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEWarning         )) { ATH_MSG_DEBUG("      FEWarning          state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEHitParity       )) { ATH_MSG_DEBUG("      FEHitParity        state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FERegisterParity  )) { ATH_MSG_DEBUG("      FERegisterParity   state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEHammingCode     )) { ATH_MSG_DEBUG("      FEHammingCode      state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEEoCOverflow     )) { ATH_MSG_DEBUG("      FEEoCOverflow      state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::RODTrailerBitError)) { ATH_MSG_DEBUG("      RODTrailerBitError state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::RODHeaderLimit    )) { ATH_MSG_DEBUG("      RODHeaderLimit     state..."); }
-    if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::RODDataOVerflow   )) { ATH_MSG_DEBUG("      RODDataOVerflow    state..."); }
-
-    // Loop over all FE
-    int nFE = 16;
-    if (i<12 || i>2035) { nFE=2; }  // for DBM
-    if (i>155 && i<436) { nFE=2; }  // for FEI4
-
-    for (int j=0; j<nFE; j++) {
-      int channelFE = (1+j)*maxHash+i;    // (FE_channel+1)*2048 + moduleHash
-      uint64_t kErrorFEWord = m_pixelCondSummaryTool->getBSErrorWord(channelFE,ctx);
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::TimeOut          )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      TimeOut           state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::BCID             )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      BCID              state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::LVL1ID           )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      LVL1ID            state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Preamble         )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      Preamble          state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Trailer          )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      Trailer           state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Flagged          )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      Flagged           state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::BadFE            )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      BadFE             state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Decoding         )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      Decoding          state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Invalid          )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      Invalid           state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::LinkMaskedByPPC  )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      LinkMaskedByPPC   state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Limit            )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      Limit             state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCUndefined     )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      MCCUndefined      state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCLVL1IDEoECheck)) { ATH_MSG_DEBUG("  FE ch.=" << j << "      MCCLVL1IDEoECheck state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCBCIDEoECheck  )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      MCCBCIDEoECheck   state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCLVL1IDCheck   )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      MCCLVL1IDCheck    state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCEoEOverflow   )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      MCCEoEOverflow    state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCHitOverflow   )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      MCCHitOverflow    state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEWarning        )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      FEWarning         state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEHitParity      )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      FEHitParity       state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FERegisterParity )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      FERegisterParity  state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEHammingCode    )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      FEHammingCode     state..."); }
-      if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEEoCOverflow    )) { ATH_MSG_DEBUG("  FE ch.=" << j << "      FEEoCOverflow     state..."); }
-    }
-
-    // Get IBL SearviceRecords : IBL hashID[156-435]
-    if (i>155 && i<436) {
-      for (int j=0; j<2; j++) {
-        for (int k=1; k<32; k++) {
-          int indexOffset = 17*maxHash;
-          int channelFE = indexOffset+(k-1)*280*2+2*(i-156)+j;    // offset+(ServiceCode)*(#IBLxFE) + (#FE)x(moduleHash-156) + FE
-          uint64_t serviceCounter = m_pixelCondSummaryTool->getBSErrorWord(channelFE,ctx);
-          ATH_MSG_DEBUG("   IBL SearviceRecords bit=" << j << "  " << serviceCounter);
-        }
-      }
-    }
-  }
-
-
-//===================================================================
-// Here I let Pixel DQ people refill the Error word with new method.
-/* 
-  using namespace Monitored;
-
-  int lb = GetEventInfo(ctx)->lumiBlock();
-  auto errorGroup = getGroup("Error");
-
-  ATH_MSG_DEBUG("Filling Error Monitoring Histograms");
-
-  // Array to count number of errors occurring in all components.
-  float num_errors[PixLayers::COUNT] = {0};
-
-  // taking the largest - FEI4's - error bit/state sizes 
-  float num_errors_per_bit[kNumErrorBitsFEI4][PixLayers::COUNT] = {{0}};
-  float num_errors_per_state[error_names_stateFEI4.size()][PixLayers::COUNT] = {{0}};
-
-  // Counters for erroneous modules in a layer, per
-  // error category, w/ and w/o ROD/MOD distinction.
-  float num_errormodules_per_cat[ErrorCategory::COUNT][PixLayers::COUNT] = {{0}};
-  float num_errormodules_per_cat_rodmod[ErrorCategoryRODMOD::COUNT][PixLayers::COUNT] = {{0}};
 
-  const auto& kFeErrorWords = m_pixelErrorTool->getAllFeErrors();
+  const int maxHash = m_pixelid->wafer_hash_max(); // 2048
 
-  // const auto& kFeSvcRecord  = m_pixelErrorTool->getAllServiceCodes(); //REVIEW n.y. implemented
-  // temporary kFeSvcRecord
-  std::map<IdentifierHash, std::map<unsigned int, std::vector<std::pair<int, unsigned int>>>> kFeSvcRecord;
- 
-  // Generate a vector of error maps for all different error states.
-  std::vector<VecAccumulator2DMap> error_maps_per_state;
-  error_maps_per_state.reserve(error_names_stateFEI3.size() + error_names_stateFEI4.size());
-  for (const auto& state : error_names_stateFEI3) {
-    error_maps_per_state.emplace_back(state + std::string("_Map"), true);
-  }
-  for (const auto& state : error_names_stateFEI4) {
-    error_maps_per_state.emplace_back(state + std::string("_Map"), true);
-  }
-  std::vector<VecAccumulator2DMap> error_maps_per_cat_rodmod; 
-  // only first four rodmod histos are unique, others are covered by 
-  // the overall, rod/mod-agnostic categories below
-  for (unsigned int cat = 0; cat < ErrorCategoryRODMOD::kTruncROD+1; ++cat) {
-    error_maps_per_cat_rodmod.emplace_back(error_names_cat_rodmod[cat], true);
-  }
-  std::vector<VecAccumulator2DMap> error_maps_per_cat;
-  for (unsigned int cat = 0; cat < ErrorCategory::COUNT; ++cat) {
-    error_maps_per_cat.emplace_back(error_names_cat[cat], true);
-  }
-  // Generate femcc_errwords and per LB maps.
-  VecAccumulator2DMap femcc_errwords_maps("femcc_errorwords", true); //simple counting per _module_
-  VecAccumulator2DMap all_errors_maps("Errors_LB", true);
-  VecAccumulator2DMap modsync_errors_maps("Errors_ModSync_LB", true);
-  VecAccumulator2DMap rodsync_errors_maps("Errors_RODSync_LB", true);
-
-  // containers to keep IBL service records info
-  std::vector<int> flagged_ibl_error_bits;
-  std::vector<unsigned int> weights_of_flagged_ibl_error_bits;
+  // Loop over modules
+  for (int modHash=0; modHash<maxHash; modHash++) {
+    Identifier waferID = m_pixelid->wafer_id(modHash);
+    int pixlayer = getPixLayersID(m_pixelid->barrel_ec(waferID), m_pixelid->layer_disk(waferID) );
+    int nFE;
+    bool is_fei4;
+    if (pixlayer == PixLayers::kDBMC || pixlayer == PixLayers::kDBMA) {
+      nFE = 2;  
+      is_fei4 = true;
+    } else if (pixlayer == PixLayers::kIBL) {
+      nFE = 2;  
+      is_fei4 = true;
+    } else { // for fei3 Pixel layers
+      nFE = 16;
+      is_fei4 = false;
+    }
+    // flagging/counting categorized errors per module.
+    bool has_err_cat[ErrorCategory::COUNT] = {false};
+    int nerrors_cat_rodmod[ErrorCategoryRODMOD::COUNT] = {0};
 
-  int nActive_layer[PixLayers::COUNT] = {0};
+    // count number of words w/ MCC/FE flags per module
+    unsigned int num_femcc_errwords = 0;
 
-  // Perform a loop over all pixel IDs to fill the error-bit maps.
-  PixelID::const_id_iterator idIt = m_pixelid->wafer_begin();
-  PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end();
-  for (; idIt != idItEnd; ++idIt) {
-    Identifier waferID = *idIt;
-    IdentifierHash id_hash = m_pixelid->wafer_hash(waferID);
-    const auto& kErrorWord = m_pixelErrorTool->getModuleErrors(id_hash);
+    // getting module_error information (only fei3 layers)
+    //
+    if (!is_fei4) {
+      uint64_t mod_errorword = m_pixelCondSummaryTool->getBSErrorWord(modHash, ctx);
+      std::bitset<kNumErrorStatesFEI3> stateFEI3 = getErrorStateFEI3Mod(mod_errorword);  
+      num_errors[pixlayer]+=stateFEI3.count();
+      for (unsigned int state = 0; state < stateFEI3.size(); ++state) {
+	if (stateFEI3[state]) {
+	  num_errors_per_state[state][pixlayer]++;
+	  error_maps_per_state[state].add(pixlayer, waferID, m_pixelid, 1.0);
+	}
+      }
+      fillErrorCatRODmod(mod_errorword, nerrors_cat_rodmod);
+    }
 
-    bool is_fei4 = false;
-    if (m_pixelErrorTool->isActive(id_hash) &&  // isActive from PixelBytestreamErrorTool to REVIEW
-	( (m_pixelid->barrel_ec(waferID) == 0 && m_pixelid->layer_disk(waferID) == 0) ||
-	  abs(m_pixelid->barrel_ec(waferID)) == 4) ) is_fei4 = true;
+    // getting fe_error information (all pixel layers)
+    //
+    for (int iFE=0; iFE<nFE; iFE++) {
 
-    int pixlayer = getPixLayersID(m_pixelid->barrel_ec(waferID), m_pixelid->layer_disk(waferID) );
+      int offsetFE = (1+iFE)*maxHash + modHash;    // (FE index+1)*2048 + moduleHash
+      uint64_t fe_errorword = m_pixelCondSummaryTool->getBSErrorWord(offsetFE, ctx);
 
-    // Boolean whether current module has a categorized error.
-    bool has_err_cat[ErrorCategory::COUNT] = {false};
-    bool has_err_cat_rodmod[ErrorCategoryRODMOD::COUNT] = {false};
+      fillErrorCatRODmod(fe_errorword, is_fei4, nerrors_cat_rodmod);
 
-    if (!is_fei4) {
-      // Bit-shifting over module errors, only for ROD-type errors for FE-I3
-      for (unsigned int bit = 0; bit < kNumErrorBitsFEI3; bit++) {
-	if ((kErrorWord & (static_cast<uint64_t>(1) << bit)) != 0) {
-	  if (bit >=4 && bit <=16) continue;
-	  num_errors[pixlayer]++;
-	  num_errors_per_bit[bit][pixlayer]++;
-	  
-	  int error_cat_rodmod = 0;
-	  if (bit == 20 || bit == 21)              error_cat_rodmod = 2;  // ROD synchronization errors      (20: BCID, 21: LVL1ID)
-	  if (bit == 0  || bit == 1)               error_cat_rodmod = 4;  // ROD truncation errors           (0: FIFO Overflow, 1: H/T Limit)
-	  if (bit == 23)                           error_cat_rodmod = 5;  // optical errors                  (23: preamble (bitflip))
-	  if (bit == 22)                           error_cat_rodmod = 7;  // timeout errors                  (22: timeout on ROD formatter)
-	  if (error_cat_rodmod) {
-	    has_err_cat_rodmod[error_cat_rodmod - 1] = true;
-	    if (!m_doOnline) {
-	      all_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
-	    }
-	    if (getErrorCategory(error_cat_rodmod)!=99) has_err_cat[getErrorCategory(error_cat_rodmod)] = true;
-	  }
-	  if (getErrorState(bit, is_fei4) != 99) {
-	    num_errors_per_state[getErrorState(bit, is_fei4)][pixlayer]++;
-	    error_maps_per_state[getErrorState(bit, is_fei4)].add(pixlayer, waferID, m_pixelid, 1.0);
+      if (!is_fei4) {
+	std::bitset<kNumErrorStatesFEI3> stateFEI3 = getErrorStateFE(fe_errorword, is_fei4);  
+	num_errors[pixlayer]+=stateFEI3.count();
+	if ( stateFEI3.any() ) num_femcc_errwords++;
+	for (unsigned int state = 0; state < stateFEI3.size(); ++state) {
+	  if (stateFEI3[state]) {
+	    num_errors_per_state[state][pixlayer]++;
+	    error_maps_per_state[state].add(pixlayer, waferID, m_pixelid, 1.0);
 	  }
 	}
-      }
-    } //end of FEI3-only part
-     
-    // Bit-shifting over FE errors, kFeErrorWords are common to both FEI3 and FEI4
-    // but bits are different, see 
-    // InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx
-    unsigned int num_femcc_errwords = 0;
-    if (kFeErrorWords.find(id_hash) != kFeErrorWords.end()) {
-      // Collection of: FE ID, associated error word
-      std::map<unsigned int, unsigned int> fe_errorword_map = kFeErrorWords.find(id_hash)->second;
-      
-      for (const auto& [fe_id, fe_errorword] : fe_errorword_map) {
-	bool has_femcc_errbits(false);
-	
-	for (unsigned int bit = 0; bit < kNumErrorBitsFEI3; bit++) {
-	  if ((fe_errorword & (static_cast<uint64_t>(1) << bit)) != 0) {
-            if (is_fei4 && bit > 7) continue; // For FE-I4 we are interested only in trailer errors, which are the first 8 bits, service records are taken separately
-	    // For FE-I3, no double-counting w/ other bits? REVIEW
-	    
-	    num_errors[pixlayer]++;
-	    num_errors_per_bit[bit][pixlayer]++;
-	    // This error word contains FE/MCC related errors. 
-	    if (bit >=4 && bit <=16) has_femcc_errbits = true;
-	    
-	    int error_cat_rodmod = 0;
-	    if (!is_fei4) {
-	      if (bit == 14 || bit == 15 || bit == 16) error_cat_rodmod = 1;  // module synchronization errors   (14: BCID, 15: BCID. 16: LVL1ID)
-	      if (bit == 4  || bit == 12 || bit == 13) error_cat_rodmod = 3;  // module truncation errors        (4: EOC, 12: hit overflow, 13: EoE overflow)
-	      if (bit >= 5  && bit <= 7)               error_cat_rodmod = 6;  // SEU (single event upset) errors (5,6,7: hit parity, register parity, hammingcode)
-	    } else {
-              if (bit == 3 || bit == 4)                error_cat_rodmod = 2;  // synchronization error   (3:LVL1ID, 4:BCID)
-              if (bit == 0 || bit == 1)                error_cat_rodmod = 4;  // ROD truncation error    (0:Row/Column error, 1:Limit error)
-              if (bit == 5)                            error_cat_rodmod = 5;  // optical error           (5:Preable error)
-              if (bit == 2 || bit == 7)                error_cat_rodmod = 7;  // Timeout error           (2:Trailer timeout error, 7:Timeout error)
-	    }
-	    if (error_cat_rodmod) {
-	      has_err_cat_rodmod[error_cat_rodmod - 1] = true;
-	      if (!m_doOnline) {
-		all_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
-	      }
-	      if (getErrorCategory(error_cat_rodmod)!=99) has_err_cat[getErrorCategory(error_cat_rodmod)] = true;
-	    }
-	    if (getErrorState(bit, is_fei4) != 99) {
-	      if (!is_fei4) {
-		num_errors_per_state[getErrorState(bit, is_fei4)][pixlayer]++;
-	      } else {
-		num_errors_per_state[getErrorState(bit, is_fei4)-error_names_stateFEI3.size()][pixlayer]++;
-	      }
-	      error_maps_per_state[getErrorState(bit, is_fei4)].add(pixlayer, waferID, m_pixelid, 1.0);
-	    }
+      } else {
+	std::bitset<kNumErrorStatesFEI3> stateFEI4 = getErrorStateFE(fe_errorword, is_fei4);  
+	num_errors[pixlayer]+=stateFEI4.count();
+	for (unsigned int state = 0; state < stateFEI4.size(); ++state) {
+	  if (stateFEI4[state]) {
+	    num_errors_per_state[state][pixlayer]++;
+	    error_maps_per_state[state+kNumErrorStatesFEI3].add(pixlayer, waferID, m_pixelid, 1.0);
 	  }
 	}
-	// If we have bits generated by FE/MCC, count this error word.
-	if (has_femcc_errbits) num_femcc_errwords++;
       }
-    }
 
-    // Loop over IBL service records, FE-I4 only
-    if (is_fei4 && kFeSvcRecord.find(id_hash) != kFeSvcRecord.end()) {
-      // map of FE ID and a vector of pairs of associated service record and payload
-      std::map<unsigned int, std::vector<std::pair<int, unsigned int>>> map_svc_record = kFeSvcRecord.find(id_hash)->second;
-
-      for (const auto& [fe_id, svc_record_vec] : map_svc_record) {
-	for (const auto& [svc_record, payload_read] : svc_record_vec) {
-          const unsigned int payload = payload_read + 1;
-
-	  // svc_record starts from bit 8 of kNumErrorBitsIBL
-	  int bit = svc_record+8;
-	  
-	  num_errors[pixlayer] += payload;
-	  num_errors_per_bit[bit][pixlayer] += payload;
-
-	  int error_cat_rodmod = 0;
-	  if (bit == 8)                     error_cat_rodmod = 1;  // synchronization error   (8:BCID counter)
-	  if (bit == 24)                    error_cat_rodmod = 3;  // truncation error        (24:Truncated event)
-	  if (bit == 9 || bit == 10 ||                             // (9:Hamming code 0, 10:Hamming code 1,
-	      bit == 11 || bit == 32 ||                            // 12:Hamming code 2, 32:Triple redundant CNFGMEM,
-	      bit == 36 || bit == 37 ||                            // 36:Bit flip in CMD, 37:Triple redundant CMD,
-	      bit == 39)                                           // 39:Triple redundant EFUSE)
-	                                    error_cat_rodmod = 6;  // SEU error
-	  if (error_cat_rodmod) {
-	    has_err_cat_rodmod[error_cat_rodmod - 1] = true;
-	    if (!m_doOnline) {
-	      all_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
-	    }
-	    if (getErrorCategory(error_cat_rodmod)!=99) has_err_cat[getErrorCategory(error_cat_rodmod)] = true;
-	  }
-	  if (getErrorState(bit, is_fei4) != 99) {
-	    num_errors_per_state[getErrorState(bit, is_fei4)-error_names_stateFEI3.size()][pixlayer] += payload;
+    } // FE loop
+    if (!is_fei4) femcc_errwords_maps.add(pixlayer, waferID, m_pixelid, num_femcc_errwords);
 
-	    error_maps_per_state[getErrorState(bit, is_fei4)].add(pixlayer, waferID, m_pixelid, payload);
-	  }
-	  if (pixlayer==PixLayers::kIBL) {
-	    flagged_ibl_error_bits.push_back(bit);
+    // getting error information from service records (only IBL)
+    //
+    int state_offset(8); // serviceCode part starts from state 8 of kNumErrorStatesFEI4
+    const int serviceRecordFieldOffset = 17*maxHash;
+    if (pixlayer == PixLayers::kIBL) {
+      int moduleOffset = (modHash-156)*nFE;
+      for (int serviceCode=0; serviceCode<32; serviceCode++) {
+	// skip irrelevant SR's (as in rel21)
+	if ( (serviceCode >= 9 && serviceCode <=14) || (serviceCode >=17 && serviceCode <=23) ) { 
+	  state_offset--;
+	  continue;
+	}
+	int serviceCodeOffset = serviceCode*280*nFE;
+	for (int iFE=0; iFE<nFE; iFE++) {
+	  // index = offset + (serviceCode)*(#IBL*nFE) + (moduleHash-156)*nFE + FE
+          int serviceCodeCounterIndex = serviceRecordFieldOffset + serviceCodeOffset + moduleOffset + iFE;
+          uint64_t serviceCodeCounter = m_pixelCondSummaryTool->getBSErrorWord(serviceCodeCounterIndex, ctx);
+	  if (serviceCodeCounter>0) {
+
+	    float payload = serviceCodeCounter; // NB: + 1, as in rel 21, is now added upstream
+	    flagged_ibl_error_bits.push_back(serviceCode);
 	    weights_of_flagged_ibl_error_bits.push_back(payload);
+
+	    int state = serviceCode + state_offset;
+	    num_errors[pixlayer] += payload;
+	    num_errors_per_state[state][pixlayer] += payload;
+	    error_maps_per_state[state+kNumErrorStatesFEI3].add(pixlayer, waferID, m_pixelid, payload);
+	   
+	    fillErrorCatRODmod(serviceCode, payload, nerrors_cat_rodmod);
 	  }
-	}
-      } // end loop over service records
-    }
 
-    femcc_errwords_maps.add(pixlayer, waferID, m_pixelid, num_femcc_errwords);
+        } // over FE
+      } //over service codes
+    } // IBL modules
 
     // access categorized error information per module
-    // it is only flagged - the actual number of errors in the same category 
-    // is not tracked for those particular arrays
+    // it is only flagged - the actual number of errors per category is not tracked
     for (int i = 0; i < ErrorCategoryRODMOD::COUNT; i++) {
-      if (has_err_cat_rodmod[i]) {
+      if (nerrors_cat_rodmod[i]) {
+	if (getErrorCategory(i+1)!=99) has_err_cat[getErrorCategory(i+1)] = true;
 	num_errormodules_per_cat_rodmod[i][pixlayer]++;
-	if (!m_doOnline && i<ErrorCategoryRODMOD::kTruncROD+1) {
-	  error_maps_per_cat_rodmod[i].add(pixlayer, waferID, m_pixelid, 1.0);
-	  if (i==0) modsync_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
-	  if (i==1) rodsync_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
+	if (!m_doOnline) {
+	  all_errors_maps.add(pixlayer, waferID, m_pixelid, nerrors_cat_rodmod[i]);
+	  if (i<ErrorCategoryRODMOD::kTruncROD+1) {
+	    error_maps_per_cat_rodmod[i].add(pixlayer, waferID, m_pixelid, 1.0);
+	    if (i==0) modsync_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
+	    if (i==1) rodsync_errors_maps.add(pixlayer, waferID, m_pixelid, 1.0);
+	  }
 	}
       }
     }
@@ -376,27 +250,39 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
     // for IBL (and DBM) normalization is effectively done by number of FEI4 
     // REVIEW once per-FE active info is available
     //
-    if (m_pixelCondSummaryTool->isActive(id_hash) == true) {
+    if (m_pixelCondSummaryTool->isActive(modHash) == true) {
       if (pixlayer == PixLayers::kIBL && m_pixelid->eta_module(waferID)>-7 && m_pixelid->eta_module(waferID)<6) nActive_layer[pixlayer]+=2;
       else nActive_layer[pixlayer]++;
-    }   
-  }  // Loop over all pixel IDs (i.e. modules)
-
-  // Fill the accumulated maps.
-  for (unsigned int state = 0; state < error_names_stateFEI3.size()+error_names_stateFEI4.size(); state++) {
-    fill2DProfLayerAccum(error_maps_per_state[state]);
-    if (state < error_names_stateFEI3.size()) {
-      for (int i = 0; i < PixLayers::kIBL; i++) {
-	if (nActive_layer[i]>0) num_errors_per_state[state][i] /= nActive_layer[i];
+    }
+
+  } // loop over modules
+
+  // normalization by active modules (or FE's in IBL/DBM case)
+  //
+  for (int i = 0; i < PixLayers::COUNT; i++) {
+    if (nActive_layer[i]>0) {
+      for (int state = 0; state < numErrorStatesLayer[i]; state++) {
+	num_errors_per_state[state][i] /= nActive_layer[i];
       }
-      fill1DProfLumiLayers(error_names_stateFEI3[state] + std::string("_per_lumi"), lb, num_errors_per_state[state]);
-    } else {
-      for (int i = PixLayers::kIBL; i < PixLayers::COUNT; i++) {
-	if (nActive_layer[i]>0) num_errors_per_state[state-error_names_stateFEI3.size()][i] /= nActive_layer[i];
+      for (int cat = 0; cat < ErrorCategoryRODMOD::COUNT; cat++) {
+	num_errormodules_per_cat_rodmod[cat][i] /= nActive_layer[i];
+      }
+      for (int cat = 0; cat < ErrorCategory::COUNT; cat++) {
+	num_errormodules_per_cat[cat][i] /= nActive_layer[i];
       }
-      fill1DProfLumiLayers(error_names_stateFEI4[state-error_names_stateFEI3.size()] + std::string("_per_lumi"), lb, num_errors_per_state[state-error_names_stateFEI3.size()]);
     }
   }
+
+  for (unsigned int state = 0; state < kNumErrorStatesFEI3+kNumErrorStatesFEI4; state++) {
+    if ( state < kNumErrorStatesFEI3 ) {
+      fill2DProfLayerAccum(error_maps_per_state[state]);
+      fill1DProfLumiLayers(error_names_stateFEI3[state] + std::string("_per_lumi"), lb, num_errors_per_state[state], PixLayers::NFEI3LAYERS);
+    } else {
+      fill2DProfLayerAccum(error_maps_per_state[state]);
+      fill1DProfLumiLayers(error_names_stateFEI4[state-kNumErrorStatesFEI3] + std::string("_per_lumi"), lb, num_errors_per_state[state-kNumErrorStatesFEI3], PixLayers::COUNT - PixLayers::NFEI3LAYERS);
+    }
+  }
+  // Fill the accumulated maps
   fill2DProfLayerAccum(femcc_errwords_maps);
   fill2DProfLayerAccum(all_errors_maps);
   fill2DProfLayerAccum(modsync_errors_maps);
@@ -413,30 +299,12 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
   // Fill the luminosity error profiles for all layers.
   fill1DProfLumiLayers("errors_per_lumi", lb, num_errors);
 
-  // Fill the luminosity error profiles per error cat_rodmod for all layers.
-
   auto vals = Monitored::Collection( "ServiceRecord_val", flagged_ibl_error_bits );
   auto wgts = Monitored::Collection( "ServiceRecord_wgt", weights_of_flagged_ibl_error_bits );
   fill( errorGroup, vals, wgts);
 
-  // NORMALIZATION by active modules (or FE's in IBL/DBM case)
-  //
-  // Normalize error bit and cat histograms by active modules
-  for (int i = 0; i < PixLayers::COUNT; i++) {
-    if (nActive_layer[i]>0) {
-      for (int bit = 0; bit < numErrorBitsLayer[i]; bit++) {
-	num_errors_per_bit[bit][i] /= nActive_layer[i];
-      }
-      for (int cat = 0; cat < ErrorCategoryRODMOD::COUNT; cat++) {
-	num_errormodules_per_cat_rodmod[cat][i] /= nActive_layer[i];
-      }
-      for (int cat = 0; cat < ErrorCategory::COUNT; cat++) {
-	num_errormodules_per_cat[cat][i] /= nActive_layer[i];
-      }
-    }
-  }
   // Fill 2D luminosity error profiles per error bit and cat split by ROD/MOD for all layers.
-  fill2DProfLumiLayers("ErrorBit_per_lumi", lb, num_errors_per_bit, numErrorBitsLayer);
+  fill2DProfLumiLayers("ErrorState_per_lumi", lb, num_errors_per_state, numErrorStatesLayer);
   fill2DProfLumiLayers("ErrorCatRODMod_per_lumi", lb, num_errormodules_per_cat_rodmod, numErrorCatRODModsLayer);
 
   // Fill 1D luminosity error profiles for error catergory for all layers.
@@ -447,158 +315,9 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const
     fill1DProfLumiLayers(error_names_cat_norm[cat], lb, num_errormodules_per_cat[cat]);
   }
 
-  */
-
   return StatusCode::SUCCESS;
 }
 
-int PixelAthErrorMonAlg::getErrorState(int bit, bool isibl) const {
-  int erstate = 99;
-  if (!isibl) {
-    switch (bit) {
-      case 14:
-        erstate = 0;  // FE/MCC BCID1 Sync
-        break;
-      case 15:
-        erstate = 1;  // FE/MCC BCID2 Sync
-        break;
-      case 16:
-        erstate = 2;  // FE/MCC LVL1ID Sync
-        break;
-      case 20:
-        erstate = 3;  // ROD BCID Sync
-        break;
-      case 21:
-        erstate = 4;  // ROD LVL1ID Sync
-        break;
-      case 4:
-        erstate = 5;  // FE/MCC EoC Trunc
-        break;
-      case 12:
-        erstate = 6;  // FE/MCC Hit Overflow Trunc
-        break;
-      case 13:
-        erstate = 7;  // FE/MCC EoE Overflow Trunc
-        break;
-      case 1:
-        erstate = 8;  // ROD H/T Limit Trunc
-        break;
-      case 0:
-        erstate = 9;  // ROD Overflow Trunc
-        break;
-      case 23:
-        erstate = 10; // Preamble/Header
-        break;
-      case 5:
-        erstate = 11; // SEU Hit Parity
-        break;
-      case 6:
-        erstate = 12; // SEU Register Parity
-        break;
-      case 7:
-        erstate = 13; // SEU Hamming Code
-        break;
-      case 22:
-        erstate = 14; // ROD Formatter Timeout
-        break;
-      case 8:
-        erstate = 15; // FE Warning
-        break;
-      default:
-        erstate = 99;
-        break;
-    }
-  } else {
-    switch (bit) {
-      case 3:
-        erstate = 16;  // BCID, ROD Synch
-        break;
-      case 4:
-        erstate = 17;  // LVL1ID, ROD Synch
-        break;
-      case 8:
-        erstate = 18;  // BCID counter, FE Synch
-        break;
-      case 12:
-        erstate = 19;  // L1 trigger input in EODCL counter (write pointer), FE Synch
-        break;
-      case 13:
-        erstate = 20;  // L1 trigger request counter to EODCL (read pointer), FE Synch
-        break;
-      case 14:
-        erstate = 21;  // L1 register, register is full, FE Synch
-        break;
-      case 15:
-        erstate = 22;  // L1 trigger ID in BC register, FE Synch
-        break;
-      case 23:
-        erstate = 23;  // Skipped trigger because the L1 register is full, FE Synch
-        break;
-      case 0:
-        erstate = 24;  // Row/Column, ROD Trunc
-        break;
-      case 1:
-        erstate = 25;  // Limit error, ROD Trunc
-        break;
-      case 24:
-        erstate = 26; // Truncated event, FE Trunc
-        break;
-      case 5:
-        erstate = 27;  // Preamble error, ROD Optical
-        break;
-      case 9:
-        erstate = 28;  // Hamming code in word 0 in EOCHL, FE SEU
-        break;
-      case 10:
-        erstate = 29;  // Hamming code in word 1 in EOCHL, FE SEU
-        break;
-      case 11:
-        erstate = 30;  // Hamming code in word 2 in EOCHL, FE SEU
-        break;
-      case 32:
-        erstate = 31;  // Triple redundant mismatch in Global Configuration Memory (CNFGMEM,) FE SEU
-        break;
-      case 36:
-        erstate = 32;  // Bit flip in CMD, FE SEU
-        break;
-      case 37:
-        erstate = 33;  // Triple redundant mismatch in CMD, FE SEU
-        break;
-      case 39:
-        erstate = 34;  // Triple redundant mismatch in EFUSE, FE SEU
-        break;
-      case 2:
-        erstate = 35;  // Trailer error, ROD
-        break;
-      case 7:
-        erstate = 36;  // Timeout error, ROD
-        break;
-      case 6:
-        erstate = 37;  // Masked link, ROD
-        break;
-      case 16:
-        erstate = 38;  // Readout process error, FE
-        break;
-      case 33:
-        erstate = 39;  // Write register data error, FE
-        break;
-      case 34:
-        erstate = 40;  // Address error, FE
-        break;
-      case 35:
-        erstate = 41;  // Other CMD decoder error, FE
-        break;
-      case 38:
-        erstate = 42;  // Data bus address, FE
-        break;
-      default:
-        erstate = 99;
-        break;
-    }
-  }
-  return erstate;
-}
-
 int PixelAthErrorMonAlg::getErrorCategory(int error_cat_rodmod) const {
   int error_cat = 99;
   if (error_cat_rodmod == 1 || error_cat_rodmod == 2) error_cat = ErrorCategory::kSync;
@@ -608,3 +327,83 @@ int PixelAthErrorMonAlg::getErrorCategory(int error_cat_rodmod) const {
   if (error_cat_rodmod == 7) error_cat = ErrorCategory::kTout;
   return error_cat;
 }
+
+std::bitset<kNumErrorStatesFEI3> PixelAthErrorMonAlg::getErrorStateFEI3Mod(uint64_t errorword) const {
+  std::bitset<kNumErrorStatesFEI3> result(0);
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::TimeOut) )            result|= 1;
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::BCID) )               result|= 1<<1;
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::LVL1ID) )             result|= 1<<2;
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Preamble) )           result|= 1<<3;
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::RODTrailerBitError) ) result|= 1<<14;
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::RODHeaderLimit) )     result|= 1<<15;
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::RODDataOVerflow) )    result|= 1<<16;
+  return result;
+}
+
+std::bitset<kNumErrorStatesFEI3> PixelAthErrorMonAlg::getErrorStateFE(uint64_t errorword, bool is_fei4) const {
+  std::bitset<kNumErrorStatesFEI3> result(0);
+  if (!is_fei4) {
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCLVL1IDEoECheck) ) result|= 1<<4;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCBCIDEoECheck) )   result|= 1<<5;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCLVL1IDCheck) )    result|= 1<<6;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCEoEOverflow) )    result|= 1<<7;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCHitOverflow) )    result|= 1<<8;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FEWarning) )         result|= 1<<9;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FEHitParity) )       result|= 1<<10;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FERegisterParity) )  result|= 1<<11;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FEHammingCode) )     result|= 1<<12;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FEEoCOverflow) )     result|= 1<<13;
+  } else {
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::TimeOut) )           result|= 1;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::BCID) )              result|= 1<<1;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::LVL1ID) )            result|= 1<<2;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Preamble) )          result|= 1<<3;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Trailer) )           result|= 1<<4;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Invalid) )           result|= 1<<5;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::LinkMaskedByPPC) )   result|= 1<<6;
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Limit) )             result|= 1<<7;
+  }
+  return result;
+}
+
+void PixelAthErrorMonAlg::fillErrorCatRODmod(uint64_t errorword, int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT]) const {
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::TimeOut) )            nerrors_cat_rodmod[6]++; // timeout errors
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::BCID) )               nerrors_cat_rodmod[1]++; // ROD synchronization
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::LVL1ID) )             nerrors_cat_rodmod[1]++; // ROD synchronization
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Preamble) )           nerrors_cat_rodmod[4]++; // optical errors
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::RODHeaderLimit) )     nerrors_cat_rodmod[3]++; // ROD truncation
+  if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::RODDataOVerflow) )    nerrors_cat_rodmod[3]++; // ROD truncation
+}
+
+void PixelAthErrorMonAlg::fillErrorCatRODmod(uint64_t errorword, bool is_fei4, int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT]) const {
+  if (!is_fei4) {
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCLVL1IDEoECheck) ) nerrors_cat_rodmod[0]++;  // module synchronization
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCBCIDEoECheck) )   nerrors_cat_rodmod[0]++;  // ---
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCLVL1IDCheck) )    nerrors_cat_rodmod[0]++;  // ---
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCEoEOverflow) )    nerrors_cat_rodmod[2]++;  // module truncation
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::MCCHitOverflow) )    nerrors_cat_rodmod[2]++;  // ---
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FEEoCOverflow) )     nerrors_cat_rodmod[2]++;  // ---
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FEHitParity) )       nerrors_cat_rodmod[5]++;  // SEU (single event upset)
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FERegisterParity) )  nerrors_cat_rodmod[5]++;  // ---
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::FEHammingCode) )     nerrors_cat_rodmod[5]++;  // ---
+  } else {
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::TimeOut) )           nerrors_cat_rodmod[6]++; // timeout errors
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::BCID) )              nerrors_cat_rodmod[1]++; // ROD synchronization
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::LVL1ID) )            nerrors_cat_rodmod[1]++; // ROD synchronization
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Preamble) )          nerrors_cat_rodmod[4]++; // optical errors
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Trailer) )           nerrors_cat_rodmod[6]++; // timeout errors
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Invalid) )           nerrors_cat_rodmod[3]++; // ROD truncation
+    if ( PixelByteStreamErrors::hasError(errorword, PixelByteStreamErrors::Limit) )             nerrors_cat_rodmod[3]++; // ROD truncation
+  }
+}
+
+void PixelAthErrorMonAlg::fillErrorCatRODmod(int sc, int payload, int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT]) const {
+
+  if (sc == 0)                  nerrors_cat_rodmod[0]+=payload;  // synchronization error   (SR0:BCID counter)
+  if (sc == 16)                 nerrors_cat_rodmod[2]+=payload;  // truncation error        (SR16:Truncated event)
+  if (sc == 1 || sc == 2 ||                                      // (SR1:Hamming code 0, SR2:Hamming code 1,
+      sc == 3 || sc == 24 ||                                     // SR3:Hamming code 2, SR24:Triple redundant CNFGMEM,
+      sc == 28 || sc == 29 ||                                    // SR28:Bit flip in CMD, SR29:Triple redundant CMD,
+      sc == 31)                                                  // SR31:Triple redundant EFUSE)
+    nerrors_cat_rodmod[5]+=payload;                              // SEU error
+}
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h
index 76edf04142b4244134761308140916143d960306..b0332d5b3aaac31cc32d2c6b92173f0b3b3f7ae5 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.h
@@ -21,59 +21,59 @@ class ErrorCategoryRODMOD {
   enum ErrorCategoryRODMODID {kSyncMod = 0, kSyncROD, kTruncMod, kTruncROD, kOpt, kSeu, kTout, COUNT};
 };
 
-static const int kNumErrorBitsFEI3{32};
-static const int kNumErrorBitsFEI4{40};
+static const int kNumErrorStatesFEI3{17};
+static const int kNumErrorStatesFEI4{27};
 
-// error states = error bits we care about but also ordered differently
-// order and naming is inherited from Run 2
-// (all state histograms go into ErrorsExpert folder)
-static constexpr std::array<const char*, 16> error_names_stateFEI3 {
-    "Mod_Sync_BCID1_errors",
-    "Mod_Sync_BCID2_errors",
-    "Mod_Sync_LVL1ID_errors",
+// error states = enumerators of PixelByteStreamErrors and FEI4 SR's we care about
+//
+static constexpr std::array<const char*, kNumErrorStatesFEI3> error_names_stateFEI3 {
+    "ROD_Timeout",
     "ROD_Sync_BCID_errors",
     "ROD_Sync_LVL1ID_errors",
-    "Mod_Trunc_EOC_errors",
-    "Mod_Trunc_Hit_Overflow_errors",
-    "Mod_Trunc_EoE_Overflow_errors",
-    "ROD_Trunc_HT_Limit_errors",
-    "ROD_Trunc_ROD_OF_errors",
     "Optical_Errors",
+    "Mod_Sync_LVL1ID_errors",
+    "Mod_Sync_BCID2_errors",
+    "Mod_Sync_BCID1_errors",
+    "Mod_Trunc_EoE_Overflow_errors",
+    "Mod_Trunc_Hit_Overflow_errors",
+    "FE_Warning",
     "SEU_Hit_Parity",
     "SEU_Register_Parity",
     "SEU_Hamming",
-    "ROD_Timeout",
-    "FE_Warning"
+    "Mod_Trunc_EOC_errors",
+    "ROD_Trailer_Bit_errors",
+    "ROD_Trunc_HT_Limit_errors",
+    "ROD_Trunc_ROD_OF_errors"
 };
 
-static constexpr std::array<const char*, 27> error_names_stateFEI4 {
+static constexpr std::array<const char*, kNumErrorStatesFEI4> error_names_stateFEI4 {
+    "ROD_Timeout_errors",
     "ROD_BCID_errors",
     "ROD_LVL1ID_errors",
-    "SR_BCID_counter_errors",
-    "SR_L1_in_counter_errors",
-    "SR_L1_request_counter_errors",
-    "SR_L1_register_errors",
-    "SR_L1_Trigger_ID_errors",
-    "SR_Skippped_trig_count_errors",
-    "SR_Row-Column_errors",
-    "SR_Limit_errors",
-    "SR_Truncated_event_flag_errors",
     "ROD_Preamble_errors",
-    "SR_Hamming_code_0_errors",
-    "SR_Hamming_code_1_errors",
-    "SR_Hamming_code_2_errors",
-    "SR_Triple_redundant_errors_CNFGMEM",
-    "SR_CMD_decoder_bitflip_errors",
-    "SR_Triple_redundant_errors_CMD",
-    "SR_Triple_redundant_errors_EFUSE",
     "ROD_Trailer_errors",
-    "ROD_Timeout_errors",
-    "SR_Masked_link",
-    "SR_FE_readout_process_errors",
-    "SR_Write_reg_data_errors",
-    "SR Address_errors",
-    "SR_Other_CMD_decoder_errors",
-    "SR_Data_bus_address_errors"
+    "ROD_Row-Column_errors",
+    "ROD_Masked_link",
+    "ROD_Limit_errors",
+    "SR0_BCID_counter_errors",
+    "SR1_Hamming_code_0_errors",
+    "SR2_Hamming_code_1_errors",
+    "SR3_Hamming_code_2_errors",
+    "SR4_L1_in_counter_errors",
+    "SR5_L1_request_counter_errors",
+    "SR6_L1_register_errors",
+    "SR7_L1_Trigger_ID_errors",
+    "SR8_FE_readout_process_errors",
+    "SR15_Skippped_trig_count_errors",
+    "SR16_Truncated_event_flag_errors",
+    "SR24_Triple_redundant_errors_CNFGMEM",
+    "SR25_Write_reg_data_errors",
+    "SR26_Address_errors",
+    "SR27_Other_CMD_decoder_errors",
+    "SR28_CMD_decoder_bitflip_errors",
+    "SR29_Triple_redundant_errors_CMD",
+    "SR30_Data_bus_address_errors",
+    "SR31_Triple_redundant_errors_EFUSE"
 };
 
 static constexpr std::array<const char*, ErrorCategoryRODMOD::COUNT> error_names_cat_rodmod {
@@ -109,9 +109,9 @@ static constexpr std::array<const char*, ErrorCategory::COUNT> error_names_cat_n
   "TimeoutErrorsFrac_per_event"
 };
 
-static const int numErrorBitsLayer[PixLayers::COUNT] = {
-  kNumErrorBitsFEI3, kNumErrorBitsFEI3, kNumErrorBitsFEI3, kNumErrorBitsFEI3,
-  kNumErrorBitsFEI3, kNumErrorBitsFEI4, kNumErrorBitsFEI4, kNumErrorBitsFEI4
+static const int numErrorStatesLayer[PixLayers::COUNT] = {
+  kNumErrorStatesFEI3, kNumErrorStatesFEI3, kNumErrorStatesFEI3, kNumErrorStatesFEI3,
+  kNumErrorStatesFEI3, kNumErrorStatesFEI4, kNumErrorStatesFEI4, kNumErrorStatesFEI4
 };
 static const int kNumErrorCatRODMods{ErrorCategoryRODMOD::COUNT};
 static const int numErrorCatRODModsLayer[PixLayers::COUNT] = {
@@ -128,8 +128,12 @@ class PixelAthErrorMonAlg : public PixelAthMonitoringBase {
   virtual StatusCode initialize() override;
   virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
   std::string findComponentString(int bec, int ld) const;
-  int getErrorState(int bit, bool isibl) const;
   int getErrorCategory(int error_cat_rodmod) const;
+  std::bitset<kNumErrorStatesFEI3> getErrorStateFEI3Mod(uint64_t errorword) const;
+  std::bitset<kNumErrorStatesFEI3> getErrorStateFE(uint64_t errorword, bool isibl) const;
+  void fillErrorCatRODmod(uint64_t mod_errorword, int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT]) const;
+  void fillErrorCatRODmod(uint64_t fe_errorword, bool is_fei4, int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT]) const;
+  void fillErrorCatRODmod(int servicecode, int payload, int (&nerrors_cat_rodmod)[ErrorCategoryRODMOD::COUNT]) const;
 
  private:
 
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx
index ec74ca188073886e693419a73dbb19da0128a77b..a7a417d6baa6ff1f3e85122cea765dca9132b274 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx
@@ -63,14 +63,18 @@ void PixelAthMonitoringBase::fill2DProfLayerAccum( const VecAccumulator2DMap& ac
 ///
 /// filling 1DProf per-lumi per-layer histograms ["ECA","ECC","B0","B1","B2","IBL","DBMA","DBMC"]
 ///
-void PixelAthMonitoringBase::fill1DProfLumiLayers( const std::string& prof1Dname, int lumiblock, float* values) const {
+void PixelAthMonitoringBase::fill1DProfLumiLayers( const std::string& prof1Dname, int lumiblock, float* values, int nlayers) const {
   ATH_MSG_VERBOSE( "in fill1DProfLumiLayers()" );
 
   // Define the monitored variables
   auto lb = Monitored::Scalar<int>( prof1Dname + "_lb", lumiblock );
   auto val = Monitored::Scalar<float>( prof1Dname + "_val", 1.0);
 
-  for (int i = 0; i < PixLayers::COUNT; i++) {
+  int i_start = 0;
+  int i_end   = PixLayers::COUNT;
+  if (nlayers == PixLayers::NFEI3LAYERS) i_end = nlayers;
+  if (nlayers == PixLayers::COUNT - PixLayers::NFEI3LAYERS) i_start = PixLayers::NFEI3LAYERS;
+  for (int i = i_start; i < i_end; i++) {
     val = values[i];
     fill( pixLayersLabel[i], lb, val);
   }
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h
index c7fe10d5b2e9642b060c9b6ebeed55c7dfdd25e5..11283f3c0a129c5c9a81b425949491c9ceedcf42 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h
@@ -14,7 +14,7 @@ class PixelID;
 
 class PixLayers {
  public:
-  enum PixLayersID {kECA = 0, kECC, kB0, kB1, kB2, kIBL, kDBMA, kDBMC, COUNT};
+  enum PixLayersID {kECA = 0, kECC, kB0, kB1, kB2, kIBL, NFEI3LAYERS=kIBL, kDBMA, kDBMC, COUNT};
 };
 const std::string pixLayersLabel[PixLayers::COUNT] = {"ECA", "ECC", "B0", "B1", "B2", "IBL", "DBMA", "DBMC"};
 const float inv_nmod_per_layer[PixLayers::COUNT] = {1./144., 1./144., 1./286., 1./494., 1./676., 1./448., 1./12., 1./12.};
@@ -41,7 +41,7 @@ namespace PixMon {
 class PixelAthMonitoringBase : public virtual AthMonitorAlgorithm {
 
  public:
-  void fill1DProfLumiLayers( const std::string& prof1Dname, int lb, float* weights ) const;
+  void fill1DProfLumiLayers( const std::string& prof1Dname, int lb, float* weights, int nlayers = PixLayers::COUNT ) const;
   void fill2DProfLumiLayers( const std::string& prof2Dname, int lb, float (*weights)[PixLayers::COUNT], const int* nCategories ) const;
 
   int getPixLayersID(int ec, int ld) const;
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
index 9c1f3618f2c870abd2a43738dae0d37bbefac4e1..aa5be16e52a586e39a7c14ccc85762c864510ec9 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
@@ -1,81 +1,24 @@
-################################################################################
-# Package: InDetPhysValMonitoring
-################################################################################
-
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetPhysValMonitoring )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/AthenaMonitoring
-                          Control/CxxUtils
-			  DetectorDescription/AtlasDetDescr
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTruth
-                          GaudiKernel
-			  InnerDetector/InDetDetDescr/InDetIdentifier
-			  InnerDetector/InDetDetDescr/InDetReadoutGeometry
-			  InnerDetector/InDetDetDescr/TRT_ReadoutGeometry
-                          InnerDetector/InDetRecTools/InDetTrackSelectionTool
-                          PhysicsAnalysis/AnalysisCommon/PATCore
-                          Tracking/TrkValidation/TrkValHistUtils
-                          PRIVATE
-                          Control/AthToolSupport/AsgTools
-                          Control/AthenaKernel
-                          Control/AthContainers
-                          Control/StoreGate
-                          DetectorDescription/GeoPrimitives
-                          Event/EventPrimitives
-                          Event/xAOD/xAODBase
-                          Event/xAOD/xAODEventInfo
-                          Event/xAOD/xAODJet
-                          InnerDetector/InDetConditions/BeamSpotConditionsData
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          InnerDetector/InDetRecEvent/InDetRIO_OnTrack
-                          PhysicsAnalysis/MCTruthClassifier
-                          Tools/PathResolver
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkExtrapolation/TrkExInterfaces
-                          Tracking/TrkTools/TrkToolInterfaces 
-                          InnerDetector/InDetValidation/InDetTruthVertexValidation )
-                          
-
 # External dependencies:
-find_package( Eigen )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread EG )
 find_package( Boost COMPONENTS unit_test_framework )
 find_package( XercesC )
 
-
 # Component(s) in the package:
 atlas_add_library( InDetPhysValMonitoringLib
                    src/*.cxx
                    PUBLIC_HEADERS InDetPhysValMonitoring
-                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS}   ${EIGEN_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES}  ${EIGEN_LIBRARIES} 
-                   AthenaBaseComps AthenaMonitoringLib CxxUtils AtlasDetDescr xAODTracking xAODTruth GaudiKernel InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry
-                   InDetTrackSelectionToolLib PATCoreLib TrkValHistUtils
-                   PRIVATE_LINK_LIBRARIES AsgTools AthenaKernel GeoPrimitives EventPrimitives 
-                   xAODBase xAODEventInfo xAODJet InDetPrepRawData InDetRIO_OnTrack
-                   AthContainers StoreGateLib
-                   MCTruthClassifierLib PathResolver TrkEventPrimitives TrkParameters TrkTrack TrkExInterfaces TrkToolInterfaces InDetTruthVertexValidationLib BeamSpotConditionsData )
+                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS}
+                   LINK_LIBRARIES AthenaBaseComps AthenaKernel AthenaMonitoringLib AtlasDetDescr BeamSpotConditionsData CxxUtils GaudiKernel InDetIdentifier InDetTrackSelectionToolLib InDetTruthVertexValidationLib MCTruthClassifierLib TrkValHistUtils TRT_ReadoutGeometry xAODBase xAODEventInfo xAODJet xAODTracking xAODTruth
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} AsgTools AthContainers EventPrimitives GeoPrimitives InDetPrepRawData InDetRIO_OnTrack PATCoreAcceptLib PathResolver StoreGateLib TrkEventPrimitives TrkExInterfaces TrkParameters TrkSurfaces TrkToolInterfaces TrkTrack )
 
 atlas_add_component( InDetPhysValMonitoring
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS}  ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES}  ${EIGEN_LIBRARIES} 
-                     AthenaBaseComps AthenaMonitoringLib CxxUtils xAODTracking xAODTruth GaudiKernel PATCoreLib 
-                     TrkValHistUtils AsgTools AthenaKernel AtlasDetDescr GeoPrimitives EventPrimitives 
-                     xAODBase xAODEventInfo xAODJet InDetIdentifier InDetPrepRawData InDetRIO_OnTrack 
-                     MCTruthClassifierLib PathResolver TrkEventPrimitives TrkParameters TrkTrack TrkExInterfaces TrkToolInterfaces InDetPhysValMonitoringLib InDetTruthVertexValidationLib BeamSpotConditionsData )
-
-
-
-
+                     LINK_LIBRARIES InDetPhysValMonitoringLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
@@ -99,25 +42,24 @@ atlas_add_test( SingleHistogramDefinition_test
 atlas_add_test( HistogramDefinitionSvc_test
                 SOURCES
                 test/HistogramDefinitionSvc_test.cxx
-                INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
-                LINK_LIBRARIES ${Boost_LIBRARIES} InDetPhysValMonitoringLib
+                INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CxxUtils TestTools InDetPhysValMonitoringLib
                 POST_EXEC_SCRIPT "nopost.sh"
 )
 
 atlas_add_test( XmlEntityInclusion_test
                 SOURCES
                 test/XmlEntityInclusion_test.cxx
-                INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
-                LINK_LIBRARIES ${Boost_LIBRARIES} InDetPhysValMonitoringLib
+                INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CxxUtils TestTools InDetPhysValMonitoringLib
                 POST_EXEC_SCRIPT "nopost.sh"
 )
 
 atlas_add_test( InDetPlotBase_test
                 SOURCES
                 test/InDetPlotBase_test.cxx
-                INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
-                LINK_LIBRARIES ${Boost_LIBRARIES} InDetPhysValMonitoringLib
+                INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CxxUtils TestTools xAODTracking InDetPhysValMonitoringLib
                 POST_EXEC_SCRIPT "nopost.sh"
 )
 
-
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py
index e6162297b276e2a167c6eb1370510b647bcaeb21..ba7cb9e488399805fad43827b9b6b7374dd3085c 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py
@@ -32,7 +32,10 @@ print(InDetPhysValFlags)
 # Set up the I/O and the RecExCommon infrastructure 
 from InDetRecExample.InDetJobProperties import InDetFlags
 InDetFlags.doSlimming.set_Value_and_Lock(False)
+# Need to turn of explicitly some subsystems which otherwise
+# cause difficulties when running on ESD
 rec.doTrigger.set_Value_and_Lock(False)
+rec.doMuon.set_Value_and_Lock(False)
 include( "AthenaPython/iread_file.py" )
 
 # Add our monitoring manager to the topSequence
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx
index 371722d08458c3aaa6de50c7ad5200bc521b6ed8..cf279e1a3dc0255b3be28dff73f5c6f65f015d27 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx
@@ -90,6 +90,8 @@ InDetRttPlots::InDetRttPlots(InDetPlotBase* pParent, const std::string& sDir, co
       }
     }
   }
+  /// update detail level of all the child tools 
+  setDetailLevel(m_iDetailLevel); 
 }
 
 //
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh
index e61afe00cf7cc2d11ebb3c788cdd4366e7b90097..3605908b50be62e043c2fb29bc9f0815b5c4f305 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh
index ed71b2246d16ba5369904c923aebc0ab0108c639..7ca9caf2638e514e32c254f26fd6136827cdf877 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh
index 962c16b4c8de751a3362daded41d6940eea3a00a..899d1c0b03127b45f66d54b0263999aed716ea15 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh
index ea3ed5ec4f94c06e7aaf23110c92c88e1087c7a2..ac3a43728eb6de16a12cda479eb88b6b05974b66 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh
@@ -4,7 +4,9 @@
 # art-input: user.keli:user.keli.mc16_13TeV.422036.ParticleGun_single_mu_Pt100.merge.EVNT.e7967_e5984_tid20254953_00
 # art-input-nfiles: 1
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
+# art-output: SiHitValid*.root
+# art-output: *Analysis*.root
 # art-output: *.xml 
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh
index ba6a38f08e35f7da424d4ee710e2fbf890383bf4..2a325ee3c45f04757fd2b55ce9e3e87bb3a2293f 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
index 7bdf4995388166963efeeae22d1488b712550f46..5f6a5395e61111a52e86207404cd8881014cf6d8 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh
index 4e2107e62e37d66faba241e236495013c24372bd..5a25d19ef139760187ac5c97ad9f62f556ffb90f 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh
@@ -4,7 +4,9 @@
 # art-input: user.keli:user.keli.mc16_13TeV.422032.ParticleGun_single_mu_Pt1.merge.EVNT.e7967_e5984_tid20254902_00
 # art-input-nfiles: 1
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
+# art-output: SiHitValid*.root
+# art-output: *Analysis*.root
 # art-output: *.xml 
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
index f554ae9ce8bd1b453078df350e9207c2f8ee4f8f..89526f1b985750f5991279e53d5453f2bc20066f 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh
index 1eeda3849c957ab498055e74989856a30efd902b..dac0d24291ba1dca14df604e58307cfbc832f41f 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh
@@ -4,7 +4,9 @@
 # art-input: user.keli:user.keli.mc16_13TeV.422035.ParticleGun_single_mu_Pt20.merge.EVNT.e7967_e5984_tid20255021_00
 # art-input-nfiles: 1
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
+# art-output: SiHitValid*.root
+# art-output: *Analysis*.root
 # art-output: *.xml 
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh
index 12d120f167655ee8f2297529fb97b499c60c7488..f4f6d28a4977ee894f7c719e0f9279374cc3cf47 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh
@@ -4,7 +4,9 @@
 # art-input: user.keli:user.keli.mc16_13TeV.422033.ParticleGun_single_mu_Pt5.merge.EVNT.e7967_e5984_tid20254920_00
 # art-input-nfiles: 1
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
+# art-output: SiHitValid*.root
+# art-output: *Analysis*.root
 # art-output: *.xml 
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
index 772ea143b84922207cccea7cd26548f15a0fcbe7..e6c1e12e40d5f3a87f2569bbb1b1b6f008dfba37 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh
index 300a74242c095e219abb9ca57471ec229f68dea4..d627e7cd19eb6c8b1b0b419586666340f65d36cc 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh
@@ -4,7 +4,9 @@
 # art-input: user.keli:user.keli.mc16_13TeV.422047.ParticleGun_single_piplus_Pt1.merge.EVNT.e7967_e5984_tid20255138_00
 # art-input-nfiles: 1
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
+# art-output: SiHitValid*.root
+# art-output: *Analysis*.root
 # art-output: *.xml 
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
index 97f7087f92f41059818d859a7e089da4d1c54ce3..2674d37d67b126487ccc2116bb494b58a98fed1c 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
@@ -6,9 +6,9 @@
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml 
-# art-output: art_core_*
+# art-output: art_core_0
 # art-output: dcube*
 
 set -x
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh
index 3585eb5ca189c4ad134ffc9f4fb4d29a0467c738..259609bcdb57d873ec68314c84f754358f0cf840 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh
@@ -4,7 +4,9 @@
 # art-input: user.keli:user.keli.mc16_13TeV.422048.ParticleGun_single_piplus_Pt5.merge.EVNT.e7967_e5984_tid20255154_00
 # art-input-nfiles: 1
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
+# art-output: SiHitValid*.root
+# art-output: *Analysis*.root
 # art-output: *.xml 
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU0_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU0_reco.sh
index 9c1e678c08bdf300d5a445b4941d3dc58abebe6a..ba2c8bb8c111408ecc7b5001aefaa49d0622afe6 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU0_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU0_reco.sh
@@ -2,7 +2,7 @@
 # art-description: Standard test for Run2 with ttbar input, PU=0
 # art-type: grid
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU40_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU40_reco.sh
index e867491661fe1e90c55d6aeba71ad8afcb37fc71..a8205843d45d40f66f88d59fd92aec2037d973dc 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU40_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU40_reco.sh
@@ -2,7 +2,7 @@
 # art-description: Standard test for Run2 with ttbar input, PU=40
 # art-type: grid
 # art-include: master/Athena
-# art-output: *.root
+# art-output: physval*.root
 # art-output: *.xml
 # art-output: dcube*
 
diff --git a/InnerDetector/InDetValidation/InDetRecStatistics/CMakeLists.txt b/InnerDetector/InDetValidation/InDetRecStatistics/CMakeLists.txt
index 33e712d32184b9efd619b94b6f421c271cde4c13..8b2e7a3fc6b5ccda32c0fd255617545b46b702f0 100644
--- a/InnerDetector/InDetValidation/InDetRecStatistics/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetRecStatistics/CMakeLists.txt
@@ -1,35 +1,8 @@
-################################################################################
-# Package: InDetRecStatistics
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetRecStatistics )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          DetectorDescription/Identifier
-                          GaudiKernel
-                          Generators/GeneratorObjects
-                          Generators/AtlasHepMC
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkEvent/TrkTrackSummary
-                          PRIVATE
-                          DetectorDescription/AtlasDetDescr
-                          DetectorDescription/IdDictDetDescr
-                          Generators/GenAnalysisTools/TruthHelper
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetRecEvent/InDetRIO_OnTrack
-                          Tracking/TrkDetDescr/TrkSurfaces
-                          Tracking/TrkEvent/TrkCompetingRIOsOnTrack
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkEventUtils
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkRIO_OnTrack
-                          Tracking/TrkEvent/TrkTruthData
-                          Tracking/TrkEvent/VxVertex
-                          Tracking/TrkTools/TrkToolInterfaces )
-
 # External dependencies:
 find_package( CLHEP )
 find_package( HepPDT )
@@ -42,6 +15,4 @@ atlas_add_component( InDetRecStatistics
                      LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps Identifier GaudiKernel GeneratorObjects TrkTrack TrkTrackSummary AtlasDetDescr IdDictDetDescr TruthHelper InDetIdentifier InDetRIO_OnTrack TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkEventUtils TrkParameters TrkRIO_OnTrack TrkTruthData VxVertex TrkToolInterfaces )
 
 # Install files from the package:
-atlas_install_headers( InDetRecStatistics )
 atlas_install_joboptions( share/*.py )
-
diff --git a/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/CMakeLists.txt b/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/CMakeLists.txt
index a48fa89d6ad5cdca4216c22fac46ef26b21364bf..69089b0daab1755c0a4eb6e222924fe34587ed66 100644
--- a/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/CMakeLists.txt
@@ -1,24 +1,8 @@
-################################################################################
-# Package: InDetSegmentDriftCircleAssValidation
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetSegmentDriftCircleAssValidation )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          Tracking/TrkEvent/TrkSegment
-                          Tracking/TrkEvent/TrkTruthData
-                          PRIVATE
-                          Control/StoreGate
-                          InnerDetector/InDetRecEvent/InDetRIO_OnTrack
-                          Tracking/TrkEvent/TrkPseudoMeasurementOnTrack
-                          Tracking/TrkEvent/TrkTrack 
-                          Generators/AtlasHepMC )
-
 # External dependencies:
 find_package( HepPDT )
 
@@ -27,8 +11,4 @@ atlas_add_component( InDetSegmentDriftCircleAssValidation
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} 
-                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel InDetPrepRawData TrkSegment TrkTruthData InDetRIO_OnTrack TrkPseudoMeasurementOnTrack TrkTrack )
-
-# Install files from the package:
-atlas_install_headers( InDetSegmentDriftCircleAssValidation )
-
+                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel InDetPrepRawData TrkSegment TrkTruthData InDetRIO_OnTrack StoreGateLib TrkPseudoMeasurementOnTrack TrkTrack )
diff --git a/InnerDetector/InDetValidation/InDetTrackClusterAssValidation/CMakeLists.txt b/InnerDetector/InDetValidation/InDetTrackClusterAssValidation/CMakeLists.txt
index 1876f3624f686391a16bae96e047f02a59d4084a..c4fc182c45b49deeb69f8b3987595e27c41852ee 100644
--- a/InnerDetector/InDetValidation/InDetTrackClusterAssValidation/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetTrackClusterAssValidation/CMakeLists.txt
@@ -1,24 +1,8 @@
-################################################################################
-# Package: InDetTrackClusterAssValidation
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetTrackClusterAssValidation )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/CxxUtils
-                          Control/StoreGate
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          Tracking/TrkEvent/TrkSpacePoint
-                          Tracking/TrkEvent/TrkTruthData
-                          PRIVATE
-                          GaudiKernel
-                          Tracking/TrkEvent/TrkRIO_OnTrack
-                          Tracking/TrkEvent/TrkTrack 
-                          Generators/AtlasHepMC )
-
 # External dependencies:
 find_package( HepPDT )
 
diff --git a/InnerDetector/InDetValidation/InDetTrackSplitterTool/CMakeLists.txt b/InnerDetector/InDetValidation/InDetTrackSplitterTool/CMakeLists.txt
index 6934a6aa2f9c4a6f59e98c9eb8bcf26bd2fe51fc..8aa9eab1228ec669e010b3e85925d33f65b730fe 100644
--- a/InnerDetector/InDetValidation/InDetTrackSplitterTool/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetTrackSplitterTool/CMakeLists.txt
@@ -1,30 +1,8 @@
-################################################################################
-# Package: InDetTrackSplitterTool
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetTrackSplitterTool )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          Tracking/TrkEvent/TrkTrack
-                          PRIVATE
-                          DetectorDescription/GeoPrimitives
-                          Event/EventPrimitives
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetRecEvent/InDetRIO_OnTrack
-                          Tracking/TrkDetDescr/TrkSurfaces
-                          Tracking/TrkEvent/TrkCompetingRIOsOnTrack
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkMeasurementBase
-                          Tracking/TrkEvent/TrkPseudoMeasurementOnTrack
-                          Tracking/TrkFitter/TrkFitterInterfaces )
-
-# External dependencies:
-find_package( Eigen )
-
 atlas_add_library( InDetTrackSplitterToolLib
                    CInDetTrackSplitterTool/*.h
                    INTERFACE
@@ -35,6 +13,4 @@ atlas_add_library( InDetTrackSplitterToolLib
 atlas_add_component( InDetTrackSplitterTool
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} InDetTrackSplitterToolLib GeoPrimitives EventPrimitives InDetIdentifier InDetRIO_OnTrack TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkMeasurementBase TrkPseudoMeasurementOnTrack TrkFitterInterfaces )
-
+                     LINK_LIBRARIES InDetTrackSplitterToolLib GaudiKernel GeoPrimitives EventPrimitives InDetIdentifier InDetRIO_OnTrack TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkMeasurementBase TrkPseudoMeasurementOnTrack TrkFitterInterfaces )
diff --git a/InnerDetector/InDetValidation/InDetTrackValidation/CMakeLists.txt b/InnerDetector/InDetValidation/InDetTrackValidation/CMakeLists.txt
index ed8857670885ee1bdaac5a503245a758b44ad6e7..dcf94f6f01c02ad8b5a24ffe16bc26a578bd6c05 100644
--- a/InnerDetector/InDetValidation/InDetTrackValidation/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetTrackValidation/CMakeLists.txt
@@ -1,51 +1,8 @@
-################################################################################
-# Package: InDetTrackValidation
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetTrackValidation )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   Control/AthenaBaseComps
-   Control/AthenaKernel
-   Control/CxxUtils
-   Control/StoreGate
-   Event/xAOD/xAODEventInfo
-   GaudiKernel
-   InnerDetector/InDetRawEvent/InDetRawData
-   InnerDetector/InDetRecEvent/InDetPrepRawData
-   InnerDetector/InDetSimEvent
-   Tracking/TrkEvent/TrkParameters
-   Tracking/TrkEvent/TrkSpacePoint
-   Tracking/TrkEvent/TrkTrack
-   Tracking/TrkValidation/TrkValInterfaces
-   PRIVATE
-   Control/AthContainers
-   DetectorDescription/AtlasDetDescr
-   DetectorDescription/GeoModel/GeoModelInterfaces
-   Event/EventPrimitives
-   Generators/GeneratorObjects
-   Generators/AtlasHepMC
-   InnerDetector/InDetConditions/InDetBeamSpotService
-   InnerDetector/InDetConditions/InDetConditionsSummaryService
-   InnerDetector/InDetConditions/PixelConditionsTools
-   InnerDetector/InDetConditions/SCT_ConditionsTools
-   InnerDetector/InDetConditions/TRT_ConditionsData
-   InnerDetector/InDetConditions/TRT_ConditionsServices
-   InnerDetector/InDetDetDescr/InDetIdentifier
-   InnerDetector/InDetDetDescr/InDetReadoutGeometry
-   InnerDetector/InDetDetDescr/SCT_Cabling
-   InnerDetector/InDetRecEvent/InDetRIO_OnTrack
-   InnerDetector/InDetValidation/InDetTrackSplitterTool
-   Tracking/TrkDetDescr/TrkSurfaces
-   Tracking/TrkEvent/TrkEventPrimitives
-   Tracking/TrkEvent/TrkMeasurementBase
-   Tracking/TrkEvent/TrkPrepRawData
-   Tracking/TrkEvent/TrkRIO_OnTrack
-   Tracking/TrkTools/TrkToolInterfaces )
-
 # External dependencies:
 find_package( CLHEP )
 find_package( ROOT COMPONENTS Core Tree MathCore )
@@ -53,12 +10,8 @@ find_package( ROOT COMPONENTS Core Tree MathCore )
 # Component(s) in the package:
 atlas_add_component( InDetTrackValidation
    InDetTrackValidation/*.h src/*.cxx src/components/*.cxx
-   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} 
-   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib
-   AthenaBaseComps AthenaKernel CxxUtils StoreGateLib SGtests xAODEventInfo GaudiKernel InDetRawData InDetPrepRawData
-   InDetSimEvent TrkParameters TrkSpacePoint TrkTrack TrkValInterfaces AthContainers AtlasDetDescr
-   EventPrimitives GeneratorObjects TRT_ConditionsData
-   TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry SCT_CablingLib
-   InDetRIO_OnTrack TrkSurfaces TrkEventPrimitives TrkMeasurementBase
-   TrkPrepRawData TrkRIO_OnTrack TrkToolInterfaces SCT_ConditionsToolsLib
-   InDetTrackSplitterToolLib )
+   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AthenaBaseComps AthenaKernel
+   AtlasDetDescr CxxUtils EventPrimitives GaudiKernel InDetIdentifier InDetPrepRawData
+   InDetRIO_OnTrack InDetRawData InDetReadoutGeometry InDetTrackSplitterToolLib SCT_CablingLib
+   SCT_ConditionsToolsLib StoreGateLib TrkMeasurementBase TrkSpacePoint TrkToolInterfaces TrkTrack xAODEventInfo )
diff --git a/InnerDetector/InDetValidation/InDetTruthVertexValidation/CMakeLists.txt b/InnerDetector/InDetValidation/InDetTruthVertexValidation/CMakeLists.txt
index fab173e34b7df627866ad82d8cb8147fd8fdece8..a9fb8042519e083a686332a47226d9a14e800752 100644
--- a/InnerDetector/InDetValidation/InDetTruthVertexValidation/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetTruthVertexValidation/CMakeLists.txt
@@ -1,34 +1,17 @@
-################################################################################
-# Package: InDetTruthVertexValidation
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetTruthVertexValidation )
 
 # Extra dependencies, based on the build environment:
-set( extra_deps )
 set( extra_libs )
 if( XAOD_STANDALONE )
-   set( extra_deps Control/xAODRootAccess
-                   PhysicsAnalysis/D3PDTools/EventLoop )
    set( extra_libs xAODRootAccess EventLoop )
 else()
-   set( extra_deps PRIVATE Control/AthenaBaseComps PhysicsAnalysis/POOLRootAccess GaudiKernel )
    set( extra_libs AthAnalysisBaseCompsLib )
 endif()
 
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthToolSupport/AsgTools
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTruth
-                          Event/EventPrimitives
-                          Event/xAOD/xAODEventInfo
-                          ${extra_deps} )
-
 # External dependencies:
-find_package( Eigen )
 find_package( ROOT COMPONENTS Core Tree Hist RIO )
 
 # Generate a CINT dictionary source file:
@@ -41,15 +24,14 @@ atlas_add_root_dictionary( InDetTruthVertexValidationLib _cintDictSource
 atlas_add_library( InDetTruthVertexValidationLib
                    Root/*.cxx ${_cintDictSource}
                    PUBLIC_HEADERS InDetTruthVertexValidation
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} 
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} EventPrimitives xAODTracking AsgTools xAODEventInfo xAODTruth ${extra_libs})
+                   PRIVATE_LINK_LIBRARIES ${extra_libs}
+                   LINK_LIBRARIES AsgTools xAODTracking xAODTruth )
 
 if( NOT XAOD_STANDALONE )
     atlas_add_component( InDetTruthVertexValidation
-                     src/*.cxx src/*.h
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} ${extra_libs} EventPrimitives xAODTracking AthenaBaseComps AsgTools xAODEventInfo xAODTruth InDetTruthVertexValidationLib )
+                         src/*.cxx src/*.h
+                         src/components/*.cxx
+                         LINK_LIBRARIES ${extra_libs} GaudiKernel xAODTracking AthenaBaseComps AsgTools InDetTruthVertexValidationLib )
 endif()
 
 # Install files from the package:
@@ -58,6 +40,7 @@ atlas_install_joboptions( share/*.py )
 if( XAOD_STANDALONE )
     atlas_add_executable( VertexTruthMatchTest
                       util/VertexTruthMatchTest.cxx
-                      LINK_LIBRARIES InDetTruthVertexValidationLib xAODTracking xAODEventInfo xAODRootAccess ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} ${extra_libs})
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                      LINK_LIBRARIES InDetTruthVertexValidationLib xAODTracking xAODEventInfo xAODRootAccess ${ROOT_LIBRARIES} ${extra_libs} )
 endif()
 
diff --git a/InnerDetector/InDetValidation/InDetVertexSplitter/CMakeLists.txt b/InnerDetector/InDetValidation/InDetVertexSplitter/CMakeLists.txt
index 04e67a9f8ead88b6d30be795b10098debb550fed..28157edf433e9bce81478197f21cdcce05587efb 100644
--- a/InnerDetector/InDetValidation/InDetVertexSplitter/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetVertexSplitter/CMakeLists.txt
@@ -1,23 +1,10 @@
-################################################################################
-# Package: InDetVertexSplitter
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( InDetVertexSplitter )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/AthenaBaseComps
-                          Event/xAOD/xAODEventInfo
-                          GaudiKernel
-                          Generators/GeneratorObjects
-                          Reconstruction/Particle
-                          Tracking/TrkEvent/TrkParticleBase
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkEvent/VxVertex )
-
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
+find_package( ROOT COMPONENTS Core Tree Minuit )
 
 # Component(s) in the package:
 atlas_add_component( InDetVertexSplitter
diff --git a/InnerDetector/InDetValidation/PixelRTT/CMakeLists.txt b/InnerDetector/InDetValidation/PixelRTT/CMakeLists.txt
index 467e7d59cc460d6e830c6721ffdfcd639abbacbf..834f8e911a5c67430d33bf57748a46498bbb4a37 100644
--- a/InnerDetector/InDetValidation/PixelRTT/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/PixelRTT/CMakeLists.txt
@@ -1,18 +1,8 @@
-################################################################################
-# Package: PixelRTT
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( PixelRTT )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   InnerDetector/InDetCalibAlgs/PixelCalibAlgs
-   PRIVATE
-   InnerDetector/InDetConditions/PixelConditionsData
-   Tools/PathResolver )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core MathCore Hist RIO Gpad )
 
@@ -21,12 +11,12 @@ atlas_add_library( PixelValidation
    PixelRTT/*.h src/*.cxx
    PUBLIC_HEADERS PixelRTT
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} PixelCalibAlgsLib
+   LINK_LIBRARIES ${ROOT_LIBRARIES} CxxUtils PixelCalibAlgsLib
    PRIVATE_LINK_LIBRARIES PixelConditionsData PathResolver )
 
 atlas_add_executable( doPixelValidation
    Application/doPixelValidation.cxx
-   LINK_LIBRARIES PixelValidation )
+   LINK_LIBRARIES CxxUtils PixelValidation )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
diff --git a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
index 67f208ab6657eca7765dd622313b6a70419eeb02..d618eea46716da3773a124645eb2303ca0490a51 100644
--- a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
+++ b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
@@ -1,14 +1,14 @@
-Tue Oct  6 19:48:02 CEST 2020
+Thu Oct 22 12:29:09 EDT 2020
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.19] [x86_64-centos7-gcc8-opt] [master-refs/ea3e66422c4] -- built on [2020-10-06T1923]
+Py:Athena            INFO using release [WorkDir-22.0.19] [x86_64-centos7-gcc8-opt] [master-mt/9d6e7edd41b] -- built on [2020-10-22T1119]
 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 "LArCellRec/LArCellDeadOTXCorr_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5569 configurables from 10 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5616 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 EventInfoMgtInit: Got release version  Athena-22.0.19
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
@@ -27,20 +27,20 @@ Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v34r0)
-                                          running on aibuild028.cern.ch on Tue Oct  6 19:48:14 2020
+                                          running on spar0103.usatlas.bnl.gov on Thu Oct 22 12:29:29 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3586 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3535 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
-DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://frontier-atlas1.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://frontier-atlas2.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(serverurl=http://ccfrontier01.in2p3.fr:23128/ccin2p3-AtlasFrontier)(serverurl=http://ccfrontier02.in2p3.fr:23128/ccin2p3-AtlasFrontier)(serverurl=http://ccfrontier03.in2p3.fr:23128/ccin2p3-AtlasFrontier)(serverurl=http://ccfrontier05.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://frontier-cache.sdcc.bnl.gov:3128)(proxyurl=http://frontier-cache1.sdcc.bnl.gov:3128)(proxyurl=http://frontier-cache2.sdcc.bnl.gov:3128)(proxyurl=http://atlasbpfrontier.fnal.gov:3127)(proxyurl=http://atlasbpfrontier.cern.ch:3127) will be considered for COOL data
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host spar0103.usatlas.bnl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc           WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
@@ -94,7 +94,7 @@ IOVDbSvc             INFO Added taginfo remove for /LAR/Identifier/LArTTCellMapA
 IOVDbSvc             INFO Added taginfo remove for /LAR/ElecCalibMC/fSampl
 IOVDbSvc             INFO Added taginfo remove for /LAR/ElecCalibMC/uA2MeV
 ClassIDSvc           INFO  getRegistryEntries: read 26 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 2511 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2268 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 39 CLIDRegistry entries for module ALL
 DetDescrCnvSvc       INFO  initializing 
 DetDescrCnvSvc       INFO Found DetectorStore service
@@ -186,7 +186,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO  getRegistryEntries: read 3621 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3578 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -195,12 +195,12 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25380Kb 	 Time = 0.68S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 24344Kb 	 Time = 0.64S
 ClassIDSvc           INFO  getRegistryEntries: read 67 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-ClassIDSvc           INFO  getRegistryEntries: read 5651 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 5532 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 618 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 3030 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3459 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 CondInputLoader      INFO Adding base classes:
   +  ( 'AthenaAttributeList' , 'ConditionStore+/LAR/BadChannels/MissingFEBs' )   ->
@@ -254,7 +254,7 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'LAruA2MeVMC' , 'ConditionStore+LAruA2MeV' ) 
 PyComponentMgr       INFO Initializing PyComponentMgr...
 testalg1             INFO Initializing testalg1...
-ClassIDSvc           INFO  getRegistryEntries: read 1042 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1105 CLIDRegistry entries for module ALL
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
 CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_ID helper object in the detector store
 CaloIDHelper_ID...   INFO in createObj: creating a LArEM_ID helper object in the detector store
@@ -263,15 +263,15 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
@@ -289,21 +289,21 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper ob
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
 CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-05T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-10-20T2101/Athena/22.0.19/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
-ClassIDSvc           INFO  getRegistryEntries: read 306 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 36 CLIDRegistry entries for module ALL
 LArOnlineIDDetD...   INFO in createObj: creating a LArOnlineID helper object in the detector store
 LArOnlineID          INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 ClassIDSvc           INFO  getRegistryEntries: read 66 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 1473 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1413 CLIDRegistry entries for module ALL
 ToolSvc.tool1        INFO Initializing LArCellDeadOTXCorr
 ToolSvc.tool1        INFO L1Calo database won't be used. Pedestal values will be constant and equal to 32.
 ToolSvc.CaloTri...   INFO  => CaloTriggerTowerService::initialize() 
@@ -313,18 +313,12 @@ LArIdMgrDetDesc...   INFO Set LArHVLineID helper in LArIdMgr
 LArIdMgrDetDesc...   INFO Set LArElectrodeID helper in LArIdMgr 
 LArIdMgrDetDesc...   INFO Set CaloCell_ID helper in LArIdMgr 
 LArIdMgrDetDesc...   INFO Initializing LArIdMgr from values in LArIdMgrDetDescrCnv 
-ClassIDSvc           INFO  getRegistryEntries: read 60 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 67 CLIDRegistry entries for module ALL
-IOVSvc.IOVSvcTool    INFO Still in initialize phase, not tiggering callback for LArCablingLegacyService[0x343e3a00]+7f8339c5f400 bound to AthenaAttributeList[/LAR/Identifier/OnOffIdMap]
-ToolSvc.LArCabl...   INFO Successfully installed callback on folder/LAR/Identifier/OnOffIdMap
-ToolSvc.LArCabl...   INFO Successfully installed callback on folder/LAR/Identifier/CalibIdMap
-ToolSvc.LArCabl...   INFO Successfully installed callback on folder/LAR/Identifier/FebRodMap
-ToolSvc.LArCabl...   INFO Sucessfully initialized LArCablingLegacyService with 3 callbacks.
 ToolSvc.CaloTri...   INFO  ====> ...CaloTriggerTowerService::init() OK 
+ClassIDSvc           INFO  getRegistryEntries: read 60 CLIDRegistry entries for module ALL
 ToolSvc.tool2        INFO Initializing LArCellDeadOTXCorr
 ToolSvc.tool2        INFO L1Calo database won't be used. Pedestal values will be constant and equal to 32.
 ApplicationMgr       INFO Application Manager Initialized successfully
-ClassIDSvc           INFO  getRegistryEntries: read 133 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 64 CLIDRegistry entries for module ALL
 CondInputLoader      INFO created CondCont<AthenaAttributeList> with key 'ConditionStore+/LAR/BadChannels/MissingFEBs'
 CondInputLoader      INFO created CondCont<AthenaAttributeList> with key 'ConditionStore+/LAR/Identifier/CalibIdMap'
 CondInputLoader      INFO created CondCont<AthenaAttributeList> with key 'ConditionStore+/LAR/Identifier/FebRodMap'
@@ -368,18 +362,9 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to LARElecCalibM
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to LARuA2MeV-Feb2011 for folder /LAR/ElecCalibMC/uA2MeV
 IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_CALO/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to CALOOflIdentifierCaloTTOnAttrIdMapAtlas-0001 for folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to CALOOflIdentifierCaloTTOnOffIdMapAtlas-0002 for folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas
-IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to CALOOflIdentifierCaloTTPpmRxIdMapAtlas-0000 for folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas
-IOVDbSvc             INFO Disconnecting from COOLOFL_CALO/OFLP200
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] EACFEBD4-9BD2-E211-848A-02163E006B20
 Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root File version:52200
-ToolSvc.CaloTri...   INFO  ====> iovCallBack 
-ToolSvc.LArCabl...   INFO  ====> iovCallBack 
-ToolSvc.LArCabl...   INFO Done reading online/offline identifier mapping
-ToolSvc.LArCabl...   INFO Found 195072 online identifier and 182468 offline identifier. 12604 disconnected channels.
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 DetectorStore     WARNING retrieve(default): No valid proxy for default object 
  of type TileDetDescrManager(CLID 2941)
@@ -490,6 +475,11 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000013.gen.COND/cond09_mc.000013.gen.COND._0001.pool.root File version:52200
 /cvmfs/atlas-co...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] F4885664-6C4D-DF11-A94A-00304867340C
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_CALO/OFLP200
+IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to CALOOflIdentifierCaloTTOnAttrIdMapAtlas-0001 for folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas
+IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to CALOOflIdentifierCaloTTOnOffIdMapAtlas-0002 for folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas
+IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to CALOOflIdentifierCaloTTPpmRxIdMapAtlas-0000 for folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas
+IOVDbSvc             INFO Disconnecting from COOLOFL_CALO/OFLP200
 CaloTTOnOffIdMa...   INFO initialize()
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] EC2448FE-EFE2-DD11-80D3-000423D98B8C
 Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0004.pool.root
@@ -530,43 +520,44 @@ testalg1             INFO Finalizing testalg1...
 IncidentProcAlg2     INFO Finalize
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.25 ))s
-IOVDbFolder          INFO Folder /LAR/BadChannels/BadChannels (AttrListColl) db-read 1/1 objs/chan/bytes 0/8/0 ((     0.03 ))s
-IOVDbFolder          INFO Folder /LAR/BadChannels/MissingFEBs (AttrList) db-read 1/1 objs/chan/bytes 1/1/16 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/CellCorrOfl/deadOTX (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/705 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/1520148 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/6100 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 1/2 objs/chan/bytes 1/1/780292 ((     0.03 ))s
-IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 1/1 objs/chan/bytes 1/1/183 ((     0.05 ))s
-IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 1/1 objs/chan/bytes 1/1/181 ((     0.03 ))s
-IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 1/1 objs/chan/bytes 1/1/181 ((     0.03 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/AutoCorr (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/486 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/DAC2uA (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/HVScaleCorr (PoolRefColl) db-read 1/1 objs/chan/bytes 12/12/1980 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/MinBias (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/174 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/MinBiasAverage (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/181 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/MphysOverMcal (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/516 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Noise (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/516 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Pedestal (PoolRef) db-read 1/1 objs/chan/bytes 1/1/167 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Ramp (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/489 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Shape (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/477 ((     0.02 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/1 objs/chan/bytes 1/1/173 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/fSampl (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/194 ((     0.22 ))s
-IOVDbFolder          INFO Folder /LAR/ElecCalibMC/uA2MeV (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/165 ((     0.02 ))s
-IOVDbSvc             INFO  bytes in ((      0.92 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.92 ))s
+IOVDbFolder          INFO Folder /LAR/BadChannels/BadChannels (AttrListColl) db-read 1/1 objs/chan/bytes 0/8/0 ((     0.45 ))s
+IOVDbFolder          INFO Folder /LAR/BadChannels/MissingFEBs (AttrList) db-read 1/1 objs/chan/bytes 1/1/16 ((     0.23 ))s
+IOVDbFolder          INFO Folder /LAR/CellCorrOfl/deadOTX (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/705 ((     0.23 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 1/1 objs/chan/bytes 1/1/1520148 ((     0.30 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 1/1 objs/chan/bytes 1/1/6100 ((     0.16 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 1/1 objs/chan/bytes 1/1/780292 ((     0.39 ))s
+IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 1/1 objs/chan/bytes 1/1/183 ((     0.81 ))s
+IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 1/1 objs/chan/bytes 1/1/181 ((     0.09 ))s
+IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/181 ((     0.10 ))s
+IOVDbFolder       WARNING Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas is requested but no data retrieved
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/AutoCorr (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/486 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.08 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/DAC2uA (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/HVScaleCorr (PoolRefColl) db-read 1/1 objs/chan/bytes 12/12/1980 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/MinBias (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/174 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/MinBiasAverage (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/181 ((     0.08 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/MphysOverMcal (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/516 ((     0.08 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Noise (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/516 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Pedestal (PoolRef) db-read 1/1 objs/chan/bytes 1/1/167 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Ramp (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/489 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/Shape (PoolRefColl) db-read 1/1 objs/chan/bytes 3/3/477 ((     0.08 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/1 objs/chan/bytes 1/1/173 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/fSampl (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/194 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/ElecCalibMC/uA2MeV (PoolRefColl) db-read 1/1 objs/chan/bytes 1/1/165 ((     0.09 ))s
+IOVDbSvc             INFO  bytes in ((      4.89 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 21 ReadTime: ((     0.81 ))s
-IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     0.11 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 21 ReadTime: ((     3.88 ))s
+IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     1.01 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.CaloTri...   INFO  => CaloTriggerTowerService::finalize() 
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot= 0.68  [s] Ave/Min/Max=  0.0179(+-  0.0833)/       0/    0.52  [s] #= 38
-cObj_ALL             INFO Time User   : Tot= 0.94  [s] Ave/Min/Max=  0.0392(+-   0.113)/       0/    0.55  [s] #= 24
-ChronoStatSvc        INFO Time User   : Tot= 54.7  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot= 0.89  [s] Ave/Min/Max=  0.0234(+-   0.104)/       0/    0.65  [s] #= 38
+cObj_ALL             INFO Time User   : Tot= 1.17  [s] Ave/Min/Max=  0.0509(+-   0.137)/       0/    0.67  [s] #= 23
+ChronoStatSvc        INFO Time User   : Tot= 50.5  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/LArCalorimeter/LArRawUtils/src/LArRoI_Map.cxx b/LArCalorimeter/LArRawUtils/src/LArRoI_Map.cxx
index 52a06c4610af4b84392ea45bf92da3835fcf11d4..03b153913965123277e2f271dfbbf2fddeb56d46 100644
--- a/LArCalorimeter/LArRawUtils/src/LArRoI_Map.cxx
+++ b/LArCalorimeter/LArRawUtils/src/LArRoI_Map.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArRawUtils/LArRoI_Map.h" 
@@ -65,9 +65,6 @@ StatusCode LArRoI_Map::initialize()
   ATH_CHECK( detStore()->regFcn(&LArCablingLegacyService::iovCallBack,&(*m_cablingSvc),
                                 &LArRoI_Map::iovCallBack,
                                 this,true) );
-  ATH_CHECK(  detStore()->regFcn(&CaloTriggerTowerService::iovCallBack,&(*m_ttSvc),
-                                 &LArRoI_Map::iovCallBack,
-                                 this,true) ) ;
 
   if (m_loadAtBegin) {
     ATH_MSG_DEBUG( "Setting callback function to load id map at begin of run"  );
diff --git a/LumiBlock/LumiBlockComps/python/LumiBlockMuWriterDefault.py b/LumiBlock/LumiBlockComps/python/LumiBlockMuWriterDefault.py
index 2dc94cbb4084be178ca2541608236490c045203e..a288a0b163876872be49f6d4d0cd06598507bd65 100644
--- a/LumiBlock/LumiBlockComps/python/LumiBlockMuWriterDefault.py
+++ b/LumiBlock/LumiBlockComps/python/LumiBlockMuWriterDefault.py
@@ -10,13 +10,13 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 from AthenaCommon.BeamFlags import jobproperties
 
 
-def LumiBlockMuWriterDefault (name = 'LumiBlockMuWriter'):
+def LumiBlockMuWriterDefault (name = 'LumiBlockMuWriter', sequence = None):
     from AthenaCommon.AlgSequence import AthSequencer
     from AthenaCommon.AlgSequence import AlgSequence
 
     condSeq = AthSequencer ('AthCondSeq')
     topSequence = AlgSequence()
-    if hasattr (condSeq, name) or hasattr (topSequence, name):
+    if (sequence and hasattr (sequence, name)) or hasattr (condSeq, name) or hasattr (topSequence, name):
         return
 
     LumiBlockMuWriter = CompFactory.LumiBlockMuWriter # LumiBlockComps
@@ -40,10 +40,13 @@ def LumiBlockMuWriterDefault (name = 'LumiBlockMuWriter'):
 
     # FIXME: If EventInfoCnvAlg is in topSequence, then this needs to come
     # after it.  Otherwise, schedule to condSeq so we'll be run early.
-    if cnvalg and cnvseq is topSequence:
-        topSequence += alg
+    if sequence:
+        sequence += alg
     else:
-        condSeq += alg
+        if cnvalg and cnvseq is topSequence:
+            topSequence += alg
+        else:
+            condSeq += alg
 
     from AthenaCommon.GlobalFlags  import globalflags
     from RecExConfig.ObjKeyStore import objKeyStore
diff --git a/LumiBlock/LumiBlockComps/python/LuminosityCondAlgDefault.py b/LumiBlock/LumiBlockComps/python/LuminosityCondAlgDefault.py
index c7c87b4684bcd84a19e744f1bc5c061eb8a170aa..61d09e6cdba97ef294932e4ad8457ae0cf3eef65 100644
--- a/LumiBlock/LumiBlockComps/python/LuminosityCondAlgDefault.py
+++ b/LumiBlock/LumiBlockComps/python/LuminosityCondAlgDefault.py
@@ -7,6 +7,7 @@
 
 from AthenaCommon.Logging import logging
 from AthenaCommon.AlgSequence import AthSequencer
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
 
 
 _isOnline = False
@@ -14,7 +15,7 @@ _isOnline = False
 
 def LuminosityCondAlgDefault (name = 'LuminosityCondAlg',
                               suffix = '',
-                              isOnline = None):
+                              isOnline = athenaCommonFlags.isOnline()):
     if name is None:
         name = 'LuminosityCondAlg' + suffix
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h b/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h
index 8f4aa98e4dc5332bbdad0f1ace8f9d1aba321664..c68bc53c59bb3307d64ea37a71499fba25b49f79 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h
@@ -31,6 +31,12 @@ private:
 	std::vector<std::string> m_structuresFromFlags;
 	std::string m_outPREsqlName;
 
+    // The following ServiceHandle<AmdcsimrecAthenaSvc> is only needed for creating AGDD muon layouts (muon passive material layouts)
+    // *IF* the AGDD xml block is still stored in the amdb file (https://twiki.cern.ch/twiki/bin/viewauth/Atlas/AmdbSimrecFiles)
+    // Note that this was the case until amdb_simrec.r.08.01, from amdb_simrec.r.08.02 onwards, the AGDD xml is stored independently
+    // of the amdb file in MuonSpectrometer/MuonG4/MuonPassiveMaterials.
+    // Thus, this ServiceHandle is only kept for backwards compatibility (in case someone wants to create muon layouts from amdb files
+    // older than amdb_simrec.r.08.02)
 #ifndef SIMULATIONBASE
 	ServiceHandle<AmdcsimrecAthenaSvc> p_AmdcsimrecAthenaSvc;
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
index 4f73cd005c8bddd65dc20ea22c51717ec2453680..f44885e25eb7b1c2ee87168d6cb85c04bdfee468 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
@@ -35,10 +35,8 @@ StatusCode MuonAGDDTool::initialize()
 		m_DBFileName = "Generated_" + m_outFileType + "_pool.txt";
 	}
 
-	// please see more details on regarding the dependency on AMDB on ATLASSIM-3636
-	// and the CMakeLists.txt . the NSWAGDDTool avoids the dependency already
 #ifndef SIMULATIONBASE
-	if(m_writeDBfile && !m_xmlFiles.size()) CHECK( p_AmdcsimrecAthenaSvc.retrieve() );
+	if(m_writeDBfile && !m_xmlFiles.size()) ATH_CHECK(p_AmdcsimrecAthenaSvc.retrieve());
 #endif
 
 	if (m_buildNSW) 
@@ -68,11 +66,11 @@ StatusCode MuonAGDDTool::construct()
 			ATH_MSG_INFO(" ----> "<<m_structuresFromFlags[i]);
 	}
 	
-	if (!m_readAGDD)
-	{
-		ATH_MSG_INFO(" trying to parse files ");
+	// reading from a local AGDD xml file
+	if (!m_readAGDD) {
+		ATH_MSG_INFO(" Parsing local xml file ");
 		m_controller->ParseFiles();
-		if(!m_writeDBfile) return StatusCode::SUCCESS;
+    // reading the AGDD xml blob from the ATLAS geometry database
 	} else {
 	    ATH_MSG_INFO(" now reading AGDD blob ");
 
@@ -87,19 +85,24 @@ StatusCode MuonAGDDTool::construct()
 	    m_controller->ParseString(AGDDfile);
 	}
 
-	if (m_printSections)
-	{	
+	if (m_printSections) {	
 		ATH_MSG_INFO("\t Printing all sections");
 		m_controller->PrintSections();
 	}
-	
-	ATH_MSG_INFO(" now dumping the flags ");
-	for (unsigned int i =0;i<m_structuresFromFlags.size();i++)
-	{
-		ATH_MSG_INFO("\t\t----- "<<m_structuresFromFlags[i]<<" "<<ALIAS(m_structuresFromFlags[i]));
-		if (!m_buildNSW && m_structuresFromFlags[i]=="NewSmallWheel") continue;
-		m_controller->GetBuilder()->BuildFromVolume(m_structuresFromFlags[i]);
-	}
+
+    // when reading from a local AGDD xml file and not creating a layout (i.e. running simulation from a local xml file),
+    // only build those volumes that are specified at the 'Volumes' property (analogously to the AGDD2GeoSwitches when reading the blob)
+    if (!m_readAGDD && !m_writeDBfile) {
+        for (const auto &vol:m_volumesToBuild) {
+            m_controller->GetBuilder()->BuildFromVolume(vol);
+        }
+    } else {
+    // when reading the AGDD xml blob, only build the volumes specified via the AGDD2GeoSwitches
+        for (unsigned int i =0;i<m_structuresFromFlags.size();i++) {
+            if (!m_buildNSW && m_structuresFromFlags[i]=="NewSmallWheel") continue;
+            m_controller->GetBuilder()->BuildFromVolume(m_structuresFromFlags[i]);
+        }
+    }
 
 	if(m_writeDBfile)
 	{
@@ -176,9 +179,12 @@ bool MuonAGDDTool::WritePREsqlFile() const
 	}
 
 	std::string TheAmdcName = m_amdcName;
-	// in principle this information could also be accessed differently and the
-	// dependency on AMDB could be avoided. for the moment it's kept to be fully
-	// consistent with previous table generations
+	// The following is only needed for creating AGDD muon (passive material) layouts
+    // *IF* the AGDD xml block is still stored in the amdb file (https://twiki.cern.ch/twiki/bin/viewauth/Atlas/AmdbSimrecFiles)
+    // Note that this was the case until amdb_simrec.r.08.01, from amdb_simrec.r.08.02 onwards, the AGDD xml is stored independently
+    // of the amdb file in MuonSpectrometer/MuonG4/MuonPassiveMaterials.
+    // Thus, this retrieval of the AmdcName is only kept for backwards compatibility (in case someone wants to create muon layouts 
+    // from amdb files older than amdb_simrec.r.08.02) to be fully consistent with previous table generations.
 #ifndef SIMULATIONBASE
     if (!m_xmlFiles.size()) {
         Amdcsimrec* pAmdcsimrec = p_AmdcsimrecAthenaSvc->GetAmdcsimrec();
diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx
index 779ee8afbe08980b7b5edba4ef2865f1646b3d34..4a073094ebd6238f28d68a5a3e8de62be9a950a9 100755
--- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx
@@ -373,37 +373,43 @@ namespace MuonGM {
     GeoPcon* c4 = new GeoPcon( 0, 360*Gaudi::Units::deg );
 
     if(m_isAmdcDb) {
-      log<< MSG::INFO <<" Using hardcoded envelope dimesions from MuonSystem-11 table" <<endmsg;
-      c4->addPlane(-26046. , 1050.  ,  1500.  );
-      c4->addPlane(-23001. , 1050.  ,  1500.  );
-      c4->addPlane(-23001. , 1050.  ,  2750.  );
-      c4->addPlane(-22030. , 1050.  ,  2750.  );
-      c4->addPlane(-22030. ,  436.  , 12650.  );
-      c4->addPlane(-18650. ,  436.  , 12650.  );
-      c4->addPlane(-18650. ,  279.  , 13400.  );
-      c4->addPlane(-12900. ,  279.  , 13400.  );
-      c4->addPlane(-12900. ,   70.  , 13910.  );
-      c4->addPlane( -6783. ,   70.  , 13910.  );
-      c4->addPlane( -6783. ,  420.  , 13910.  );
-      c4->addPlane( -6736. ,  420.  , 13910.  );
-      c4->addPlane( -6736. , 3800.  , 13910.  );
-      c4->addPlane( -6550. , 3800.  , 13910.  );
-      c4->addPlane( -6550. , 4255.  , 13000.  );
-      c4->addPlane(  6550. , 4255.  , 13000.  );
-      c4->addPlane(  6550. , 3800.  , 13910.  );
-      c4->addPlane(  6736. , 3800.  , 13910.  );
-      c4->addPlane(  6736. ,  420.  , 13910.  );
-      c4->addPlane(  6783. ,  420.  , 13910.  );
-      c4->addPlane(  6783. ,   70.  , 13910.  );
-      c4->addPlane( 12900. ,   70.  , 13910.  );
-      c4->addPlane( 12900. ,  279.  , 13400.  );
-      c4->addPlane( 18650. ,  279.  , 13400.  );
-      c4->addPlane( 18650. ,  436.  , 12650.  );
-      c4->addPlane( 22030. ,  436.  , 12650.  );
-      c4->addPlane( 22030. , 1050.  ,  2750.  );
-      c4->addPlane( 23001. , 1050.  ,  2750.  );
-      c4->addPlane( 23001. , 1050.  ,  1500.  );
-      c4->addPlane( 26046. , 1050.  ,  1500.  );         
+      // NOTE: the following hard coded values are ONLY needed for local validation studies of new amdb layouts
+      // (when no values from the geometry database are retrieved, the values correspond to ATLAS-R2-2016-01-00-01)
+      log<< MSG::INFO <<" Using hardcoded envelope dimesions from MuonSystem-15 table" <<endmsg;
+      c4->addPlane(-26046. , 1050.  ,  1500);
+      c4->addPlane(-23001. , 1050.  ,  1500);
+      c4->addPlane(-23001. , 1050.  ,  2750);
+      c4->addPlane(-22030. , 1050.  ,  2750);
+      c4->addPlane(-22030. ,  436.7 , 12650);
+      c4->addPlane(-18650. ,  436.7 , 12650);
+      c4->addPlane(-18650. ,  279.  , 13400);
+      c4->addPlane(-12900. ,  279.  , 13400);
+      c4->addPlane(-12900. ,   70.  , 14200);
+      c4->addPlane( -6783. ,   70.  , 14200);
+      c4->addPlane( -6783. ,  420.  , 14200);
+      c4->addPlane( -6736. ,  420.  , 14200);
+      c4->addPlane( -6736. , 3800.  , 14200);
+      c4->addPlane( -6550. , 3800.  , 14200);
+      c4->addPlane( -6550. , 4255.  , 14200);
+      c4->addPlane( -4000. , 4255.  , 14200);
+      c4->addPlane( -4000. , 4255.  , 13000);
+      c4->addPlane(  4000. , 4255.  , 13000);
+      c4->addPlane(  4000. , 4255.  , 14200);
+      c4->addPlane(  6550. , 4255.  , 14200);
+      c4->addPlane(  6550. , 3800.  , 14200);
+      c4->addPlane(  6736. , 3800.  , 14200);
+      c4->addPlane(  6736. ,  420.  , 14200);
+      c4->addPlane(  6783. ,  420.  , 14200);
+      c4->addPlane(  6783. ,   70.  , 14200);
+      c4->addPlane( 12900. ,   70.  , 14200);
+      c4->addPlane( 12900. ,  279.  , 13400);
+      c4->addPlane( 18650. ,  279.  , 13400);
+      c4->addPlane( 18650. ,  436.7 , 12650);
+      c4->addPlane( 22030. ,  436.7 , 12650);
+      c4->addPlane( 22030. , 1050.  ,  2750);
+      c4->addPlane( 23001. , 1050.  ,  2750);
+      c4->addPlane( 23001. , 1050.  ,  1500);
+      c4->addPlane( 26046. , 1050.  ,  1500);
     } else {
 
       //--- --- --- CREATE ENVELOPE --- --- ---
diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_01.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_01.sh
index 963ac2ec2914fbefcba14ce4e923dfa1cb191cde..f26d290174e0d5a7c00232c8fead3afba18049c5 100755
--- a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_01.sh
+++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_01.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# art-description: Run simulation from existing layout of geometry database and from local file (for muon geometry MuonSpectrometer-R.08.01)
+# art-description: Run simulation from existing layout of geometry database and from local amdb file (for muon geometry MuonSpectrometer-R.08.01)
 #
 # art-type: grid
 # art-include: master/Athena
@@ -14,16 +14,17 @@ art.py createpoolfile
 set -x
 
 #######################################
-# first, run simulation with ATLAS layout ATLAS-R2-2016-01-00-01 (official Run2) based on MuonSpectrometer-R.08.01
+# run simulation with ATLAS layout ATLAS-R2-2016-01-00-01 (official Run2) based on MuonSpectrometer-R.08.01
 # but from local file (in this case: amdb_simrec.r.08.01)
 #######################################
 
 # download amdb file
 wget http://atlas.web.cern.ch/Atlas/GROUPS/MUON/AMDB/amdb_simrec.r.08.01
 # run simulation from local amdb file
+# NOTE: the simFlags.G4Commands+=["/process/em/applyCuts true"] is added by hand, since it is part of the nominal s3512 job, but apparently overwritten when giving a custom postExec
 Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
           --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
-          --postExec 'input_amdb_simrec="amdb_simrec.r.08.01";include("MuonGeoModel/InitGeoFromLocal_postIncl.py")' \
+          --postExec 'input_amdb_simrec="amdb_simrec.r.08.01";include("MuonGeoModel/InitGeoFromLocal_postIncl.py");simFlags.G4Commands+=["/process/em/applyCuts true"]' \
           --AMI=s3512 \
           --maxEvents 25 \
           --imf False \
@@ -39,7 +40,7 @@ fi
 mv log.EVNTtoHITS log.EVNTtoHITS_fromLocal
 
 #######################################
-# second, run simulation with ATLAS layout ATLAS-R2-2016-01-00-01 (official Run2) based on MuonSpectrometer-R.08.01
+# run simulation with ATLAS layout ATLAS-R2-2016-01-00-01 (official Run2) based on MuonSpectrometer-R.08.01
 #######################################
 
 Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
@@ -60,7 +61,7 @@ fi
 # then diff the output files
 #######################################
 
-acmd.py diff-root --ignore-leaves timings --mode semi-detailed --error-mode resilient OUT_HITS_fromLocal.root OUT_HITS.root &> log_diff_HITS.log
+acmd.py diff-root OUT_HITS_fromLocal.root OUT_HITS.root --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref &> log_diff_HITS.log
 exit_code=$?
 echo  "art-result: ${exit_code} diff-root_sim"
 if [ ${exit_code} -ne 0 ]
diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_02_AGDD.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_02_AGDD.sh
new file mode 100755
index 0000000000000000000000000000000000000000..097a189a2d09b93a126ab58c21eabcc4953f80d0
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_02_AGDD.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# art-description: Run simulation from existing layout of geometry database and from local AGDD file (for muon geometry MuonSpectrometer-R.08.02)
+#
+# art-type: grid
+# art-include: master/Athena
+#
+# art-output: log.EVNTtoHITS_fromLocal
+# art-output: log.EVNTtoHITS
+# art-output: log_diff_HITS.log
+
+art.py createpoolfile
+
+set -x
+
+#######################################
+# run simulation with ATLAS layout ATLAS-R2-2016-01-02-01 (best knowledge Run2) based on MuonSpectrometer-R.08.02
+# but from local file (in this case: passiveMat_r.08.02.xml)
+#######################################
+
+# download AGDD file
+get_files passiveMat_r.08.02.xml
+# run simulation from local AGDD file
+# NOTE: the simFlags.G4Commands+=["/process/em/applyCuts true"] is added by hand, since it is part of the nominal s3512 job, but apparently overwritten when giving a custom postExec
+Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
+          --geometryVersion 'default:ATLAS-R2-2016-01-02-01_VALIDATION' \
+          --postExec 'input_agdd_xml="passiveMat_r.08.02.xml";include("InitGeoFromLocal_postIncl.py");simFlags.G4Commands+=["/process/em/applyCuts true"]' \
+          --AMI=s3512 \
+          --maxEvents 25 \
+          --imf False \
+          --outputHITSFile OUT_HITS_fromLocal.root
+
+exit_code=$?
+echo  "art-result: ${exit_code} Sim_tf_fromLocal"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+mv log.EVNTtoHITS log.EVNTtoHITS_fromLocal
+
+#######################################
+# run simulation with ATLAS layout ATLAS-R2-2016-01-02-01 (best knowledge Run2) based on MuonSpectrometer-R.08.02
+#######################################
+
+Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
+          --geometryVersion 'default:ATLAS-R2-2016-01-02-01_VALIDATION' \
+          --AMI=s3512 \
+          --maxEvents 25 \
+          --imf False \
+          --outputHITSFile OUT_HITS.root
+
+exit_code=$?
+echo  "art-result: ${exit_code} Sim_tf"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+#######################################
+# then diff the output files
+#######################################
+
+acmd.py diff-root OUT_HITS_fromLocal.root OUT_HITS.root --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref &> log_diff_HITS.log
+exit_code=$?
+echo  "art-result: ${exit_code} diff-root_sim"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+echo "art-result: $?"
+
+
+
diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_02_Amdb.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_02_Amdb.sh
new file mode 100755
index 0000000000000000000000000000000000000000..fc08e7f7c02d86c0af26f02ba5efe1eb53562d8b
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_08_02_Amdb.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# art-description: Run simulation from existing layout of geometry database and from local amdb file (for muon geometry MuonSpectrometer-R.08.02)
+#
+# art-type: grid
+# art-include: master/Athena
+#
+# art-output: log.EVNTtoHITS_fromLocal
+# art-output: log.EVNTtoHITS
+# art-output: log_diff_HITS.log
+
+art.py createpoolfile
+
+set -x
+
+#######################################
+# run simulation with ATLAS layout ATLAS-R2-2016-01-02-01 (best knowledge Run2) based on MuonSpectrometer-R.08.02
+# but from local file (in this case: amdb_simrec.r.08.02)
+#######################################
+
+# download amdb file
+wget http://atlas.web.cern.ch/Atlas/GROUPS/MUON/AMDB/amdb_simrec.r.08.02
+# run simulation from local amdb file
+# NOTE: the simFlags.G4Commands+=["/process/em/applyCuts true"] is added by hand, since it is part of the nominal s3512 job, but apparently overwritten when giving a custom postExec
+Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
+          --geometryVersion 'default:ATLAS-R2-2016-01-02-01_VALIDATION' \
+          --postExec 'input_amdb_simrec="amdb_simrec.r.08.02";include("MuonGeoModel/InitGeoFromLocal_postIncl.py");simFlags.G4Commands+=["/process/em/applyCuts true"]' \
+          --AMI=s3512 \
+          --maxEvents 25 \
+          --imf False \
+          --outputHITSFile OUT_HITS_fromLocal.root
+
+exit_code=$?
+echo  "art-result: ${exit_code} Sim_tf_fromLocal"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+mv log.EVNTtoHITS log.EVNTtoHITS_fromLocal
+
+#######################################
+# run simulation with ATLAS layout ATLAS-R2-2016-01-02-01 (best knowledge Run2) based on MuonSpectrometer-R.08.02
+#######################################
+
+Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
+          --geometryVersion 'default:ATLAS-R2-2016-01-02-01_VALIDATION' \
+          --AMI=s3512 \
+          --maxEvents 25 \
+          --imf False \
+          --outputHITSFile OUT_HITS.root
+
+exit_code=$?
+echo  "art-result: ${exit_code} Sim_tf"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+#######################################
+# then diff the output files
+#######################################
+
+acmd.py diff-root OUT_HITS_fromLocal.root OUT_HITS.root --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref &> log_diff_HITS.log
+exit_code=$?
+echo  "art-result: ${exit_code} diff-root_sim"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+echo "art-result: $?"
+
+
+
diff --git a/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_09_02_NSWAGDD.sh b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_09_02_NSWAGDD.sh
new file mode 100755
index 0000000000000000000000000000000000000000..5af0b37cc89f53c815eb468a0af3028ba5794463
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonGeomValidation/MuonGeomRTT/test/test_geoFromLocal_R_09_02_NSWAGDD.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# art-description: Run simulation from existing layout of geometry database and from local NSW AGDD file (for muon geometry MuonSpectrometer-R.09.02.Asym)
+#
+# art-type: grid
+# art-include: master/Athena
+#
+# art-output: log.EVNTtoHITS_fromLocal
+# art-output: log.EVNTtoHITS
+# art-output: log_diff_HITS.log
+
+art.py createpoolfile
+
+set -x
+
+#######################################
+# run simulation with ATLAS layout ATLAS-R3-2021-01-00-01 (asymmetric Run3) based on MuonSpectrometer-R.09.02.Asym
+# but from local file (in this case: stations.v2.08_Aside.xml)
+#######################################
+
+# download NSWAGDD file
+get_files stations.v2.08_Aside.xml
+# run simulation from local NSW AGDD file
+# NOTE: the simFlags.G4Commands+=["/process/em/applyCuts true"] is added by hand, since it is part of the nominal s3512 job, but apparently overwritten when giving a custom postExec
+Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
+          --geometryVersion 'default:ATLAS-R3-2021-01-00-01_VALIDATION' \
+          --postExec 'input_nsw_xml="stations.v2.08_Aside.xml";include("MuonGeoModel/InitGeoFromLocal_postIncl.py");simFlags.G4Commands+=["/process/em/applyCuts true"]' \
+          --AMI=s3512 \
+          --maxEvents 25 \
+          --imf False \
+          --outputHITSFile OUT_HITS_fromLocal.root
+
+exit_code=$?
+echo  "art-result: ${exit_code} Sim_tf_fromLocal"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+mv log.EVNTtoHITS log.EVNTtoHITS_fromLocal
+
+#######################################
+# run simulation with ATLAS layout ATLAS-R3-2021-01-00-01 (asymmetric Run3) based on MuonSpectrometer-R.09.02.Asym
+#######################################
+
+Sim_tf.py --inputEVNTFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.EVNT.e3601_e5984/EVNT.12228944._002158.pool.root.1 \
+          --geometryVersion 'default:ATLAS-R3-2021-01-00-01_VALIDATION' \
+          --AMI=s3512 \
+          --maxEvents 25 \
+          --imf False \
+          --outputHITSFile OUT_HITS.root
+
+exit_code=$?
+echo  "art-result: ${exit_code} Sim_tf"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+#######################################
+# then diff the output files
+#######################################
+
+acmd.py diff-root OUT_HITS_fromLocal.root OUT_HITS.root --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref &> log_diff_HITS.log
+exit_code=$?
+echo  "art-result: ${exit_code} diff-root_sim"
+if [ ${exit_code} -ne 0 ]
+then
+    exit ${exit_code}
+fi
+
+echo "art-result: $?"
+
+
+
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/MCTruthCommon.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/MCTruthCommon.py
index 8ba6d1969e81d24a8be3d417e8bce4d6ec7c8773..fadf6b8fa7c2bd79397cf80d364e7bbdc8bf3d2a 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/MCTruthCommon.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/MCTruthCommon.py
@@ -546,7 +546,7 @@ def addLargeRJetD2(kernel=None):
     #Extra classifier for D2 variable
     from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthD2Decorator
     TruthD2Decorator= DerivationFramework__TruthD2Decorator("TruthD2Decorator",
-                                                            JetContainerKey = "AntiKt10TruthTrimmedPtFrac5SmallR20Jets",
+                                                            JetContainerKey = "AntiKt10TruthSoftDropBeta100Zcut10Jets",
                                                             DecorationName = "D2")
     from AthenaCommon.AppMgr import ToolSvc
     ToolSvc += TruthD2Decorator
@@ -655,5 +655,5 @@ def addTruth3ContentToSlimmerTool(slimmer):
     ]
     slimmer.ExtraVariables += [
         "AntiKt4TruthDressedWZJets.GhostCHadronsFinalCount.GhostBHadronsFinalCount.pt.HadronConeExclTruthLabelID.ConeTruthLabelID.PartonTruthLabelID.TrueFlavor",
-        "AntiKt10TruthTrimmedPtFrac5SmallR20Jets.pt.Tau1_wta.Tau2_wta.Tau3_wta.D2",
+        "AntiKt10TruthSoftDropBeta100Zcut10Jets.pt.Tau1_wta.Tau2_wta.Tau3_wta.D2",
         "TruthEvents.Q.XF1.XF2.PDGID1.PDGID2.PDFID1.PDFID2.X1.X2.crossSection"]
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/TruthDerivationTools.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/TruthDerivationTools.py
index c341e53339d2ec1936fb5948e89a70baa0e0728a..85e43033239c814c464aff869d7134a682448fd1 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/TruthDerivationTools.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/python/TruthDerivationTools.py
@@ -197,7 +197,7 @@ DFCommonTruthPhotonIsolationTool3 = DerivationFramework__TruthIsolationTool(name
                                                                   )
 ToolSvc += DFCommonTruthPhotonIsolationTool3
 # Quark/gluon decoration for jets
-#from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthQGDecorationTool
-#DFCommonTruthQGLabelTool = DerivationFramework__TruthQGDecorationTool(name="DFCommonTruthQGLabelTool",
-#                                                                  JetCollection = "AntiKt4TruthWZJets")
-#ToolSvc += DFCommonTruthQGLabelTool
+from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthQGDecorationTool
+DFCommonTruthQGLabelTool = DerivationFramework__TruthQGDecorationTool(name="DFCommonTruthQGLabelTool",
+                                                                  JetCollection = "AntiKt4TruthDressedWZJets")
+ToolSvc += DFCommonTruthQGLabelTool
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH0.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH0.py
index 77355f600cd0f1bb54d3efe92c62ce0d14f97ee8..018a22cbe2e1859b4e148074f28eecda4d9a215a 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH0.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH0.py
@@ -15,9 +15,11 @@ if ("EventInfo#McEventInfo" not in inputFileSummary['eventdata_itemsList']) and
 
 # Decide what kind of input HepMC container we are dealing with
 if ("McEventCollection#GEN_EVENT" in inputFileSummary['eventdata_itemsList']):
-    DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_EVNT2xAOD",AODContainerName="GEN_EVENT")
+    if not hasattr(DerivationFrameworkJob,'GEN_EVNT2xAOD'):
+        DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_EVNT2xAOD",AODContainerName="GEN_EVENT")
 elif ("McEventCollection#TruthEvent" in inputFileSummary['eventdata_itemsList']):
-    DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_EVNT2xAOD",AODContainerName="TruthEvent")
+    if not hasattr(DerivationFrameworkJob,'GEN_AOD2xAOD'):
+        DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_EVNT2xAOD",AODContainerName="TruthEvent")
 
 #==============================================================================
 # Create the derivation kernel algorithm
@@ -48,4 +50,10 @@ TRUTH0Stream.AddItem( "xAOD::TruthVertexContainer#*" )
 TRUTH0Stream.AddItem( "xAOD::TruthVertexAuxContainer#*" )
 TRUTH0Stream.AddItem( "xAOD::TruthParticleContainer#*" )
 TRUTH0Stream.AddItem( "xAOD::TruthParticleAuxContainer#*" )
+# Keep the metadata of course!
 TRUTH0Stream.AddMetaDataItem( [ "xAOD::TruthMetaDataContainer#TruthMetaData", "xAOD::TruthMetaDataAuxContainer#TruthMetaDataAux." ] )
+
+# If we don't have a conditions tag set by now, then assume this job isn't going to have one and kill the conditions service
+if len(globalflags.ConditionsTag())==0:
+    for a in svcMgr.PoolSvc.ReadCatalog:
+        svcMgr.PoolSvc.ReadCatalog.remove(a)
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH1.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH1.py
index 03715247efed1b5abe4a19694650b1ea4d1fb6cd..49bce2ec6522673bb790d94e0d8ac848e8826195 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH1.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH1.py
@@ -3,214 +3,76 @@
 # This should appear in ALL derivation job options
 #==============================================================================
 from DerivationFrameworkCore.DerivationFrameworkMaster import *
-# Add translator from EVGEN input to xAOD-like truth here
-from DerivationFrameworkMCTruth.MCTruthCommon import * 
-from DerivationFrameworkTau.TauTruthCommon import *
-augmentationTools = []
 
-
-#==============================================================================
-# Set up stream
-#==============================================================================
-streamName = derivationFlags.WriteDAOD_TRUTH1Stream.StreamName
-fileName = buildFileName( derivationFlags.WriteDAOD_TRUTH1Stream )
-TRUTH1Stream = MSMgr.NewPoolRootStream( streamName, fileName )
-augStream = MSMgr.GetStream( streamName )
-evtStream = augStream.GetEventStream()
-
-# Only events that pass the filters listed are written out
-# AcceptAlgs  = logical OR of filters
-# RequireAlgs = logical AND of filters
-TRUTH1Stream.AcceptAlgs(['TRUTH1Kernel'])
-
-#====================================================================
-# JET/MET
-#====================================================================
-# Set jet flags
-from JetRec.JetRecFlags import jetFlags
-jetFlags.useTruth = True
-jetFlags.useTracks = False
-# Add jet algorithms
-from JetRec.JetAlgorithm import addJetRecoToAlgSequence
-addJetRecoToAlgSequence(DerivationFrameworkJob,eventShapeTools=None)
-from JetRec.JetRecStandard import jtm
-from JetRec.JetRecConf import JetAlgorithm
-jetFlags.truthFlavorTags = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
-                            "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
-                            "TausFinal",
-                            "Partons",
-                            ]
-if dfInputIsEVNT:
-  # Standard truth jets
-  # To recover jet constituents remove the last modifier.
-  akt4 = jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit, jtm.jetdrlabeler, jtm.trackjetdrlabeler], ptmin= 5000)
-  akt4alg = JetAlgorithm("jetalgAntiKt4TruthJets", Tools = [akt4] )
-  DerivationFrameworkJob += akt4alg
-
-  # WZ Truth Jets
-  akt4wz = jtm.addJetFinder("AntiKt4TruthWZJets",  "AntiKt", 0.4,  "truthwz", ptmin= 5000, modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit])
-  akt4wzalg = JetAlgorithm("jetalgAntiKt4TruthWZJets", Tools = [akt4wz] )
-  DerivationFrameworkJob += akt4wzalg
-  #jtm.addJetFinder("AntiKt6TruthWZJets",  "AntiKt", 0.6,  "truthwz", ptmin= 5000)
-  #Large R jets
-  akt10 = jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth",ptmin= 100000)
-  akt10alg = JetAlgorithm("jetalgAntiKt10TruthJets", Tools = [akt10] )
-  DerivationFrameworkJob += akt10alg
-  akt10trim = jtm.addJetTrimmer("TrimmedAntiKt10TruthJets", rclus=0.2, ptfrac=0.05, input='AntiKt10TruthJets', modifiersin=[jtm.nsubjettiness, jtm.removeconstit])
-  akt10trimalg = JetAlgorithm("jetalgTrimmedAntiKt10TruthJets", Tools = [akt10trim] )
-  DerivationFrameworkJob += akt10trimalg
-
-# Add truth-based MET algorithm here
-import METReconstruction.METConfig_Truth
-from METReconstruction.METRecoFlags import metFlags # not sure if you even need this line
-from METReconstruction.METRecoConfig import getMETRecoAlg
-metAlg = getMETRecoAlg('METReconstruction')
-DerivationFrameworkJob += metAlg
+# Add translator from EVGEN input to xAOD-like truth
+# Add all the particle derivation tools
+# This sets up its own common kernel and adds the common tools to it
+from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents
+addStandardTruthContents()
 
 #==============================================================================
 # HEAVY FLAVOR DECORATIONS (ttbar)
 #==============================================================================
-# PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/HadronOriginClassifier.cxx
-# PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/HadronOriginDecorator.cxx
-# list of ttbar samples by mc_channel_number
-TRUTH1DSIDList=[
-  410000,
-  410001,
-  410002,
-  410003,
-  410004,
-  410007,
-  410008,
-  410009,
-  301528,
-  301529,
-  301530,
-  301531,
-  301532,
-  303722,
-  303723,
-  303724,
-  303725,
-  303726,
-  407009,
-  407010,
-  407011,
-  407012,
-  410120,
-  410121,
-  426090,
-  426091,
-  426092,
-  426093,
-  426094,
-  426095,
-  426096,
-  426097,
-  429007,
-]
-
-import PyUtils.AthFile as af
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-f = af.fopen(athenaCommonFlags.FilesInput()[0])
-if len(f.infos['run_number']) > 0:
-  if(int((f.infos['run_number'])[0]) in TRUTH1DSIDList):
-    from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__HadronOriginClassifier
-    TRUTH1hadronorigintool = DerivationFramework__HadronOriginClassifier("TRUTH1HadronOriginClassifier",DSID=int((f.infos['run_number'])[0]))
-    ToolSvc += TRUTH1hadronorigintool
-    print "TRUTH1hadronorigintool: ", TRUTH1hadronorigintool
-    from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__HadronOriginDecorator
-    TRUTH1hadronorigindecorator = DerivationFramework__HadronOriginDecorator(name = "TRUTH1HadronOriginDecorator")
-    TRUTH1hadronorigindecorator.ToolName = TRUTH1hadronorigintool
-    ToolSvc += TRUTH1hadronorigindecorator
-    print "TRUTH1hadronorigindecorator: ", TRUTH1hadronorigindecorator
-    augmentationTools.append(TRUTH1hadronorigindecorator)
+import DerivationFrameworkMCTruth.HFHadronsCommon
 
 #==============================================================================
-# Thinning the master truth collection 
+# Set up stream
 #==============================================================================
-from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__MenuTruthThinning
-TRUTH1TruthThinning = DerivationFramework__MenuTruthThinning(name                      = "TRUTH1TruthThinning",
-                                                            StreamName                 = streamName,
-                                                            WritePartons               = False,
-                                                            WriteHadrons               = False,
-                                                            WriteBHadrons              = True,
-                                                            WritettHFHadrons           = True,
-                                                            WriteGeant                 = False,
-                                                            GeantPhotonPtThresh        = -1.0,
-                                                            WriteTauHad                = True,
-                                                            PartonPtThresh             = -1.0,
-                                                            WriteBSM                   = True,
-                                                            WriteBosons                = True,
-                                                            WriteBSMProducts           = True,
-                                                            WriteBosonProducts         = True,
-                                                            WriteTopAndDecays          = True,
-                                                            WriteEverything            = False,
-                                                            WriteAllLeptons            = True,
-                                                            WriteStatus3               = False,
-                                                            PreserveDescendants        = False, 
-                                                            PreserveGeneratorDescendants = False,
-                                                            PreserveAncestors          = True,
-                                                            WriteFirstN                = 10)
-ToolSvc += TRUTH1TruthThinning
+streamName = derivationFlags.WriteDAOD_TRUTH1Stream.StreamName
+fileName = buildFileName( derivationFlags.WriteDAOD_TRUTH1Stream )
+TRUTH1Stream = MSMgr.NewPoolRootStream( streamName, fileName )
 
 #==============================================================================
-# Thinning the photon truth collection : no photons from pi0 (origin=42)
+# Set up slimming content list here
 #==============================================================================
-from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
-TRUTH1PhotonThinning = DerivationFramework__GenericTruthThinning(name                    = "TRUTH1PhotonThinning",
-                                                                 StreamName              = streamName,
-                                                                 ParticlesKey            = "TruthPhotons",  
-                                                                 ParticleSelectionString = "(TruthPhotons.classifierParticleOrigin != 42) || (TruthPhotons.pt > 20.0*GeV)")
-ToolSvc += TRUTH1PhotonThinning
+from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
+TRUTH1SlimmingHelper = SlimmingHelper("TRUTH1SlimmingHelper")
+TRUTH1SlimmingHelper.AppendToDictionary = {'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
+                                           'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
+                                           'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBottom':'xAOD::TruthParticleContainer','TruthBottomAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'HardScatterParticles':'xAOD::TruthParticleContainer','HardScatterParticlesAux':'xAOD::TruthParticleAuxContainer',
+                                           'HardScatterVertices':'xAOD::TruthVertexContainer','HardScatterVerticesAux':'xAOD::TruthVertexAuxContainer',
+                                           'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
+                                           'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
+                                           'AntiKt2TruthChargedJets':'xAOD::JetContainer','AntiKt2TruthChargedJetsAux':'xAOD::JetAuxContainer',
+                                           'AntiKt4TruthDressedWZJets':'xAOD::JetContainer','AntiKt4TruthDressedWZJetsAux':'xAOD::JetAuxContainer',
+                                           'AntiKt10TruthJets':'xAOD::JetContainer','AntiKt10TruthJetsAux':'xAOD::JetAuxContainer',
+                                           'AntiKt10TruthTrimmedPtFrac5SmallR20Jets':'xAOD::JetContainer','AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux':'xAOD::JetAuxContainer'
+                                          }
+# Custom extra variables -- won't be overridden by the call below, just added to. Full lists for completeness.
+TRUTH1SlimmingHelper.ExtraVariables = ["AntiKt2TruthChargedJets.GhostHBosonsCount.GhostHBosonsPt.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.HadronConeExclTruthLabelID.ConeTruthLabelID.PartonTruthLabelID.TruthLabelDeltaR_B.TruthLabelDeltaR_C.TruthLabelDeltaR_T.ConeExclBHadronsFinal.ConeExclCHadronsFinal.ConeExclTausFinal.constituentLinks",
+                                       "AntiKt4TruthDressedWZJets.GhostCHadronsFinalCount.GhostBHadronsFinalCount.pt.HadronConeExclTruthLabelID.ConeTruthLabelID.PartonTruthLabelID.TruthLabelDeltaR_B.TruthLabelDeltaR_C.TruthLabelDeltaR_T.ConeExclBHadronsFinal.ConeExclCHadronsFinal.ConeExclTausFinal.constituentLinks",
+                                       "AntiKt10TruthTrimmedPtFrac5SmallR20Jets.pt.Tau1_wta.Tau2_wta.Tau3_wta.constituentLinks.D2"]
 
-#Let's save the post-shower HT and MET filter values that will make combining filtered samples easier (adds to the EventInfo) 
-SUSYGenFilt_MCTruthClassifier = MCTruthClassifier(name = "SUSYGenFilt_MCTruthClassifier",
-                                                  ParticleCaloExtensionTool="")
-ToolSvc += SUSYGenFilt_MCTruthClassifier
-GenFilter = CfgMgr.DerivationFramework__SUSYGenFilterTool(
-  "MTandHTGenFilt",
-  )
-ToolSvc += GenFilter
+# Add standard content
+from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool
+addTruth3ContentToSlimmerTool(TRUTH1SlimmingHelper)
 
-#==============================================================================
-# Create the derivation kernel algorithm
-#==============================================================================
-from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
-augmentationTools += [DFCommonTruthClassificationTool,GenFilter,
-                      DFCommonTruthMuonTool,DFCommonTruthElectronTool,DFCommonTruthPhotonTool,DFCommonTruthNeutrinoTool,
-                      DFCommonTruthElectronDressingTool, DFCommonTruthMuonDressingTool,
-                      DFCommonTruthElectronIsolationTool1, DFCommonTruthElectronIsolationTool2,
-                      DFCommonTruthMuonIsolationTool1, DFCommonTruthMuonIsolationTool2,
-                      DFCommonTruthPhotonIsolationTool1, DFCommonTruthPhotonIsolationTool2]
-DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("TRUTH1Kernel",
-                                                                        AugmentationTools = augmentationTools,
-                                                                        ThinningTools = [TRUTH1TruthThinning,TRUTH1PhotonThinning])
-
-#==============================================================================
-# Set up slimming content list here
-#==============================================================================
+TRUTH1SlimmingHelper.AppendContentToStream(TRUTH1Stream)
+# Add the event info, in its entirety
 TRUTH1Stream.AddItem("xAOD::EventInfo#McEventInfo")
 TRUTH1Stream.AddItem("xAOD::EventInfo#EventInfo")
 TRUTH1Stream.AddItem("xAOD::EventAuxInfo#EventInfoAux.")
-TRUTH1Stream.AddItem("xAOD::JetContainer#AntiKt4TruthWZJets")
-TRUTH1Stream.AddItem("xAOD::JetContainer#AntiKt4TruthJets")
-TRUTH1Stream.AddItem("xAOD::JetAuxContainer#AntiKt4TruthJetsAux.")
-TRUTH1Stream.AddItem("xAOD::JetAuxContainer#AntiKt4TruthWZJetsAux.")
-TRUTH1Stream.AddItem("xAOD::JetContainer#TrimmedAntiKt10TruthJets")
-TRUTH1Stream.AddItem("xAOD::JetAuxContainer#TrimmedAntiKt10TruthJetsAux.")
-TRUTH1Stream.AddItem("xAOD::JetContainer#AntiKt10TruthJets")
-TRUTH1Stream.AddItem("xAOD::JetAuxContainer#AntiKt10TruthJetsAux.")
-TRUTH1Stream.AddItem("xAOD::MissingETContainer#MET_Truth")
-TRUTH1Stream.AddItem("xAOD::MissingETContainer#MET_TruthRegions")
-TRUTH1Stream.AddItem("xAOD::MissingETAuxContainer#MET_TruthAux.")
-TRUTH1Stream.AddItem("xAOD::MissingETAuxContainer#MET_TruthRegionsAux.")
+# Add the entirety of the truth event
 TRUTH1Stream.AddItem( "xAOD::TruthEventContainer#TruthEvents" )
 TRUTH1Stream.AddItem( "xAOD::TruthEventAuxContainer#TruthEventsAux." )
 TRUTH1Stream.AddItem( "xAOD::TruthVertexContainer#TruthVertices" )
 TRUTH1Stream.AddItem( "xAOD::TruthVertexAuxContainer#TruthVerticesAux." )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#JetInputTruthParticles" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#JetInputTruthParticlesNoWZ" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthElectrons" )
+TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthParticles" )
+TRUTH1Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthParticlesAux." )
+# Not clear to me if these are needed?
 TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBHadronsFinal" )
 TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBHadronsInitial" )
 TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBQuarksFinal" )
@@ -223,15 +85,10 @@ TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelTQuarksFinal" )
 TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelTausFinal" )
 TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelWBosons" )
 TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelZBosons" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthMuons" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthParticles" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthPhotons" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthTaus" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleContainer#TruthNeutrinos" )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthElectronsAux." )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthMuonsAux." )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthParticlesAux." )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthPhotonsAux." )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthTausAux." )
-TRUTH1Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthNeutrinosAux." )
+# Keep the metadata of course!
 TRUTH1Stream.AddMetaDataItem( [ "xAOD::TruthMetaDataContainer#TruthMetaData", "xAOD::TruthMetaDataAuxContainer#TruthMetaDataAux." ] )
+
+# If we don't have a conditions tag set by now, then assume this job isn't going to have one and kill the conditions service
+if len(globalflags.ConditionsTag())==0:
+    for a in svcMgr.PoolSvc.ReadCatalog:
+        svcMgr.PoolSvc.ReadCatalog.remove(a)
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH2.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH2.py
index 46a6eb735e3522cd4186994ff45f541bc1c2ab9e..d4ac40bb1c0bfe8aa2a24f5ee02bd6aa971083b0 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH2.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH2.py
@@ -9,91 +9,11 @@
 #==============================================================================
 from DerivationFrameworkCore.DerivationFrameworkMaster import *
 
-#====================================================================
-# ATTACH THE RECONSTRUCTION TO THE SEQUENCER  
-#====================================================================
-
-# Flag to distinguish EVNT/xAOD input
-isEVNT = True
-
-# Add translator from EVGEN input to xAOD-like truth here
-from RecExConfig.ObjKeyStore import objKeyStore
-from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
-from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__xAODtoHepMCCnvAlg
-
-if objKeyStore.isInInput( "McEventCollection", "GEN_EVENT" ):
-    DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_EVNT2xAOD",AODContainerName="GEN_EVENT")
-    isEVNT = True
-else:
-    # Add back-translator from xAOD::TruthEvent to HepMC for xAOD input
-    # Needed to run hard truth on xAOD input files
-    # Use GEN_EVENT name for output
-    DerivationFrameworkJob += DerivationFramework__xAODtoHepMCCnvAlg("xAOD2GEN_EVENT",
-                                  xAODTruthEventKey = "TruthEvents",
-                                  HepMCTruthEventKey = "GEN_EVENT",
-                                  MaxCount = 5,
-                                  OutputLevel = Lvl.INFO)
-    isEVNT = False
-    
-#==============================================================================
-# Set up stream
-#==============================================================================
-
-streamName = derivationFlags.WriteDAOD_TRUTH2Stream.StreamName
-fileName = buildFileName( derivationFlags.WriteDAOD_TRUTH2Stream )
-TRUTH2Stream = MSMgr.NewPoolRootStream( streamName, fileName )
-# Only events that pass the filters listed are written out
-# AcceptAlgs  = logical OR of filters
-# RequireAlgs = logical AND of filters
-TRUTH2Stream.AcceptAlgs(['TRUTH2Kernel'])
-
-augStream = MSMgr.GetStream( streamName )
-evtStream = augStream.GetEventStream()
-
-#==============================================================================
-# Make truth jets and MET
-#==============================================================================
-
-# Only do this for EVNT input, not xAOD
-# For Rel.20 use JetRec-02-04-82-08 to avoid CaloCluster ERROR for truth
-
-if( isEVNT ):
-
-    # Set jet flags
-    from JetRec.JetRecFlags import jetFlags
-    jetFlags.useTruth = True
-    jetFlags.useTracks = False
-    # Add jet algorithms
-    from JetRec.JetAlgorithm import addJetRecoToAlgSequence
-    addJetRecoToAlgSequence(DerivationFrameworkJob,eventShapeTools=None)
-    from JetRec.JetRecStandard import jtm
-    from JetRec.JetRecConf import JetAlgorithm
-    jetFlags.truthFlavorTags = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
-                                "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
-                                "TausFinal",
-                                "Partons",
-                                ]
-    # Standard truth jets
-    # To recover jet constituents remove the last modifier.
-    akt4 = jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit], ptmin= 5000)
-    akt4alg = JetAlgorithm("jetalgAntiKt4TruthJets", Tools = [akt4] )
-    DerivationFrameworkJob += akt4alg
-    
-    # WZ Truth Jets
-    #jtm.addJetFinder("AntiKt4TruthWZJets",  "AntiKt", 0.4,  "truthwz", ptmin= 5000)
-    #jtm.addJetFinder("AntiKt6TruthWZJets",  "AntiKt", 0.6,  "truthwz", ptmin= 5000)
-    # Other jets
-    #akt6  = jtm.addJetFinder("AntiKt6TruthJets", "AntiKt", 0.6, "truth", ptmin= 5000)
-    #akt10 = jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth", ptmin= 5000)
-    #akt10trim = jtm.addJetTrimmer("TrimmedAntiKt10TruthJets", rclus=0.3, ptfrac=0.05, input='AntiKt10TruthJets')
-    
-    # Add truth-based MET algorithm here
-    import METReconstruction.METConfig_Truth
-    from METReconstruction.METRecoFlags import metFlags # not sure if you even need this line
-    from METReconstruction.METRecoConfig import getMETRecoAlg
-    metAlg = getMETRecoAlg('METReconstruction')
-    DerivationFrameworkJob += metAlg
-
+# Add translator from EVGEN input to xAOD-like truth
+# Add all the particle derivation tools
+# This sets up its own common kernel and adds the common tools to it
+from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents
+addStandardTruthContents()
 
 #==============================================================================
 # Build hard truth HepMC
@@ -104,15 +24,14 @@ thinHard = DerivationFramework__CompactHardTruth(
                                 McEvent = "GEN_EVENT",
                                 McEventOut = "GEN_HARD",
                                 DanglePtCut = 1000.,
-                                MaxCount = 5,
-                                OutputLevel = Lvl.INFO)
-
+                                MaxCount = 5)
 DerivationFrameworkJob += thinHard
 
 # Convert GEN_HARD to TruthEvent format with new name(s):
 # Need to set TruthLinks to avoid conflict with standard name
 # Need to set xAODTruthPileupEventContainerName
-
+# No need for truth metadata here; it comes from the other converter
+from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
 DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg(
                           "GEN_HARD2xAOD",
                           AODContainerName="GEN_HARD",
@@ -121,19 +40,14 @@ DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg(
                           xAODTruthParticleContainerName="TruthHardParticles",
                           xAODTruthVertexContainerName="TruthHardVertices",
                           TruthLinks="TruthHardLinks",
-                          OutputLevel = Lvl.INFO)
-
-
-#####################################
-# Skip new truth collections in TRUTH1
-#####################################
+                          WriteTruthMetaData=False)
 
 #==============================================================================
 # Thin standard TruthEvent with HardTruthThinning
 #==============================================================================
 
 # HardTruthThinning is designed to work with CompactHardTruth. It uses
-# thinning to keep truth particles related to hard objects:
+# ThinningSvc to keep truth particles related to hard objects:
 #      - Stable particles matching those from CompactHardTruth
 #      - Stable particles from truth jets (with some selection)
 #      - Selected particles and their descendant particles/vertices
@@ -149,8 +63,6 @@ keepers  = cHadrons + bHadrons + tau
 from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__HardTruthThinning
 TRUTH2TruthThinningTool = DerivationFramework__HardTruthThinning(
                          name = "HardThinTool",
-                         StreamName = streamName,
-                         EventInfo = "McEventInfo",
                          TruthParticles = "TruthParticles",
                          TruthVertices = "TruthVertices",
                          HardParticles = "TruthHardParticles",
@@ -175,21 +87,53 @@ DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel(
                           ThinningTools = thinningTools)
 
 #==============================================================================
-# Set up slimming content list here
+# Set up stream
 #==============================================================================
 
+streamName = derivationFlags.WriteDAOD_TRUTH2Stream.StreamName
+fileName = buildFileName( derivationFlags.WriteDAOD_TRUTH2Stream )
+TRUTH2Stream = MSMgr.NewPoolRootStream( streamName, fileName )
+# Only events that pass the filters listed are written out
+# AcceptAlgs  = logical OR of filters
+# RequireAlgs = logical AND of filters
+TRUTH2Stream.AcceptAlgs(['TRUTH2Kernel'])
+
+#==============================================================================
+# Set up slimming content list here
+#==============================================================================
+from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
+TRUTH2SlimmingHelper = SlimmingHelper("TRUTH2SlimmingHelper")
+TRUTH2SlimmingHelper.AppendToDictionary = {'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
+                                           'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'AntiKt4TruthDressedWZJets':'xAOD::JetContainer','AntiKt4TruthDressedWZJetsAux':'xAOD::JetAuxContainer',
+                                           'AntiKt10TruthTrimmedPtFrac5SmallR20Jets':'xAOD::JetContainer','AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux':'xAOD::JetAuxContainer'
+                                          }
+TRUTH2SlimmingHelper.ExtraVariables = ["AntiKt4TruthDressedWZJets.GhostCHadronsFinalCount.GhostBHadronsFinalCount.pt.HadronConeExclTruthLabelID.ConeTruthLabelID.PartonTruthLabelID.TrueFlavor.TruthLabelDeltaR_B.TruthLabelDeltaR_C.TruthLabelDeltaR_T"]
+from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool
+addTruth3ContentToSlimmerTool(TRUTH2SlimmingHelper)
+TRUTH2SlimmingHelper.AppendContentToStream(TRUTH2Stream)
+
+# The entire event info, truth event, etc
 TRUTH2Stream.AddItem("xAOD::EventInfo#*")
 TRUTH2Stream.AddItem("xAOD::EventAuxInfo#*")
-TRUTH2Stream.AddItem("xAOD::JetContainer#*")
-TRUTH2Stream.AddItem("xAOD::JetAuxContainer#*")
-TRUTH2Stream.AddItem("xAOD::MissingETContainer#*")
-TRUTH2Stream.AddItem("xAOD::MissingETAuxContainer#*")
-
 TRUTH2Stream.AddItem( "xAOD::TruthEventContainer#*" )
 TRUTH2Stream.AddItem( "xAOD::TruthEventAuxContainer#*" )
 TRUTH2Stream.AddItem( "xAOD::TruthVertexContainer#*" )
 TRUTH2Stream.AddItem( "xAOD::TruthVertexAuxContainer#*" )
 TRUTH2Stream.AddItem( "xAOD::TruthParticleContainer#*" )
 TRUTH2Stream.AddItem( "xAOD::TruthParticleAuxContainer#*" )
+# Keep the metadata of course!
 TRUTH2Stream.AddMetaDataItem( [ "xAOD::TruthMetaDataContainer#TruthMetaData", "xAOD::TruthMetaDataAuxContainer#TruthMetaDataAux." ] )
 
+# If we don't have a conditions tag set by now, then assume this job isn't going to have one and kill the conditions service
+if len(globalflags.ConditionsTag())==0:
+    for a in svcMgr.PoolSvc.ReadCatalog:
+        svcMgr.PoolSvc.ReadCatalog.remove(a)
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH3.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH3.py
index 6b3997002d8675e1ef8136666316df90e3ff205e..5f44e324e5d3e23dc402ce2fab6399014d52e454 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH3.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH3.py
@@ -3,140 +3,12 @@
 # This should appear in ALL derivation job options
 #==============================================================================
 from DerivationFrameworkCore.DerivationFrameworkMaster import *
-# Add translator from EVGEN input to xAOD-like truth here
-from DerivationFrameworkMCTruth.MCTruthCommon import * 
-from DerivationFrameworkTau.TauTruthCommon import *
-# Flag to distinguish EVNT/xAOD input
-# isEVNT = False
-# This is now set in the MCTruthCommon
 
-#====================================================================
-# JET/MET
-#====================================================================
-# Set jet flags
-from JetRec.JetRecFlags import jetFlags
-jetFlags.useTruth = True
-jetFlags.useTracks = False
-# Add jet algorithms
-from JetRec.JetAlgorithm import addJetRecoToAlgSequence
-addJetRecoToAlgSequence(DerivationFrameworkJob,eventShapeTools=None)
-from JetRec.JetRecStandard import jtm
-from JetRec.JetRecConf import JetAlgorithm
-#jetFlags.truthFlavorTags = []
-
-jetFlags.truthFlavorTags = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
-                            "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
-                            "TausFinal",
-                            "Partons",
-                            ]
-
-if dfInputIsEVNT:
-  # Standard truth jets
-  # To recover jet constituents remove the last modifier.
-  akt4 = jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit, jtm.jetdrlabeler, jtm.trackjetdrlabeler], ptmin= 20000)
-  #akt4 = jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit, jtm.jetdrlabeler, jtm.trackjetdrlabeler], ptmin= 20000)
-  akt4alg = JetAlgorithm("jetalgAntiKt4TruthJets", Tools = [akt4] )
-  DerivationFrameworkJob += akt4alg
-
-  # WZ Truth Jets
-  akt4wz = jtm.addJetFinder("AntiKt4TruthWZJets",  "AntiKt", 0.4,  "truthwz", ptmin= 20000, modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit])
-  akt4wzalg = JetAlgorithm("jetalgAntiKt4TruthWZJets", Tools = [akt4wz] )
-  DerivationFrameworkJob += akt4wzalg
-  #jtm.addJetFinder("AntiKt6TruthWZJets",  "AntiKt", 0.6,  "truthwz", ptmin= 5000)
-  # Other jets
-  #akt6  = jtm.addJetFinder("AntiKt6TruthJets", "AntiKt", 0.6, "truth", ptmin= 5000)
-  #akt10 = jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth", ptmin= 5000)
-  #akt10trim = jtm.addJetTrimmer("TrimmedAntiKt10TruthJets", rclus=0.3, ptfrac=0.05, input='AntiKt10TruthJets')
-
-  #Large R jets
-  akt10 = jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth",ptmin= 100000)
-  akt10alg = JetAlgorithm("jetalgAntiKt10TruthJets", Tools = [akt10] )
-  DerivationFrameworkJob += akt10alg
-  akt10trim = jtm.addJetTrimmer("TrimmedAntiKt10TruthJets", rclus=0.2, ptfrac=0.05, input='AntiKt10TruthJets', modifiersin=[jtm.nsubjettiness, jtm.removeconstit])
-  akt10trimalg = JetAlgorithm("jetalgTrimmedAntiKt10TruthJets", Tools = [akt10trim] )
-  DerivationFrameworkJob += akt10trimalg
-
-# Add truth-based MET algorithm here
-import METReconstruction.METConfig_Truth
-from METReconstruction.METRecoFlags import metFlags # not sure if you even need this line
-from METReconstruction.METRecoConfig import getMETRecoAlg
-metAlg = getMETRecoAlg('METReconstruction')
-DerivationFrameworkJob += metAlg
-
-#==============================================================================
-# Create the derivation kernel algorithm
-#==============================================================================
-
-#Photons with a pT cut
-TRUTH3PhotonTool = DerivationFramework__TruthCollectionMaker(name                 = "TRUTH3PhotonTool",
-                                                             NewCollectionName       = "Truth3Photons",
-                                                             ParticleSelectionString = "(abs(TruthParticles.pdgId) == 22) && (TruthParticles.status == 1) && (TruthParticles.pt > 20.0*GeV)")
-# ((TruthParticles.classifierParticleOrigin != 42) || (TruthParticles.pt > 20.0*GeV)))")
-ToolSvc += TRUTH3PhotonTool
-
-'''
-#from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthIsolationTool
-TRUTH3PhotonIsolationTool1 = DerivationFramework__TruthIsolationTool(name = "TRUTH3PhotonIsolationTool1",
-                                                                  isoParticlesKey = "TruthPhotons",
-                                                                  allParticlesKey = "TruthParticles",
-                                                                  particleIDsToCalculate = [22],
-                                                                  IsolationConeSizes = [0.2],
-                                                                  IsolationVarNamePrefix = 'etcone',
-                                                                  ChargedParticlesOnly = False
-                                                                  )
-ToolSvc += TRUTH3PhotonIsolationTool1
-TRUTH3PhotonIsolationTool2 = DerivationFramework__TruthIsolationTool(name = "TRUTH3PhotonIsolationTool2",
-                                                                  isoParticlesKey = "TruthPhotons",
-                                                                  allParticlesKey = "TruthParticles",
-                                                                  particleIDsToCalculate = [22],
-                                                                  IsolationConeSizes = [0.3],
-                                                                  IsolationVarNamePrefix = 'ptcone',
-                                                                  ChargedParticlesOnly = True
-                                                                  )
-ToolSvc += TRUTH3PhotonIsolationTool2
-'''
-
-#Now, for partons.
-TRUTH3TopTool = DerivationFramework__TruthCollectionMaker(name                   = "TRUTH3TopTool",
-                                                          NewCollectionName       = "TruthTop",
-                                                          ParticleSelectionString = "(abs(TruthParticles.pdgId) == 6)",
-                                                          Do_Compress = True,
-                                                          )
-ToolSvc += TRUTH3TopTool
-
-TRUTH3BosonTool = DerivationFramework__TruthCollectionMaker(name                   = "TRUTH3BosonTool",
-                                                            NewCollectionName       = "TruthBoson",
-                                                            ParticleSelectionString = "(abs(TruthParticles.pdgId) == 23 || abs(TruthParticles.pdgId) == 24 || abs(TruthParticles.pdgId) == 25)",
-                                                            Do_Compress = True,
-                                                            Do_Sherpa= True)
-ToolSvc += TRUTH3BosonTool
-
-TRUTH3BSMTool = DerivationFramework__TruthCollectionMaker(name                   = "TRUTH3BSMTool",
-                                                          NewCollectionName       = "TruthBSM",
-                                                          ParticleSelectionString = "( (31<abs(TruthParticles.pdgId) && abs(TruthParticles.pdgId)<38) || abs(TruthParticles.pdgId)==39 || abs(TruthParticles.pdgId)==41 || abs(TruthParticles.pdgId)==42 || abs(TruthParticles.pdgId)== 7 || abs(TruthParticles.pdgId)== 8 || (1000000<abs(TruthParticles.pdgId) && abs(TruthParticles.pdgId)<1000040) || (2000000<abs(TruthParticles.pdgId) && abs(TruthParticles.pdgId)<2000040) )",
-                                                          Do_Compress = True)
-ToolSvc += TRUTH3BSMTool
-#Taken from the code in DerivationFramework::MenuTruthThinning::isBSM
-
-#Let's save the post-shower HT and MET filter values that will make combining filtered samples easier (adds to the EventInfo)
-SUSYGenFilt_MCTruthClassifier = MCTruthClassifier(name = "SUSYGenFilt_MCTruthClassifier",
-                                                  ParticleCaloExtensionTool="")
-ToolSvc += SUSYGenFilt_MCTruthClassifier
-GenFilter = CfgMgr.DerivationFramework__SUSYGenFilterTool(
-  "MTandHTGenFilt",
-  )
-ToolSvc += GenFilter
-
-from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
-DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("TRUTH3Kernel",
-                                                                       AugmentationTools = [DFCommonTruthClassificationTool,GenFilter,
-                                                                                            DFCommonTruthMuonTool,DFCommonTruthElectronTool,TRUTH3PhotonTool,DFCommonTruthNeutrinoTool,
-                                                                                            TRUTH3TopTool,TRUTH3BosonTool,TRUTH3BSMTool,
-                                                                                            DFCommonTruthElectronDressingTool, DFCommonTruthMuonDressingTool,
-                                                                                            DFCommonTruthElectronIsolationTool1, DFCommonTruthElectronIsolationTool2,
-                                                                                            DFCommonTruthMuonIsolationTool1, DFCommonTruthMuonIsolationTool2],
-                                                                       ThinningTools = [])
-#                                                                       ThinningTools = [TRUTH3PhotonIsolationTool1, TRUTH3PhotonIsolationTool2])
+# Add translator from EVGEN input to xAOD-like truth
+# Add all the particle derivation tools
+# This sets up its own common kernel and adds the common tools to it
+from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents
+addStandardTruthContents()
 
 #==============================================================================
 # Set up stream
@@ -144,13 +16,6 @@ DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("TRUTH3Ke
 streamName = derivationFlags.WriteDAOD_TRUTH3Stream.StreamName
 fileName = buildFileName( derivationFlags.WriteDAOD_TRUTH3Stream )
 TRUTH3Stream = MSMgr.NewPoolRootStream( streamName, fileName )
-augStream = MSMgr.GetStream( streamName )
-evtStream = augStream.GetEventStream()
-
-# Only events that pass the filters listed are written out
-# AcceptAlgs  = logical OR of filters
-# RequireAlgs = logical AND of filters
-TRUTH3Stream.AcceptAlgs(['TRUTH3Kernel'])
 
 #==============================================================================
 # Set up slimming content list here
@@ -159,22 +24,40 @@ from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
 TRUTH3SlimmingHelper = SlimmingHelper("TRUTH3SlimmingHelper")
 TRUTH3SlimmingHelper.AppendToDictionary = {'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
                                            'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
-                                           'MET_TruthRegions':'xAOD::MissingETContainer','MET_TruthRegionsAux':'xAOD::MissingETAuxContainer',
                                            'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
                                            'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
-                                           'Truth3Photons':'xAOD::TruthParticleContainer','Truth3PhotonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
                                            'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
                                            'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
                                            'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
                                            'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBottom':'xAOD::TruthParticleContainer','TruthBottomAux':'xAOD::TruthParticleAuxContainer',
                                            'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
-                                           'AntiKt4TruthJets':'xAOD::JetContainer','AntiKt4TruthJetsAux':'xAOD::JetAuxContainer',
-                                           'TrimmedAntiKt10TruthJets':'xAOD::JetContainer','TrimmedAntiKt10TruthJetsAux':'xAOD::JetAuxContainer'     
+                                           'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
+                                           'HardScatterParticles':'xAOD::TruthParticleContainer','HardScatterParticlesAux':'xAOD::TruthParticleAuxContainer',
+                                           'HardScatterVertices':'xAOD::TruthVertexContainer','HardScatterVerticesAux':'xAOD::TruthVertexAuxContainer',
+                                           'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
+                                           'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
+                                           'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
+                                           'AntiKt4TruthDressedWZJets':'xAOD::JetContainer','AntiKt4TruthDressedWZJetsAux':'xAOD::JetAuxContainer',
+                                           'AntiKt10TruthSoftDropBeta100Zcut10Jets':'xAOD::JetContainer','AntiKt10TruthSoftDropBeta100Zcut10JetsAux':'xAOD::JetAuxContainer'
                                           }
-TRUTH3SlimmingHelper.AllVariables = ["MET_Truth","MET_TruthRegions","TruthElectrons","TruthMuons","Truth3Photons","TruthTaus","TruthNeutrinos","TruthBSM","TruthTop","TruthBoson"]
-TRUTH3SlimmingHelper.ExtraVariables = ["AntiKt4TruthJets.GhostCHadronsFinalCount.GhostBHadronsFinalCount.pt.HadronConeExclTruthLabelID.ConeTruthLabelID.PartonTruthLabelID.TruthLabelDeltaR_B.TruthLabelDeltaR_C.TruthLabelDeltaR_T",
-                                       "TrimmedAntiKt10TruthJets.pt.Tau1_wta.Tau2_wta.Tau3_wta",
-                                       "TruthEvents.Q.XF1.XF2.PDGID1.PDGID2.PDFID1.PDFID2.X1.X2.weights.crossSection"]
+
+from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool
+addTruth3ContentToSlimmerTool(TRUTH3SlimmingHelper)
 TRUTH3SlimmingHelper.AppendContentToStream(TRUTH3Stream)
+
+# Keep the metadata of course!
 TRUTH3Stream.AddMetaDataItem( [ "xAOD::TruthMetaDataContainer#TruthMetaData", "xAOD::TruthMetaDataAuxContainer#TruthMetaDataAux." ] )
 
+# Remove the old-style event info. It just duplicates information, and it's quite large in the case of multiple event weights.
+# Note that in 21.2, this means we can't read the file in athena. A bit too dangerous given truth analyses that might be of interest.
+# In master, this is safe and saves us another 0.75kB/event or so
+TRUTH3Stream.RemoveItem('EventInfo#*')
+
+# If we don't have a conditions tag set by now, then assume this job isn't going to have one and kill the conditions service
+if len(globalflags.ConditionsTag())==0:
+    for a in svcMgr.PoolSvc.ReadCatalog:
+        svcMgr.PoolSvc.ReadCatalog.remove(a)
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH4.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH4.py
deleted file mode 100644
index 5d583575b4cb44398c64b07c7b8ee4b09145e035..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH4.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#==============================================================================
-# Set up common services and job object.
-# This should appear in ALL derivation job options
-#==============================================================================
-
-# Add translator from EVGEN input to xAOD-like truth here
-from DerivationFrameworkCore.DerivationFrameworkMaster import *
-from RecExConfig.ObjKeyStore import objKeyStore
-from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
-from DerivationFrameworkMCTruth.TruthDerivationTools import *
-
-if objKeyStore.isInInput( "McEventCollection", "GEN_EVENT" ):
-        DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_EVNT2xAOD",AODContainerName="GEN_EVENT")
-elif objKeyStore.isInInput( "McEventCollection", "TruthEvent"):
-        DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_EVNT2xAOD",AODContainerName="TruthEvent")
-
-from DerivationFrameworkHiggs.TruthCategories import *
-
-#====================================================================
-# JET/MET
-#====================================================================
-# Set jet flags
-from JetRec.JetRecFlags import jetFlags
-jetFlags.useTruth = True
-jetFlags.useTracks = False
-# Add jet algorithms
-from JetRec.JetAlgorithm import addJetRecoToAlgSequence
-addJetRecoToAlgSequence(DerivationFrameworkJob,eventShapeTools=None)
-from JetRec.JetRecStandard import jtm
-from JetRec.JetRecConf import JetAlgorithm
-jetFlags.truthFlavorTags = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
-                            "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
-                            "TausFinal",
-                            "Partons",
-                            ]
-# Standard truth jets
-# To recover jet constituents remove the last modifier.
-akt4 = jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit], ptmin= 5000)
-akt4alg = JetAlgorithm("jetalgAntiKt4TruthJets", Tools = [akt4] )
-DerivationFrameworkJob += akt4alg
-
-# WZ Truth Jets
-akt4wz = jtm.addJetFinder("AntiKt4TruthWZJets",  "AntiKt", 0.4,  "truthwz", ptmin= 5000, modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit])
-akt4wzalg = JetAlgorithm("jetalgAntiKt4TruthWZJets", Tools = [akt4wz] )
-DerivationFrameworkJob += akt4wzalg
-#jtm.addJetFinder("AntiKt6TruthWZJets",  "AntiKt", 0.6,  "truthwz", ptmin= 5000)
-# Other jets
-#akt6  = jtm.addJetFinder("AntiKt6TruthJets", "AntiKt", 0.6, "truth", ptmin= 5000)
-#akt10 = jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth", ptmin= 5000)
-#akt10trim = jtm.addJetTrimmer("TrimmedAntiKt10TruthJets", rclus=0.3, ptfrac=0.05, input='AntiKt10TruthJets')
-
-# Add truth-based MET algorithm here
-import METReconstruction.METConfig_Truth
-from METReconstruction.METRecoFlags import metFlags # not sure if you even need this line
-from METReconstruction.METRecoConfig import getMETRecoAlg
-metAlg = getMETRecoAlg('METReconstruction')
-DerivationFrameworkJob += metAlg
-
-#==============================================================================
-# Create the derivation kernel algorithm
-#==============================================================================
-from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
-DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("TRUTH4Kernel")
-
-#==============================================================================
-# Set up stream
-#==============================================================================
-streamName = derivationFlags.WriteDAOD_TRUTH4Stream.StreamName
-fileName = buildFileName( derivationFlags.WriteDAOD_TRUTH4Stream )
-TRUTH4Stream = MSMgr.NewPoolRootStream( streamName, fileName )
-
-# Only events that pass the filters listed are written out
-# AcceptAlgs  = logical OR of filters
-# RequireAlgs = logical AND of filters
-TRUTH4Stream.AcceptAlgs(['TRUTH4Kernel'])
-
-#==============================================================================
-# Set up slimming content list here
-#==============================================================================
-TRUTH4Stream.AddItem("xAOD::EventInfo#McEventInfo")
-TRUTH4Stream.AddItem("xAOD::EventInfo#EventInfo")
-TRUTH4Stream.AddItem("xAOD::EventAuxInfo#EventInfoAux.")
-TRUTH4Stream.AddItem("xAOD::JetContainer#AntiKt4TruthWZJets")
-TRUTH4Stream.AddItem("xAOD::JetContainer#AntiKt4TruthJets")
-TRUTH4Stream.AddItem("xAOD::JetAuxContainer#AntiKt4TruthJetsAux.")
-TRUTH4Stream.AddItem("xAOD::JetAuxContainer#AntiKt4TruthWZJetsAux.")
-TRUTH4Stream.AddItem("xAOD::MissingETContainer#MET_Truth")
-TRUTH4Stream.AddItem("xAOD::MissingETContainer#MET_TruthRegions")
-TRUTH4Stream.AddItem("xAOD::MissingETAuxContainer#MET_TruthAux.")
-TRUTH4Stream.AddItem("xAOD::MissingETAuxContainer#MET_TruthRegionsAux.")
-TRUTH4Stream.AddItem( "xAOD::TruthEventContainer#TruthEvents" )
-TRUTH4Stream.AddItem( "xAOD::TruthEventAuxContainer#TruthEventsAux." )
-TRUTH4Stream.AddItem( "xAOD::TruthVertexContainer#TruthVertices" )
-TRUTH4Stream.AddItem( "xAOD::TruthVertexAuxContainer#TruthVerticesAux." )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthParticles" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthParticlesAux." )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#JetInputTruthParticles" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#JetInputTruthParticlesNoWZ" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBHadronsFinal" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBHadronsInitial" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBQuarksFinal" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelCHadronsFinal" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelCHadronsInitial" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelCQuarksFinal" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelHBosons" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelPartons" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelTQuarksFinal" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelTausFinal" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelWBosons" )
-TRUTH4Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelZBosons" )
-TRUTH4Stream.AddMetaDataItem( [ "xAOD::TruthMetaDataContainer#TruthMetaData", "xAOD::TruthMetaDataAuxContainer#TruthMetaDataAux." ] )
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH5.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH5.py
deleted file mode 100644
index b6e1606de72d10d98c2a1573eb6c349bc90fb703..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/share/TRUTH5.py
+++ /dev/null
@@ -1,168 +0,0 @@
-#==============================================================================
-# Set up common services and job object.
-# This should appear in ALL derivation job options
-#==============================================================================
-from DerivationFrameworkCore.DerivationFrameworkMaster import *
-from DerivationFrameworkCore.DerivationFrameworkMaster import *
-from RecExConfig.ObjKeyStore import objKeyStore
-from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
-from DerivationFrameworkMCTruth.TruthDerivationTools import *
-
-#==============================================================================
-# Set up stream
-#==============================================================================
-streamName = derivationFlags.WriteDAOD_TRUTH5Stream.StreamName
-fileName = buildFileName( derivationFlags.WriteDAOD_TRUTH5Stream )
-TRUTH5Stream = MSMgr.NewPoolRootStream( streamName, fileName )
-augStream = MSMgr.GetStream( streamName )
-evtStream = augStream.GetEventStream()
-
-# Only events that pass the filters listed are written out
-# AcceptAlgs  = logical OR of filters
-# RequireAlgs = logical AND of filters
-TRUTH5Stream.AcceptAlgs(['TRUTH5Kernel'])
-
-#====================================================================
-# GEN_AOD and xAOD truth making
-#====================================================================
-
-from McParticleAlgs.JobOptCfg import McAodBuilder,createMcAodBuilder
-builder =  createMcAodBuilder(inMcEvtCollection = "GEN_EVENT")
-DerivationFrameworkJob += builder
-DerivationFrameworkJob += xAODMaker__xAODTruthCnvAlg("GEN_AOD2xAOD",AODContainerName="GEN_AOD")
-
-#====================================================================
-# JET/MET
-#====================================================================
-# Set jet flags
-from JetRec.JetRecFlags import jetFlags
-jetFlags.useTruth = True
-jetFlags.useTracks = False
-# Add jet algorithms
-from JetRec.JetAlgorithm import addJetRecoToAlgSequence
-addJetRecoToAlgSequence(DerivationFrameworkJob,eventShapeTools=None)
-from JetRec.JetRecStandard import jtm
-from JetRec.JetRecConf import JetAlgorithm
-jetFlags.truthFlavorTags = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal",
-                            "CHadronsInitial", "CHadronsFinal", "CQuarksFinal",
-                            "TausFinal",
-                            "Partons",
-                            ]
-# Standard truth jets
-# To recover jet constituents remove the last modifier.
-akt4 = jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit, jtm.jetdrlabeler, jtm.trackjetdrlabeler], ptmin= 5000)
-akt4alg = JetAlgorithm("jetalgAntiKt4TruthJets", Tools = [akt4] )
-DerivationFrameworkJob += akt4alg
-
-# WZ Truth Jets
-akt4wz = jtm.addJetFinder("AntiKt4TruthWZJets",  "AntiKt", 0.4,  "truthwz", ptmin= 5000, modifiersin=[jtm.truthpartondr, jtm.partontruthlabel, jtm.removeconstit])
-akt4wzalg = JetAlgorithm("jetalgAntiKt4TruthWZJets", Tools = [akt4wz] )
-DerivationFrameworkJob += akt4wzalg
-#jtm.addJetFinder("AntiKt6TruthWZJets",  "AntiKt", 0.6,  "truthwz", ptmin= 5000)
-# Other jets
-#akt6  = jtm.addJetFinder("AntiKt6TruthJets", "AntiKt", 0.6, "truth", ptmin= 5000)
-#akt10 = jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth", ptmin= 5000)
-#akt10trim = jtm.addJetTrimmer("TrimmedAntiKt10TruthJets", rclus=0.3, ptfrac=0.05, input='AntiKt10TruthJets')
-
-# Add truth-based MET algorithm here
-import METReconstruction.METConfig_Truth
-from METReconstruction.METRecoFlags import metFlags # not sure if you even need this line
-from METReconstruction.METRecoConfig import getMETRecoAlg
-metAlg = getMETRecoAlg('METReconstruction')
-DerivationFrameworkJob += metAlg
-
-#==============================================================================
-# Thinning the master truth collection 
-#==============================================================================
-from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__MenuTruthThinning
-TRUTH5TruthThinning = DerivationFramework__MenuTruthThinning(name                      = "TRUTH5TruthThinning",
-                                                            StreamName                 = streamName,
-                                                            WritePartons               = False,
-                                                            WriteHadrons               = False,
-                                                            WriteBHadrons              = True,
-                                                            WriteGeant                 = False,
-                                                            GeantPhotonPtThresh        = -1.0,
-                                                            WriteTauHad                = True,
-                                                            PartonPtThresh             = -1.0,
-                                                            WriteBSM                   = True,
-                                                            WriteBosons                = True,
-                                                            WriteBSMProducts           = True,
-                                                            WriteBosonProducts         = True,
-                                                            WriteTopAndDecays          = True,
-                                                            WriteEverything            = False,
-                                                            WriteAllLeptons            = False,
-                                                            WriteStatus3               = False,
-                                                            PreserveDescendants        = False, 
-                                                            PreserveGeneratorDescendants = False,
-                                                            PreserveAncestors          = True,
-                                                            WriteFirstN                = 10)
-ToolSvc += TRUTH5TruthThinning
-
-#==============================================================================
-# Thinning the photon truth collection : no photons from pi0 (origin=42)
-#==============================================================================
-from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__GenericTruthThinning
-TRUTH5PhotonThinning = DerivationFramework__GenericTruthThinning(name                    = "TRUTH5PhotonThinning",
-                                                                 StreamName              = streamName,
-                                                                 ParticlesKey            = "TruthPhotons",  
-                                                                 ParticleSelectionString = "(TruthPhotons.classifierParticleOrigin != 42) || (TruthPhotons.pt > 20.0*GeV)")
-ToolSvc += TRUTH5PhotonThinning
-
-#==============================================================================
-# Create the derivation kernel algorithm
-#==============================================================================
-from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
-DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("TRUTH5Kernel",
-                                                                        AugmentationTools = [DFCommonTruthClassificationTool,
-                                                                          DFCommonTruthMuonTool,DFCommonTruthElectronTool,DFCommonTruthPhotonTool,DFCommonTruthTauTool,DFCommonTruthNeutrinoTool,
-                                                                          DFCommonTruthElectronDressingTool, DFCommonTruthMuonDressingTool,
-                                                                          DFCommonTruthElectronIsolationTool1, DFCommonTruthElectronIsolationTool2,
-                                                                          DFCommonTruthMuonIsolationTool1, DFCommonTruthMuonIsolationTool2,
-                                                                          DFCommonTruthPhotonIsolationTool1, DFCommonTruthPhotonIsolationTool2],
-                                                                        ThinningTools = [TRUTH5TruthThinning,TRUTH5PhotonThinning])
-
-#==============================================================================
-# Set up slimming content list here
-#==============================================================================
-TRUTH5Stream.AddItem("xAOD::EventInfo#McEventInfo")
-TRUTH5Stream.AddItem("xAOD::EventInfo#EventInfo")
-TRUTH5Stream.AddItem("xAOD::EventAuxInfo#EventInfoAux.")
-TRUTH5Stream.AddItem("xAOD::JetContainer#AntiKt4TruthWZJets")
-TRUTH5Stream.AddItem("xAOD::JetContainer#AntiKt4TruthJets")
-TRUTH5Stream.AddItem("xAOD::JetAuxContainer#AntiKt4TruthJetsAux.")
-TRUTH5Stream.AddItem("xAOD::JetAuxContainer#AntiKt4TruthWZJetsAux.")
-TRUTH5Stream.AddItem("xAOD::MissingETContainer#MET_Truth")
-TRUTH5Stream.AddItem("xAOD::MissingETContainer#MET_TruthRegions")
-TRUTH5Stream.AddItem("xAOD::MissingETAuxContainer#MET_TruthAux.")
-TRUTH5Stream.AddItem("xAOD::MissingETAuxContainer#MET_TruthRegionsAux.")
-TRUTH5Stream.AddItem( "xAOD::TruthEventContainer#TruthEvents" )
-TRUTH5Stream.AddItem( "xAOD::TruthEventAuxContainer#TruthEventsAux." )
-TRUTH5Stream.AddItem( "xAOD::TruthVertexContainer#TruthVertices" )
-TRUTH5Stream.AddItem( "xAOD::TruthVertexAuxContainer#TruthVerticesAux." )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#JetInputTruthParticles" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#JetInputTruthParticlesNoWZ" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthElectrons" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBHadronsFinal" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBHadronsInitial" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelBQuarksFinal" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelCHadronsFinal" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelCHadronsInitial" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelCQuarksFinal" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelHBosons" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelPartons" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelTQuarksFinal" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelTausFinal" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelWBosons" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthLabelZBosons" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthMuons" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthParticles" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthPhotons" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthTaus" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleContainer#TruthNeutrinos" )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthElectronsAux." )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthMuonsAux." )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthParticlesAux." )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthPhotonsAux." )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthTausAux." )
-TRUTH5Stream.AddItem( "xAOD::TruthParticleAuxContainer#TruthNeutrinosAux." )
-TRUTH5Stream.AddMetaDataItem( [ "xAOD::TruthMetaDataContainer#TruthMetaData", "xAOD::TruthMetaDataAuxContainer#TruthMetaDataAux." ] )
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/CMakeLists.txt b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/CMakeLists.txt
index 32a0c0cea2c398e2812f4858966327bc7012acb2..1cff0de860dccf00883eeaf3d730fab3e0747a29 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/CMakeLists.txt
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/CMakeLists.txt
@@ -4,15 +4,19 @@
 atlas_subdir( DerivationFrameworkMuons )
 
 # External dependencies:
-find_package( CLHEP )
 find_package( ROOT COMPONENTS Core MathCore )
 
 # Component(s) in the package:
-atlas_add_component( DerivationFrameworkMuons
+#the library is used by the MCP software https://gitlab.cern.ch/atlas-mcp/MuonPerformanceAnalysis
+atlas_add_library( DerivationFrameworkMuonsLib
    DerivationFrameworkMuons/*.h src/*.cxx src/components/*.cxx
-   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AsgTools AthContainers AthenaBaseComps AthenaKernel CaloEvent CaloGeoHelpers DerivationFrameworkInterfaces ExpressionEvaluationLib FourMomUtils GaudiKernel ICaloTrkMuIdTools InDetTrackSelectionToolLib MCTruthClassifierLib RecoToolInterfaces TrigDecisionToolLib TrigMuonMatchingLib TrkExInterfaces TrkParameters TrkSurfaces muonEvent xAODBase xAODCaloEvent xAODEventInfo xAODJet xAODMuon xAODPrimitives xAODTracking xAODTruth )
+   PUBLIC_HEADERS DerivationFrameworkMuons
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthContainers AthenaBaseComps AthenaKernel CaloEvent CaloGeoHelpers DerivationFrameworkInterfaces ExpressionEvaluationLib FourMomUtils GaudiKernel ICaloTrkMuIdTools InDetTrackSelectionToolLib MCTruthClassifierLib RecoToolInterfaces TrigDecisionToolLib TrigMuonMatchingLib TrkExInterfaces TrkParameters TrkSurfaces muonEvent xAODBase xAODCaloEvent xAODEventInfo xAODJet xAODMuon xAODPrimitives xAODTracking xAODTruth )
 
+atlas_add_component( DerivationFrameworkMuons
+   src/components/*.cxx
+   LINK_LIBRARIES GaudiKernel DerivationFrameworkMuonsLib )
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonIDCovMatrixDecorator.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonIDCovMatrixDecorator.cxx
index 17ea939aac6a2bb6816134155e2b61b5fc5b8199..239e97886ee768e24c0cdbc3efdd50f5497f78ef 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonIDCovMatrixDecorator.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonIDCovMatrixDecorator.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////
@@ -13,7 +13,6 @@
 #include <vector>
 #include <string>
 #include <memory>
-#include "CLHEP/Units/SystemOfUnits.h"
 #include "xAODMuon/MuonContainer.h"
 
 // Constructor
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/dimuonTaggingTool.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/dimuonTaggingTool.cxx
index f801b3a1dd481b47f3e143eecc259da267ab88da..3893f44f582c12f2223743068bda65da8cc409bf 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/dimuonTaggingTool.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/dimuonTaggingTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////
@@ -12,7 +12,7 @@
 #include <string>
 #include <memory>
 
-#include "CLHEP/Units/SystemOfUnits.h"
+#include "GaudiKernel/SystemOfUnits.h"
 
 #include "xAODEventInfo/EventInfo.h"
 #include "xAODTracking/TrackingPrimitives.h"
@@ -59,8 +59,8 @@ DerivationFramework::dimuonTaggingTool::dimuonTaggingTool(const std::string& t,
 
   declareProperty("OppositeCharge", m_requireOS=true); 
   declareProperty("PairDPhiMin", m_dPhiMin=-1); 
-  declareProperty("InvariantMassLow", m_invariantMassLow=2.0*CLHEP::GeV); 
-  declareProperty("InvariantMassHigh", m_invariantMassHigh=4.3*CLHEP::GeV); 
+  declareProperty("InvariantMassLow", m_invariantMassLow=2.0*Gaudi::Units::GeV); 
+  declareProperty("InvariantMassHigh", m_invariantMassHigh=4.3*Gaudi::Units::GeV); 
 
   declareProperty("IDTrackThinningConeSize", m_thinningConeSize=0.4);
   declareProperty("BranchPrefix", m_br_prefix="");
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/isolationDecorator.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/isolationDecorator.cxx
index 409718f925a04d81f51780817a7975401aa1f07f..68ab34c29e901129375467af7a9958d11aad66e5 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/isolationDecorator.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/isolationDecorator.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////
@@ -11,8 +11,6 @@
 #include <vector>
 #include <string>
 
-#include "CLHEP/Units/SystemOfUnits.h"
-
 #include "xAODEventInfo/EventInfo.h"
 #include "xAODTracking/TrackingPrimitives.h"
 #include "xAODPrimitives/IsolationHelpers.h"
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
index 680b210e9d5272147b3c0d5f22cf9f02463e4721..09b37e3c1bd198c35aad1331092bb77bac9f2784 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt
@@ -1,6 +1,4 @@
-#####################################
-# Flavor tagging discriminant tools
-#####################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 # This package is a collection of 'duel-use' tools to calculate
 # high-level flavor tagging discriminants. Because it should work both
@@ -8,28 +6,13 @@
 # atlas geometry, or material maps, but neural networks etc are all
 # fine.
 
-
 # Declare the package name:
 atlas_subdir( FlavorTagDiscriminants )
 
-# we use lwtnn in here a bit
+# External dependencies:
+find_package( Boost COMPONENTS filesystem )
 find_package( lwtnn )
-find_package( ROOT )
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-  PUBLIC
-  Control/AthToolSupport/AsgTools
-  Reconstruction/Jet/JetInterface
-  Event/xAOD/xAODBase
-  Event/xAOD/xAODMuon
-  Event/xAOD/xAODJet
-  Event/xAOD/xAODBTagging
-  Event/xAOD/xAODEventInfo
-  Event/xAOD/xAODTracking
-  PRIVATE
-  Tools/PathResolver
-  )
+find_package( ROOT COMPONENTS Core MathCore )
 
 # Build a shared library:
 atlas_add_library( FlavorTagDiscriminants
@@ -51,17 +34,17 @@ atlas_add_library( FlavorTagDiscriminants
   Root/HbbTagConfig.cxx
   Root/HbbGraphConfig.cxx
   Root/VRJetOverlapDecorator.cxx
-  INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS}
   PUBLIC_HEADERS FlavorTagDiscriminants
-  LINK_LIBRARIES AsgTools xAODBase xAODJet xAODBTagging xAODTracking xAODMuon xAODEventInfo PathResolver
-  JetInterface
-  ${LWTNN_LIBRARIES})
+  PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+  INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${LWTNN_INCLUDE_DIRS}
+  PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} PathResolver
+  LINK_LIBRARIES ${Boost_LIBRARIES} ${LWTNN_LIBRARIES} AsgTools AthContainers AthLinks JetInterface xAODBTagging xAODEventInfo xAODJet xAODMuon xAODTracking )
+
 
 if (NOT XAOD_STANDALONE)
   atlas_add_component( FlavorTagDiscriminantsLib
     src/components/FlavorTagDiscriminants_entries.cxx
-    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-    LINK_LIBRARIES ${ROOT_LIBRARIES} FlavorTagDiscriminants
+    LINK_LIBRARIES FlavorTagDiscriminants
     )
 endif()
 
@@ -70,5 +53,4 @@ atlas_add_dictionary( FlavorTagDiscriminantsDict
    FlavorTagDiscriminants/selection.xml
    LINK_LIBRARIES FlavorTagDiscriminants )
 
-
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/python/discriminants.py b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/python/discriminants.py
index ee7e389c5fa3659f2314726a0e7e3ad9c9880cda..83481cc2764b4baa23f186923eeaa6df1df2a6e6 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/python/discriminants.py
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/python/discriminants.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 # Python package containing lists of discriminants that are defined by
 # the code here.
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/CMakeLists.txt
index 7b4db02be98369920740ce0e69f058bf5b82380e..8ee61741dcfa6b5cc0fb1b81a4c877440448abf5 100644
--- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/CMakeLists.txt
@@ -1,43 +1,8 @@
-################################################################################
-# Package: BTagging
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( BTagging )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthToolSupport/AsgTools
-                          Control/AthenaBaseComps
-                          Event/xAOD/xAODBTagging
-                          Event/xAOD/xAODJet
-                          GaudiKernel
-                          Reconstruction/Jet/JetInterface
-                          Tracking/TrkEvent/VxVertex
-                          PRIVATE
-                          DetectorDescription/GeoPrimitives
-                          Event/xAOD/xAODBase
-                          Event/xAOD/xAODCore
-                          Event/xAOD/xAODMuon
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODJet
-                          InnerDetector/InDetRecTools/InDetRecToolInterfaces
-                          PhysicsAnalysis/AnalysisCommon/ParticleJetTools
-                          PhysicsAnalysis/JetTagging/JetTagEvent
-                          PhysicsAnalysis/JetTagging/JetTagInfo
-                          PhysicsAnalysis/JetTagging/JetTagTools
-                          PhysicsAnalysis/JetTagging/FlavorTagDiscriminants
-                          Reconstruction/Particle
-                          Tracking/TrkEvent/TrkLinks
-                          Tracking/TrkEvent/VxJetVertex
-                          Tracking/TrkEvent/VxSecVertex
-                          MagneticField/MagFieldElements
-                          MagneticField/MagFieldConditions
-			  )
-
-# External dependencies:
-find_package( Eigen )
-
 # Component(s) in the package:
 atlas_add_library( BTaggingLib
                    src/BTagTool.cxx
@@ -56,14 +21,12 @@ atlas_add_library( BTaggingLib
                    src/BTagHighLevelAugmenterAlg.cxx
                    src/HighLevelBTagAlg.cxx
                    PUBLIC_HEADERS BTagging
-                   PRIVATE_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                   LINK_LIBRARIES AsgTools AthenaBaseComps xAODBTagging xAODJet GaudiKernel JetInterface VxVertex ParticleJetToolsLib JetTagToolsLib FlavorTagDiscriminants
-                   PRIVATE_LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoPrimitives xAODBase xAODCore xAODMuon xAODTracking InDetRecToolInterfaces JetTagEvent JetTagInfo Particle TrkLinks VxJetVertex VxSecVertex MagFieldElements MagFieldConditions )
+                   LINK_LIBRARIES AsgTools AthContainers AthenaBaseComps CxxUtils FlavorTagDiscriminants GaudiKernel GeoPrimitives JetInterface MagFieldConditions ParticleJetToolsLib StoreGateLib TrkExInterfaces TrkVertexFitterInterfaces VxSecVertex VxVertex xAODBTagging xAODEventInfo xAODJet xAODMuon xAODTracking
+                   PRIVATE_LINK_LIBRARIES InDetRecToolInterfaces JetTagEvent JetTagToolsLib Particle TrkLinks TrkSurfaces VxJetVertex xAODBase xAODCore )
 
 atlas_add_component( BTagging
                      src/components/*.cxx
-                     INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AsgTools AthenaBaseComps xAODBTagging xAODJet GaudiKernel JetInterface VxVertex GeoPrimitives xAODBase xAODCore xAODMuon xAODTracking InDetRecToolInterfaces ParticleJetToolsLib JetTagEvent JetTagInfo JetTagToolsLib FlavorTagDiscriminants Particle TrkLinks VxJetVertex VxSecVertex BTaggingLib )
+                     LINK_LIBRARIES BTaggingLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/JetBTaggerTool.cxx b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/JetBTaggerTool.cxx
index d2c524af54a0964d02d95a3d394c78b585fd2660..7c849fa532914c312c3c3cf9a612c85df0fbd6e9 100644
--- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/JetBTaggerTool.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/JetBTaggerTool.cxx
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
    */
 
 #include "BTagging/JetBTaggerTool.h"
@@ -20,7 +20,6 @@
 #include "BTagging/BTagTrackAssociation.h"
 #include "BTagging/BTagSecVertexing.h"
 #include "BTagging/BTagJetPtScaling.h"
-#include "TRandom.h"
 
 #include <iostream>
 #include <string>
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt
index 377e2957f5b2e901a8e4d106f6daab965a60f025..cc440c4189fa91b22ae8a62e7782c1e15f4ce23d 100644
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/CMakeLists.txt
@@ -1,40 +1,24 @@
-################################################################################
-# Package: JetTagCalibration
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagCalibration )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/StoreGate
-                          GaudiKernel
-                          PRIVATE
-                          Database/APR/FileCatalog
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          Database/AthenaPOOL/PoolSvc
-                          Reconstruction/MVAUtils
-                          DetectorDescription/DetDescrCond/DetDescrCondTools )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-find_package( Eigen )
 find_package( lwtnn )
 
 # Component(s) in the package:
 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 MVAUtils
-                   PRIVATE_LINK_LIBRARIES AthenaPoolUtilities PoolSvcLib )
+                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${LWTNN_INCLUDE_DIRS}
+                   LINK_LIBRARIES ${LWTNN_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities GaudiKernel MVAUtils StoreGateLib
+                   PRIVATE_LINK_LIBRARIES FileCatalog PoolSvcLib )
 
 atlas_add_component( JetTagCalibration
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GaudiKernel FileCatalog AthenaPoolUtilities JetTagCalibrationLib )
+                     LINK_LIBRARIES JetTagCalibrationLib )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
diff --git a/PhysicsAnalysis/JetTagging/JetTagEvent/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagEvent/CMakeLists.txt
index d57ebd0484cfdafc56a1e0c52e8d1e6b32483cda..3184c157d107c92f5821d7edd41271981cb837a9 100644
--- a/PhysicsAnalysis/JetTagging/JetTagEvent/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagEvent/CMakeLists.txt
@@ -1,37 +1,16 @@
-################################################################################
-# Package: JetTagEvent
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagEvent )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloGeoHelpers
-                          Control/Navigation
-                          PhysicsAnalysis/AnalysisCommon/ParticleEvent
-                          Reconstruction/Jet/JetEvent
-                          Reconstruction/Particle
-                          PRIVATE
-                          Event/EventKernel
-                          Event/NavFourMom
-                          Tracking/TrkEvent/VxSecVertex )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_library( JetTagEvent
                    src/*.cxx
                    PUBLIC_HEADERS JetTagEvent
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                    LINK_LIBRARIES CaloGeoHelpers Navigation ParticleEvent JetEvent Particle
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} EventKernel NavFourMom VxSecVertex )
+                   PRIVATE_LINK_LIBRARIES EventKernel NavFourMom VxSecVertex )
 
 atlas_add_dictionary( JetTagEventDict
                       JetTagEvent/JetTagEventDict.h
                       JetTagEvent/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} CaloGeoHelpers Navigation ParticleEvent JetEvent Particle EventKernel NavFourMom VxSecVertex JetTagEvent
-                      NAVIGABLES  )
-
+                      LINK_LIBRARIES JetTagEvent )
diff --git a/PhysicsAnalysis/JetTagging/JetTagInfo/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagInfo/CMakeLists.txt
index 03f249a5a424e0d59a97458265ec7046045a3c58..a1800448c5561e5b63a0cb68b2a7eed34693b8ea 100644
--- a/PhysicsAnalysis/JetTagging/JetTagInfo/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagInfo/CMakeLists.txt
@@ -1,37 +1,20 @@
-################################################################################
-# Package: JetTagInfo
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagInfo )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthLinks
-                          Event/EventPrimitives
-                          Reconstruction/Jet/JetEvent
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/Particle
-                          Reconstruction/egamma/egammaEvent
-                          Tracking/TrkEvent/VxVertex
-                          PRIVATE
-                          GaudiKernel )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( Boost )
 
 # Component(s) in the package:
 atlas_add_library( JetTagInfo
                    src/*.cxx
                    PUBLIC_HEADERS JetTagInfo
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
                    LINK_LIBRARIES AthLinks EventPrimitives JetEvent muonEvent Particle egammaEvent VxVertex
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel )
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} GaudiKernel )
 
 atlas_add_dictionary( JetTagInfoDict
                       JetTagInfo/JetTagInfoDict.h
                       JetTagInfo/selection.xml
-                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthLinks EventPrimitives JetEvent muonEvent Particle egammaEvent VxVertex GaudiKernel JetTagInfo )
-
+                      LINK_LIBRARIES JetTagInfo )
diff --git a/PhysicsAnalysis/JetTagging/JetTagInfoAthenaPool/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagInfoAthenaPool/CMakeLists.txt
index 8de0bee1be51b73e16cbad34268edd6d683951a1..6363541ec5035b462f57e1366e758a560b7dde0e 100644
--- a/PhysicsAnalysis/JetTagging/JetTagInfoAthenaPool/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagInfoAthenaPool/CMakeLists.txt
@@ -1,23 +1,15 @@
-################################################################################
-# Package: JetTagInfoAthenaPool
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagInfoAthenaPool )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          PRIVATE
-                          Database/AthenaPOOL/AthenaPoolCnvSvc
-                          PhysicsAnalysis/JetTagging/JetTagInfoTPCnv )
-
 # Component(s) in the package:
+atlas_add_library( JetTagInfoAthenaPoolLib
+                   JetTagInfoAthenaPool/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS JetTagInfoAthenaPool )
+
 atlas_add_poolcnv_library( JetTagInfoAthenaPoolPoolCnv
                            src/*.cxx
                            FILES JetTagInfoAthenaPool/JetTagInfo.h
-                           LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib JetTagInfoTPCnv )
-
-# Install files from the package:
-atlas_install_headers( JetTagInfoAthenaPool )
-
+                           LINK_LIBRARIES AthenaPoolCnvSvcLib JetTagInfoTPCnv JetTagInfoAthenaPoolLib )
diff --git a/PhysicsAnalysis/JetTagging/JetTagInfoTPCnv/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagInfoTPCnv/CMakeLists.txt
index d8b70b8184a88d76e697c08d248131f542975299..a994a5edb5b1152d48ffcfa68da855c17453bdd8 100644
--- a/PhysicsAnalysis/JetTagging/JetTagInfoTPCnv/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagInfoTPCnv/CMakeLists.txt
@@ -1,54 +1,26 @@
-################################################################################
-# Package: JetTagInfoTPCnv
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagInfoTPCnv )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/DataModelAthenaPool
-                          Database/AthenaPOOL/AthenaPoolCnvSvc
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          Event/EventPrimitives
-                          GaudiKernel
-                          PhysicsAnalysis/JetTagging/JetTagEvent
-                          PhysicsAnalysis/JetTagging/JetTagInfo
-                          PhysicsAnalysis/MuonID/MuonIDEvent
-                          Reconstruction/Jet/JetEvent
-                          Reconstruction/Jet/JetEventTPCnv
-                          Reconstruction/Particle
-                          Reconstruction/egamma/egammaEvent
-                          Tracking/TrkEvent/VxVertex
-                          Tracking/TrkEventCnv/TrkEventTPCnv
-                          Control/CxxUtils
-                          PRIVATE
-                          Control/SGTools
-                          AtlasTest/TestTools )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_library( JetTagInfoTPCnv
                    src/*.cxx
                    PUBLIC_HEADERS JetTagInfoTPCnv
-                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolUtilities EventPrimitives GaudiKernel JetTagEvent JetTagInfo MuonIDEvent JetEvent JetEventTPCnv Particle egammaEvent VxVertex TrkEventTPCnv DataModelAthenaPoolLib AthenaPoolCnvSvcLib
-                   PRIVATE_LINK_LIBRARIES CxxUtils )
+                   LINK_LIBRARIES AthenaPoolUtilities CxxUtils EventPrimitives JetTagEvent JetTagInfo MuonIDEvent JetEvent JetEventTPCnv Particle egammaEvent VxVertex TrkEventTPCnv DataModelAthenaPoolLib AthenaPoolCnvSvcLib
+                   PRIVATE_LINK_LIBRARIES GaudiKernel )
 
 atlas_add_dictionary( JetTagInfoTPCnvDict
                       JetTagInfoTPCnv/JetTagInfoTPCnvDict.h
                       JetTagInfoTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities EventPrimitives GaudiKernel JetTagEvent JetTagInfo MuonIDEvent JetEvent JetEventTPCnv Particle egammaEvent VxVertex TrkEventTPCnv CxxUtils JetTagInfoTPCnv )
+                      LINK_LIBRARIES JetTagInfoTPCnv )
 
 atlas_add_dictionary( ARA_JetTagInfoTPCnvDict
                       JetTagInfoTPCnv/JetTagInfoTPCnvDict.h
                       JetTagInfoTPCnv/ARA_selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities EventPrimitives GaudiKernel JetTagEvent JetTagInfo MuonIDEvent JetEvent JetEventTPCnv Particle egammaEvent VxVertex TrkEventTPCnv CxxUtils JetTagInfoTPCnv )
+                      LINK_LIBRARIES JetTagInfoTPCnv )
 
+# Test(s) in the package:
 set( _jobOPath "${CMAKE_CURRENT_SOURCE_DIR}/share" )
 set( _jobOPath "${_jobOPath}:${CMAKE_JOBOPT_OUTPUT_DIRECTORY}" )
 set( _jobOPath "${_jobOPath}:$ENV{JOBOPTSEARCHPATH}" )
@@ -67,9 +39,7 @@ foreach( test AtlfInfoCnv_p1 BaseTagInfoCnv_p1 ElectronAssociationCnv_p1
   atlas_add_test( ${test}_test
                   SOURCES
                   test/${test}_test.cxx
-                  INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                  LINK_LIBRARIES ${ROOT_LIBRARIES} JetTagInfoTPCnv AthenaPoolUtilities EventPrimitives GaudiKernel JetTagEvent JetTagInfo MuonIDEvent JetEvent JetEventTPCnv Particle egammaEvent VxVertex TrkEventTPCnv DataModelAthenaPoolLib AthenaPoolCnvSvcLib CxxUtils TestTools SGTools
+                  LINK_LIBRARIES GaudiKernel JetTagInfoTPCnv SGTools TestTools
                   ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" )
 endforeach()
               
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagMonitoring/CMakeLists.txt
index 5720afbf21a773f346e6d9df129892711b39c944..131b7bbcc47501dec51e799255724969d5dba28e 100644
--- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/CMakeLists.txt
@@ -1,40 +1,19 @@
-################################################################################
-# Package: JetTagMonitoring
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagMonitoring )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaMonitoring
-                          Event/xAOD/xAODJet
-                          InnerDetector/InDetConditions/InDetConditionsSummaryService
-                          Reconstruction/RecoTools/ITrackToVertex
-                          PRIVATE
-                          Event/xAOD/xAODBTagging
-                          Event/xAOD/xAODEventInfo
-                          Event/xAOD/xAODTracking
-                          GaudiKernel
-                          LArCalorimeter/LArRecEvent
-                          PhysicsAnalysis/JetTagging/JetTagTools
-                          Tools/LWHists
-                          Tracking/TrkEvent/TrkParticleBase
-                          Tracking/TrkEvent/VxSecVertex
-                          Tracking/TrkVertexFitter/TrkVertexFitterInterfaces
-                          Trigger/TrigAnalysis/TrigDecisionTool )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_component( JetTagMonitoring
-		     src/*.cxx
+                     src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringLib xAODJet ITrackToVertex xAODBTagging xAODEventInfo xAODTracking GaudiKernel LArRecEvent JetTagToolsLib LWHists TrkParticleBase VxSecVertex TrkVertexFitterInterfaces TrigDecisionToolLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaMonitoringKernelLib AthenaMonitoringLib GaudiKernel ITrackToVertex JetTagToolsLib LArRecEvent LWHists StoreGateLib TrigDecisionToolLib TrkParticleBase TrkTrack TrkVertexFitterInterfaces VxSecVertex VxVertex xAODBTagging xAODEgamma xAODEventInfo xAODJet xAODMuon xAODTracking )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt
index 009586c9f91b3be403ab54fcc58067fd98e55fd4..4fb473ce926d96247f45ac7182f85274e0cfacf0 100644
--- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt
@@ -1,15 +1,8 @@
-################################################################################
-# Package: CalibrationDataInterface
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( CalibrationDataInterface )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          PhysicsAnalysis/JetTagging/JetTagCalibration )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Cint Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
 
@@ -19,21 +12,20 @@ find_package( Boost ) # header-only so no libraries needed
 atlas_add_root_dictionary( CalibrationDataInterfaceLib
                            CalibrationDataInterfaceLibDictSource
                            ROOT_HEADERS
-			   CalibrationDataInterface/CalibrationDataContainer.h
-			   CalibrationDataInterface/CalibrationDataVariables.h
-			   CalibrationDataInterface/CalibrationDataInterfaceBase.h
-			   CalibrationDataInterface/CalibrationDataInterfaceROOT.h
-			   CalibrationDataInterface/CalibrationDataEigenVariations.h
-			   CalibrationDataInterface/CalibrationDataBackend.h
-			   CalibrationDataInterface/CalibrationDataUtilities.h
-			   CalibrationDataInterface/CalibrationDataInternals.h Root/LinkDef.h
+                           CalibrationDataInterface/CalibrationDataContainer.h
+                           CalibrationDataInterface/CalibrationDataVariables.h
+                           CalibrationDataInterface/CalibrationDataInterfaceBase.h
+                           CalibrationDataInterface/CalibrationDataInterfaceROOT.h
+                           CalibrationDataInterface/CalibrationDataEigenVariations.h
+                           CalibrationDataInterface/CalibrationDataBackend.h
+                           CalibrationDataInterface/CalibrationDataUtilities.h
+                           CalibrationDataInterface/CalibrationDataInternals.h Root/LinkDef.h
                            EXTERNAL_PACKAGES ROOT Boost )
 
 atlas_add_library( CalibrationDataInterfaceLib
                    Root/*.cxx
                    ${CalibrationDataInterfaceLibDictSource}
                    PUBLIC_HEADERS CalibrationDataInterface
-
                    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
                    LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} )
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt
index 5f2331d6f3478f13c1bf95752286320c371eaac5..59ad17fb61f2600c0180b0fe90630cba18d3f9da 100644
--- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt
@@ -1,7 +1,4 @@
-# $Id: CMakeLists.txt 780668 2016-10-27 10:10:01Z krasznaa $
-################################################################################
-# Package: xAODBTaggingEfficiency
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( xAODBTaggingEfficiency )
@@ -14,15 +11,16 @@ atlas_add_library( xAODBTaggingEfficiencyLib
   xAODBTaggingEfficiency/*.h Root/*.cxx
   PUBLIC_HEADERS xAODBTaggingEfficiency
   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-  LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODBTagging xAODJet
-  PATCoreLib PATInterfaces CalibrationDataInterfaceLib PathResolver
-  FTagAnalysisInterfacesLib )
+  LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODBTagging
+  PATCoreAcceptLib PATInterfaces CalibrationDataInterfaceLib
+  FTagAnalysisInterfacesLib
+  PRIVATE_LINK_LIBRARIES PathResolver )
 
 if( NOT XAOD_STANDALONE )
    atlas_add_component( xAODBTaggingEfficiency
       src/*.h src/*.cxx src/components/*.cxx
       LINK_LIBRARIES xAODJet CalibrationDataInterfaceLib AthenaBaseComps
-      GaudiKernel PathResolver xAODBTaggingEfficiencyLib )
+      GaudiKernel FTagAnalysisInterfacesLib xAODBTaggingEfficiencyLib )
 endif()
 
 atlas_add_dictionary( xAODBTaggingEfficiencyDict
@@ -34,11 +32,11 @@ atlas_add_dictionary( xAODBTaggingEfficiencyDict
 if( XAOD_STANDALONE )
    atlas_add_executable( BTaggingEfficiencyToolTester
       util/BTaggingEfficiencyToolTester.cxx
-      LINK_LIBRARIES xAODRootAccess xAODBTaggingEfficiencyLib )
+      LINK_LIBRARIES xAODBTaggingEfficiencyLib )
 
    atlas_add_executable( BTaggingSelectionToolTester
       util/BTaggingSelectionToolTester.cxx
-      LINK_LIBRARIES xAODJet xAODBTagging xAODBTaggingEfficiencyLib )
+      LINK_LIBRARIES AsgMessagingLib xAODJet xAODBTagging xAODBTaggingEfficiencyLib )
 endif()
 
 # Install files from the package:
diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt
index 2d29de37c055219c33831612971471dc96992967..db520beab2111357a468ff72d7d5e7ec4675dc93 100644
--- a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt
@@ -1,72 +1,13 @@
-# $Id: CMakeLists.txt 793433 2017-01-23 10:57:26Z dguest $
-################################################################################
-# Package: JetTagTools
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagTools )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-    PUBLIC
-    Control/AthToolSupport/AsgTools
-    Control/AthenaBaseComps
-    Control/StoreGate
-    DetectorDescription/GeoPrimitives
-    Event/xAOD/xAODBTagging
-    Event/xAOD/xAODJet
-    Event/xAOD/xAODTracking
-    GaudiKernel
-    PhysicsAnalysis/JetTagging/JetTagInfo
-    Reconstruction/Jet/JetRec
-    Reconstruction/Jet/JetSubStructureMomentTools
-    Reconstruction/Jet/JetSubStructureUtils
-    Reconstruction/MVAUtils
-    Tracking/TrkEvent/TrkParameters
-    InnerDetector/InDetRecTools/InDetSVWithMuonTool
-
-    PRIVATE
-    Control/AthenaKernel
-    Control/Navigation
-    Event/xAOD/xAODMuon
-    InnerDetector/InDetRecTools/InDetSVWithMuonTool
-    InnerDetector/InDetRecTools/InDetTrackSelectionTool
-    InnerDetector/InDetRecTools/TrackVertexAssociationTool
-    InnerDetector/InDetRecTools/InDetRecToolInterfaces
-    PhysicsAnalysis/AnalysisCommon/ParticleJetTools
-    PhysicsAnalysis/JetTagging/JetTagCalibration
-    PhysicsAnalysis/MuonID/MuonSelectorTools
-    PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections
-    Reconstruction/Jet/JetEDM
-    Reconstruction/Particle
-    Reconstruction/RecoTools/ITrackToVertex
-    Tracking/TrkEvent/TrkEventPrimitives
-    Tracking/TrkEvent/TrkLinks
-    Tracking/TrkEvent/TrkTrack
-    Tracking/TrkEvent/TrkTrackLink
-    Tracking/TrkEvent/TrkTrackSummary
-    Tracking/TrkEvent/VxJetVertex
-    Tracking/TrkEvent/VxSecVertex
-    Tracking/TrkEvent/VxVertex
-    Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils
-    Tracking/TrkVertexFitter/TrkVertexFitterInterfaces
-    )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
 find_package( CLHEP )
-#find_package( Eigen )
-find_package( lwtnn )
 find_package( ROOT COMPONENTS TMVA Core Tree MathCore Hist RIO pthread
     MathMore Minuit Minuit2 Matrix Physics HistPainter Rint RooFitCore RooFit )
 
-# Switch off the -Werror=return-type flag explicitly as a temporary solution
-# to a build issue against Boost.
-foreach( mode RELEASE RELWITHDEBINFO )
-    string( REPLACE "-Werror=return-type" "" CMAKE_CXX_FLAGS_${mode}
-        "${CMAKE_CXX_FLAGS_${mode}}" )
-endforeach()
-
 # Component(s) in the package:
 atlas_add_library( JetTagToolsLib
     JetTagTools/*.h
@@ -84,28 +25,21 @@ atlas_add_library( JetTagToolsLib
     src/DL1Tag.cxx src/TagNtupleDumper.cxx src/RNNIPTag.cxx
 
     PUBLIC_HEADERS JetTagTools
-    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${LWTNN_INCLUDE_DIRS}
-    PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
-    DEFINITIONS ${CLHEP_DEFINITIONS}
-
-    LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${LWTNN_LIBRARIES}
-    AsgTools AthenaBaseComps GeoPrimitives xAODBTagging xAODJet
-    xAODTracking GaudiKernel JetTagInfo JetSubStructureUtils TrkParameters
-    JetRecLib JetSubStructureMomentToolsLib egammaMVACalibLib MVAUtils
-    TrackVertexAssociationToolLib ParticleJetToolsLib JetTagCalibrationLib
-    MuonSelectorToolsLib MuonMomentumCorrectionsLib TrkNeuralNetworkUtilsLib
-    InDetSVWithMuonToolLib ITrackToVertex
-
-    PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} AthenaKernel
-    Navigation xAODMuon JetEDM Particle ITrackToVertex TrkEventPrimitives
-    TrkLinks TrkTrack TrkTrackSummary VxJetVertex VxVertex VxSecVertex
-    TrkVertexFitterInterfaces InDetTrackSelectionToolLib
-    )
+    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+    PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
+    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
+    LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils GaudiKernel
+    GeoPrimitives ITrackToVertex InDetSVWithMuonToolLib JetTagCalibrationLib JetTagInfo
+    MVAUtils StoreGateLib xAODBTagging xAODJet xAODTracking
+    PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} InDetTrackSelectionToolLib MuonAnalysisInterfacesLib
+    Navigation Particle ParticleJetToolsLib TrkEventPrimitives TrkLinks TrkNeuralNetworkUtilsLib
+    TrkParameters TrkTrack TrkTrackLink TrkTrackSummary TrkVertexFitterInterfaces VxJetVertex
+    VxSecVertex VxVertex xAODMuon )
 
 atlas_add_component( JetTagTools
     src/components/*.cxx
-    LINK_LIBRARIES GaudiKernel JetTagToolsLib )
+    LINK_LIBRARIES JetTagToolsLib )
 
 # Install files from the package:
 atlas_install_runtime( share/*.root share/*.txt )
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/CMakeLists.txt
index 5e808c7e88b39eb8a485dd284961cb4f94cda62e..f6fd74a94a7b7b2b4a90ca5972e54892a7e69dd6 100644
--- a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/CMakeLists.txt
@@ -1,23 +1,8 @@
-################################################################################
-# Package: JetTagDQA
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTagDQA )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          GaudiKernel
-                          PRIVATE
-                          Control/AthenaBaseComps
-                          Control/AthenaMonitoring
-                          Event/xAOD/xAODBTagging
-                          Event/xAOD/xAODBase
-                          Event/xAOD/xAODJet
-                          Event/xAOD/xAODTracking
-                          PhysicsAnalysis/AnalysisCommon/ParticleJetTools
-                          Tracking/TrkValidation/TrkValHistUtils )
-
 # External dependencies:
 find_package( CLHEP )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
diff --git a/PhysicsAnalysis/JetTagging/JetTaggingTagTools/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTaggingTagTools/CMakeLists.txt
index 79520341f314e2f0a862052787ebc034f48433df..264b6ca3a16292955df4e84375b7ece2c0bbbf2d 100644
--- a/PhysicsAnalysis/JetTagging/JetTaggingTagTools/CMakeLists.txt
+++ b/PhysicsAnalysis/JetTagging/JetTaggingTagTools/CMakeLists.txt
@@ -1,20 +1,8 @@
-################################################################################
-# Package: JetTaggingTagTools
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( JetTaggingTagTools )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/StoreGate
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          GaudiKernel
-                          PhysicsAnalysis/EventTag/TagEvent
-                          PRIVATE
-                          Reconstruction/Jet/JetEvent )
-
 # External dependencies:
 find_package( CLHEP )
 
@@ -24,13 +12,12 @@ atlas_add_library( JetTaggingTagToolsLib
                    PUBLIC_HEADERS JetTaggingTagTools
                    PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES AthenaBaseComps AthenaPoolUtilities GaudiKernel TagEvent StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} JetEvent )
+                   LINK_LIBRARIES AthenaBaseComps AthenaPoolUtilities TagEvent StoreGateLib
+                   PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} GaudiKernel JetEvent )
 
 atlas_add_component( JetTaggingTagTools
                      src/components/*.cxx
-                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps StoreGateLib SGtests AthenaPoolUtilities GaudiKernel TagEvent JetEvent JetTaggingTagToolsLib )
+                     LINK_LIBRARIES JetTaggingTagToolsLib )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx
index 5e807046423707d8bd8e696f80073ba5da69c057..bbc12e482acf210847f7e02057d47ac58fbdd27f 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopCPTools/Root/TopJetMETCPTools.cxx
@@ -204,30 +204,30 @@ namespace top {
       top::check(jetUpdateJvtTool->initialize(), "Failed to initialize");
       m_jetUpdateJvtTool = jetUpdateJvtTool;
     }
-
+    
     ///-- Calculate fJVT --///
     //Only setup fJVT tool if user actually wants it
     if (m_config->doForwardJVTinMET() || m_config->getfJVTWP() != "None") {
-      
+    
       const std::string fjvt_tool_name = "JetSelectfJvtTool";
       if (asg::ToolStore::contains<IJetModifier>(fjvt_tool_name)) {
-	m_jetSelectfJvtTool = asg::ToolStore::get<IJetModifier>(fjvt_tool_name);
+        m_jetSelectfJvtTool = asg::ToolStore::get<IJetModifier>(fjvt_tool_name);
       } else {
-	IJetModifier* JetSelectfJvtTool = new JetForwardJvtTool(fjvt_tool_name);
-	top::check(asg::setProperty(JetSelectfJvtTool, "JvtMomentName", "AnalysisTop_JVT"), //fJVT uses JVT decision
-		   "Failed to set JvtMomentName for JetForwardJvtTool");
-	
-	//Default fJVT WP is medium but this can't be used with default Tight MET WP
-	//MET WP takes precidence so making ATop default fJVT=Tight 
-	if (m_config->getfJVTWP() != "Medium"){ 
-	  top::check(asg::setProperty(JetSelectfJvtTool, "UseTightOP", true),
-                     "Failed to set UseTightOP for JetForwardJvtTool");
-	}
-	top::check(asg::setProperty(JetSelectfJvtTool, "OutputDec", "AnalysisTop_fJVTdecision"), //Adds custom decorator, 'AnalysisTop_fJVTdecision', to all jets
-		   "Failed to set OutputDec for JetForwardJvtTool");
-
-	top::check(JetSelectfJvtTool->initialize(), "Failed to initialize " + fjvt_tool_name);
-	m_jetSelectfJvtTool = JetSelectfJvtTool;
+        IJetModifier* JetSelectfJvtTool = new JetForwardJvtTool(fjvt_tool_name);
+        top::check(asg::setProperty(JetSelectfJvtTool, "JvtMomentName", "AnalysisTop_JVT"), //fJVT uses JVT decision
+        	   "Failed to set JvtMomentName for JetForwardJvtTool");
+        
+        //Default fJVT WP is medium but this can't be used with default Tight MET WP
+        //MET WP takes precidence so making ATop default fJVT=Tight 
+        if (m_config->getfJVTWP() != "Medium"){ 
+          top::check(asg::setProperty(JetSelectfJvtTool, "UseTightOP", true),
+                           "Failed to set UseTightOP for JetForwardJvtTool");
+        }
+        top::check(asg::setProperty(JetSelectfJvtTool, "OutputDec", "AnalysisTop_fJVTdecision"), //Adds custom decorator, 'AnalysisTop_fJVTdecision', to all jets
+        	   "Failed to set OutputDec for JetForwardJvtTool");
+  
+        top::check(JetSelectfJvtTool->initialize(), "Failed to initialize " + fjvt_tool_name);
+        m_jetSelectfJvtTool = JetSelectfJvtTool;
       }
     }
 
@@ -540,14 +540,14 @@ namespace top {
       }
      
       if (m_config->doForwardJVTinMET()) { 
-	if (m_config->getfJVTWP() == "Medium") {
-	  top::check(metMaker->setProperty("JetSelection", "Tenacious"), "Failed to set METMaker JetSelection to Tenacious");
-	}
+        if (m_config->getfJVTWP() == "Medium") {
+          top::check(metMaker->setProperty("JetSelection", "Tenacious"), "Failed to set METMaker JetSelection to Tenacious");
+        }
         top::check(metMaker->setProperty("JetRejectionDec","AnalysisTop_fJVTdecision"), "Failed to set METMaker JetRejectionDec to AnalysisTop_fJVTdecision");
-	top::check(metMaker->initialize(), "Failed to initialize");
-	metMaker->msg().setLevel(MSG::INFO);
-	m_met_maker = metMaker;
       }
+      top::check(metMaker->initialize(), "Failed to initialize");
+      metMaker->msg().setLevel(MSG::INFO);
+      m_met_maker = metMaker;
     }
 
     // MET Systematics tool
diff --git a/Reconstruction/DiTauRec/CMakeLists.txt b/Reconstruction/DiTauRec/CMakeLists.txt
index c87b989731727d20118092a6503d618cf414d976..72c07d0add5033c7abdcda11b0739f58b488e7df 100644
--- a/Reconstruction/DiTauRec/CMakeLists.txt
+++ b/Reconstruction/DiTauRec/CMakeLists.txt
@@ -1,28 +1,8 @@
-################################################################################
-# Package: DiTauRec
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( DiTauRec )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Event/xAOD/xAODEgamma
-                          Event/xAOD/xAODJet
-                          Event/xAOD/xAODMuon
-                          Event/xAOD/xAODTau
-                          GaudiKernel
-                          PhysicsAnalysis/MuonID/MuonSelectorTools
-                          Reconstruction/Jet/JetEDM
-                          Tracking/TrkTools/TrkToolInterfaces
-                          PRIVATE
-                          Calorimeter/CaloEvent
-                          Event/xAOD/xAODTracking
-                          Reconstruction/RecoTools/RecoToolInterfaces
-                          Reconstruction/tauRecTools
-                          Tracking/TrkEvent/TrkParametersIdentificationHelpers )
-
 # External dependencies:
 find_package( FastJet )
 
@@ -31,9 +11,8 @@ atlas_add_component( DiTauRec
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${FASTJET_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${FASTJET_LIBRARIES} AthenaBaseComps xAODEgamma xAODJet xAODMuon xAODTau GaudiKernel MuonSelectorToolsLib JetEDM TrkToolInterfaces CaloEvent xAODTracking RecoToolInterfaces tauRecToolsLib TrkParametersIdentificationHelpers )
+                     LINK_LIBRARIES ${FASTJET_LIBRARIES} AthenaBaseComps xAODEgamma xAODJet xAODMuon xAODTau GaudiKernel JetEDM TrkToolInterfaces CaloEvent xAODTracking RecoToolInterfaces StoreGateLib tauRecToolsLib TrkParametersIdentificationHelpers )
 
 # Install files from the package:
-atlas_install_headers( DiTauRec )
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-ignore=F401,F821 )
diff --git a/Reconstruction/Jet/JetRecConfig/python/ConstModHelpers.py b/Reconstruction/Jet/JetRecConfig/python/ConstModHelpers.py
index d1b4f4ac84ed3d97fde527e4bc6ef93c5f775bda..28ca378acd2f866657023deddfa99e244e9552b4 100644
--- a/Reconstruction/Jet/JetRecConfig/python/ConstModHelpers.py
+++ b/Reconstruction/Jet/JetRecConfig/python/ConstModHelpers.py
@@ -160,9 +160,6 @@ def getConstitModAlg(constit, monTool=None):
     return constitmodalg
 
 
-
-
-
 def constitModWithAlternateTrk(mod, trkopt):
     """Generates a new JetConstitModifier cloned from mod and stores it in the standard jetconstitmoddic.
     The cloned JetConstitModifier has all its track related properties changed according to trackcollectionmap[trkopt]
diff --git a/Reconstruction/Jet/JetRecConfig/python/JetRecConfig.py b/Reconstruction/Jet/JetRecConfig/python/JetRecConfig.py
index 4ba2d6d7e5be0ff1e36fe393b24f6252a6b4b911..88b0b327b36544d782d21b1687ab7039ea835213 100644
--- a/Reconstruction/Jet/JetRecConfig/python/JetRecConfig.py
+++ b/Reconstruction/Jet/JetRecConfig/python/JetRecConfig.py
@@ -94,26 +94,39 @@ def JetRecCfg(jetdef0, configFlags):
 
 
 ########################################################################
-def JetInputCfg(jetdef, configFlags, sequenceName):
+def JetInputCfg(jetOrConstitdef, configFlags, sequenceName='AthAlgSeq'):
     """Function for setting up inputs to jet finding
-    
+
     This includes constituent modifications, track selection, copying of
     input truth particles and event density calculations
+    
+    jetOrConstitdef can either be 
+     * a JetDefinition : this happens when called from JetRecCfg, then the jetdef._prereqDic/Order are used.
+     * a JetConstitSource : to allow scheduling the corresponding constituents algs independently of any jet alg. 
     """
 
     jetlog.info("Setting up jet inputs.")
     components = ComponentAccumulator(sequenceName)
 
+    
+    from .JetDefinition import JetConstitSource, JetDefinition
+    if isinstance(jetOrConstitdef, JetConstitSource):
+        jetdef = JetDefinition('Kt', 0., jetOrConstitdef.clone())
+        instantiateAliases(jetdef)        
+        removeComponentFailingConditions(jetdef, configFlags, raiseOnFailure= not jetdef.standardRecoMode)
+    else:
+        jetdef = jetOrConstitdef
+    
     jetlog.info("Inspecting input file contents")
     filecontents = configFlags.Input.Collections
 
     inputdeps = [ inputkey for inputkey in jetdef._prereqOrder if inputkey.startswith('input:')]
+
     
     for inputfull in inputdeps:
-        #inputkey = inputfull[6:] # remove 'input:'
         inputInstance = jetdef._prereqDic[inputfull]
-        from .JetDefinition import JetConstitSource
-
+        isprimary = False # actually not using it yet.
+        
         if isinstance(inputInstance, JetConstitSource):
             if inputInstance.containername in filecontents:
                 jetlog.debug("Input container {0} for label {1} already in input file.".format(inputInstance.containername, inputInstance.name))
@@ -124,12 +137,12 @@ def JetInputCfg(jetdef, configFlags, sequenceName):
                 from . import ConstModHelpers
                 constitalg = ConstModHelpers.getConstitModAlg(inputInstance)
                 if constitalg:
-                    components.addEventAlgo(constitalg)
+                    components.addEventAlgo(constitalg, primary=isprimary)
         else:
             jetlog.debug("Requesting input {} with function {} and specs {}".format(inputInstance.name, inputInstance.algoBuilder, inputInstance.specs) )
             # inputInstance must be a JetInputDef
             if inputInstance.algoBuilder:
-                components.addEventAlgo( inputInstance.algoBuilder( jetdef, inputInstance.specs )  )
+                components.addEventAlgo( inputInstance.algoBuilder( jetdef, inputInstance.specs ), primary=isprimary )
             else:
                 # for now just hope the input will be present... 
                 pass
@@ -314,8 +327,9 @@ def instantiateAliases( jetdef ):
       * implies calls to recursives function constH.aliasToInputDef and modH.aliasToModDef
     """
 
-    # start with the inputdef (replacing the jetdef attribute to ensure it really is an instance, not only a str)
-    jetdef.inputdef = constH.aliasToInputDef(jetdef.inputdef, jetdef)
+    # start with the inputdef, cloning it so we're not altering a private copy
+    jetdef.inputdef = jetdef.inputdef.clone()
+    constH.instantiateJetConstitAliases(jetdef.inputdef, jetdef)
 
     jetdef._prereqDic['input:'+jetdef.inputdef.name] = jetdef.inputdef
     jetdef._prereqOrder.append('input:'+jetdef.inputdef.name)
diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h b/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
index e2517af01afdce44f1f637a184edaaa9eff46aa1..b45a5a8f09143c9e62592d99f215658d621cd78d 100644
--- a/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
+++ b/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
@@ -20,6 +20,7 @@
 #include "AsgTools/ToolHandleArray.h"
 #include "xAODCore/ShallowCopy.h"
 
+#include "xAODBase/IParticleHelpers.h"
 #include "xAODBase/IParticleContainer.h"
 #include "xAODCaloEvent/CaloClusterContainer.h"
 #include "xAODPFlow/TrackCaloClusterContainer.h"
@@ -118,13 +119,15 @@ JetConstituentModSequence::copyModRecord(const SG::ReadHandleKey<T>& inKey,
   std::pair< T*, xAOD::ShallowAuxContainer* > newconstit =
     xAOD::shallowCopyContainer(*inHandle);    
   newconstit.second->setShallowIO(m_saveAsShallow);
-  
+
   for (auto t : m_modifiers) {ATH_CHECK(t->process(newconstit.first));}
 
   auto handle = makeHandle(outKey);
   ATH_CHECK(handle.record(std::unique_ptr<T>(newconstit.first),
                           std::unique_ptr<xAOD::ShallowAuxContainer>(newconstit.second)));
   
+  xAOD::setOriginalObjectLink(*inHandle, *handle);
+  
   return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx
index c0c80680cf15c20143b0ede49c7b3a1b9980ef5e..7c1300ffbc1709bbd8147fa2b8abf1b0550c8eae 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx
@@ -7,7 +7,7 @@
 #include "MuonCombinedEvent/MuonCandidateCollection.h"
 
 MuonCombinedInDetExtensionAlg::MuonCombinedInDetExtensionAlg(const std::string& name, ISvcLocator* pSvcLocator)
-    : AthAlgorithm(name, pSvcLocator) {
+    : AthReentrantAlgorithm(name, pSvcLocator) {
 }
 
 StatusCode
@@ -31,10 +31,10 @@ MuonCombinedInDetExtensionAlg::initialize()
 }
 
 StatusCode
-MuonCombinedInDetExtensionAlg::execute()
+MuonCombinedInDetExtensionAlg::execute(const EventContext& ctx) const
 {
 
-    SG::ReadHandle<InDetCandidateCollection> indetCandidateCollection(m_indetCandidateCollectionName);
+    SG::ReadHandle<InDetCandidateCollection> indetCandidateCollection(m_indetCandidateCollectionName, ctx);
     if (!indetCandidateCollection.isValid()) {
         ATH_MSG_ERROR("Could not read " << m_indetCandidateCollectionName);
         return StatusCode::FAILURE;
@@ -45,7 +45,7 @@ MuonCombinedInDetExtensionAlg::execute()
     for (const MuonCombined::InDetCandidate* candidate : *indetCandidateCollection)
         ATH_MSG_VERBOSE(candidate->toString());
 
-    SG::WriteHandle<MuonCombined::InDetCandidateToTagMap> tagMap(m_tagMap);
+    SG::WriteHandle<MuonCombined::InDetCandidateToTagMap> tagMap(m_tagMap, ctx);
     ATH_CHECK(tagMap.record(std::make_unique<MuonCombined::InDetCandidateToTagMap>()));
 
     TrackCollection*        combTracks = nullptr;
@@ -53,50 +53,52 @@ MuonCombinedInDetExtensionAlg::execute()
     Trk::SegmentCollection* segments   = nullptr;
 
     if (m_combTracks.key() != "") {
-        SG::WriteHandle<TrackCollection> wh_combTracks(m_combTracks);
+        SG::WriteHandle<TrackCollection> wh_combTracks(m_combTracks, ctx);
         ATH_CHECK(wh_combTracks.record(std::make_unique<TrackCollection>()));
         combTracks = wh_combTracks.ptr();
     }
     if (m_METracks.key() != "") {
-        SG::WriteHandle<TrackCollection> wh_meTracks(m_METracks);
+        SG::WriteHandle<TrackCollection> wh_meTracks(m_METracks, ctx);
         ATH_CHECK(wh_meTracks.record(std::make_unique<TrackCollection>()));
         meTracks = wh_meTracks.ptr();
     }
 
     if (m_segments.key() != "") {
-        SG::WriteHandle<Trk::SegmentCollection> wh_segs(m_segments);
+        SG::WriteHandle<Trk::SegmentCollection> wh_segs(m_segments, ctx);
         ATH_CHECK(wh_segs.record(std::make_unique<Trk::SegmentCollection>()));
         segments = wh_segs.ptr();
     }
 
     if (m_usePRDs) {
         MuonCombined::IMuonCombinedInDetExtensionTool::MuonPrdData prdData;
-        SG::ReadHandle<Muon::MdtPrepDataContainer>                 mdtPRDContainer(m_MDT_ContainerName);
+        SG::ReadHandle<Muon::MdtPrepDataContainer>                 mdtPRDContainer(m_MDT_ContainerName, ctx);
         prdData.mdtPrds = mdtPRDContainer.cptr();
         if (m_hasCSC) {
-            SG::ReadHandle<Muon::CscPrepDataContainer> cscPRDContainer(m_CSC_ContainerName);
+            SG::ReadHandle<Muon::CscPrepDataContainer> cscPRDContainer(m_CSC_ContainerName, ctx);
             prdData.cscPrds = cscPRDContainer.cptr();
         }
         if (m_hasSTGC && m_hasMM) {
-            SG::ReadHandle<Muon::sTgcPrepDataContainer> stgcPRDContainer(m_sTGC_ContainerName);
-            SG::ReadHandle<Muon::MMPrepDataContainer>   mmPRDContainer(m_MM_ContainerName);
+            SG::ReadHandle<Muon::sTgcPrepDataContainer> stgcPRDContainer(m_sTGC_ContainerName, ctx);
+            SG::ReadHandle<Muon::MMPrepDataContainer>   mmPRDContainer(m_MM_ContainerName, ctx);
             prdData.stgcPrds = stgcPRDContainer.cptr();
             prdData.mmPrds   = mmPRDContainer.cptr();
         }
-        SG::ReadHandle<Muon::RpcPrepDataContainer> rpcPRDContainer(m_RPC_ContainerName);
+        SG::ReadHandle<Muon::RpcPrepDataContainer> rpcPRDContainer(m_RPC_ContainerName, ctx);
         prdData.rpcPrds = rpcPRDContainer.cptr();
-        SG::ReadHandle<Muon::TgcPrepDataContainer> tgcPRDContainer(m_TGC_ContainerName);
+        SG::ReadHandle<Muon::TgcPrepDataContainer> tgcPRDContainer(m_TGC_ContainerName, ctx);
         prdData.tgcPrds = tgcPRDContainer.cptr();
-        for (auto& tool : m_muonCombinedInDetExtensionTools)
+        for (auto& tool : m_muonCombinedInDetExtensionTools) {
             tool->extendWithPRDs(*indetCandidateCollection, tagMap.ptr(), prdData, combTracks, meTracks, segments);
+        }
     } else {
-        for (auto& tool : m_muonCombinedInDetExtensionTools)
+        for (auto& tool : m_muonCombinedInDetExtensionTools) {
             tool->extend(*indetCandidateCollection, tagMap.ptr(), combTracks, meTracks, segments);
+        }
     }
 
     //Clean up at the end of execute
     for (auto& tool : m_muonCombinedInDetExtensionTools) {
-      tool->cleanUp();
+        tool->cleanUp();
     }
 
     return StatusCode::SUCCESS;
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.h b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.h
index 593a9cd97715219b4125022f2540424ef667b6d7..0d88f16967fba66153edbbeadbae905f9b35a8c0 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.h
@@ -6,7 +6,7 @@
 #define MUONCOMBINEDALGS_MUONCOMBINEDINDETEXTENSIONALG_H
 
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonCombinedEvent/InDetCandidateCollection.h"
 #include "MuonCombinedEvent/InDetCandidateToTagMap.h"
@@ -20,13 +20,13 @@
 
 #include <string>
 
-class MuonCombinedInDetExtensionAlg : public AthAlgorithm {
+class MuonCombinedInDetExtensionAlg : public AthReentrantAlgorithm {
   public:
     MuonCombinedInDetExtensionAlg(const std::string& name, ISvcLocator* pSvcLocator);
     ~MuonCombinedInDetExtensionAlg()=default;
 
     StatusCode initialize();
-    StatusCode execute();
+    StatusCode execute(const EventContext& ctx) const;
 
   private:
     ToolHandleArray<MuonCombined::IMuonCombinedInDetExtensionTool> m_muonCombinedInDetExtensionTools{this,"MuonCombinedInDetExtensionTools",{}};
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index 9dbe634be4df94f90a14aa50db1542a002aed09a..f38fbfeedb7a990d8c158f3f9b73a32bfe5bf232 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -943,14 +943,22 @@ if rec.doFileMetaData():
 
     # Add the needed stuff for cut-flow bookkeeping.
     # Only the configurables that are not already present will be created
-    from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
-    logRecExCommon_topOptions.debug("Going to call CreateCutFlowSvc")
-    CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
-    if rec.readAOD() or rec.readESD():
-        #force CutFlowSvc execution (necessary for file merging)
-        theApp.CreateSvc+=['CutFlowSvc']
-        logRecExCommon_topOptions.debug("Added CutFlowSvc to theApp")
-        pass    
+    hasBookkeepers = False
+    if 'metadata_items' in metadata:
+        metadata_items = metadata['metadata_items']
+        if 'xAOD::CutBookkeeperContainer_v1' in set(metadata_items.values()):
+            logRecExCommon_topOptions.debug("Existing CutBookkeeperContainer found")
+            hasBookkeepers = True
+    if hasBookkeepers or hasattr(runArgs, "reductionConf"): # TODO: no other way to detect we are running derivations
+        # TODO: check all DAOD workflows
+        from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+        logRecExCommon_topOptions.debug("Going to call CreateCutFlowSvc")
+        CreateCutFlowSvc( svcName="CutFlowSvc", seq=topSequence, addMetaDataToAllOutputFiles=True )
+        if rec.readAOD() or rec.readESD():
+            #force CutFlowSvc execution (necessary for file merging)
+            theApp.CreateSvc+=['CutFlowSvc']
+            logRecExCommon_topOptions.debug("Added CutFlowSvc to theApp")
+            pass    
 
     try:
         # ByteStreamMetadata
diff --git a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/CMakeLists.txt b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/CMakeLists.txt
index 1fbefe9c3c76f6230030137ec2ad0c5da2acfd54..919b823866d0dd37638f91875cbf9c90586e31a8 100644
--- a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/CMakeLists.txt
+++ b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/CMakeLists.txt
@@ -5,21 +5,10 @@
 # Declare the package name:
 atlas_subdir( TrackParticleAssociationAlgs )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Calorimeter/CaloUtils
-                          Control/AthenaBaseComps
-                          Event/xAOD/xAODAssociations
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODTracking
-                          GaudiKernel
-                          Reconstruction/RecoTools/RecoToolInterfaces
-                          Reconstruction/RecoTools/TrackToCalo
-                          Tracking/TrkTools/TrkToolInterfaces )
-
 # Component(s) in the package:
 atlas_add_component( TrackParticleAssociationAlgs
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES CaloUtilsLib AthenaBaseComps xAODAssociations xAODCaloEvent xAODTracking GaudiKernel RecoToolInterfaces TrackToCaloLib TrkToolInterfaces )
+		     INCLUDE_DIRS 
+                     LINK_LIBRARIES  CaloUtilsLib AthenaBaseComps xAODAssociations xAODCaloEvent xAODTracking FourMomUtils GaudiKernel RecoToolInterfaces TrackToCaloLib TrkToolInterfaces )
 
diff --git a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx
index 7209bced179d1aeaf1e49549bb86f7219a630243..c506ebdd1b00fd5d80be07f865730db5b89e38e7 100644
--- a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx
+++ b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx
@@ -1,135 +1,173 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrackParticleClusterAssociationAlg.h"
-#include "xAODTracking/TrackParticleContainer.h"
-#include "xAODCaloEvent/CaloClusterContainer.h"
-#include "xAODCaloEvent/CaloClusterAuxContainer.h"
-#include "xAODCaloEvent/CaloCluster.h"
-#include "xAODAssociations/TrackParticleClusterAssociation.h"
-#include "xAODAssociations/TrackParticleClusterAssociationContainer.h"
-#include "xAODAssociations/TrackParticleClusterAssociationAuxContainer.h"
-
-#include "TrkToolInterfaces/ITrackSelectorTool.h"
-#include "RecoToolInterfaces/IParticleCaloClusterAssociationTool.h"
-#include "TrackToCalo/CrossedCaloCellHelper.h"
-#include "CaloUtils/CaloClusterStoreHelper.h"
 
-TrackParticleClusterAssociationAlg::TrackParticleClusterAssociationAlg(const std::string& name, ISvcLocator* pSvcLocator):
-  AthAlgorithm(name,pSvcLocator),
-  m_caloClusterAssociationTool("Rec::ParticleCaloClusterAssociationTool/ParticleCaloClusterAssociationTool"),
-  m_trackSelector("InDet::InDetDetailedTrackSelectorTool/MuonCombinedInDetDetailedTrackSelectorTool") {  
-
-  declareProperty("ParticleCaloClusterAssociationTool"  ,   m_caloClusterAssociationTool);
-  declareProperty("TrackParticleContainerName"          ,   m_trackParticleCollectionName = "InDetTrackParticles" );
-  declareProperty("PtCut"                               ,   m_ptCut                       = 25000. );
-  declareProperty("OutputCollectionPostFix"             ,   m_outputPostFix               = "" );
-  declareProperty("CaloClusterLocation"                 ,   m_caloClusters                = "CaloCalTopoClusters"   );
-}
+#include "StoreGate/WriteDecorHandle.h"
 
-TrackParticleClusterAssociationAlg::~TrackParticleClusterAssociationAlg()
-{
+#include "FourMomUtils/P4Helpers.h"
+
+#include "AthContainers/AuxElement.h"
 
-}
+
+TrackParticleClusterAssociationAlg::TrackParticleClusterAssociationAlg(const std::string& name, ISvcLocator* pSvcLocator):
+  AthAlgorithm(name,pSvcLocator) {  }
 
 StatusCode TrackParticleClusterAssociationAlg::initialize()
 {
-  ATH_CHECK(m_caloClusterAssociationTool.retrieve());
-  // ATH_CHECK(m_trackSelector.retrieve());
 
+  ATH_CHECK( m_caloExtKey.initialize() );
+  ATH_CHECK( m_trackParticleCollectionHandle.initialize() );
+  ATH_CHECK( m_caloClusters.initialize() );
+  ATH_CHECK( m_assocClustersDecor.initialize() );
+
+  ATH_CHECK(m_caloEntryParsDecor.initialize( !m_caloEntryParsDecor.empty() ) );
+
+  ATH_CHECK( m_vertexContHandle.initialize( !m_vertexContHandle.empty() ) );
+  if(!m_vertexContHandle.empty() ) {
+    ATH_CHECK(m_trackvertexassoTool.retrieve() );
+  }
+
+  ATH_MSG_DEBUG(" cluster decoration = "<< m_assocClustersDecor.key() );
   return StatusCode::SUCCESS; 
 }
 
 StatusCode TrackParticleClusterAssociationAlg::execute()
 {
 
+  ATH_MSG_DEBUG("excute()");
   // get track particles
-  const xAOD::TrackParticleContainer* trackParticles = 0;
-  if(evtStore()->contains<xAOD::TrackParticleContainer>(m_trackParticleCollectionName)) {
-    if(evtStore()->retrieve(trackParticles,m_trackParticleCollectionName).isFailure()) {
-      ATH_MSG_FATAL( "Unable to retrieve " << m_trackParticleCollectionName );
-      return StatusCode::FAILURE;
-    }
-  }else{
-    // in case nothing is found return
-    return StatusCode::SUCCESS;
+  SG::ReadHandle<xAOD::TrackParticleContainer> trackParticles(m_trackParticleCollectionHandle);  
+  ATH_MSG_DEBUG("retrieved "<< m_trackParticleCollectionHandle.key()<< " size ="<< trackParticles->size() );
+  
+  // pre-calculate a width of clusters, set it as dynamica attribute so we don't have to recalculate it
+  SG::ReadHandle<xAOD::CaloClusterContainer> clusterContainer(m_caloClusters);
+  ATH_MSG_DEBUG("retrieved "<< m_caloClusters.key() << " size = "<< clusterContainer->size() );
+  static SG::AuxElement::Decorator<float> sig_dec("sigmaWidth");
+  //for(const xAOD::CaloCluster *cl : *clusterContainer){
+  for(const xAOD::CaloCluster *cl : *clusterContainer){
+    double rad;
+    cl->retrieveMoment(xAOD::CaloCluster::SECOND_R,rad);
+    double cent;
+    cl->retrieveMoment(xAOD::CaloCluster::CENTER_MAG,cent);
+    double sigmaWidth = atan(sqrt(rad)/cent)*cosh(cl->eta());
+    sig_dec(*cl) = sigmaWidth;
   }
 
-  // create strings for locations based on input track collection
-  // std::string clusterContainerName = m_trackParticleCollectionName + "AssociatedClusters" + m_outputPostFix;
-  std::string associationContainerName = m_trackParticleCollectionName + "ClusterAssociations" + m_outputPostFix;
 
-  // Create the xAOD container and its auxiliary store:
-  xAOD::TrackParticleClusterAssociationContainer* xaoda = new xAOD::TrackParticleClusterAssociationContainer();
-  ATH_CHECK( evtStore()->record( xaoda, associationContainerName ) );
+  // obtain the CaloExtension from the map in the event store
+  SG::ReadHandle<CaloExtensionCollection> caloExts( m_caloExtKey );
+  ATH_MSG_DEBUG("CaloExtensionCollection "<< m_caloExtKey.key() << "  : size="<< caloExts->size() );
 
-  xAOD::TrackParticleClusterAssociationAuxContainer* auxa = new xAOD::TrackParticleClusterAssociationAuxContainer();
-  ATH_CHECK( evtStore()->record( auxa, associationContainerName + "Aux." ) );
-  xaoda->setStore( auxa );
-  ATH_MSG_DEBUG( "Recorded TrackParticleClusterAssociationContainer with key: " << associationContainerName );    
+  const xAOD::Vertex * pv0 = nullptr;
+  if(!m_vertexContHandle.empty()){
+    SG::ReadHandle<xAOD::VertexContainer> vxCont(m_vertexContHandle);
+    if(!vxCont->empty()) pv0=(*vxCont)[0]; // Hard code HS vertex as PV0
+  }
 
+  SG::WriteDecorHandle<xAOD::TrackParticleContainer,
+		       std::vector<ElementLink<xAOD::CaloClusterContainer>> > assoClustDecor(m_assocClustersDecor);
+    
+  ATH_MSG_DEBUG("will decorate with "<<assoClustDecor.key()<< " and adding trkParam : "<< m_caloEntryParsDecor.key()  );
+
+  // ******************************************
+  // main loop over tracks 
   unsigned int ntracks = 0;
-  for( unsigned int i=0;i<trackParticles->size();++i ){
+  for( const xAOD::TrackParticle* tp : *trackParticles){
+
 
-    // slect track
-    const xAOD::TrackParticle* tp = (*trackParticles)[i];
-    // if( !m_trackSelector->decision(*tp) || tp->pt() < m_ptCut ) continue;
     if( tp->pt() < m_ptCut ) continue;
 
-    // get ParticleCellAssociation
-    ATH_MSG_DEBUG(" Selected track: pt " << tp->pt() << " eta " << tp->eta() << " phi " << tp->phi() );
-    const Rec::ParticleClusterAssociation* association = 0;
-    if( !m_caloClusterAssociationTool->particleClusterAssociation(*tp,association,0.1) ){
-      ATH_MSG_DEBUG("failed to obtain the ParticleClusterAssociation");
-      continue;
-    }
+    if( pv0 != nullptr) if(! m_trackvertexassoTool->isCompatible(*tp, *pv0 )) continue;
+    
+    ATH_MSG_DEBUG(" Selected track " << tp->index() << "  pt " << tp->pt() << " eta " << tp->eta() << " phi " << tp->phi() );
 
-    // require container as it should be there
-    if( !association->container() ){
-      ATH_MSG_WARNING("Failed to obtain CaloClusterContainer from ParticleCellAssociation");
+
+    // IMMPORTANT : this assumes a correspondance between the TrackParticleContainer and the CaloExtensionCollection !
+    const Trk::CaloExtension * caloExtension = (*caloExts)[tp->index() ] ;
+    if (caloExtension == nullptr ) {
+      ATH_MSG_DEBUG(" Selected track "<< tp->index() << " has no caloExtension ");
       continue;
     }
-    
-    // create element links
-    ElementLink< xAOD::TrackParticleContainer > trackLink(m_trackParticleCollectionName,i);
-    std::vector< ElementLink< xAOD::CaloClusterContainer > > caloClusterLinks;
-    
-    for(auto cluster : association->data())
-    {
-        ElementLink< xAOD::CaloClusterContainer >   clusterLink(m_caloClusters,cluster->index());
-        // if valid create TrackParticleClusterAssociation
-        if( clusterLink.isValid() ){
-            caloClusterLinks.push_back( clusterLink );
-        }
-        ATH_MSG_DEBUG(" New cluster: eta " << cluster->eta() << " phi " << cluster->phi() );
-    }
-    
-    if( trackLink.isValid() && caloClusterLinks.size()!=0){
-        xAOD::TrackParticleClusterAssociation* trackAssociation = new xAOD::TrackParticleClusterAssociation();
-        xaoda->push_back(trackAssociation);
-        trackAssociation->setTrackParticleLink( trackLink );
-        trackAssociation->setCaloClusterLinks(caloClusterLinks);
-        ATH_MSG_DEBUG("added association");
-        ++ntracks;
-    }
-    else{
-        if( !trackLink.isValid() )   ATH_MSG_WARNING("Failed to create track ElementLink ");
-        if( caloClusterLinks.size()==0 ) ATH_MSG_VERBOSE("Failed to create cluster ElementLink - this is probably a trackonly TCC ");
+
+
+    // build the associated clusters
+    std::vector<const xAOD::CaloCluster*> assoClusters = associatedClusters( *caloExtension, *clusterContainer); 
+
+
+    // retrieve the vector of links to cluster (and creating it )
+    std::vector< ElementLink< xAOD::CaloClusterContainer > > & caloClusterLinks = assoClustDecor(*tp);
+    // translate in ElementLink
+    caloClusterLinks.reserve( assoClusters.size() );
+    for(const xAOD::CaloCluster* cluster : assoClusters) caloClusterLinks.emplace_back( *clusterContainer,cluster->index() );
+    ntracks++;     
+  }// end loop over tracks
+
+  // 2nd loop over track, only to decorate with Track parameter if requested.
+  if (! m_caloEntryParsDecor.empty() ){
+    // we can not do this in the above loop because declaring a WriteDecorHandle requires a non empty key
+    //  (otherwise : run-time error).
+    SG::WriteDecorHandle<xAOD::TrackParticleContainer,  const Trk::TrackParameters*> trkParamDecor( m_caloEntryParsDecor );
+    for( const xAOD::TrackParticle* tp : *trackParticles){
+      const Trk::CaloExtension * caloExtension = (*caloExts)[tp->index() ] ;
+      if (caloExtension == nullptr ) trkParamDecor( *tp ) =  nullptr ;
+      else trkParamDecor( *tp ) = caloExtension->caloEntryLayerIntersection();      
     }
-   
-  }
 
+  }
+  
   ATH_MSG_DEBUG(" Total number of selected tracks: " << ntracks );
 
-  // if (CaloClusterStoreHelper::finalizeClusters(&(*evtStore()), xaod,clusterContainerName,msg()).isFailure() ) 
-    // ATH_MSG_WARNING("finalizeClusters failed");
-
   return StatusCode::SUCCESS;
 }
 
 
-StatusCode TrackParticleClusterAssociationAlg::finalize()
-{
-  return StatusCode::SUCCESS;
+std::vector<const xAOD::CaloCluster* > TrackParticleClusterAssociationAlg::associatedClusters(const Trk::CaloExtension & caloExtension, const xAOD::CaloClusterContainer & allClusters ){
+
+  std::vector<const xAOD::CaloCluster* > clusters;
+
+  const Trk::TrackParameters*  pars = caloExtension.caloEntryLayerIntersection();
+  if(!pars) {
+    ATH_MSG_WARNING( " NO TrackParameters caloExtension.caloEntryLayerIntersection() ");
+    return clusters;
+  } 
+    
+  float eta = pars->position().eta();
+  float phi = pars->position().phi();
+
+  double uncertEta = 0.;
+  double uncertPhi = 0.;
+  if(pars->covariance()) {
+    uncertEta = -2.*sin(pars->position().theta()) / (cos(2.*pars->position().theta())-1.) * sqrt((*pars->covariance())(Trk::theta,Trk::theta));
+    uncertPhi = sqrt((*pars->covariance())(Trk::phi,Trk::phi));
+  } 
+  double uncertExtrp = uncertEta*uncertEta + uncertPhi*uncertPhi;
+
+  float dr2Cut0 = m_dr*m_dr;
+  // to access the pre-calculated width :
+  static SG::AuxElement::ConstAccessor<float> sig_acc("sigmaWidth");
+
+  for(const xAOD::CaloCluster * cl : allClusters){
+
+    float dPhi = P4Helpers::deltaPhi( cl->phi(), phi);
+    float dEta = cl->eta()-eta;
+    float dr2  = dPhi*dPhi+ dEta*dEta;
+    float dr2Cut = dr2Cut0;
+    
+    if(m_useCovariance) {                        
+      
+      double sigmaWidth = sig_acc(*cl);          
+      double uncertClus  = 2.*sigmaWidth*sigmaWidth;
+      if(uncertExtrp>uncertClus){
+	ATH_MSG_DEBUG("Extrapolation uncertainty larger than cluster width! Returning without association.");
+	continue;
+      }
+      
+      dr2Cut = (sigmaWidth+uncertEta)*(sigmaWidth+uncertEta)+(sigmaWidth+uncertPhi)*(sigmaWidth+uncertPhi);   
+    }
+    if( dr2 < dr2Cut ) clusters.push_back( cl );    
+  }
+
+  return clusters;
 }
diff --git a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h
index c1fe43b908c269a44a9f86d701d28b6be53dfe4a..8399686db4481a10f5d28959a4e945c316e6e60e 100644
--- a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h
+++ b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRACKPARTICLEASSOCIATIONALGS_TRACKPARTICLECLUSTERASSOCIATIONALG_H
@@ -7,37 +7,67 @@
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
-#include <string>
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
+#include "StoreGate/WriteDecorHandleKey.h"
+
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "TrkCaloExtension/CaloExtensionCollection.h"
 
+#include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
 
-namespace Rec {
-  class IParticleCaloClusterAssociationTool;
-}
-namespace Trk {
-  class ITrackSelectorTool;
-}
+#include <string>
 
+//////////////////////////////////////////////////////////
+/// \class TrackParticleClusterAssociationAlg
+/// Associate clusters to each track based on its extrapolation to the calo.
+///
+/// This alg reads in a CaloExtensionCollection corresponding to a TrackParticleContainer.
+/// It then decorates each TrackParticleContainer with a vector<EL<CaloCluster>> containing
+/// the clusters close enough (DeltaR property) w.r.t CaloExtension corresponding to the track.
+/// Optionnaly tracks are also decorated with a const Trk::TrackParameters* obtain from
+/// caloExtension->caloEntryLayerIntersection().
+///
+/// Note: In earlier versions this alg was creating 2 maps a xAODAssociations/TrackParticleClusterAssociationContainer
+/// and a Rec::ParticleClusterAssociation and was using ParticleCaloClusterAssociationTool to retrieve the extrapolation
+/// and perform the clusters association.
+/// All of this was suppress or replaced in order to simplify the procedure.
 class TrackParticleClusterAssociationAlg : public AthAlgorithm
 {
  public:
   TrackParticleClusterAssociationAlg(const std::string& name, ISvcLocator* pSvcLocator);
 
-  ~TrackParticleClusterAssociationAlg();
 
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  StatusCode initialize() override ;
+  StatusCode execute() override ;
+
 
  private:
 
-  ToolHandle<Rec::IParticleCaloClusterAssociationTool> m_caloClusterAssociationTool;
-  ToolHandle <Trk::ITrackSelectorTool>              m_trackSelector; //!< Tool to select tracks
+  /// returns the clusters from allClusters which are close enough to caloExtensions
+  std::vector<const xAOD::CaloCluster* > associatedClusters(const Trk::CaloExtension & caloExtensions, const xAOD::CaloClusterContainer & allClusters) ;
+  
+  
 
-  std::string m_trackParticleCollectionName;
-  double m_ptCut;
-  std::string m_outputPostFix;
-  std::string m_caloClusters;
-};
+  Gaudi::Property<float> m_dr {this, "DeltaR", 0.1, "max deltaR to match track and cluster" };
+  Gaudi::Property<bool> m_useCovariance {this, "UseCovariance", true, "use covariance from TrkParameters to evaluate angular uncertainties"};
+  Gaudi::Property<double> m_ptCut {this, "PtCut", 25000., ""};
 
+  // input containers
+  SG::ReadHandleKey<CaloExtensionCollection> m_caloExtKey {this, "CaloExtensionName", "", ""};
+  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticleCollectionHandle {this,"TrackParticleContainerName",  "InDetTrackParticles", "input tracks" };
+  SG::ReadHandleKey<xAOD::CaloClusterContainer> m_caloClusters {this, "CaloClusterLocation", "CaloCalTopoClusters","input calo clusters"};
+
+  // vertex handling
+  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContHandle {this, "VertexContainerName", "", "if empty all tracks will be decorated. if not only those corresponding to the PV[0] will."};
+  ToolHandle<CP::ITrackVertexAssociationTool> m_trackvertexassoTool {this, "TrackVertexAssoTool", "" };
+
+
+  // decorations 
+  SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_assocClustersDecor {this, "AssociatedClusterDecorKey" , "", "Decoration key to store associated clusters. IMPORTANT  must be consistent with TrackParticleContainer" };
+  SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_caloEntryParsDecor {this, "CaloEntryParsDecorKey" , "", "Decoration name to store trk parameters to calo entry (if non blank). IMPORTANT : must be consistent with TrackParticleContainer" };
+};
 
 #endif
diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloClusterAssociationTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloClusterAssociationTool.h
index 2790b2d7bd571246bfb59f55b05821fae44099e7..51d32bdcbf5c70abd07fefd56b213f4ccea08274 100644
--- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloClusterAssociationTool.h
+++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloClusterAssociationTool.h
@@ -40,7 +40,7 @@ namespace Rec
         @return true if the call was successful
     */
     virtual bool particleClusterAssociation( const xAOD::IParticle& particle,  const ParticleClusterAssociation*& association, float dr, 
-                                             const xAOD::CaloClusterContainer* container = 0, bool useCaching = true ) const = 0;
+                                             const xAOD::CaloClusterContainer* container, bool useCaching = true ) const = 0;
 
     static const InterfaceID& interfaceID( ) ;
   };
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.cxx
deleted file mode 100644
index bc87f568f39b487fd5c9eafbc51f6386a8f8f35f..0000000000000000000000000000000000000000
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.cxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "ParticleCaloClusterAssociationTool.h"
-// forward declares
-
-#include "ParticleCaloExtension/ParticleClusterAssociationCollection.h"
-#include "ParticlesInConeTools/ICaloClustersInConeTool.h"
-
-#include "TrkCaloExtension/CaloExtension.h"
-#include "TrkCaloExtension/CaloExtensionHelpers.h"
-
-#include "FourMomUtils/P4Helpers.h"
-
-#include "CaloGeoHelpers/CaloSampling.h"
-
-#include "TrackCaloClusterRecTools/IParticleToCaloExtensionMap.h"
-#include "xAODTracking/VertexContainer.h"
-
-
-namespace Rec {
-
-  ParticleCaloClusterAssociationTool::ParticleCaloClusterAssociationTool(const std::string& t, const std::string& n, const IInterface*  p )
-    : AthAlgTool(t,n,p),
-      m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"),
-      m_clustersInConeTool("xAOD::CaloClustersInConeTool/CaloClustersInConeTool"),
-      m_caloClusters("CaloCalTopoClusters"),
-      m_caloEntryMapName("ParticleToCaloExtensionMap")
-  {
-    declareInterface<IParticleCaloClusterAssociationTool>(this);
-    declareProperty("ParticleCaloExtensionTool",   m_caloExtensionTool );
-    declareProperty("ClustersInConeTool",          m_clustersInConeTool);
-    declareProperty("CaloClusterLocation",         m_caloClusters);
-    declareProperty("AssociationCollectionName",   m_assCollection);
-    declareProperty("ParticleCaloEntryMapName",    m_caloEntryMapName);
-    //coneSize for including calo cells around track
-    declareProperty("ConeSize",                    m_coneSize = 0.1);
-    declareProperty("UseCovariance",               m_useCovariance = true);
-  }
-
-  ParticleCaloClusterAssociationTool::~ParticleCaloClusterAssociationTool() {}
-
-  StatusCode ParticleCaloClusterAssociationTool::initialize() {
-    /* Retrieve track extrapolator from ToolService */
-    ATH_CHECK( m_caloExtensionTool.retrieve() );
-
-    if (!m_clustersInConeTool.empty()) ATH_CHECK(m_clustersInConeTool.retrieve());
-    
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode ParticleCaloClusterAssociationTool::finalize() {
-    return StatusCode::SUCCESS;
-  }
-
-  bool ParticleCaloClusterAssociationTool::particleClusterAssociation( const xAOD::IParticle& particle,  const ParticleClusterAssociation*& association, float dr, 
-                                                                       const xAOD::CaloClusterContainer* container, bool useCaching ) const {
-
-
-    ATH_MSG_DEBUG(" particleClusterAssociation: ptr " << &particle << " dr " << dr << " useCaching " << useCaching);
-
-    // reset pointer
-    association = nullptr;
-    // check if link is already there
-    if( useCaching ){
-      if( particle.isAvailable< ParticleClusterAssociation* >("clusterAssociation") ){
-        ParticleClusterAssociation* theAssociation = particle.auxdata< ParticleClusterAssociation* >("clusterAssociation");
-        if( theAssociation ){
-          // check whether the cached association is from the same container
-          if( container && theAssociation->container() != container ){
-            ATH_MSG_WARNING("Calling cached version with different container pointer");
-            return false;
-          }
-          // check if we need to resize the cone
-          if( dr > theAssociation->associationConeSize() ){
-            ATH_MSG_DEBUG(" dr larger then cached dr: " << dr << " cached dr " << theAssociation->associationConeSize());
-            ParticleClusterAssociation::Data clusters;
-            associateClusters(container,theAssociation->caloExtension(),dr,clusters,particle);    
-            theAssociation->updateData(std::move(clusters),dr);
-          }
-          association = theAssociation;
-          ATH_MSG_DEBUG("Found existing calo extension");
-          return true;
-        }
-      }
-    }
-
-    // get the extrapolation into the calo
-    std::unique_ptr<Trk::CaloExtension> caloExtension = m_caloExtensionTool->caloExtension(particle);
-    if( caloExtension==nullptr ) {
-      ATH_MSG_DEBUG("Failed to get calo extension");      
-      return false;
-    }
-    if( caloExtension->caloLayerIntersections().empty()){
-      ATH_MSG_DEBUG( "Received a caloExtension object without track extrapolation");
-      return false;
-    }
-    
-    //retrieve the cluster container if not provided, return false it retrieval failed
-    if( !container && !(container = getClusterContainer()) ) {
-      ATH_MSG_DEBUG("Failed to get calo cluster container");      
-      return false;
-    }
-    
-    // update cone size in case it is smaller than the default
-    if( dr < m_coneSize ) dr = m_coneSize;
-    ParticleClusterAssociation::Data clusters;
-    associateClusters(container,*(caloExtension.get()),dr,clusters,particle);    
-    
-    association = new ParticleClusterAssociation( caloExtension.release(), std::move(clusters), dr, container );
-
-    // now add particle and CaloExtension to the container
-    IParticleToCaloExtensionMap * caloExtensionMap = nullptr;
-    if(not evtStore()->contains<IParticleToCaloExtensionMap>(m_caloEntryMapName)) {
-      caloExtensionMap = new IParticleToCaloExtensionMap();
-      if (evtStore()->record(caloExtensionMap, m_caloEntryMapName).isFailure()) {
-	ATH_MSG_WARNING( "Failed to record output collection, will leak the ParticleCaloExtension");
-	delete caloExtensionMap;
-	caloExtensionMap = nullptr;
-      }
-    } else {
-      if(evtStore()->retrieve(caloExtensionMap,m_caloEntryMapName).isFailure()) {
-	ATH_MSG_WARNING( "Unable to retrieve ParticleToCaloExtensionMap will leak the ParticleCaloExtension" );
-      }
-    }
-    if (caloExtensionMap)
-      caloExtensionMap->addEntry(&particle,caloExtension->caloEntryLayerIntersection());
-         
-    return true;
-    
-  }
-  
-  void ParticleCaloClusterAssociationTool::associateClusters( const xAOD::CaloClusterContainer* container, 
-                                                              const Trk::CaloExtension& caloExtension,
-                                                              float dr,
-                                                              ParticleClusterAssociation::Data& clusters, 
-                                                              const xAOD::IParticle& particle) const {    
-
-    particle.auxdecor<int>("ParticleCaloClusterAssociationTool")    = 1;
-
-    const Trk::TrackParameters*  pars = caloExtension.caloEntryLayerIntersection();
-    if(!pars) {
-      ATH_MSG_WARNING( " NO TrackParameters caloExtension.caloEntryLayerIntersection() ");
-      return;
-    } 
-    
-    float eta = pars->position().eta();
-    float phi = pars->position().phi();
-         
-    if( container ){
-      float dr2Cut = dr*dr;
-            
-      for( unsigned int i=0;i<container->size();++i ){
-        float dPhi = P4Helpers::deltaPhi( (*container)[i]->phi(), phi);
-        float dEta = (*container)[i]->eta()-eta;
-        float dr2  = dPhi*dPhi+ dEta*dEta;
-        
-        if(m_useCovariance) {
-            double uncertEta = 0.;
-            double uncertPhi = 0.;
-            if(pars->covariance()) {
-              uncertEta = -2.*sin(pars->position().theta()) / (cos(2.*pars->position().theta())-1.) * sqrt((*pars->covariance())(Trk::theta,Trk::theta));
-              uncertPhi = sqrt((*pars->covariance())(Trk::phi,Trk::phi));
-            } 
-            
-            float eInSample = 0.; 
-            float eInSampleFull = 0.; 
-            float emfrac = 0.; 
-            for (int s=0;s<CaloSampling::Unknown; s++){
-                eInSampleFull += (*container)[i]->eSample(CaloSampling::CaloSample(s));
-            }
-            eInSample += (*container)[i]->eSample(CaloSampling::EMB1);
-            eInSample += (*container)[i]->eSample(CaloSampling::EMB2);
-            eInSample += (*container)[i]->eSample(CaloSampling::EMB3);
-            eInSample += (*container)[i]->eSample(CaloSampling::EME1);
-            eInSample += (*container)[i]->eSample(CaloSampling::EME2);
-            eInSample += (*container)[i]->eSample(CaloSampling::EME3);
-            eInSample += (*container)[i]->eSample(CaloSampling::FCAL1);
-            
-            emfrac  = eInSample/eInSampleFull;
-            if ( emfrac > 1.0 ) emfrac = 1.;
-            if ( emfrac < 0.0 ) emfrac = 0.;
-            
-            double rad;
-            (*container)[i]->retrieveMoment(xAOD::CaloCluster::SECOND_R,rad);
-            double cent;
-            (*container)[i]->retrieveMoment(xAOD::CaloCluster::CENTER_MAG,cent);
-            double sigmaWidth = atan(sqrt(rad)/cent)*cosh((*container)[i]->eta());
-            double uncertExtrp = uncertEta*uncertEta + uncertPhi*uncertPhi;
-            double uncertClus  = 2.*sigmaWidth*sigmaWidth;
-	    	    
-            if(uncertExtrp>uncertClus){
-              ATH_MSG_DEBUG("Extrapolation uncertainty larger than cluster width! Returning without association.");
-	      continue;
-            }
-            
-            double dr2CutTmp = (sigmaWidth+uncertEta)*(sigmaWidth+uncertEta)+(sigmaWidth+uncertPhi)*(sigmaWidth+uncertPhi);
-            
-            if(sqrt(dr2)<sqrt(dr2Cut) && dr2 < dr2CutTmp) ATH_MSG_DEBUG("1. selections match! dR " << sqrt(dr2) << " new cut value " << sqrt(dr2CutTmp) << " pt trk " << pars->pT() << " sigma(phi) trk " << uncertPhi << " sigma(eta) trk " << uncertEta << " energy cluster " << (*container)[i]->e() << " sigma width " << sigmaWidth << " em frac " << emfrac);
-	    if(sqrt(dr2)<sqrt(dr2Cut) && dr2 > dr2CutTmp) ATH_MSG_DEBUG("2. only  dR matches! dR " << sqrt(dr2) << " new cut value " << sqrt(dr2CutTmp) << " pt trk " << pars->pT() << " sigma(phi) trk " << uncertPhi << " sigma(eta) trk " << uncertEta << " energy cluster " << (*container)[i]->e() << " sigma width " << sigmaWidth << " em frac " << emfrac);
-	    if(sqrt(dr2)>sqrt(dr2Cut) && dr2 < dr2CutTmp) ATH_MSG_DEBUG("3. only new matches! dR " << sqrt(dr2) << " new cut value " << sqrt(dr2CutTmp) << " pt trk " << pars->pT() << " sigma(phi) trk " << uncertPhi << " sigma(eta) trk " << uncertEta << " energy cluster " << (*container)[i]->e() << " sigma width " << sigmaWidth << " em frac " << emfrac);           
-            
-	    dr2Cut = dr2CutTmp;
-        }
-        
-        if( dr2 < dr2Cut )
-	  clusters.push_back( (*container)[i]);
-      }
-    } else {
-      ATH_MSG_DEBUG("We're at the clustersinconetool." );
-      if( !m_clustersInConeTool->particlesInCone(eta,phi,dr,clusters) ) {
-        ATH_MSG_WARNING("Failed to get clusters");
-      }
-    }
-  }
-  
-  const xAOD::CaloClusterContainer* ParticleCaloClusterAssociationTool::getClusterContainer() const {
-
-    const xAOD::CaloClusterContainer* container = nullptr;
-    //retrieve the cell container
-    if( evtStore()->retrieve(container, m_caloClusters).isFailure() || !container ) {
-      ATH_MSG_WARNING( "Unable to retrieve the cluster container  " << m_caloClusters << " container ptr " << container );
-      return nullptr;
-    }
-    if( container ) ATH_MSG_DEBUG("Retrieved cluster container " << container->size());
-    return container;
-  }
-
-} // end of namespace Rec
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h
deleted file mode 100644
index 13ec089aa7d2bb95e492a491a130b700df18c758..0000000000000000000000000000000000000000
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-/***************************************************************************
-ParticleCaloClusterAssociationTool.h  -  Description
--------------------
-begin   : Summer 2014
-authors : Niels van Eldik (CERN PH-ATC)
-***************************************************************************/
-#ifndef TRACKTOCALO_PARTICLECALOCLUSTERASSOCIATION_H
-#define TRACKTOCALO_PARTICLECALOCLUSTERASSOCIATION_H
-
-#include "RecoToolInterfaces/IParticleCaloClusterAssociationTool.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
-
-#include "ParticleCaloExtension/ParticleClusterAssociation.h"
-
-#include "RecoToolInterfaces/IParticleCaloExtensionTool.h"
-#include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
-#include "CxxUtils/checker_macros.h"
-namespace Trk {
-  class CaloExtension;
-}
-namespace xAOD {
-  class ICaloClustersInConeTool;
-}
-namespace Rec {
-
-  /* Mark as not ATLAS_NOT_THREAD_SAFE
-   * as it still uses the old style caching
-   * to be updated if needed
-   */
-  class  ParticleCaloClusterAssociationTool :
-    virtual public IParticleCaloClusterAssociationTool, public AthAlgTool {
-  public:
-    
-    ParticleCaloClusterAssociationTool(const std::string&,const std::string&,const IInterface*);
-
-    virtual ~ParticleCaloClusterAssociationTool();
-
-    virtual StatusCode initialize();
-    virtual StatusCode finalize();
-
-    /** Method to get the ParticleClusterAssociation of a given TrackParticle
-        @param particle       input particle
-        @param extension      reference to a pointer to a ParticleClusterAssociation, will be updated if call is successfull
-                              NEVER delete the pointer, you will cause a crash! 
-        @param dr             cone size used for the association
-                              If caching is enabled, the cells associated to the association contain at least all cells
-                              in dr but could contain more. Users ALWAYS have to recalculate the associated cells in their cone.
-        @param container      cluster container to be used if provided 
-        @param useCaching     configure whether the tool caches the result on the track particle
-                              The default behavior is 'true' to ensure optimal performance
-                              If caching is enabled, the code will perform a consistency check on the container pointer
-                              If the function is called twice on the same particle with different containers, the call will fail.
-                              The same is true if the function is called once without container and once with on the same particle.
-        @return true if the call was successful
-    */
-    bool particleClusterAssociation( const xAOD::IParticle& particle,  const ParticleClusterAssociation*& association, float dr, 
-                                     const xAOD::CaloClusterContainer* container = 0, bool useCaching = true ) const final;
-    
-  private:
-
-
-    void associateClusters( const xAOD::CaloClusterContainer* container, 
-                            const Trk::CaloExtension& caloExtension,
-                            float dr,
-                            ParticleClusterAssociation::Data& clusters,
-                            const xAOD::IParticle& particle) const;
-    
-    const xAOD::CaloClusterContainer* getClusterContainer() const;
-
-    ToolHandle< Trk::IParticleCaloExtensionTool >  m_caloExtensionTool;
-    // FIXME: mutable
-    ToolHandle< xAOD::ICaloClustersInConeTool >     m_clustersInConeTool;
-    std::string m_caloClusters;
-    std::string m_assCollection;
-    std::string m_caloEntryMapName;
-    double      m_coneSize;
-    bool        m_useCovariance;
-
-  };
-
-
-}
-
-#endif
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx
index 512ba3a7994b6ae80f08263ca39f568c12f99d77..42aaa002f06a78ddd58f302ba71d4f04d5c2e7f1 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx
@@ -183,6 +183,8 @@ ParticleCaloExtensionTool::caloExtension( const EventContext& ctx,
    */
 
   ParticleHypothesis particleType = m_particleType;
+
+  ATH_MSG_DEBUG("caloExtension for tracks. "<< particleType << "  index= "<< particle.index() );
   
   if(m_particleType == electron || 
      particle.particleHypothesis() ==  xAOD::electron ){  
@@ -248,13 +250,12 @@ ParticleCaloExtensionTool::caloExtension( const EventContext& ctx,
  
   /* The last argument to the extrapolate  overload 
    * corresponds  to a GeometrySignature value from
-   * TrkDetDescrUtils/TrkGeometrySignature.h
-   * The extrapolation stop at 
-   * the indicated subdetector exit
+   * TrkDetDescrUtils/GeometrySignature.h
+   * The extrapolation stop at the indicated subdetector exit
    */
-
   const std::vector<std::pair<const Trk::TrackParameters *,int>>* caloParameters=
-    m_extrapolator->extrapolate(ctx, startPars, propDir, particleType, material, 3);
+    m_extrapolator->extrapolate(ctx, startPars, propDir, particleType, material, m_extrapolDetectorID); 
+
   if (material) {
     ATH_MSG_DEBUG("Got material " << material->size() );
     for( auto& m : *material ) {
@@ -279,7 +280,7 @@ ParticleCaloExtensionTool::caloExtension( const EventContext& ctx,
   const TrackParameters* muonEntry = nullptr;
   std::vector<const CurvilinearParameters*> caloLayers;
   caloLayers.reserve(caloParameters->size()-1);
-  ATH_MSG_DEBUG( " Found calo parameters: " << caloParameters->size() );
+  ATH_MSG_DEBUG( " Found calo parameters: " << caloParameters->size() << "  extrapolation exit ID="<<m_extrapolDetectorID);
 
   for( const auto& p : *caloParameters ){
     if( !p.first ) {
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h
index 8fee32cea601fe1c16055558ec53efe5e9541d04..a0587bddbcac19432e5cb45e00bebc5435925070 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h
@@ -22,7 +22,7 @@
 
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "TrkEventPrimitives/ParticleHypothesis.h" 
-
+#include "TrkDetDescrUtils/GeometrySignature.h"
 /* 
  * xAOD includes
  */
@@ -91,6 +91,9 @@ private:
   Gaudi::Property<bool>  m_startFromPerigee{this,"StartFromPerigee",false, "Start from Perigee"};
   const AtlasDetectorID* m_detID;
   ParticleHypothesis  m_particleType ;
+
+  Gaudi::Property<unsigned int>  m_extrapolDetectorID{this,"ExtrapolationDetectorID", Trk::Calo, "The detector this tool should extrapolate through. Expects a Trk::GeometrySignature enum value."};
+  
 };
 }
 
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx b/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx
index 9f92120cee85e164000342d014acfc1feb772956..2795b9bb967093f64021f2341c584e10e6a5a7bc 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx
@@ -1,6 +1,5 @@
 #include "../ParticleCaloExtensionTool.h"
 #include "../ParticleCaloCellAssociationTool.h"
-#include "../ParticleCaloClusterAssociationTool.h"
 #include "../MuonCaloEnergyTool.h"
 #include "../CaloExtensionBuilderAlg.h"
 
@@ -8,6 +7,5 @@ using namespace Trk;
 using namespace Rec;
 DECLARE_COMPONENT( ParticleCaloExtensionTool )
 DECLARE_COMPONENT( ParticleCaloCellAssociationTool )
-DECLARE_COMPONENT( ParticleCaloClusterAssociationTool )
 DECLARE_COMPONENT( MuonCaloEnergyTool )
 DECLARE_COMPONENT( CaloExtensionBuilderAlg )
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/CMakeLists.txt b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5d4f2610d78dccff14ec72dd202c1d1036b328af
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/CMakeLists.txt
@@ -0,0 +1,19 @@
+ ################################################################################
+ # Package: TrackCaloClusterRecAlgs
+ ################################################################################
+ 
+ # Declare the package name:
+ atlas_subdir( TrackCaloClusterRecAlgs )
+ 
+ 
+ find_package( FastJet )
+ find_package( FastJetContrib ) 
+                           
+ # Component(s) in the package:
+ atlas_add_component( TrackCaloClusterRecAlgs
+                      src/*.cxx
+                      src/components/*.cxx
+                      INCLUDE_DIRS ${FASTJET_INCLUDE_DIRS} ${FASTJETCONTRIB_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${FASTJET_LIBRARIES} ${FASTJETCONTRIB_LIBRARIES} AthenaBaseComps GaudiKernel AtlasDetDescr xAODBase 
+                      xAODTracking xAODAssociations xAODPFlow TrackCaloClusterRecToolsLib TrkParametersIdentificationHelpers )
+                      
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterAlg.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..c5151092e69664944797bf91bc9cef562ab87bf2
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterAlg.h
@@ -0,0 +1,51 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERALGS_TRACKCALOCLUSTERALG_H
+#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERALGS_TRACKCALOCLUSTERALG_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "StoreGate/ReadDecorHandleKey.h"
+#include "StoreGate/WriteDecorHandleKey.h"
+
+
+#include "xAODPFlow/FlowElementContainer.h"
+#include "TrackCaloClusterRecInterfaces/ITrackCaloClusterTool.h"
+
+#include "TrackCaloClusterRecTools/TrackCaloClusterInfo.h"
+
+
+////////////////////////////////////////////////////////
+/// \class TrackCaloClusterAlg
+///
+/// Builds TrackCaloCluster after a TrackCaloClusterInfo object has been prepared and is available in
+/// the event store.
+///
+/// The 'taste' or type (TCC or UFO) of the TrackCaloCluster objects being build depends on the
+/// TCC creator tools (ITrackCaloClusterTool) attached to this alg. See the TCCTools property.
+/// 
+class TrackCaloClusterAlg: public ::AthAlgorithm { 
+public: 
+  TrackCaloClusterAlg( const std::string& name, ISvcLocator* pSvcLocator );
+    
+  virtual StatusCode  initialize() override;
+  virtual StatusCode  execute() override;
+  
+ 
+private:
+  
+  /// The tools implementting the creation of TCC
+  ToolHandleArray <ITrackCaloClusterTool> m_tccTools {this, "TCCTools", {},"List of TrackCaloClusterTool"};
+     
+  ///TrackCaloClusterInfo used by this alg
+  SG::ReadHandleKey<TrackCaloClusterInfo> m_tccInfoHandle {this, "TCCInfo", "", "the TrackCaloClusterInfo which contain the energy weights needed to split clusters/PFO onto tracks" };
+  
+  ///Cluster Collection container
+  SG::WriteHandleKey<xAOD::FlowElementContainer>  m_outputTCCHandle {this, "OutputTCCName", "TrackCaloClusters", "Name of output container to be created" };
+
+  SG::ReadHandleKey<xAOD::FlowElementContainer> m_copiedTCCHandle {this, "AppendToTCCName", "", "optionnaly, read-in an existing container, recopy and append to it with new FlowElements build by this alg."};
+
+};
+
+#endif //
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterInfoAlg.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterInfoAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..fa710bb4ebded0bc752a125ed11d497609c88c05
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/TrackCaloClusterRecAlgs/TrackCaloClusterInfoAlg.h
@@ -0,0 +1,97 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERALGS_TRACKCALOCLUSTERINFOALG_H
+#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERALGS_TRACKCALOCLUSTERINFOALG_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h" 
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/ReadDecorHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
+
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODTracking/VertexContainer.h"
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODPFlow/PFOContainer.h"
+
+#include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
+
+#include "TrackCaloClusterRecTools/TrackCaloClusterInfo.h"
+
+
+////////////////////////////////////////////////////////
+/// \class TrackCaloClusterInfoAlg
+///
+/// Builds a TrackCaloClusterInfo map which contains the weights needed to build TrackCaloCluster objects.
+/// This TrackCaloClusterInfo is then expected to be used by a TrackCaloClusterAlg and its tools.
+///
+/// \authors : Naomie Calace, P-A Delsart
+
+class TrackCaloClusterInfoAlg: public ::AthAlgorithm { 
+public: 
+  TrackCaloClusterInfoAlg( const std::string& name, ISvcLocator* pSvcLocator );
+  virtual ~TrackCaloClusterInfoAlg() {}
+  
+  virtual StatusCode  initialize() override;
+  virtual StatusCode  execute() override ;
+  
+  
+protected:
+  virtual  StatusCode fillInfo(SG::WriteHandle<TrackCaloClusterInfo> & tccInfo) const ;
+  
+  ///TrackCaloClusterInfo created by this alg
+  SG::WriteHandleKey<TrackCaloClusterInfo> m_tccInfoHandle {this, "TCCInfoName","TCCInfo","Name of TrackCaloClusterInfo to be created" };
+
+
+  
+  ///Tracks  used by this alg
+  SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inputTracksHandle {this, "InputTracks", "InDetTrackParticles", ""};
+  /// Decoration of tracks expected by this alg (set by TrackParticleClusterAssociationAlg)
+  SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> m_assoClustersKey{this, "AssoClustersDecor", "", "Key to access clusters associated to a track. IMPORTANT must be consistent with TrackParticleContainer "};
+
+  ///Original clusters from which the m_inputObjectName are build ()
+  SG::ReadHandleKey<xAOD::CaloClusterContainer> m_inputClustersHandle {this, "InputClusters", "CaloCalTopoClusters","input calo clusters"};
+  
+  SG::ReadHandleKey<xAOD::VertexContainer> m_inputVertexHandle {this, "VertexContainer", "PrimaryVertices", "IMPORTANT : if blank all tracks will be considered, else only those from the PV[0] of VertexContainer"};
+  
+  /// use cluster energy or pt?
+  Gaudi::Property<bool> m_useEnergy {this, "UseEnergy", false,"wether to cut on E or pT"};
+
+};
+
+
+
+
+
+////////////////////////////////////////////////////////
+/// \class TrackCaloClusterInfoUFOAlg
+///
+/// Builds a TrackCaloClusterInfo map using PFO as input.
+///
+/// \authors : P-A Delsart, Jennifer Roloff
+
+class TrackCaloClusterInfoUFOAlg: public TrackCaloClusterInfoAlg { 
+public: 
+  TrackCaloClusterInfoUFOAlg( const std::string& name, ISvcLocator* pSvcLocator );
+
+  virtual StatusCode  initialize() override;
+  
+protected:
+
+  virtual StatusCode fillInfo(SG::WriteHandle<TrackCaloClusterInfo> & tccInfo) const override;
+
+
+  SG::ReadHandleKey< xAOD::PFOContainer > m_inputPFOHandle {this, "InputPFO", "", ""};
+  SG::ReadDecorHandleKey<xAOD::PFOContainer> m_orig_pfo{this, "OriginPFO", "Origin_pfo", "Key to access original un-modified pfo"};
+
+  
+  /// cluster with E below this cut won't be considered in the TCC alg. WARNING cut must be configured as in UFOTool
+  Gaudi::Property<float> m_clusterEcut{this , "ClusterECut", 0, " Impotant !! : must be the same value as in UFOTool"};
+
+  ToolHandle<CP::ITrackVertexAssociationTool> m_trackVertexAssoTool {this, "TrackVertexAssoTool", "" };
+
+};
+
+#endif //
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterExample_jobOptions.py b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterExample_jobOptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..1c5b42b81637c0e3b9c60d857e3ae32fd37fde39
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/share/TrackCaloClusterExample_jobOptions.py
@@ -0,0 +1,154 @@
+#########################################################
+## This jobOptions demonstrates how to run reconstruction of
+##  TCC and UFO objects.
+##
+## See also older (and probably deprecated) example for TCC only in TrackCaloClusterReco_Standalone.py and TrackCaloClusterReco_TrackClusterInfo.py
+##########################################################
+
+
+# ***************************
+# Set-up input and athena geometry
+import AthenaPoolCnvSvc.ReadAthenaPool
+
+from AthenaCommon import CfgMgr
+
+InputFiles = ["AOD.13485488._000001.pool.root.1"]
+
+svcMgr.EventSelector.InputCollections = InputFiles
+
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+athenaCommonFlags.FilesInput = svcMgr.EventSelector.InputCollections
+
+# not sure the lines below are strictlyy necessary (?)
+from AthenaCommon.GlobalFlags import globalflags
+DetDescrVersion = 'ATLAS-R2-2016-01-00-01' #ATLAS-R2-2015-03-01-00
+globalflags.DetDescrVersion = DetDescrVersion
+
+from IOVDbSvc.CondDB import conddb
+conddb.setGlobalTag('OFLCOND-MC15c-SDR-09')
+
+print "globalflags.DetDescrVersion = ", globalflags.DetDescrVersion
+# Set up geometry and BField
+include("RecExCond/AllDet_detDescr.py")
+
+
+
+# ***************************
+# Access the algorithm sequence:
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
+
+
+
+# *********************************************
+# *********************************************
+# Setup TCC and UFO
+
+# Set the source of cluster and tracks :
+caloClusterName="CaloCalTopoClusters"
+trackParticleName="InDetTrackParticles"
+
+from TrackCaloClusterRecTools.TrackCaloClusterConfig import runTCCReconstruction, setupTrackCaloAssoc, runUFOReconstruction
+
+# Schedule TCC in the topSequence
+tccAlg = runTCCReconstruction(topSequence,ToolSvc, caloClusterName, trackParticleName)
+
+
+# scheduling UFO is a bit more complex.
+# We firts need to prepar a unified PFlow collection.
+# We choose a LC scale pflow, with origin of neutrals corrected to the PV0
+
+# we need to import the jet config helpers :
+from JetRec.JetRecStandardToolManager import jtm
+from JetRecTools.JetRecToolsConfig import ctm
+from JetRecTools.JetRecToolsConf import  JetConstituentModSequence, SoftKillerWeightTool, ConstituentSubtractorTool, ChargedHadronSubtractionTool, CorrectPFOTool
+  
+ctm.add(CorrectPFOTool("correctpfoLC",   WeightPFOTool = jtm.pflowweighter, InputIsEM=True, CalibratePFO=True, CorrectNeutral=True,InputType = 3), alias='correctpfoLC')
+ctm.add(ChargedHadronSubtractionTool("pfochs", InputType = 3), alias='pfochs')
+
+import ROOT
+from ROOT import xAOD
+xAOD.Type.ObjectType
+
+
+# here we prepare a tool building our unified PFlow container. The prefix of the output collection is 'PlainLC'
+pflowLCSeq = ctm.buildConstitModifSequence( 'ConstitLCSeq',
+                                              OutputContainer = 'PlainLC',
+                                              InputContainer= 'JetETMiss',
+                                              InputType = 3,
+                                              modList = [ 'correctpfoLC', 'pfochs'] ,
+)
+
+
+# now schedule this tool as par of a JetAlgorithm (this doesn't run a jet alg, just the above pflowLCSeq tool)
+from JetRec.JetRecConf import JetAlgorithm
+clustSeqAlg = JetAlgorithm("ClusterModifiers", Tools = [pflowLCSeq])
+topSequence += clustSeqAlg
+
+# Finally we can run the UFO building taking our unified PFlow container as input
+lcufoAlg = runUFOReconstruction(topSequence,ToolSvc, PFOPrefix="PlainLC")
+
+
+
+
+# *********************************************
+# *********************************************
+# We create a DAOD output using the DerivationFramework
+# We just put the container we created
+
+from DerivationFrameworkCore.DerivationFrameworkMaster import *
+streamName = 'StreamDAOD_TESTTCC'
+fileName = "TestTCCDAOD.root"
+TESTTCCStream = MSMgr.NewPoolRootStream( streamName, fileName )
+
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
+DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("TESTTCCKernel")
+TESTTCCStream.AcceptAlgs(["TESTTCCKernel"])
+
+from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
+TESTTCCSlimmingHelper = SlimmingHelper("TESTTCCSlimmingHelper")
+
+
+
+
+TESTTCCSlimmingHelper.AppendToDictionary["EventInfo"] = 'xAOD::EventInfo'
+TESTTCCSlimmingHelper.AppendToDictionary['EventInfoAux'] = 'xAOD::EventAuxInfo'
+TESTTCCSlimmingHelper.ExtraVariables +=[ 'EventInfo.mcChannelNumber.mcEventNumber.streamTagRobs.streamTagDets.mcEventWeights.averageInteractionsPerCrossing.actualInteractionsPerCrossing.eventNumber.runNumber.nPV' ]
+
+cont = 'CaloCalTopoClusters'
+TESTTCCSlimmingHelper.AppendToDictionary[cont] = 'xAOD::CaloClusterContainer'
+TESTTCCSlimmingHelper.AppendToDictionary[cont+'Aux'] = 'xAOD::CaloClusterContainer'
+TESTTCCSlimmingHelper.ExtraVariables +=[ cont+'.calE.calEta.calPhi.rawE' ]
+
+
+# we can not output directly our PlainLC pflow container. Technically this container is a 'view' container
+# and I'm not sure the DerivationFramework is able to deal with them. A solution is to add a custom alg which
+# fully copies this view container into a new one, which we can then write out as below.
+# cont = 'PlainLCPFO'
+# TESTTCCSlimmingHelper.AppendToDictionary[cont] = 'xAOD::PFOContainer'
+# TESTTCCSlimmingHelper.AppendToDictionary[cont+'Aux'] = 'xAOD::PFOAuxContainer'
+# TESTTCCSlimmingHelper.ExtraVariables +=[ cont+'.pt.eta.phi.charged' ]
+
+cont = 'TrackCaloClusters'
+TESTTCCSlimmingHelper.AppendToDictionary[cont] = 'xAOD::TrackCaloClusterContainer'
+TESTTCCSlimmingHelper.AppendToDictionary[cont+'Aux'] = 'xAOD::PFOAuxContainer'
+TESTTCCSlimmingHelper.ExtraVariables +=[ cont+'.pt.eta.phi.taste' ]
+
+cont = 'PlainLCUFO'
+TESTTCCSlimmingHelper.AppendToDictionary[cont] = 'xAOD::TrackCaloClusterContainer'
+TESTTCCSlimmingHelper.AppendToDictionary[cont+'Aux'] = 'xAOD::TrackCaloClusterAuxContainer'
+TESTTCCSlimmingHelper.ExtraVariables +=[ cont+'.pt.eta.phi.taste' ]
+
+
+
+
+
+TESTTCCSlimmingHelper.SmartCollections = [
+]
+
+TESTTCCSlimmingHelper.AppendContentToStream(TESTTCCStream)
+
+
+
+# only a fraction of event 
+theApp.EvtMax = 10 # -1 for all events
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterAlg.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..659fa9598f65d6e50de773cb12af98fe294bd811
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterAlg.cxx
@@ -0,0 +1,71 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+// TrackCaloClusterAlgs includes
+#include "TrackCaloClusterRecAlgs/TrackCaloClusterAlg.h"
+
+#include "TrkParametersIdentificationHelpers/TrackParametersIdHelper.h"
+#include "AtlasDetDescr/AtlasDetectorID.h"
+
+#include "xAODPFlow/TrackCaloClusterAuxContainer.h"
+#include "xAODPFlow/FlowElementContainer.h"
+#include "xAODPFlow/FlowElementAuxContainer.h"
+
+#include "StoreGate/ReadDecorHandle.h"
+#include "StoreGate/WriteDecorHandle.h"
+
+
+
+TrackCaloClusterAlg::TrackCaloClusterAlg( const std::string& name, ISvcLocator* pSvcLocator ) : 
+  AthAlgorithm( name, pSvcLocator ) { }
+  
+  
+// *****************************************************
+StatusCode TrackCaloClusterAlg::initialize() {
+  ATH_MSG_DEBUG ("Initializing " << name() << "...");    
+  ATH_CHECK(m_tccTools.retrieve());
+  ATH_CHECK(m_tccInfoHandle.initialize());
+  ATH_CHECK(m_outputTCCHandle.initialize());
+  ATH_CHECK(m_copiedTCCHandle.initialize(! m_copiedTCCHandle.empty()) );
+
+  return StatusCode::SUCCESS;
+}
+
+// *****************************************************
+StatusCode TrackCaloClusterAlg::execute() {  
+  ATH_MSG_DEBUG ("Executing " << name() << "...");
+
+  SG::ReadHandle<TrackCaloClusterInfo> tccInfo(m_tccInfoHandle);
+  
+  // Create containers
+  SG::WriteHandle<xAOD::FlowElementContainer> tccContainer(m_outputTCCHandle) ;
+  ATH_CHECK( tccContainer.record (std::make_unique<xAOD::FlowElementContainer>(),
+				  std::make_unique<xAOD::FlowElementAuxContainer>()) );
+  ATH_MSG_DEBUG( "Recorded TrackCaloClusterContainer with key: " << m_outputTCCHandle.key()  );    
+
+  // Optionnaly recopy an existing container.
+  // This option is mainly to enable functionalities of the original alg. 
+  if(! m_copiedTCCHandle.empty() ){
+    SG::ReadHandle<xAOD::FlowElementContainer> tccToCopy(m_copiedTCCHandle) ;
+    for(const xAOD::FlowElement* tobecopied: *tccToCopy){
+      xAOD::FlowElement* tcc = new xAOD::FlowElement;
+      tccContainer->push_back(tcc);
+      *tcc = *tobecopied;
+    }
+  }
+
+
+  // Loop over each TCC tool  ...
+  for(const ToolHandle<ITrackCaloClusterTool> & tool : m_tccTools){
+    // .. and have it fill  tccContainer
+    ATH_MSG_DEBUG("executing "<<tool.name() );
+    StatusCode sc=tool->fillTCC(tccContainer.ptr(), *tccInfo);
+    if(sc.isFailure()){
+      ATH_MSG_ERROR(" TCC tool "<< tool->name() << "  failed. "); return sc;
+    }
+    ATH_MSG_DEBUG("executed "<<tool.name() << " num object= "<< tccContainer->size() );
+  }
+         
+  return StatusCode::SUCCESS;
+}
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterInfoAlg.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterInfoAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..b1c04a86746e9f748eed845f0a8fbb09f0968705
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/TrackCaloClusterInfoAlg.cxx
@@ -0,0 +1,173 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+// TrackCaloClusterInfoAlgs includes
+#include "TrackCaloClusterRecAlgs/TrackCaloClusterInfoAlg.h"
+
+#include "StoreGate/ReadDecorHandle.h"
+
+#include "TrackCaloClusterRecTools/TCCHelpers.h"
+
+TrackCaloClusterInfoAlg::TrackCaloClusterInfoAlg( const std::string& name, ISvcLocator* pSvcLocator ) : 
+  AthAlgorithm( name, pSvcLocator ) {}
+  
+  
+StatusCode TrackCaloClusterInfoAlg::initialize() {
+  ATH_MSG_DEBUG ("Initializing " << name() << "...");
+  ATH_CHECK(m_inputClustersHandle.initialize() );
+  ATH_CHECK(m_inputTracksHandle.initialize() );
+  ATH_CHECK(m_inputVertexHandle.initialize());
+  ATH_CHECK(m_tccInfoHandle.initialize());
+
+  ATH_CHECK(m_assoClustersKey.initialize());
+
+  return StatusCode::SUCCESS;
+}
+  
+
+StatusCode TrackCaloClusterInfoAlg::execute()  {  
+  ATH_MSG_DEBUG ("Executing " << name() << "...");
+
+  // Prepare a TrackCaloClusterInfo map : 
+  SG::WriteHandle<TrackCaloClusterInfo> tccInfo(m_tccInfoHandle);    
+  ATH_CHECK( tccInfo.record( std::make_unique<TrackCaloClusterInfo>() ) );
+
+  // Retrieve the input containers 
+  SG::ReadHandle<xAOD::CaloClusterContainer> clusterContainer(m_inputClustersHandle);
+  SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_inputTracksHandle);
+  SG::ReadHandle<xAOD::VertexContainer> vertices(m_inputVertexHandle);
+
+  tccInfo->allClusters = &*clusterContainer;
+  tccInfo->allTracks = &*tracks;
+
+  // retrieve PV0 if it exists
+  if(!vertices->empty()) {
+    tccInfo->pv0=(*vertices)[0]; // Hard code HS vertex as PV0 : WARNING we expect it is the same as was used for m_inputTrackCaloAssocName !!
+  } else {    
+    ATH_MSG_ERROR ("Vertex container " << m_inputVertexHandle << " is empty! Can't perform TVA!");
+    return StatusCode::FAILURE;
+  }
+
+  // Fill the maps 
+  ATH_CHECK( fillInfo(tccInfo) );  
+  
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode TrackCaloClusterInfoAlg::fillInfo(SG::WriteHandle<TrackCaloClusterInfo> & tccInfo) const {
+
+  std::multimap <const xAOD::IParticle*, const xAOD::TrackParticle*> clusterToTracksMap;
+
+  SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<ElementLink<xAOD::CaloClusterContainer>> > clusterLinks(m_assoClustersKey);
+  static const xAOD::IParticle::FourMom_t nullV(0,0,0,0);
+  
+  for(const xAOD::TrackParticle* trk : *tccInfo->allTracks){
+    const auto & clustLinks = clusterLinks( *trk );
+    if(clustLinks.empty() ) continue;
+    // follow the link to the calorimeter clusters
+    for( const auto& clLink : clustLinks) {
+      const xAOD::IParticle* cluster = *clLink;
+      clusterToTracksMap.insert(std::make_pair(cluster, trk));
+      // find FourMom_t for trk or insert (0,0,0,0) if not yet in map :
+      xAOD::IParticle::FourMom_t & totalP4 = ( tccInfo->trackTotalClusterPt.insert( {trk, nullV} ) ).first->second;
+      totalP4 += cluster->p4(); // add the cluster p4 into the map.      
+    }
+  }
+  
+
+  // Create cluster-to-tracks weight map
+  for (std::pair<const xAOD::IParticle*, const xAOD::TrackParticle*>  entry : clusterToTracksMap)
+    {
+      const xAOD::IParticle* cluster = entry.first;
+      double cluster_pt       = m_useEnergy ? cluster->e() : cluster->pt();
+      double totalcluster_pt  = m_useEnergy ? tccInfo->trackTotalClusterPt.at(entry.second).E() : tccInfo->trackTotalClusterPt.at(entry.second).Pt();
+
+      // find FourMom_t for trk or insert (0,0,0,0) if not yet in map :
+      xAOD::IParticle::FourMom_t & totalP4 = ( tccInfo->clusterToTracksWeightMap.insert( {cluster, nullV} ) ).first->second;
+      totalP4 += entry.second->p4() * (cluster_pt/totalcluster_pt); // add the track p4 into the map.
+    }
+
+  
+  return StatusCode::SUCCESS;  
+}
+
+
+
+
+
+
+
+namespace TCCHelpers{
+
+  ///////////////////////////////////////////////////////
+  /// Implement a concrete CombinedUFOLoop dedicated to collection of energy sharing weights for UFO
+  ///  see TCCHelpers.h in TrackCaloClusterRecTools/
+  struct WeightsCollector : public CombinedUFOLoop {
+
+    // additional members 
+    std::multimap <const xAOD::IParticle*, const xAOD::TrackParticle*> pfoToTracksMap;
+    TrackCaloClusterInfo * tccInfo_nonconst;
+
+    const xAOD::IParticle::FourMom_t nullV = {0,0,0,0};
+    
+    virtual void processPFO(const xAOD::TrackParticle* trk, const xAOD::PFO* pfo) {
+      /// collect pfo momentum and register the pair (trk,pfo) in the relevant tccInfo map 
+      pfoToTracksMap.insert(std::make_pair(pfo, trk));
+      // get the total p4 for this track, creating it from nullV  if not existing.
+      xAOD::IParticle::FourMom_t & totalP4 = ( tccInfo_nonconst->trackTotalClusterPt.insert( {trk, nullV} ) ).first->second;
+      totalP4 += pfo->p4(); // this modifies the totalP4 stored inside the map (reference access)
+    }
+    
+    virtual void processTrk(const xAOD::TrackParticle* ) { }
+        
+  };
+}
+
+
+
+TrackCaloClusterInfoUFOAlg::TrackCaloClusterInfoUFOAlg( const std::string& name, ISvcLocator* pSvcLocator ) : 
+  TrackCaloClusterInfoAlg( name, pSvcLocator ) {}
+  
+  
+StatusCode TrackCaloClusterInfoUFOAlg::initialize() {
+  ATH_CHECK(m_trackVertexAssoTool.retrieve() );
+  ATH_CHECK(m_inputPFOHandle.initialize() );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrackCaloClusterInfoUFOAlg::fillInfo(SG::WriteHandle<TrackCaloClusterInfo> & tccInfo) const {
+
+
+
+  SG::ReadHandle<xAOD::PFOContainer> pfos(m_inputPFOHandle);
+
+  // We use a dedicated helper to collect the weights mapping tracks to PFO.  
+  TCCHelpers::WeightsCollector wcoll;
+  wcoll.m_orig_pfoK = m_orig_pfo.key();
+  wcoll.m_clustersLinkK = m_assoClustersKey.key();
+  wcoll.m_trackVertexAssoTool = m_trackVertexAssoTool.get();
+  wcoll.m_clusterEcut = m_clusterEcut;
+  wcoll.m_useEnergy = m_useEnergy;
+  wcoll.tccInfo_nonconst = tccInfo.ptr();
+
+  // perform the weight collection : this populates tccInfo.trackTotalClusterPt and tccInfo.pfoToTracksMap maps
+  wcoll.combinedUFOLoop(tccInfo.cptr(), pfos.cptr());
+  
+
+  static const xAOD::IParticle::FourMom_t nullV(0,0,0,0);
+  
+  // Create cluster-to-tracks weight map
+  for (std::pair<const xAOD::IParticle*, const xAOD::TrackParticle*>  entry : wcoll.pfoToTracksMap){
+    double cluster_pt       = m_useEnergy ? entry.first->e() : entry.first->pt();
+    double totalcluster_pt  = m_useEnergy ? tccInfo->trackTotalClusterPt.at(entry.second).E() : tccInfo->trackTotalClusterPt.at(entry.second).Pt();
+    
+    // find FourMom_t for trk or insert (0,0,0,0) if not yet in map :
+    xAOD::IParticle::FourMom_t & totalP4 = ( tccInfo->clusterToTracksWeightMap.insert( {entry.first, nullV} ) ).first->second;
+    totalP4 += entry.second->p4() * (cluster_pt/totalcluster_pt); // add the track p4 into the map.
+  }
+
+  return StatusCode::SUCCESS;
+  
+}
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/components/TrackCaloClusterRecAlgs_entries.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/components/TrackCaloClusterRecAlgs_entries.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..9cfce5b9e2374e02cc18ae5a1a25389f71b76182
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecAlgs/src/components/TrackCaloClusterRecAlgs_entries.cxx
@@ -0,0 +1,8 @@
+
+#include "TrackCaloClusterRecAlgs/TrackCaloClusterAlg.h"
+#include "TrackCaloClusterRecAlgs/TrackCaloClusterInfoAlg.h"
+
+DECLARE_COMPONENT(TrackCaloClusterAlg)
+DECLARE_COMPONENT(TrackCaloClusterInfoAlg)
+DECLARE_COMPONENT(TrackCaloClusterInfoUFOAlg)
+
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces/TrackCaloClusterRecInterfaces/IClusterFilterTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces/TrackCaloClusterRecInterfaces/IClusterFilterTool.h
index 9b7af3924e5774d4439a021e438ff627eae77ff1..21012e399e1bc36b362a34860b4f2b7fb682a810 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces/TrackCaloClusterRecInterfaces/IClusterFilterTool.h
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces/TrackCaloClusterRecInterfaces/IClusterFilterTool.h
@@ -23,7 +23,7 @@ class IClusterFilterTool : virtual public IAlgTool {
      * 
      */
     
-    virtual bool rejectCluster(const xAOD::CaloCluster& cluster) = 0;
+    virtual bool rejectCluster(const xAOD::CaloCluster& cluster) const = 0;
     
     static const InterfaceID& interfaceID( ) ;
 };
@@ -32,4 +32,4 @@ inline const InterfaceID& IClusterFilterTool::interfaceID() {
   return IID_IClusterFilterTool; 
 }
 
-#endif // TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECINTERFACES_ICLUSTERFILTERTOOL_H
\ No newline at end of file
+#endif // TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECINTERFACES_ICLUSTERFILTERTOOL_H
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces/TrackCaloClusterRecInterfaces/ITrackCaloClusterTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces/TrackCaloClusterRecInterfaces/ITrackCaloClusterTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..801c5092ad6313431356addf8b4b453d2d8c3082
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces/TrackCaloClusterRecInterfaces/ITrackCaloClusterTool.h
@@ -0,0 +1,36 @@
+// this file is -*- C++ -*-
+/*
+  Copyright (C) 2019-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// ITrackCaloClusterTool.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECINTERFACES_ITRACKCALOCLUSTTOOL_H
+#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECINTERFACES_ITRACKCALOCLUSTTOOL_H
+
+#include "GaudiKernel/IAlgTool.h"
+#include "xAODBase/IParticle.h"
+#include "xAODPFlow/FlowElementContainer.h"
+
+static const InterfaceID IID_ITrackCaloClusterTool("ITrackCaloClusterTool", 1, 0);
+
+
+class TrackCaloClusterInfo;
+
+/** @brief Interface for tools creating particles using TCC methods and filling a FlowElementContainer */
+class ITrackCaloClusterTool : virtual public IAlgTool {
+public:
+    
+    
+  
+  virtual StatusCode fillTCC(xAOD::FlowElementContainer* container, const TrackCaloClusterInfo & wmap ) const = 0;
+  
+  static const InterfaceID& interfaceID( ) ;
+};
+
+inline const InterfaceID& ITrackCaloClusterTool::interfaceID() {
+  return IID_ITrackCaloClusterTool; 
+}
+
+#endif // TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECINTERFACES_IPARTICLEEXTRAPOLATIONTOOL_H
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/CMakeLists.txt b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/CMakeLists.txt
index 4fc2fe7718618040bde220fa0e4b616fe62bd19f..a5ffd41218a60cccf6723a49f540c8bc2e8d945a 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/CMakeLists.txt
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/CMakeLists.txt
@@ -5,32 +5,6 @@
 # Declare the package name:
 atlas_subdir( TrackCaloClusterRecTools )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PUBLIC
-   GaudiKernel
-   Control/AthenaBaseComps
-   Control/StoreGate
-   Event/xAOD/xAODAssociations
-   Event/xAOD/xAODCaloEvent
-   Event/xAOD/xAODPFlow
-   Event/xAOD/xAODTracking
-   Event/xAOD/xAODTruth
-   InnerDetector/InDetRecTools/TrackVertexAssociationTool
-   Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecInterfaces
-   Tracking/TrkEvent/TrkEventPrimitives
-   PRIVATE
-   Control/CxxUtils
-   DetectorDescription/AtlasDetDescr
-   Event/FourMomUtils
-   Event/xAOD/xAODMuon
-   Tracking/TrkDetDescr/TrkSurfaces
-   Tracking/TrkEvent/TrkCaloExtension
-   Tracking/TrkEvent/TrkParameters
-   Tracking/TrkEvent/TrkParametersIdentificationHelpers
-   Tracking/TrkEvent/TrkTrack
-   Tracking/TrkExtrapolation/TrkExInterfaces )
-
 # Component(s) in the package:
 atlas_add_library( TrackCaloClusterRecToolsLib
    TrackCaloClusterRecTools/*.h src/*.cxx
@@ -47,3 +21,4 @@ atlas_add_library( TrackCaloClusterRecToolsLib
 atlas_add_component( TrackCaloClusterRecTools
    src/components/*.cxx
    LINK_LIBRARIES GaudiKernel TrackCaloClusterRecToolsLib )
+atlas_install_python_modules( python/*.py )
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/ClusterFilterTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/ClusterFilterTool.h
index ca93d4c58fc076e20a786421e35dcfeace193975..06e803cb6e525b68f986731d94c417fdb7108bb5 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/ClusterFilterTool.h
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/ClusterFilterTool.h
@@ -32,11 +32,11 @@ class ClusterFilterTool : virtual public IClusterFilterTool, public AthAlgTool {
      *  @return true if the cluster has been rejected
      * 
      */
-    bool rejectCluster(const xAOD::CaloCluster& cluster) final;
+    bool rejectCluster(const xAOD::CaloCluster& cluster) const final;
     
   private:    
     // Get a data container; implementation at end of this header file
-    template<class T> const T* getContainer( const std::string & containerName);
+    template<class T> const T* getContainer( const std::string & containerName) const ;
   
     std::string m_caloEntryMapName;
     
@@ -54,7 +54,7 @@ class ClusterFilterTool : virtual public IClusterFilterTool, public AthAlgTool {
 };
 
 template<class T>
-inline const T* ClusterFilterTool::getContainer(const std::string & containerName){
+inline const T* ClusterFilterTool::getContainer(const std::string & containerName) const{
   const T * ptr = evtStore()->retrieve< const T >( containerName );
   if (!ptr) {
     ATH_MSG_WARNING("Container '"<<containerName<<"' could not be retrieved");
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TCCHelpers.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TCCHelpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..9240016d33bc90d3eaebcd3bdb4d97e86b9bce5e
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TCCHelpers.h
@@ -0,0 +1,107 @@
+// this file is -*- C++ -*-
+/*
+  Copyright (C) 2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TCCHELPERS_H
+#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TCCHELPERS_H
+
+/////////////////////////////////////////////////////////
+/// \bried Internal helper class for TCC & UFO building.
+/// 
+/// This header is meant to be included only from dedicated implementation files.
+///
+/// \author P-A Delsart
+
+namespace TCCHelpers {
+
+  ///////////////////////////////////////////////////////
+  /// Implements a loop over tracks and pflow object to build UFOs
+  ///
+  /// Building UFO implies running a nested loop on tracks and pflows 2 times :
+  ///  - to collect and normalize energy sharing weights
+  ///  - to use these weights to actually build the UFO
+  /// The loop contains several condition and tests and so is relatively complex.
+  /// Thus it is factorized in this helper base class so we avoid to copy-paste it
+  /// and risk to introduce buggy differences.
+  ///
+  /// The 2 clients : TrackCaloClusterInfoAlg (in TrackCaloClusterRecAlgs/) UFOTool (in TrackCaloClusterRecTools/)
+  /// define derived classes which implement the only differing parts : the 
+  /// methods processPFO() and processTrk()
+  ///
+  struct CombinedUFOLoop {
+
+    virtual ~CombinedUFOLoop(){}
+    
+    // These members are used to collect info.
+    // They are expected to be set by the clients.
+    std::string m_orig_pfoK;
+    std::string m_clustersLinkK;
+    const CP::ITrackVertexAssociationTool* m_trackVertexAssoTool;
+    float m_clusterEcut;
+    bool m_useEnergy;
+    
+
+    virtual void processPFO(const xAOD::TrackParticle* trk, const xAOD::PFO* pfo) = 0;
+    virtual void processTrk(const xAOD::TrackParticle* trk) = 0;
+    
+    virtual void combinedUFOLoop(const TrackCaloClusterInfo *tccInfo, const xAOD::PFOContainer* pfos){
+      SG::AuxElement::ConstAccessor<ElementLink<xAOD::PFOContainer> > orig_pfo(m_orig_pfoK);
+      SG::AuxElement::ConstAccessor< std::vector<ElementLink<xAOD::CaloClusterContainer> > > clusterLinks(m_clustersLinkK);
+				     
+	
+      // For performance reasons, we create a map<track, bool> before looping on the tracks.
+      std::map<const xAOD::TrackParticle*, bool> isIsolatedMatchedTrack;
+      for(const xAOD::PFO* pfo: *pfos ){
+	if( ! pfo->isCharged() ) continue;
+	int isInDenseEnvironment = false;
+	pfo->attribute(xAOD::PFODetails::PFOAttributes::eflowRec_isInDenseEnvironment,isInDenseEnvironment);
+	if(isInDenseEnvironment) continue;
+	isIsolatedMatchedTrack[pfo->track(0)] = true;
+      }
+      
+
+      for(const xAOD::TrackParticle * trk: *tccInfo->allTracks){
+	// Only include tracks which aren't associated to a charged PFO -- don't want to double count!
+	if (isIsolatedMatchedTrack.find(trk) != isIsolatedMatchedTrack.end() ) continue;
+
+	// if not matched to PV0, ignore track
+	if (! m_trackVertexAssoTool->isCompatible(*trk, *tccInfo->pv0) ) continue ;
+    
+
+	const auto & clustLinks = clusterLinks( *trk );
+	if(clustLinks.empty() ) continue;
+
+
+	// follow the link to the calorimeter clusters
+	for( const auto& clLink : clustLinks) {
+	  const xAOD::CaloCluster* cluster = *clLink;
+      
+	  // See if any of the PFO are matched to this cluster
+	  for ( const xAOD::PFO* pfo : *pfos ){
+	    if(pfo->pt()<=0.) continue;
+
+	    const xAOD::PFO* pfo_orig = *orig_pfo( *pfo );
+	    if( !(fabs(pfo_orig->eta() - cluster->rawEta() )<0.01 && fabs( pfo_orig->phi()  - cluster->rawPhi() )<0.01)) continue;
+	
+
+	    if( ! pfo->isCharged() ){
+	      // Only want to apply this to PFO which aren't able to be subtracted with E/p
+	      if(cluster->rawE() < m_clusterEcut) continue;
+	    }
+
+	    processPFO(trk, pfo);
+	  } // pfo loop
+	} // cluster associated to trk loop    
+	processTrk(trk);
+    
+      } // track loop
+
+      
+    }
+    
+  };
+
+}
+
+#endif
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterCreatorTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterCreatorTool.h
deleted file mode 100644
index 70b994bcf160a422d8006fdd6c66be9e71bd7746..0000000000000000000000000000000000000000
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterCreatorTool.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-/***************************************************************************
-TrackCaloClusterCreatorTool.h  -  Description
--------------------
-begin   : March 2017
-authors : Roland Jansky
-***************************************************************************/
-#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERCREATORTOOL_H
-#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERCREATORTOOL_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't!
-#include "xAODPFlow/TrackCaloClusterContainer.h"
-#include "xAODTracking/TrackParticleContainer.h"
-#include "xAODAssociations/TrackParticleClusterAssociationContainer.h"
-
-#include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
-
-#include "TrackCaloClusterRecInterfaces/IClusterFilterTool.h"
-
-class TrackCaloClusterCreatorTool : public AthAlgTool {
-  public:
-    TrackCaloClusterCreatorTool(const std::string&,const std::string&,const IInterface*);
-    virtual ~TrackCaloClusterCreatorTool();
-
-    virtual StatusCode initialize();
-    virtual StatusCode finalize();
-    
-    /// Definition of the 4-momentum type.
-    typedef xAOD::IParticle::FourMom_t FourMom_t;
-
-    /** Method to calculate weights for TCC
-     */
-    void createCombinedTCCs(xAOD::TrackCaloClusterContainer* tccContainer, 
-			    const xAOD::TrackParticleClusterAssociationContainer* assocContainer, 
-			    std::map <const xAOD::TrackParticle*, FourMom_t>* TrackTotalClusterPt, 
-			    std::map <const xAOD::CaloCluster*, FourMom_t>* clusterToTracksWeightMap    );
-    
-    void createNeutralTCCs(xAOD::TrackCaloClusterContainer* tccContainer,
-			   const xAOD::CaloClusterContainer* assocContainer,
-			   std::map <const xAOD::CaloCluster*, FourMom_t>* clusterToTracksWeightMap    );
-    
-    void createChargedTCCs(xAOD::TrackCaloClusterContainer* tccContainer,
-			   const xAOD::TrackParticleContainer* assocContainer, 
-			   std::map <const xAOD::TrackParticle*, FourMom_t>* TrackTotalClusterPt   );
-   
-  private:  
-    
-    void computeVertexCorr(double& eta, double& phi, const Amg::Vector3D& vertex, double radius);
-    
-//     double DetectorEta(const xAOD::CaloCluster& cluster, const Amg::Vector3D& vertex);
-    
-    // ToolHandle<IJetFromPseudojet> m_bld;  // Tool to build jets.
-    ToolHandle<CP::ITrackVertexAssociationTool> m_loosetrackvertexassoTool;
-    
-    /// Vertex container's name
-    std::string m_vertexContname;
-    
-    /// Particle to CaloEntry container name
-    std::string m_caloEntryMapName;
-    
-    /// use cluster energy or pt?
-    bool m_useEnergy;
-    
-    // enable origin correction
-    bool m_doOriginCorrection;
-    bool m_storeCorrectedPosition;
-    
-    // enable cluster filtering on the neutralOnly collection
-    bool m_applyFilter;
-    ToolHandle<IClusterFilterTool> m_clusterFilterTool;
-    
-    // this is saving the detector eta to be used in calibration
-    // --> For charged and combined TCC this is using eta of the extrapolated position at the calo entry
-    //     in the ATLAS global frame, i.e. origin (0., 0., 0.)
-    // --> For neutral TCC this is evaluated using the cluster moment CaloCluster::CENTER_MAG
-    //     inverting what is done for CaloVertexedTopoCluster objects
-    bool m_saveDetectorEta;
-    
-};
-
-
-#endif // TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERCREATORTOOL_H
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterInfo.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterInfo.h
new file mode 100644
index 0000000000000000000000000000000000000000..087d08b3b81d9d59eb1c0b61334c3848c7139100
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterInfo.h
@@ -0,0 +1,40 @@
+// this file is -*- C++ -*-
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERINFO_H
+#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERINFO_H
+
+#include <map>
+#include "xAODCore/CLASS_DEF.h"
+
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODTracking/Vertex.h"
+#include "xAODAssociations/TrackParticleClusterAssociationContainer.h"
+
+////////////////////////////////////////////////////////
+/// \class TrackCaloClusterInfo
+///
+/// Holds all the necessary information to build TrackCaloCluster objects.
+/// In particular the map of weights relating tracks and clusters (or PFO objects)
+struct TrackCaloClusterInfo
+{
+
+  /// Definition of the 4-momentum type.
+  typedef xAOD::IParticle::FourMom_t FourMom_t;
+  
+  const xAOD::TrackParticleClusterAssociationContainer* assocContainer =  nullptr;
+  std::map <const xAOD::TrackParticle*, FourMom_t> trackTotalClusterPt; 
+  std::map <const xAOD::IParticle*, FourMom_t> clusterToTracksWeightMap ;
+
+  const xAOD::TrackParticleContainer * allTracks =  nullptr;
+  const xAOD::CaloClusterContainer * allClusters =  nullptr;
+  const xAOD::Vertex * pv0 =  nullptr;
+  
+  
+};
+CLASS_DEF( TrackCaloClusterInfo , 111448884 , 1 )
+
+#endif
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..cc0ec9beddf705faa59cc13ea568120503876893
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterTool.h
@@ -0,0 +1,140 @@
+// this file is -*- C++ -*-
+/*
+  Copyright (C) 2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////////
+///
+/// \file TrackCaloClusterTool.h  
+///
+/// Defines implementions of ITrackCaloClusterTool in charge of building different taste of TCC or UFO
+/// 
+/// \authors : Naomie Calace, P-A Delsart, Jennifer Roloff
+///////////////////////////////////////////////////////////////////////
+
+#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTER_H
+#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTER_H
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "xAODPFlow/PFOContainer.h"
+#include "StoreGate/ReadDecorHandleKey.h"
+
+#include "TrackCaloClusterRecInterfaces/ITrackCaloClusterTool.h"
+#include "TrackVertexAssociationTool/ITrackVertexAssociationTool.h"
+#include "TrackCaloClusterRecInterfaces/IClusterFilterTool.h"
+
+
+
+///////////////////////////////////////////////////////////////////////
+/// \class TrackCaloClusterBaseTool
+/// A base class for tools implementing ITrackCaloClusterTool
+///
+/// simply holds a few properties shared by most implementations.
+class TrackCaloClusterBaseTool : virtual public ITrackCaloClusterTool, public AthAlgTool {
+public:
+  TrackCaloClusterBaseTool(const std::string&,const std::string&,const IInterface*);
+  virtual ~TrackCaloClusterBaseTool();
+
+  virtual StatusCode initialize() override ;
+
+  virtual StatusCode fillTCC(xAOD::FlowElementContainer* container, const TrackCaloClusterInfo & tccInfo ) const =0;
+    
+protected:    
+
+  /// The tool used to make sure a track is associated to PV0
+  ToolHandle<CP::ITrackVertexAssociationTool> m_trackVertexAssoTool {this ,"TrackVertexAssoTool", ""};
+  
+  /// use cluster energy or pt?
+  Gaudi::Property<bool> m_useEnergy {this, "UseEnergy", false, "if false will use pT for weights evaluation"};
+
+
+  SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> m_assoClustersKey{this, "AssoClustersDecor", "TCCAssoClusters", "Key to access clusters associated to a track. IMPORTANT must be constistent with the TrackParticleContainer the parent alg will operate on"};
+  
+
+  
+  SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> m_caloEntryParsDecor {this, "CaloEntryParsDecorKey" , "","IMPORTANT must be constistent with the TrackParticleContainer the parent alg will operate on, REQUIRED if SaveDetectorEta or DoOriginCorrection, else leave blank so the scheduler won't require it unnecessarily."};
+
+  /// flag to add dectetor eta decoration onto the produced TrackCaloClusters
+  Gaudi::Property<bool> m_saveDetectorEta {this, "SaveDetectorEta", false, ""};       
+};
+
+
+
+///////////////////////////////////////////////////////////////////////
+/// \class TCCCombinedTool
+///
+/// Implements the creation of "combined" TCC objects
+///
+class TCCCombinedTool : public TrackCaloClusterBaseTool {
+public:
+  TCCCombinedTool(const std::string&,const std::string&,const IInterface*);
+  virtual ~TCCCombinedTool() {}
+
+  virtual StatusCode fillTCC(xAOD::FlowElementContainer* container, const TrackCaloClusterInfo & tccInfo ) const override;
+
+protected:  
+  // enable origin correction
+  Gaudi::Property<bool> m_doOriginCorrection {this, "DoOriginCorrection", false, ""};
+  Gaudi::Property<bool> m_storeCorrectedPosition{this, "StoreCorrectedPosition", false, ""};
+};
+
+
+///////////////////////////////////////////////////////////////////////
+/// \class TCCChargedTool
+///
+/// Implements the creation of "charged" TCC objects (that is tracks matched 0 clusters)
+///
+class TCCChargedTool : public TrackCaloClusterBaseTool {
+public:
+  TCCChargedTool(const std::string&,const std::string&,const IInterface*);
+
+  virtual StatusCode fillTCC(xAOD::FlowElementContainer* container, const TrackCaloClusterInfo & tccInfo ) const override;
+
+protected:
+  
+};
+
+
+
+///////////////////////////////////////////////////////////////////////
+/// \class TCCNeutralTool
+///
+/// Implements the creation of "neutral" TCC objects (that is clusters matched to 0 tracks)
+///
+class TCCNeutralTool : public TrackCaloClusterBaseTool {
+public:
+  TCCNeutralTool(const std::string&,const std::string&,const IInterface*);
+
+  virtual StatusCode fillTCC(xAOD::FlowElementContainer* container, const TrackCaloClusterInfo & tccInfo ) const override ;
+  virtual StatusCode initialize() override;
+
+protected:
+  /// optionnal tool to filter cluster we don't want to consider as TCC
+  ToolHandle<IClusterFilterTool> m_clusterFilterTool {this, "ClusterFilterTool", ""};
+  bool m_applyFilter ; // set automatically according to ClusterFilterTool
+};
+
+
+
+///////////////////////////////////////////////////////////////////////
+/// \class UFOTool
+///
+/// Implements the creation of UFO objects. These are build similarly as TCC but using PFO in the place of CaloClusters.
+/// All Combined, Charged and Neutral are build together within this class.
+///
+class UFOTool : public TrackCaloClusterBaseTool {
+public:
+  UFOTool(const std::string&,const std::string&,const IInterface*);
+
+  virtual StatusCode fillTCC(xAOD::FlowElementContainer* container, const TrackCaloClusterInfo & tccInfo ) const override;
+
+protected:
+
+  SG::ReadHandleKey<xAOD::PFOContainer> m_inputPFOHandle {this, "InputPFO", "CHSParticleFlowObjects", ""};
+  SG::ReadDecorHandleKey<xAOD::PFOContainer> m_orig_pfo{this, "OriginPFO", "Origin_pfo", "Key to access original un-modified pfo"};
+
+  /// cluster with E below this cut won't be considered in the TCC alg. WARNING cut must be configured as in TrackCaloClusterInfoUFOAlg
+  Gaudi::Property<float> m_clusterEcut{this , "ClusterECut", 0, " Impotant !! : must be the same value as in TrackCaloClusterInfoUFOAlg"};
+};
+
+#endif // TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_PARTICLETOCALOEXTRAPOLATIONTOOL_H
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterWeightsTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterWeightsTool.h
deleted file mode 100644
index e3c137971e24edde97d08d067b668e27f740c42c..0000000000000000000000000000000000000000
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/TrackCaloClusterRecTools/TrackCaloClusterWeightsTool.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-/***************************************************************************
-TrackCaloClusterWeightsTool.h  -  Description
--------------------
-begin   : March 2017
-authors : Roland Jansky
-***************************************************************************/
-#ifndef TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERWEIGHTSTOOL_H
-#define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERWEIGHTSTOOL_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "xAODPFlow/TrackCaloCluster.h"
-#include "xAODTracking/TrackParticle.h"
-#include "xAODAssociations/TrackParticleClusterAssociationContainer.h"
-
-class TrackCaloClusterWeightsTool : public AthAlgTool {
-  public:
-    TrackCaloClusterWeightsTool(const std::string&,const std::string&,const IInterface*);
-    virtual ~TrackCaloClusterWeightsTool();
-
-    virtual StatusCode initialize();
-    virtual StatusCode finalize();
-    
-    /// Definition of the 4-momentum type.
-    typedef xAOD::IParticle::FourMom_t FourMom_t;
-
-    /** Method to calculate weights for TCC
-     */
-    void fillWeightMaps(const xAOD::TrackParticleClusterAssociationContainer* assocContainer, std::multimap <const xAOD::CaloCluster*, const xAOD::TrackParticle*>* clusterToTracksMap, std::map <const xAOD::TrackParticle*, FourMom_t>* TrackTotalClusterPt, std::map <const xAOD::CaloCluster*, FourMom_t>* clusterToTracksWeightMap    );
-   
-  private:    
-
-    /// use cluster energy or pt?
-    bool m_useEnergy;
-
-};
-
-
-#endif // TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECTOOLS_TRACKCALOCLUSTERWEIGHTSTOOL_H
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/python/TrackCaloClusterConfig.py b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/python/TrackCaloClusterConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..21a7337581d740449a59f116026f36ba90522415
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/python/TrackCaloClusterConfig.py
@@ -0,0 +1,261 @@
+#   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+from AthenaCommon import Logging
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+ufolog = Logging.logging.getLogger('TCCorUFO')
+
+from AthenaConfiguration import UnifyProperties
+
+
+
+def _unifyPV0onlyTrkClustAssoc( vxContName1, vxContName2):
+    if vxContName2 == vxContName1 : return vxContName1
+    if "" in [vxContName1, vxContName2] : return vxContName1 or vxContName2
+    raise Exception(" Error : incompatible VertexContainerName of 2 instance of TrackParticleClusterAssociationAlg : '{}' and '{}'".format(vxContName1, vxContName2))
+
+
+# we make sure a unique TrackParticleAssociationAlg is well behaved when configured for both TCC and UFOInfo
+# in the same job. The function below will be used in the de-duplication and implies all tracks (not only PV0)
+# have associated clusters only if TCC is scheduled.
+#  !! Doesn't seem to work yet ??!!
+UnifyProperties.setUnificationFunction( "TrackParticleClusterAssociationAlg.VertexContainerName", _unifyPV0onlyTrkClustAssoc)
+    
+
+
+
+def setupTrackVertexAssocTool():
+    #from AthenaCommon import CfgMgr
+    # do as in jet config :
+    return CompFactory.getComp("CP::TrackVertexAssociationTool")("jetLooseTVAtool", WorkingPoint='Loose')
+
+
+def tmpSetupTrackServices(inputFlags):
+    """This temporary function ensure the tracking services necessary for TCC/UFO building are set up in a RunIII compatible way"""
+    
+    result=ComponentAccumulator()
+    StoreGateSvc=CompFactory.StoreGateSvc
+    result.addService(StoreGateSvc("DetectorStore"))
+    
+    #Setup up general geometry
+    from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
+    result.merge(InDetGeometryCfg(inputFlags))
+ 
+    #Setup TRT conditions                                                                                                                                  
+    TRTAlignCondAlg=CompFactory.TRTAlignCondAlg
+    result.addCondAlgo(TRTAlignCondAlg(name = "TRTAlignCondAlg",UseDynamicFolders = inputFlags.GeoModel.Align.Dynamic))
+ 
+    #Setup Pixel conditions
+    PixelAlignCondAlg=CompFactory.PixelAlignCondAlg
+    result.addCondAlgo(PixelAlignCondAlg(name = "PixelAlignCondAlg",UseDynamicAlignFolders = inputFlags.GeoModel.Align.Dynamic))
+ 
+    PixelDetectorElementCondAlg=CompFactory.PixelDetectorElementCondAlg
+    result.addCondAlgo(PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg"))
+ 
+    #Setup SCT conditions
+    SCT_AlignCondAlg=CompFactory.SCT_AlignCondAlg
+    result.addCondAlgo(SCT_AlignCondAlg(name = "SCT_AlignCondAlg",UseDynamicAlignFolders = inputFlags.GeoModel.Align.Dynamic))
+ 
+    SCT_DetectorElementCondAlg=CompFactory.SCT_DetectorElementCondAlg
+    result.addCondAlgo(SCT_DetectorElementCondAlg(name = "SCT_DetectorElementCondAlg"))
+ 
+    GeometryDBSvc=CompFactory.GeometryDBSvc
+    result.addService(GeometryDBSvc("InDetGeometryDBSvc"))
+    
+ 
+    #Setup TRT geometry
+    TRT_DetectorTool=CompFactory.TRT_DetectorTool
+    trtDetectorTool = TRT_DetectorTool()
+    #These two lines fix ATLASRECTS-5053. I expect eventually we can remove them, once the underlying issue is fixed.
+    trtDetectorTool.DoXenonArgonMixture = False
+    trtDetectorTool.DoKryptonMixture = False
+    result.getService("GeoModelSvc").DetectorTools += [ trtDetectorTool ]
+ 
+    #Setup up material for inner detector
+    InDetServMatTool=CompFactory.InDetServMatTool
+    result.getService("GeoModelSvc").DetectorTools += [ InDetServMatTool() ]
+    
+    #Setup up tracking geometry
+    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+    acc = TrackingGeometrySvcCfg(inputFlags)
+    result.merge(acc)
+    
+    #load folders needed for Run2 ID alignment
+    from IOVDbSvc.IOVDbSvcConfig import addFolders
+    result.merge(addFolders(inputFlags,['/TRT/Align'],'TRT_OFL'))
+    
+    #Setup up muon geometry
+    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
+    result.merge(MuonGeoModelCfg(inputFlags))    
+ 
+    #setup magnetic field service
+    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
+    result.merge(MagneticFieldSvcCfg(inputFlags))
+ 
+    #hard-code MC conditions tag needed for my ESD file - must be a better way? how to auto-configure?
+    #iovDbSvc=result.getService("IOVDbSvc")
+    #iovDbSvc.GlobalTag="OFLCOND-MC16-SDR-20"    
+
+    return result 
+
+
+def getDecorationKeyFunc(trackParticleName, assocPostfix):
+    """Simple helper returning a function to build decoration keys """
+    return lambda d : trackParticleName+'.'+d+assocPostfix
+
+def setupTrackCaloAssoc(configFlags, caloClusterName="CaloCalTopoClusters",trackParticleName="InDetTrackParticles", assocPostfix = "TCC", onlyPV0Tracks=False):
+    """ Schedule a TrackParticleClusterAssociationAlg in the top sequence, taking as input clusters and tracks defined 
+    by the keys caloClusterName and trackParticleName.
+
+    onlyPV0Tracks : calculate associated clusters only for PV0 tracks. Avoids unnecessary calculation (used in the UFO case).
+       (IMPORTANT CaloExtensionBuilderAlg does extrapolate all tracks : if too much time consuming, it needs a new option to mask non-PV0 tracks)
+    """
+    ###################################
+
+
+    decorKey = getDecorationKeyFunc(trackParticleName,assocPostfix)
+    
+    components = ComponentAccumulator()
+
+    components.merge( tmpSetupTrackServices(configFlags) )
+
+    from TrackToCalo.CaloExtensionBuilderAlgCfg import getCaloExtenstionBuilderAlgorithm 
+    caloExtAlg =getCaloExtenstionBuilderAlgorithm( configFlags )
+    caloExtAlg.LastCaloExtentionTool.ExtrapolationDetectorID = 3
+    #caloExtAlg.LastCaloExtentionTool.ParticleType = "pion"
+    caloExtAlg.TrkPartContainerName = trackParticleName
+    caloExtAlg.LastCaloExtentionTool.OutputLevel = 3
+    caloExtAlg.LastCaloExtentionTool.Extrapolator.OutputLevel = 3
+    components.addEventAlgo(  caloExtAlg  )
+    
+    
+    trackParticleClusterAssociation = CompFactory.TrackParticleClusterAssociationAlg(
+        "TrackClusterAssociationAlg"+assocPostfix,
+        #ParticleCaloClusterAssociationTool = particleCaloClusterAssociation,
+        TrackParticleContainerName = trackParticleName,
+        PtCut = 400.,
+        CaloExtensionName = caloExtAlg.ParticleCache,
+        CaloClusterLocation = caloClusterName,
+        TrackVertexAssoTool=setupTrackVertexAssocTool(), # will associate trks from PV0 only
+        VertexContainerName = "PrimaryVertices" if onlyPV0Tracks else "",
+        AssociatedClusterDecorKey = decorKey("AssoClusters"),
+        OutputLevel=2)
+
+
+    components.addEventAlgo( trackParticleClusterAssociation )
+    return components
+
+    
+def runTCCReconstruction(configFlags, caloClusterName="CaloCalTopoClusters",trackParticleName="InDetTrackParticles",
+                         assocPostfix="TCC", doCombined=True, doNeutral=True, doCharged=False, outputTCCName="TrackCaloClusters"):
+    """Create a TrackCaloCluster collection from clusters and tracks (caloClusterName and trackParticleName). 
+    Depending on options, the collection contains combined, neutral and/or charged TCC.
+    This functions schedules 2 TCC spécific algs : 
+       * a TrackCaloClusterInfoAlg to build the TrackCaloClusterInfo object
+       * a TrackCaloClusterAlg to build the TCC
+    
+    """
+
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+    decorKey = getDecorationKeyFunc(trackParticleName,assocPostfix)
+
+    components = ComponentAccumulator()    
+    
+    components.merge(
+        setupTrackCaloAssoc(configFlags, caloClusterName, trackParticleName, assocPostfix, onlyPV0Tracks=False)
+    )
+
+    
+
+
+        
+    ###################################
+    # Schedule the TrackCaloClusterInfoAlg to create the weights for clusters/tracks and store them in a TrackCaloClusterInfo object.
+    #from TrackCaloClusterRecAlgs.TrackCaloClusterRecAlgsConf import TrackCaloClusterAlg, TrackCaloClusterInfoAlg
+    tccInfoAlg = CompFactory.TrackCaloClusterInfoAlg(
+        "TCCInfoAlg",
+        TCCInfoName = "TCCInfo",
+        InputTracks = trackParticleName,
+        InputClusters = caloClusterName,
+        VertexContainer = "PrimaryVertices",
+        AssoClustersDecor = decorKey("AssoClusters"),
+    )
+
+    components.addEventAlgo( tccInfoAlg) 
+    
+    ###################################
+    # Create the TCC creator alg. TrackCaloClusterAlg makes use of the TrackCaloClusterInfo object
+    # and a list of tools to build the various TCC types.
+    tccTools = []
+    commonArgs = dict( TrackVertexAssoTool = setupTrackVertexAssocTool(),
+                       AssoClustersDecor = decorKey("AssoClusters") )
+    if doCombined:
+        tccCombined = CompFactory.TCCCombinedTool("TCCcombined", **commonArgs)
+        tccTools.append(tccCombined)
+    if doCharged:
+        tccCharged = CompFactory.TCCChargedTool("TCCCharged", **commonArgs )
+        tccTools.append(tccCharged)
+    if doNeutral:
+        tccNeutral = CompFactory.TCCNeutralTool("TCCNeutral", **commonArgs )        
+        tccTools.append(tccNeutral)
+
+    tccAlg = CompFactory.TrackCaloClusterAlg(name = "TrackCaloClusterAlg",
+                                             OutputTCCName = outputTCCName,
+                                             TCCInfo = "TCCInfo",
+                                             TCCTools = tccTools,
+                                             OutputLevel = 2,
+                                             
+                                 )
+
+    components.addEventAlgo( tccAlg)
+    return components
+
+
+def runUFOReconstruction( constits, configFlags, caloClusterName="CaloCalTopoClusters", trackParticleName="InDetTrackParticles",
+                         assocPostfix="TCC", ):
+    """Create a TrackCaloCluster collection from PFlow and tracks (PFO retrieved from PFOPrefix and tracks directly from trackParticleName). 
+    This functions schedules 2 UFO specific algs : 
+       * a TrackCaloClusterInfoUFOAlg to build the TrackCaloClusterInfo object
+       * a TrackCaloClusterAlg to build the UFO
+    """
+
+    from JetRecConfig.JetRecConfig import JetInputCfg
+
+    components = JetInputCfg(constits, configFlags)
+    constitAlg = components.getEventAlgos()[0]
+    PFOPrefix = constitAlg.Tools[0].OutputContainer
+    
+    
+    components.merge(
+        setupTrackCaloAssoc(configFlags, caloClusterName, trackParticleName, assocPostfix, onlyPV0Tracks=True)
+    )
+
+        
+
+    tccInfoAlg = CompFactory.TrackCaloClusterInfoUFOAlg("UFOInfoAlg_"+PFOPrefix,
+                                            TCCInfoName = PFOPrefix+"UFOInfo",
+                                            InputTrackCaloAssoc = trackParticleName+"ClusterAssociationsTCC",
+                                            InputTracks = trackParticleName,
+                                            InputClusters = caloClusterName,
+                                            VertexContainer = "PrimaryVertices",
+                                            TrackVertexAssoTool = setupTrackVertexAssocTool(), 
+                                            PFOPrefix = PFOPrefix,
+                                            ClusterECut = 0.,
+    )
+
+    components.addEventAlgo( tccInfoAlg) 
+
+    tccUFO = CompFactory.UFOTool("UFOtool",
+                                 TrackVertexAssoTool = setupTrackVertexAssocTool(), 
+                                 PFOPrefix = PFOPrefix,
+                                 ClusterECut = tccInfoAlg.ClusterECut,                     
+                                 )
+
+    tccAlg = CompFactory.TrackCaloClusterAlg(name = "TrackCaloClusterAlgUFO"+PFOPrefix,
+                                 OutputTCCName = "UFO"+PFOPrefix,
+                                 TCCInfo = tccInfoAlg.TCCInfoName,
+                                 TCCTools = [tccUFO,]
+    )
+    components.addEventAlgo( tccAlg)
+    return components
+
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ClusterFilterTool.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ClusterFilterTool.cxx
index 276449c2ada0f68c66d03a4023342d2b1fca7e23..b0b4b73b7d319b9ce5c7958513fd0c0ca2f2f624 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ClusterFilterTool.cxx
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ClusterFilterTool.cxx
@@ -36,7 +36,7 @@ StatusCode ClusterFilterTool::finalize() {
   return StatusCode::SUCCESS;
 }
 
-bool ClusterFilterTool::rejectCluster(const xAOD::CaloCluster& cluster) {
+bool ClusterFilterTool::rejectCluster(const xAOD::CaloCluster& cluster) const {
       
   // loop on all the tracks
   const auto allTracks   = getContainer<xAOD::TrackParticleContainer>(m_trackParticleCollectionName);
@@ -95,4 +95,4 @@ bool ClusterFilterTool::rejectCluster(const xAOD::CaloCluster& cluster) {
  
   return false;
   
-}
\ No newline at end of file
+}
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ParticleToCaloExtrapolationTool.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ParticleToCaloExtrapolationTool.cxx
index c6f23eebceb90c12d20911671c1cd82d7f56b456..aa5939aa407342dc325d5aa65302ec20cd05b3d3 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ParticleToCaloExtrapolationTool.cxx
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/ParticleToCaloExtrapolationTool.cxx
@@ -185,7 +185,7 @@ Trk::CaloExtension* ParticleToCaloExtrapolationTool::caloExtension( const Trk::T
 
   // pointers to hold results and go
   std::vector<const Trk::TrackStateOnSurface*>* material = 0;//new std::vector<const Trk::TrackStateOnSurface*>();
-  const auto* caloParameters = m_extrapolator->extrapolate( startPars, propDir, particleType, material, 3 ); 
+  const auto* caloParameters = m_extrapolator->extrapolate( startPars, propDir, particleType, material, 1 ); // last parameter is the "destination" interpreted as a GeometrySignature (1=include ID, 3=include clo)
   if( material ) {
     ATH_MSG_DEBUG("Got material " << material->size() );
     for( auto& m : *material ) {
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterCreatorTool.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterCreatorTool.cxx
deleted file mode 100644
index 1bd6f56061c24ef8fe79e7c723c8dda5b6873924..0000000000000000000000000000000000000000
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterCreatorTool.cxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-#include "TrackCaloClusterRecTools/TrackCaloClusterCreatorTool.h"
-#include "TrackCaloClusterRecTools/IParticleToCaloExtensionMap.h"
-#include "TrkCaloExtension/CaloExtension.h"
-
-#include "xAODTracking/VertexContainer.h"
-
-#include "CxxUtils/sincos.h"
-#include <cmath>
-
-TrackCaloClusterCreatorTool::TrackCaloClusterCreatorTool(const std::string& t, const std::string& n, const IInterface*  p )
-  : AthAlgTool(t,n,p),
-  m_loosetrackvertexassoTool("LooseTrackVertexAssociationTool"),
-  m_caloEntryMapName("ParticleToCaloExtensionMap"),
-  m_useEnergy(false),
-  m_doOriginCorrection(false),
-  m_storeCorrectedPosition(false),
-  m_applyFilter(true),
-  m_clusterFilterTool("ClusterFilterTool"),
-  m_saveDetectorEta(false)
-{
-    declareProperty("VertexContainerName"          ,    m_vertexContname                  = "PrimaryVertices"   );
-    declareProperty("ParticleCaloEntryMapName"     ,    m_caloEntryMapName                                      );
-    declareProperty("LooseTrackVertexAssoTool"     ,    m_loosetrackvertexassoTool                              );
-    declareProperty("UseEnergy"                    ,    m_useEnergy                                             );
-    declareProperty("DoOriginCorrection"           ,    m_doOriginCorrection                                    );
-    declareProperty("StoreCorrectedPosition"       ,    m_storeCorrectedPosition                                );
-    declareProperty("ApplyClusterFilter"           ,    m_applyFilter                                           );
-    declareProperty("ClusterFilterTool"            ,    m_clusterFilterTool                                     );
-    declareProperty("SaveDetectorEta"              ,    m_saveDetectorEta                                       );    
-}
-
-TrackCaloClusterCreatorTool::~TrackCaloClusterCreatorTool() {}
-
-StatusCode TrackCaloClusterCreatorTool::initialize() {
-  ATH_CHECK(m_loosetrackvertexassoTool.retrieve());
-  if (m_applyFilter)
-    ATH_CHECK(m_clusterFilterTool.retrieve());
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrackCaloClusterCreatorTool::finalize() {
-  return StatusCode::SUCCESS;
-}
-
-void TrackCaloClusterCreatorTool::createCombinedTCCs(xAOD::TrackCaloClusterContainer* tccContainer, 
-						     const xAOD::TrackParticleClusterAssociationContainer* assocContainer, 
-						     std::map <const xAOD::TrackParticle*, FourMom_t>* TrackTotalClusterPt, 
-						     std::map <const xAOD::CaloCluster*, FourMom_t>* clusterToTracksWeightMap ) {
-    
-    const xAOD::VertexContainer *vxCont=0;
-    StatusCode sc = evtStore()->retrieve(vxCont, m_vertexContname);
-    if (sc.isFailure()) {
-        ATH_MSG_WARNING ("Vertex container " << m_vertexContname << " not found! Can't perform TVA!");
-    }
-
-    for ( const auto* assocClusters : *assocContainer ) {
-        ATH_MSG_VERBOSE ("InDetTrackParticlesClusterAssociations index = " << assocClusters->index());
-        // flollow the link to the track particle
-        const xAOD::TrackParticle* trk = 0;
-        if (assocClusters->trackParticleLink().isValid()) {
-            trk = *(assocClusters->trackParticleLink());
-            bool isMatched = true;
-            if (vxCont && vxCont->size()!=0) {
-	      isMatched = m_loosetrackvertexassoTool->isCompatible(*trk, *(vxCont->at(0)) );
-            } else {
-	      ATH_MSG_WARNING ("Vertex container " << m_vertexContname << " is empty! Can't perform TVA!");
-            }
-            if (!isMatched) continue;
-        } else {
-	  ATH_MSG_ERROR ("trackParticleLink is not valid! " );
-        }
-	FourMom_t tcc_4p(0.,0.,0.,0.);
-        // follow the link to the calorimeter clusters
-        ATH_MSG_VERBOSE ("#(CaloCluster) = " << assocClusters->caloClusterLinks().size());
-        if (assocClusters->caloClusterLinks().size()) {
-            for (size_t c = 0; c < assocClusters->caloClusterLinks().size(); ++c) {
-                    const xAOD::CaloCluster* cluster = *(assocClusters->caloClusterLinks().at(c));
-                    double cluster_pt       = m_useEnergy ? cluster->e() : cluster->pt();
-                    double totalcluster_pt  = m_useEnergy ? TrackTotalClusterPt->at(trk).E() : TrackTotalClusterPt->at(trk).Pt();
-                    tcc_4p += cluster->p4()*(( trk->pt() * cluster_pt / totalcluster_pt) / ((clusterToTracksWeightMap->at(cluster)).Pt()));
-                    ATH_MSG_VERBOSE ("cluster->pt() " << cluster_pt << " cluster->eta() " << cluster->eta() << " cluster->phi() " 
-		    << cluster->phi() << " track pt " << trk->pt() << " (clusterToTracksWeightMap.at(cluster)).Pt() " << (clusterToTracksWeightMap->at(cluster)).Pt());
-            } // for caloClusterLinks
-        } // if caloClusterLinks().size
-        
-        double eta = trk->eta();
-	double phi = trk->phi();
-	
-	if (m_doOriginCorrection) {
-	  // retrieve the caloExtensionContainer to get the track direction at the calo entrance
-	  IParticleToCaloExtensionMap * caloExtensionMap = 0;
-	  if(evtStore()->retrieve(caloExtensionMap,m_caloEntryMapName).isFailure())
-	    ATH_MSG_WARNING( "Unable to retrieve " << m_caloEntryMapName << " will leak the ParticleCaloExtension" );
-	  
-	  const Trk::TrackParameters* pars = caloExtensionMap->readCaloEntry(trk);
-	  eta = pars->position().eta();
-	  phi = pars->position().phi();
-	  
-	  computeVertexCorr(eta, phi, (vxCont->at(0))->position(), pars->position().perp());
-	  if (m_storeCorrectedPosition) {
-	    trk->auxdecor<int>("Corrected") = 1;
-	    trk->auxdecor<float>("CaloEntryPosEtaCorr") = eta;
-	    trk->auxdecor<float>("CaloEntryPosPhiCorr") = phi;
-	  }
-	}
-	
-	xAOD::TrackCaloCluster* tcc = new xAOD::TrackCaloCluster;
-	tccContainer->push_back(tcc);
-	tcc->setParameters(tcc_4p.Pt(),eta,phi,tcc_4p.M(),xAOD::TrackCaloCluster::Taste::Combined,assocClusters->trackParticleLink(),assocClusters->caloClusterLinks());
-	// Commenting this for the moment... We can decide if we want this back later.
-	//         tcc->setParameters(tcc_4p.Pt(),eta,phi,tcc_4p.M(),xAOD::TrackCaloCluster::Taste::Combined,assocClusters->trackParticleLink(),assocClusters->caloClusterLinks());
-	
-        ATH_MSG_VERBOSE ("Created TCC with pt " << tcc->pt() << " eta " << tcc->eta() << " phi " << tcc->phi() << " mass " << tcc->m() << " taste " << tcc->taste());
-	
-	if(m_saveDetectorEta) {
-	  // retrieve the caloExtensionContainer to get the track direction at the calo entrance
-	  IParticleToCaloExtensionMap * caloExtensionMap = 0;
-	  if(evtStore()->retrieve(caloExtensionMap,m_caloEntryMapName).isFailure())
-	    ATH_MSG_WARNING( "Unable to retrieve " << m_caloEntryMapName << " will leak the ParticleCaloExtension" );
-	  
-	  const Trk::TrackParameters* pars = caloExtensionMap->readCaloEntry(trk);
-	  double det_eta = pars->position().eta();
-	  tcc->auxdecor<float>("DetectorEta") = det_eta;
-	}
-    } // for assoc clusters
-    
-}
-
-void TrackCaloClusterCreatorTool::createNeutralTCCs(xAOD::TrackCaloClusterContainer* tccContainer, 
-							const xAOD::CaloClusterContainer* assocContainer, 
-							std::map <const xAOD::CaloCluster*, FourMom_t>* clusterToTracksWeightMap  ) {
-//   const xAOD::VertexContainer* vxCont=0;
-//   if (m_saveDetectorEta) {
-//     StatusCode sc = evtStore()->retrieve(vxCont, m_vertexContname);
-//     if (sc.isFailure()) {
-//         ATH_MSG_WARNING ("Vertex container " << m_vertexContname << " not found!");
-//     }
-//   }
-  unsigned int i = 0;
-  for ( const auto* cluster : *assocContainer ) {
-      if(clusterToTracksWeightMap->find(cluster)==clusterToTracksWeightMap->end()){
-	  if (m_applyFilter and m_clusterFilterTool->rejectCluster(*cluster)) continue;
-          xAOD::TrackCaloCluster* tcc = new xAOD::TrackCaloCluster;
-          tccContainer->push_back(tcc);
-	  ElementLink< xAOD::CaloClusterContainer > clusterLink(*assocContainer,i);
-	  const std::vector< ElementLink<xAOD::CaloClusterContainer> > ClusterLink {clusterLink};
-	  tcc->setParameters(cluster->pt(),cluster->eta(),cluster->phi(),cluster->m(),xAOD::TrackCaloCluster::Taste::Neutral,ElementLink<xAOD::TrackParticleContainer>(),ClusterLink);
-          ATH_MSG_VERBOSE ("Created TCC with pt " << tcc->pt() << " eta " << tcc->eta() << " phi " << tcc->phi() << " mass " << tcc->m() << " taste " << tcc->taste());
-	  static SG::AuxElement::Accessor< float > acc_det_eta ( "DetectorEta" );
-	  if(m_saveDetectorEta and acc_det_eta.isAvailable(*cluster)) {
-// 	    double det_eta = DetectorEta(*cluster, vxCont->at(0)->position());
-	    tcc->auxdecor<float>("DetectorEta") = acc_det_eta(*cluster);
-	  }
-      }
-      i++;
-  } // for all clusters
-}
-
-void TrackCaloClusterCreatorTool::createChargedTCCs(xAOD::TrackCaloClusterContainer* tccContainer, 
-						      const xAOD::TrackParticleContainer* assocContainer, 
-						      std::map <const xAOD::TrackParticle*, FourMom_t>* TrackTotalClusterPt  ) {
-    
-    const xAOD::VertexContainer *vxCont=0;
-    StatusCode sc = evtStore()->retrieve(vxCont, m_vertexContname);
-    if (sc.isFailure()) {
-        ATH_MSG_WARNING ("Vertex container " << m_vertexContname << " not found! Can't perform TVA!");
-    }
-
-    unsigned int i = 0;
-    for ( const auto* track : *assocContainer ) {
-        if(TrackTotalClusterPt->find(track)==TrackTotalClusterPt->end()){
-            bool isMatched = true;
-            if (vxCont && vxCont->size()!=0) {
-                isMatched = m_loosetrackvertexassoTool->isCompatible(*track, *(vxCont->at(0)) );
-            }
-            else{
-                ATH_MSG_WARNING ("Vertex container " << m_vertexContname << " is empty! Can't perform TVA!");
-            }
-            if (!isMatched) continue;
-            xAOD::TrackCaloCluster* tcc = new xAOD::TrackCaloCluster;
-            tccContainer->push_back(tcc);
-	    ElementLink< xAOD::TrackParticleContainer > trkLink(*assocContainer,i);
-            tcc->setParameters(track->pt(),track->eta(),track->phi(),track->m(),xAOD::TrackCaloCluster::Taste::Charged,trkLink,std::vector<ElementLink<xAOD::CaloClusterContainer>>());
-            ATH_MSG_VERBOSE ("Created TCC with pt " << tcc->pt() << " eta " << tcc->eta() << " phi " << tcc->phi() << " mass " << tcc->m() << " taste " << tcc->taste());
-
-	    if(m_saveDetectorEta) {
-	      // retrieve the caloExtensionContainer to get the track direction at the calo entrance
-	      IParticleToCaloExtensionMap * caloExtensionMap = 0;
-	      if(evtStore()->retrieve(caloExtensionMap,m_caloEntryMapName).isFailure())
-		ATH_MSG_WARNING( "Unable to retrieve " << m_caloEntryMapName << " will leak the ParticleCaloExtension" );
-	      
-	      const Trk::TrackParameters* pars = caloExtensionMap->readCaloEntry(track);
-	      double det_eta = track->eta();
-	      if(pars)
-		det_eta = pars->position().eta();
-	      tcc->auxdecor<float>("DetectorEta") = det_eta;
-	    }
-        }
-        i++;
-    } // for all tracks
-    
-}
-
-void TrackCaloClusterCreatorTool::computeVertexCorr(double& eta, double& phi, const Amg::Vector3D& vertex, double radius) {
-  
-  if (radius<1.) return;
-  
-  if (std::fabs(eta)>10. || std::fabs(phi)>10.) return;
-  
-  CxxUtils::sincos sc (phi);
-  double iradius = 1 / radius;
-  eta += (-vertex[2]/std::cosh(eta) + sc.apply (vertex[1], vertex[0])*std::tanh(eta)) * iradius;
-  phi += sc.apply (vertex[0], -vertex[1]) * iradius;
-}
-
-// double TrackCaloClusterCreatorTool::DetectorEta(const xAOD::CaloCluster& cluster, const Amg::Vector3D& vertex) {
-//   
-//   // this is the origin corrected eta
-//   double eta = cluster.eta();
-//     
-//   double radius = 0;
-//   double mag = 0;
-//   if (cluster.retrieveMoment (xAOD::CaloCluster::CENTER_MAG, mag))  
-//     radius = mag/std::cosh(eta);
-//  
-//   if (radius<1. || std::fabs(eta)>10.) return eta;
-//   
-//   double theta = 2.*std::atan(std::exp(-eta));
-//   double eta_det = std::atan(radius/(radius/std::tan(theta)-vertex[2]));
-//   
-//   return eta_det;
-//   
-// }
\ No newline at end of file
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterTool.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..5fa6e4896e393c9b8aef9bfcee2d00e76f9e8885
--- /dev/null
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterTool.cxx
@@ -0,0 +1,398 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+#include "StoreGate/ReadDecorHandle.h"
+
+#include "AthContainers/AuxElement.h"
+
+#include "TrackCaloClusterRecTools/TrackCaloClusterTool.h"
+#include "TrackCaloClusterRecTools/TrackCaloClusterInfo.h"
+
+
+#include "CxxUtils/sincos.h"
+
+#include "TrackCaloClusterRecTools/TCCHelpers.h"
+
+
+namespace {
+  // helper functions needed only in this file are defined in this anonymous namespace
+  
+  typedef xAOD::IParticle::FourMom_t  FourMom_t; // this is actually 
+
+  // update the given eta and phi coordinates by shifting the origin to the position of vertex
+  void computeVertexCorr(double& eta, double& phi, const Amg::Vector3D& vertex, double radius) {
+  
+    if (radius<1.) return;
+    
+    if (std::fabs(eta)>10. || std::fabs(phi)>10.) return;
+  
+    CxxUtils::sincos sc (phi);
+    double iradius = 1 / radius;
+    eta += (-vertex[2]/std::cosh(eta) + sc.apply (vertex[1], vertex[0])*std::tanh(eta)) * iradius;
+    phi += sc.apply (vertex[0], -vertex[1]) * iradius;
+  }
+
+
+
+  template<typename T>
+  void setParameters(xAOD::FlowElement* fe, float pt, float eta, float phi, float m,
+		     xAOD::FlowElement::SignalType stype,
+		     const ElementLink<xAOD::IParticleContainer> &trackLink,
+		     const std::vector<ElementLink<T> >& neutralLinks){
+    std::vector<ElementLink<xAOD::IParticleContainer> > ipLinks(neutralLinks.size());
+    for(size_t i=0;i<neutralLinks.size();i++) ipLinks[i] = neutralLinks[i];
+    setParameters(fe,pt,eta,phi, m, stype,trackLink, ipLinks);
+  }
+
+  template<>
+  void setParameters<xAOD::IParticleContainer>(xAOD::FlowElement* fe, float pt, float eta, float phi, float m,
+		     xAOD::FlowElement::SignalType stype,
+		     const ElementLink<xAOD::IParticleContainer> &trackLink,
+		     const std::vector<ElementLink<xAOD::IParticleContainer> >& neutralLinks){
+    fe->setP4(pt,eta,phi,m);
+    fe->setSignalType(stype);
+    fe->setChargedObjectLinks( {trackLink} );
+    fe->setOtherObjectLinks( neutralLinks);
+  }
+  
+
+  /// help work around limitation of ReadDecorHandle
+  template<typename DTYPE, typename CTYPE>
+  SG::AuxElement::ConstAccessor<DTYPE> asConstAccessor(const SG::ReadDecorHandleKey<CTYPE> & wh){
+    static const std::string ts = typeid(DTYPE).name();
+    if(wh.empty() ) return SG::AuxElement::ConstAccessor<DTYPE>( typeid(DTYPE).name() );
+    const auto split = wh.key().rfind ('.');
+    if (split == std::string::npos)
+      throw std::runtime_error ("decor key does not contain a .: " + wh.key());
+    return SG::AuxElement::ConstAccessor<DTYPE>( wh.key().substr (split + 1) );
+  }
+  
+  
+
+}
+
+
+//*******************************************************************************
+
+TrackCaloClusterBaseTool::TrackCaloClusterBaseTool(const std::string& t, const std::string& n, const IInterface*  p )
+  : AthAlgTool(t,n,p)
+{
+  declareInterface<ITrackCaloClusterTool>(this);
+}
+TrackCaloClusterBaseTool::~TrackCaloClusterBaseTool() {}
+
+
+StatusCode TrackCaloClusterBaseTool::initialize() {
+  if(!m_trackVertexAssoTool.empty()) ATH_CHECK(m_trackVertexAssoTool.retrieve());
+
+  ATH_CHECK(m_assoClustersKey.initialize());
+
+  ATH_CHECK(m_caloEntryParsDecor.initialize(!m_caloEntryParsDecor.empty()) );
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+
+
+
+//*******************************************************************************
+
+TCCCombinedTool::TCCCombinedTool(const std::string& t, const std::string& n, const IInterface*  p )
+  : TrackCaloClusterBaseTool(t,n,p) { }
+
+
+StatusCode TCCCombinedTool::fillTCC(xAOD::FlowElementContainer* tccContainer, const TrackCaloClusterInfo & tccInfo ) const {
+
+  if(tccInfo.pv0==nullptr){
+    ATH_MSG_ERROR ("No PV0 available ! ");
+    return StatusCode::FAILURE;
+  }
+
+  // declare Decorator in case we want to save out corrected positions
+  static SG::AuxElement::Decorator<int> dec_isCorrected("Corrected");
+  static SG::AuxElement::Decorator<float> dec_calEntryEta("CaloEntryPosEtaCorr") ;
+  static SG::AuxElement::Decorator<float> dec_calEntryPhi("CaloEntryPosPhiCorr") ;
+  static SG::AuxElement::Decorator<float> dec_detEta("DetectorEta") ;
+
+  // it is not possible to prepare a blank ReadDecorHandle (which we need if !m_caloEntryParsDecor.empty()), so instead or re-instantiating a ReadDecorHandle on each
+  // track in the loop below, we just instantiate a ConstAccessor  
+  SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<ElementLink<xAOD::CaloClusterContainer>> > clusterLinksH(m_assoClustersKey);
+  auto caloEntryParams = asConstAccessor<const Trk::TrackParameters*>(m_caloEntryParsDecor);
+  
+  
+  for ( const xAOD::TrackParticle* trk : *tccInfo.allTracks ) {
+
+    if (! m_trackVertexAssoTool->isCompatible(*trk, *tccInfo.pv0) ) continue ;
+   
+    const auto & clusterLinks = clusterLinksH(*trk);
+    if( clusterLinks.empty() ) continue;
+    
+    FourMom_t tcc_4p(0.,0.,0.,0.); // will be the TCC 4-vector
+
+    // Loop over associated clusters to sum the 4-vectors x weigths
+    for( const ElementLink<xAOD::CaloClusterContainer> & clLink : clusterLinks){
+      const xAOD::CaloCluster* cluster = *clLink;
+
+      double cluster_pt       = m_useEnergy ? cluster->e() : cluster->pt();
+      double totalcluster_pt  = m_useEnergy ? tccInfo.trackTotalClusterPt.at(trk).E() : tccInfo.trackTotalClusterPt.at(trk).Pt();
+      
+      tcc_4p += cluster->p4()*(( trk->pt() * cluster_pt / totalcluster_pt) / ((tccInfo.clusterToTracksWeightMap.at(cluster)).Pt()));
+      
+      ATH_MSG_VERBOSE ("cluster->pt() " << cluster_pt << " cluster->eta() " << cluster->eta() << " cluster->phi() " 
+                       << cluster->phi() << " track pt " << trk->pt() << " (tccInfo.clusterToTracksWeightMap.at(cluster)).Pt() " << (tccInfo.clusterToTracksWeightMap.at(cluster)).Pt());
+    } // for caloClusterLinks
+    
+
+    // get angular position from tracks
+    double eta = trk->eta();
+    double phi = trk->phi();
+    
+    if (m_doOriginCorrection) {
+      // retrieve the caloExtensionContainer to get the track direction at the calo entrance
+      
+      const Trk::TrackParameters* pars = caloEntryParams(*trk);
+      eta = pars->position().eta();
+      phi = pars->position().phi();
+	  
+      computeVertexCorr(eta, phi, tccInfo.pv0->position(), pars->position().perp());
+      if (m_storeCorrectedPosition) {
+        dec_isCorrected(*trk) = 1;
+	dec_calEntryEta(*trk) = eta;
+	dec_calEntryPhi(*trk) = phi;
+      }
+    }
+	
+    // Build the final TCC
+    xAOD::FlowElement* tcc = new xAOD::FlowElement;
+    tccContainer->push_back(tcc);
+    setParameters(tcc, tcc_4p.Pt(),eta,phi,tcc_4p.M(),xAOD::FlowElement::SignalType::Combined,
+		  ElementLink<xAOD::TrackParticleContainer>(*tccInfo.allTracks, trk->index() ),clusterLinks);
+    
+    ATH_MSG_VERBOSE ("Created TCC with pt " << tcc->pt() << " eta " << tcc->eta() << " phi " << tcc->phi() << " mass " << tcc->m() << " signalType= " << tcc->signalType());
+    
+    if(m_saveDetectorEta) {	  
+      const Trk::TrackParameters* pars = caloEntryParams(*trk);
+      double det_eta = pars->position().eta();      
+      dec_detEta(*tcc) = det_eta;
+    }
+  } // for assoc clusters
+
+  
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+
+
+
+//*******************************************************************************
+
+TCCChargedTool::TCCChargedTool(const std::string& t, const std::string& n, const IInterface*  p )
+  : TrackCaloClusterBaseTool(t,n,p) { }
+
+
+    
+StatusCode TCCChargedTool::fillTCC(xAOD::FlowElementContainer* tccContainer, const TrackCaloClusterInfo & tccInfo ) const {
+      
+
+  // it is not possible to prepare a blank ReadDecorHandle (which we need if !m_caloEntryParsDecor.empty()), so instead or re-instantiating a ReadDecorHandle on each
+  // track in the loop below, we just instantiate a ConstAccessor  
+  auto caloEntryParams = asConstAccessor<const Trk::TrackParameters*>(m_caloEntryParsDecor);
+  
+  SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<ElementLink<xAOD::CaloClusterContainer>> > clusterLinksH(m_assoClustersKey);
+  
+  // declare Decorator in case we want to save out corrected positions  
+  static SG::AuxElement::Decorator<float> dec_detEta("DetectorEta") ;
+  
+  unsigned int i = 0;
+  // Loop over ALL tracks at the source of TCC
+  for ( const xAOD::TrackParticle* track : *tccInfo.allTracks ) {
+    if( ! clusterLinksH(*track).empty() ) continue; // because if not empty, it is matched to a cluster
+    // considre ONLY tracks NOT matched to a cluster :
+    if(tccInfo.trackTotalClusterPt.find(track)==tccInfo.trackTotalClusterPt.end()){
+      bool isMatched = m_trackVertexAssoTool->isCompatible(*track, *tccInfo.pv0 );
+      if (!isMatched) continue;
+      
+      xAOD::FlowElement* tcc = new xAOD::FlowElement;
+      tccContainer->push_back(tcc);
+      ElementLink< xAOD::TrackParticleContainer > trkLink(*tccInfo.allTracks,i);
+      setParameters(tcc, track->pt(),track->eta(),track->phi(),track->m(),xAOD::FlowElement::SignalType::Charged,trkLink,std::vector<ElementLink<xAOD::CaloClusterContainer>>());
+      ATH_MSG_VERBOSE ("Created TCC with pt " << tcc->pt() << " eta " << tcc->eta() << " phi " << tcc->phi() << " mass " << tcc->m() << " taste " << tcc->signalType());
+
+      if(m_saveDetectorEta) {
+        // retrieve the caloExtensionContainer to get the track direction at the calo entrance
+        double det_eta = track->eta();
+	const Trk::TrackParameters* pars = caloEntryParams(*track);
+        if(pars) det_eta = pars->position().eta();
+        dec_detEta(*tcc) = det_eta;
+      }
+    }
+    i++;
+  }
+  return StatusCode::SUCCESS;
+}
+    
+
+
+
+
+//*******************************************************************************
+
+TCCNeutralTool::TCCNeutralTool(const std::string& t, const std::string& n, const IInterface*  p )
+  : TrackCaloClusterBaseTool(t,n,p) {}
+
+StatusCode TCCNeutralTool::initialize() {
+  ATH_CHECK(TrackCaloClusterBaseTool::initialize());
+  if (!m_clusterFilterTool.empty()){
+    ATH_CHECK(m_clusterFilterTool.retrieve());
+    m_applyFilter=true;
+  } else m_applyFilter=false;
+  return StatusCode::SUCCESS;
+}
+
+
+    
+StatusCode TCCNeutralTool::fillTCC(xAOD::FlowElementContainer* tccContainer, const TrackCaloClusterInfo & tccInfo ) const {
+  
+  unsigned int i = 0;
+  // declare Decorator in case we want to save out corrected positions  
+  static SG::AuxElement::Decorator<float> dec_detEta("DetectorEta") ;
+
+  // Loop over ALL clusters 
+  for ( const xAOD::CaloCluster* cluster : *tccInfo.allClusters ) {
+    // consider only clusters NOT matched to a track :
+    if(tccInfo.clusterToTracksWeightMap.find(cluster)==tccInfo.clusterToTracksWeightMap.end()){
+      if (m_applyFilter and m_clusterFilterTool->rejectCluster(*cluster)) continue;
+      
+      // create a neutral TCC
+      xAOD::FlowElement* tcc = new xAOD::FlowElement;
+      tccContainer->push_back(tcc);
+      ElementLink< xAOD::CaloClusterContainer > clusterLink(*tccInfo.allClusters,i);
+      const std::vector< ElementLink<xAOD::CaloClusterContainer> > ClusterLink {clusterLink};
+      setParameters(tcc, cluster->pt(),cluster->eta(),cluster->phi(),cluster->m(),xAOD::FlowElement::SignalType::Neutral,ElementLink<xAOD::TrackParticleContainer>(),ClusterLink);
+      ATH_MSG_VERBOSE ("Created TCC with pt " << tcc->pt() << " eta " << tcc->eta() << " phi " << tcc->phi() << " mass " << tcc->m() << " taste " << tcc->signalType());
+      
+      static SG::AuxElement::Accessor< float > acc_det_eta ( "DetectorEta" );        
+      if(m_saveDetectorEta && acc_det_eta.isAvailable(*cluster)) {
+        dec_detEta(*tcc) = dec_detEta(*cluster);
+      }
+    }
+    i++;
+  } // for all clusters
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+
+
+
+
+
+
+//*******************************************************************************
+
+
+
+namespace TCCHelpers{
+  ///////////////////////////////////////////////////////
+  /// Implement a concrete CombinedUFOLoop dedicated to building UFO
+  ///  see TCCHelpers.h in TrackCaloClusterRecTools/
+  struct UFOBuilder : public CombinedUFOLoop {
+
+    const xAOD::PFOContainer * m_pfoContainer;
+    const TrackCaloClusterInfo* m_tccInfo;
+    xAOD::FlowElementContainer * m_tccContainer;
+    
+    std::vector<ElementLink< xAOD::PFOContainer > > m_pfoLinks;
+    FourMom_t m_tcc_4p = {0.,0.,0.,0.};
+    
+    virtual void processPFO(const xAOD::TrackParticle* trk, const xAOD::PFO* pfo) {
+      /// accumulate the total P4 and the pfos linked to trk
+      
+      ElementLink< xAOD::PFOContainer > pfoLink(*m_pfoContainer,pfo->index());
+      m_pfoLinks.push_back(pfoLink);
+      double pfo_pt       = m_useEnergy ? pfo->e() : pfo->pt();
+      const FourMom_t & totalP = m_tccInfo->trackTotalClusterPt.at(trk);
+      double totalpfo_pt  = m_useEnergy ? totalP.E() : totalP.Pt();
+      m_tcc_4p += pfo->p4()*(( trk->pt() * pfo_pt / totalpfo_pt) / ((m_tccInfo->clusterToTracksWeightMap.at(pfo)).Pt()));
+    }
+    
+    virtual void processTrk(const xAOD::TrackParticle* trk ) {
+      // build the actual combined UFO
+      if(m_tcc_4p.Pt() <=0) return;
+      
+      xAOD::FlowElement* tcc = new xAOD::FlowElement;
+      m_tccContainer->push_back(tcc);
+      setParameters(tcc, m_tcc_4p.Pt(), trk->eta(), trk->phi(),m_tcc_4p.M(),xAOD::FlowElement::SignalType::Combined,
+		    ElementLink<xAOD::TrackParticleContainer>(*m_tccInfo->allTracks,trk->index()),m_pfoLinks);
+
+      // reset accumulators for next track :
+      m_pfoLinks.clear();
+      m_tcc_4p = {0.,0.,0.,0.};
+    }
+  };
+}
+
+
+
+UFOTool::UFOTool(const std::string& t, const std::string& n, const IInterface*  p )
+  : TrackCaloClusterBaseTool(t,n,p) {}
+
+
+StatusCode UFOTool::fillTCC(xAOD::FlowElementContainer* tccContainer, const TrackCaloClusterInfo & tccInfo ) const {
+
+  SG::ReadHandle<xAOD::PFOContainer> pfos(m_inputPFOHandle);
+
+  SG::ReadDecorHandle<xAOD::PFOContainer, ElementLink<xAOD::PFOContainer> > orig_pfo(m_orig_pfo);
+  SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<ElementLink<xAOD::CaloClusterContainer>> > clusterLinksH(m_assoClustersKey);
+
+
+  // We use a dedicated helper to build the combined UFO. Initialize it :  
+  TCCHelpers::UFOBuilder ufoB;
+  ufoB.m_orig_pfoK = m_orig_pfo.key();
+  ufoB.m_clustersLinkK = m_assoClustersKey.key();
+  ufoB.m_trackVertexAssoTool = m_trackVertexAssoTool.get();
+  ufoB.m_clusterEcut = m_clusterEcut;
+  ufoB.m_useEnergy = m_useEnergy;
+
+  ufoB.m_pfoContainer = pfos.ptr();
+  ufoB.m_tccInfo = &tccInfo;
+  ufoB.m_tccContainer = tccContainer;
+
+  // create a combined UFO for each track matched to some PFO 
+  ufoB.combinedUFOLoop(&tccInfo, pfos.cptr());
+  
+  
+  // Create a UFO for all neutral and charged PFO which are not matched to any tracks
+  unsigned int i = -1;
+  for ( const xAOD::PFO* pfo : *pfos ) {
+    i++;
+    if(pfo->pt() <= 0) continue;
+    if(tccInfo.clusterToTracksWeightMap.find(pfo)!=tccInfo.clusterToTracksWeightMap.end()) continue; // combined
+
+    if(pfo->isCharged()) {
+      // this decoration is set by JetRecTools/Root/ChargedHadronSubtractionTool.cxx !
+      const static SG::AuxElement::Accessor<char> PVMatchedAcc("matchedToPV"); 
+      if(!PVMatchedAcc(*pfo)) continue;
+    }
+    
+    ElementLink< xAOD::PFOContainer > pfoLink(*pfos,i);
+    const std::vector< ElementLink<xAOD::PFOContainer> > PFOLink {pfoLink};    
+    xAOD::FlowElement* tcc = new xAOD::FlowElement;
+    tccContainer->push_back(tcc);
+
+    if(pfo->isCharged()) {
+      setParameters(tcc, pfo->pt(), pfo->eta(), pfo->phi(), pfo->m(), xAOD::FlowElement::SignalType::Charged, ElementLink<xAOD::TrackParticleContainer>(*tccInfo.allTracks, pfo->track(0)->index()), PFOLink);
+    }else{
+      setParameters(tcc, pfo->pt(),pfo->eta(),pfo->phi(),pfo->m(),xAOD::FlowElement::SignalType::Neutral,ElementLink<xAOD::TrackParticleContainer>(),PFOLink);      
+    }
+  } //  PFO
+    
+  return StatusCode::SUCCESS;
+}
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterWeightsTool.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterWeightsTool.cxx
deleted file mode 100644
index cc266823f703ebd145dc9fdf2231d37fc78d48a6..0000000000000000000000000000000000000000
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/TrackCaloClusterWeightsTool.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-#include "TrackCaloClusterRecTools/TrackCaloClusterWeightsTool.h"
-
-
-TrackCaloClusterWeightsTool::TrackCaloClusterWeightsTool(const std::string& t, const std::string& n, const IInterface*  p )
-  : AthAlgTool(t,n,p),
-    m_useEnergy(false)
-{
-    declareProperty("UseEnergy",        m_useEnergy );
-}
-
-TrackCaloClusterWeightsTool::~TrackCaloClusterWeightsTool() {}
-
-StatusCode TrackCaloClusterWeightsTool::initialize() {
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrackCaloClusterWeightsTool::finalize() {
-  return StatusCode::SUCCESS;
-}
-
-void TrackCaloClusterWeightsTool::fillWeightMaps( const xAOD::TrackParticleClusterAssociationContainer* assocContainer, 
-						  std::multimap <const xAOD::CaloCluster*, const xAOD::TrackParticle*>* clusterToTracksMap, 
-						  std::map <const xAOD::TrackParticle*, FourMom_t>* TrackTotalClusterPt, 
-						  std::map <const xAOD::CaloCluster*, FourMom_t>* clusterToTracksWeightMap ) {
-
-    // First loop to fill cluster-to-tracks map
-    for ( const auto* assocClusters : *assocContainer ) {
-        // flollow the link to the track particle
-        const xAOD::TrackParticle* trk = 0;
-        if (assocClusters->trackParticleLink().isValid()) {
-            trk = *(assocClusters->trackParticleLink());
-        }
-        else if ( !assocClusters->trackParticleLink().isValid() ){
-            ATH_MSG_ERROR ("trackParticleLink is not valid! " );
-        }
-        // follow the link to the calorimeter clusters
-        if (assocClusters->caloClusterLinks().size()) {
-            for (size_t c = 0; c < assocClusters->caloClusterLinks().size(); ++c) {
-                    const xAOD::CaloCluster* cluster = *(assocClusters->caloClusterLinks().at(c));
-                    clusterToTracksMap->insert(std::make_pair(cluster, trk));
-                    if(TrackTotalClusterPt->find(trk)==TrackTotalClusterPt->end()){
-                        TrackTotalClusterPt->insert(std::make_pair(trk, cluster->p4()));
-                    }
-                    else{
-                        TrackTotalClusterPt->at(trk) = TrackTotalClusterPt->at(trk) + cluster->p4();
-                    }
-            } // for caloClusterLinks
-        } // if caloClusterLinks().size
-    } // for assoc clusters
-    
-    // Create cluster-to-tracks weight map
-    for (auto entry : *clusterToTracksMap)
-    {
-        double cluster_pt       = m_useEnergy ? entry.first->e() : entry.first->pt();
-        double totalcluster_pt  = m_useEnergy ? TrackTotalClusterPt->at(entry.second).E() : TrackTotalClusterPt->at(entry.second).Pt();
-        if(clusterToTracksWeightMap->find(entry.first)==clusterToTracksWeightMap->end()){
-            clusterToTracksWeightMap->insert(std::make_pair(entry.first, entry.second->p4() * (cluster_pt/totalcluster_pt)));
-        }
-        else{
-            clusterToTracksWeightMap->at(entry.first) = clusterToTracksWeightMap->at(entry.first) + entry.second->p4() * (cluster_pt/totalcluster_pt);
-        }
-    }
-    
-}
-
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/components/ParticleToCaloExtrapolationTool_entries.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/components/ParticleToCaloExtrapolationTool_entries.cxx
index c5a37e62da612d1fa7f6ac1063ba9d073f75923e..7ad7dbf42bec1de248b7b2894d2237506603ce62 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/components/ParticleToCaloExtrapolationTool_entries.cxx
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/src/components/ParticleToCaloExtrapolationTool_entries.cxx
@@ -1,10 +1,11 @@
 #include "TrackCaloClusterRecTools/ParticleToCaloExtrapolationTool.h"
-#include "TrackCaloClusterRecTools/TrackCaloClusterWeightsTool.h"
-#include "TrackCaloClusterRecTools/TrackCaloClusterCreatorTool.h"
+#include "TrackCaloClusterRecTools/TrackCaloClusterTool.h"
 #include "TrackCaloClusterRecTools/ClusterFilterTool.h"
  
 DECLARE_COMPONENT( ParticleToCaloExtrapolationTool )
-DECLARE_COMPONENT( TrackCaloClusterWeightsTool )
-DECLARE_COMPONENT( TrackCaloClusterCreatorTool )
+DECLARE_COMPONENT( TCCCombinedTool )
+DECLARE_COMPONENT( TCCChargedTool )
+DECLARE_COMPONENT( TCCNeutralTool )
+DECLARE_COMPONENT( UFOTool )
 DECLARE_COMPONENT( ClusterFilterTool )
 
diff --git a/Reconstruction/eflowEvent/CMakeLists.txt b/Reconstruction/eflowEvent/CMakeLists.txt
index 51a83507c98eaecb8ca2f9c9e8da574d706b1b90..4cae3025b7cdf0cf5d5fff0f81826bac135b5471 100644
--- a/Reconstruction/eflowEvent/CMakeLists.txt
+++ b/Reconstruction/eflowEvent/CMakeLists.txt
@@ -1,44 +1,22 @@
-################################################################################
-# Package: eflowEvent
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( eflowEvent )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloEvent
-                          Control/AthContainers
-                          Control/AthLinks
-                          Control/AthenaKernel
-                          Control/Navigation
-                          Event/EventKernel
-                          Event/FourMom
-                          Event/NavFourMom
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODPFlow
-                          Event/xAOD/xAODTracking
-                          GaudiKernel
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/Particle
-                          Tracking/TrkEvent/VxVertex )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( Boost )
 
 # Component(s) in the package:
 atlas_add_library( eflowEvent
                    src/*.cxx
                    PUBLIC_HEADERS eflowEvent
-                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloEvent AthContainers AthLinks Navigation AthenaKernel EventKernel FourMom NavFourMom xAODCaloEvent xAODPFlow xAODTracking GaudiKernel muonEvent Particle VxVertex )
+                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
+                   LINK_LIBRARIES ${Boost_LIBRARIES} CaloEvent AthContainers AthLinks Navigation AthenaKernel EventKernel FourMom NavFourMom xAODCaloEvent xAODPFlow xAODTracking GaudiKernel muonEvent Particle VxVertex )
 atlas_generate_cliddb( eflowEvent )
 
 atlas_add_dictionary( eflowEventDict
                       eflowEvent/eflowEventDict.h
                       eflowEvent/selection.xml
-                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} CaloEvent AthContainers AthLinks Navigation AthenaKernel EventKernel FourMom NavFourMom xAODCaloEvent xAODPFlow xAODTracking GaudiKernel muonEvent Particle VxVertex eflowEvent
+                      LINK_LIBRARIES eflowEvent
                       NAVIGABLES eflowObjectContainer )
 
diff --git a/Reconstruction/eflowEventTPCnv/CMakeLists.txt b/Reconstruction/eflowEventTPCnv/CMakeLists.txt
index ab0608c24397868e4a1a760fc4cba2182ad54948..1b0a9749c4b88c3dfeef15f6079dc8cdd850286e 100644
--- a/Reconstruction/eflowEventTPCnv/CMakeLists.txt
+++ b/Reconstruction/eflowEventTPCnv/CMakeLists.txt
@@ -1,101 +1,40 @@
-################################################################################
-# Package: eflowEventTPCnv
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( eflowEventTPCnv )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloEvent
-                          Control/DataModelAthenaPool
-                          Database/AthenaPOOL/AthenaPoolCnvSvc
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/Particle
-                          Reconstruction/eflowEvent
-                          Tracking/TrkEvent/VxVertex
-                          PRIVATE
-                          AtlasTest/TestTools
-                          Control/AthLinks
-                          Control/AthenaKernel
-                          Control/Navigation
-                          Control/SGTools )
-
 # External dependencies:
 find_package( CLHEP )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_tpcnv_library( eflowEventTPCnv
                          src/*.cxx
                          PUBLIC_HEADERS eflowEventTPCnv
-                         PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                         PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                          PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                         LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools )
+                         LINK_LIBRARIES AthenaPoolCnvSvcLib CaloEvent DataModelAthenaPoolLib Particle VxVertex eflowEvent muonEvent
+                         PRIVATE_LINK_LIBRARIES AthLinks AthenaKernel Navigation )
 
 atlas_add_dictionary( eflowEventTPCnvDict
                       eflowEventTPCnv/eflowEventTPCnvDict.h
                       eflowEventTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectCnv_p1_test
-                SOURCES
-                test/eflowObjectCnv_p1_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectCnv_p2_test
-                SOURCES
-                test/eflowObjectCnv_p2_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectCnv_p3_test
-                SOURCES
-                test/eflowObjectCnv_p3_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectCnv_p4_test
-                SOURCES
-                test/eflowObjectCnv_p4_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectCnv_p5_test
-                SOURCES
-                test/eflowObjectCnv_p5_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectContainerCnv_p1_test
-                SOURCES
-                test/eflowObjectContainerCnv_p1_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectContainerCnv_p2_test
-                SOURCES
-                test/eflowObjectContainerCnv_p2_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectContainerCnv_p3_test
-                SOURCES
-                test/eflowObjectContainerCnv_p3_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectContainerCnv_p4_test
-                SOURCES
-                test/eflowObjectContainerCnv_p4_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
-atlas_add_test( eflowObjectContainerCnv_p5_test
-                SOURCES
-                test/eflowObjectContainerCnv_p5_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent DataModelAthenaPoolLib AthenaPoolCnvSvcLib muonEvent Particle eflowEvent VxVertex TestTools AthLinks AthenaKernel Navigation SGTools eflowEventTPCnv )
-
+                      LINK_LIBRARIES LINK_LIBRARIES DataModelAthenaPoolLib eflowEventTPCnv )
+
+# Tests in the package:
+function( _add_test name )
+   atlas_add_test( ${name}
+                   SOURCES test/${name}.cxx
+                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
+                   LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib CaloEvent DataModelAthenaPoolLib Particle SGTools TestTools VxVertex eflowEvent eflowEventTPCnv )
+endfunction( _add_test )
+
+_add_test( eflowObjectCnv_p1_test )
+_add_test( eflowObjectCnv_p2_test )
+_add_test( eflowObjectCnv_p3_test )
+_add_test( eflowObjectCnv_p4_test )
+_add_test( eflowObjectCnv_p5_test )
+_add_test( eflowObjectContainerCnv_p1_test )
+_add_test( eflowObjectContainerCnv_p2_test )
+_add_test( eflowObjectContainerCnv_p3_test )
+_add_test( eflowObjectContainerCnv_p4_test )
+_add_test( eflowObjectContainerCnv_p5_test )
diff --git a/Reconstruction/eflowRec/CMakeLists.txt b/Reconstruction/eflowRec/CMakeLists.txt
index 2c73f643b8df0964ea035081f5e3982f5a382f80..4cbac95c78053158d3b1ac8deb09d004c61075e9 100644
--- a/Reconstruction/eflowRec/CMakeLists.txt
+++ b/Reconstruction/eflowRec/CMakeLists.txt
@@ -1,60 +1,19 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-################################################################################
-# Package: eflowRec
-################################################################################
-
 # Declare the package name:
 atlas_subdir( eflowRec )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloEvent
-                          Calorimeter/CaloIdentifier
-                          Calorimeter/CaloRec
-                          Control/AthContainers
-                          Control/AthLinks
-                          Control/AthenaBaseComps
-                          Control/AthenaKernel
-                          Control/CxxUtils
-                          DetectorDescription/GeoPrimitives
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODCore
-                          Event/xAOD/xAODEgamma
-                          Event/xAOD/xAODMuon
-                          Event/xAOD/xAODPFlow
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTau
-                          GaudiKernel
-                          InnerDetector/InDetDetDescr/InDetReadoutGeometry
-                          InnerDetector/InDetDetDescr/TRT_ReadoutGeometry
-                          InnerDetector/InDetRecTools/InDetTrackSelectionTool
-                          InnerDetector/InDetRecTools/TrackVertexAssociationTool
-                          Reconstruction/Particle
-                          Reconstruction/RecoTools/RecoToolInterfaces
-                          Tracking/TrkEvent/TrkParameters
-                          PRIVATE
-                          Calorimeter/CaloDetDescr
-                          Calorimeter/CaloUtils
-                          Control/StoreGate
-                          Event/FourMomUtils
-                          Tools/PathResolver
-                          Tracking/TrkEvent/TrkCaloExtension
-                          Tracking/TrkEvent/TrkParametersIdentificationHelpers )
-
 # External dependencies:
-find_package( Eigen )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_component( eflowRec
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry TrackVertexAssociationToolLib Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib SGtests FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib )
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives Identifier xAODBase xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib )
 
 # Install files from the package:
-atlas_install_headers( eflowRec )
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
 atlas_install_runtime( share/rmsvsdr.dat )
diff --git a/Reconstruction/eflowRec/python/PFHLTSequence.py b/Reconstruction/eflowRec/python/PFHLTSequence.py
index a0a999012a0203cc07e5cf19fbdc4d83d3ac36d2..956190f2b3404fae37d4d5e37ccaf57baf5c1849 100644
--- a/Reconstruction/eflowRec/python/PFHLTSequence.py
+++ b/Reconstruction/eflowRec/python/PFHLTSequence.py
@@ -1,4 +1,4 @@
-from __future__ import print_function
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from eflowRec import eflowRecConf
 from InDetTrackSelectionTool import InDetTrackSelectionToolConf
diff --git a/Reconstruction/eflowRec/python/PFLocalHadCal.py b/Reconstruction/eflowRec/python/PFLocalHadCal.py
index 98ed876f560552dda6af3273618d9a4b373ab419..b0ceef9f73db2aa9af402fbbf52f03c6d8e8302c 100644
--- a/Reconstruction/eflowRec/python/PFLocalHadCal.py
+++ b/Reconstruction/eflowRec/python/PFLocalHadCal.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
 from AthenaCommon.JobProperties import jobproperties
@@ -13,15 +13,15 @@ class PFLocalHadCal:
         try:
             from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
             Calib = CaloClusterLocalCalib(name+"_CaloClusterLocalCalib")
-        except:
+        except Exception:
             mlog.error("could not import CaloClusterCorrection.CaloClusterLocalCalib")
             traceback.print_exc()
             return False
         
         try:
-            from CaloUtils.CaloUtilsConf import CaloLCClassificationTool;
+            from CaloUtils.CaloUtilsConf import CaloLCClassificationTool
             LCClassify   = CaloLCClassificationTool(name+"_CaloLCClassificationTool")
-        except:
+        except Exception:
             mlog.error("could not import CaloUtils.EMFracClusterClassificationTool")
             traceback.print_exc()
             return False
@@ -59,17 +59,16 @@ class PFLocalHadCal:
         mlog = logging.getLogger( 'PFLocalHadCal::getLCWeightTool' )
 
         try:
-            from CaloUtils.CaloUtilsConf import CaloLCWeightTool;
+            from CaloUtils.CaloUtilsConf import CaloLCWeightTool
             LCWeight = CaloLCWeightTool(name+"_CaloLCWeightTool")
-        except:
+        except Exception:
             mlog.error("could not import CaloUtils.CaloLCWeightTool")
             traceback.print_exc()
             return False
 
             from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg
             #For LCWeightsTool needs electronic noise
-            CaloNoiseCondAlg(noisetype="electronicNoise")     
-            from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+            CaloNoiseCondAlg(noisetype="electronicNoise")
                    
         LCWeight.CorrectionKey       = "H1ClusterCellWeights"
         LCWeight.SignalOverNoiseCut  = 2.0
@@ -84,7 +83,7 @@ class PFLocalHadCal:
         try:
             from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
             CalibDM = CaloClusterLocalCalib(name+"_CaloClusterLocalCalibDM")
-        except:
+        except Exception:
             mlog.error("could not import CaloClusterCorrection.CaloClusterLocalCalib")
             traceback.print_exc()
             return False
@@ -105,7 +104,7 @@ class PFLocalHadCal:
         try:
             from CaloUtils.CaloUtilsConf import CaloLCDeadMaterialTool
             LCDeadMaterial = CaloLCDeadMaterialTool(name+"_CaloLCDeadMaterialTool")
-        except:
+        except Exception:
             mlog.error("could not import CaloUtils.CaloLCDeadMaterialTool")
             traceback.print_exc()
             return False
@@ -124,7 +123,7 @@ class PFLocalHadCal:
         try:
             from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
             CalibOO = CaloClusterLocalCalib(name+"_CaloClusterLocalCalibOO")
-        except:
+        except Exception:
             mlog.error("could not import CaloClusterCorrection.CaloClusterLocalCalib")
             traceback.print_exc()
             return False
@@ -146,7 +145,7 @@ class PFLocalHadCal:
         try:
             from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
             CalibOOPi0 = CaloClusterLocalCalib(name+"_CaloClusterLocalCalibOOPi0")
-        except:
+        except Exception:
             mlog.error("could not import CaloClusterCorrection.CaloClusterLocalCalib")
             traceback.print_exc()
             return False
@@ -167,7 +166,7 @@ class PFLocalHadCal:
         try:
             from CaloUtils.CaloUtilsConf import CaloLCOutOfClusterTool
             OOCC = CaloLCOutOfClusterTool(name+"_CaloLCOutOfClusterTool")
-        except:
+        except Exception:
             mlog.error("Could not import CaloUtils.CaloLCOutOfClusterTool")
             traceback.print_exc()
             return False
@@ -185,7 +184,7 @@ class PFLocalHadCal:
         try:
             from CaloUtils.CaloUtilsConf import CaloLCOutOfClusterTool
             OOCCPi0 = CaloLCOutOfClusterTool(name+"_CaloLCOutOfClusterPi0Tool")
-        except:
+        except Exception:
             mlog.error("Could not import CaloUtils.CaloLCOutOfClusterTool")
             traceback.print_exc()
             return False
diff --git a/Reconstruction/tauEvent/CMakeLists.txt b/Reconstruction/tauEvent/CMakeLists.txt
index d247feb0d90bb741a4f02aa9383b8120e86d7504..3b00ff00d26498c42946bdca3eedea01a78d3809 100644
--- a/Reconstruction/tauEvent/CMakeLists.txt
+++ b/Reconstruction/tauEvent/CMakeLists.txt
@@ -1,53 +1,28 @@
-################################################################################
-# Package: tauEvent
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( tauEvent )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloEvent
-                          Calorimeter/CaloIdentifier
-                          Control/AthLinks
-                          Control/Navigation
-                          Control/AthenaKernel
-                          Event/EventKernel
-                          Event/FourMom
-                          Event/NavFourMom
-                          GaudiKernel
-                          PhysicsAnalysis/AnalysisCommon/ParticleEvent
-                          Reconstruction/Jet/JetEvent
-                          Reconstruction/Particle
-                          Tracking/TrkEvent/VxVertex )
-
 # External dependencies:
 find_package( CLHEP )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
-# this line failed automatic conversion in cmt2cmake :
-# macro_append tauEventDict_shlibflags
-
 # Component(s) in the package:
 atlas_add_library( tauEvent
                    src/*.cxx
                    PUBLIC_HEADERS tauEvent
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloEvent CaloIdentifier AthLinks Navigation AthenaKernel EventKernel FourMom NavFourMom GaudiKernel ParticleEvent JetEvent Particle VxVertex
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthContainers CaloEvent CaloIdentifier AthLinks Navigation AthenaKernel EventKernel FourMom NavFourMom GaudiKernel ParticleEvent JetEvent Particle VxVertex )
 
 atlas_add_dictionary( tauEventDict
                       tauEvent/tauEventDict.h
                       tauEvent/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent CaloIdentifier AthLinks Navigation AthenaKernel EventKernel FourMom NavFourMom GaudiKernel ParticleEvent JetEvent Particle VxVertex tauEvent
-                      ELEMENT_LINKS Analysis::TauJetContainer  Analysis::TauDetailsContainer )
+                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} tauEvent
+                      ELEMENT_LINKS Analysis::TauJetContainer Analysis::TauDetailsContainer )
 
 atlas_add_dictionary( tauEnumsDict
                       tauEvent/tauEnumsDict.h
                       tauEvent/selectionEnums.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent CaloIdentifier AthLinks Navigation AthenaKernel EventKernel FourMom NavFourMom GaudiKernel ParticleEvent JetEvent Particle VxVertex tauEvent )
-
+                      LINK_LIBRARIES tauEvent )
diff --git a/Reconstruction/tauEventTPCnv/CMakeLists.txt b/Reconstruction/tauEventTPCnv/CMakeLists.txt
index 0bb48e5114aafc37857449f23c89417fe0de10a8..b5bde8ccdc508d0d34fa3b4d4d4faebffad63313 100644
--- a/Reconstruction/tauEventTPCnv/CMakeLists.txt
+++ b/Reconstruction/tauEventTPCnv/CMakeLists.txt
@@ -1,39 +1,21 @@
-################################################################################
-# Package: tauEventTPCnv
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( tauEventTPCnv )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/DataModelAthenaPool
-                          Database/AthenaPOOL/AthenaPoolCnvSvc
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          Database/AthenaPOOL/RootConversions
-                          Event/EventCommonTPCnv
-                          PhysicsAnalysis/AnalysisCommon/ParticleEventTPCnv
-                          Reconstruction/tauEvent
-                          Tracking/TrkEventCnv/TrkEventTPCnv
-                          PRIVATE
-                          Control/AthenaKernel )
-
 # External dependencies:
 find_package( CLHEP )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_tpcnv_library( tauEventTPCnv
                          src/*.cxx
                          PUBLIC_HEADERS tauEventTPCnv
                          INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                         PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                          DEFINITIONS ${CLHEP_DEFINITIONS}
-                         LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions EventCommonTPCnv ParticleEventTPCnv tauEvent TrkEventTPCnv AthenaKernel )
+                         LINK_LIBRARIES ${CLHEP_LIBRARIES} DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions EventCommonTPCnv ParticleEventTPCnv tauEvent TrkEventTPCnv
+                         PRIVATE_LINK_LIBRARIES AthenaKernel )
 
 atlas_add_dictionary( tauEventTPCnvDict
                       tauEventTPCnv/tauEventTPCnvDict.h
                       tauEventTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions EventCommonTPCnv ParticleEventTPCnv tauEvent TrkEventTPCnv AthenaKernel tauEventTPCnv )
-
+                      LINK_LIBRARIES tauEventTPCnv )
diff --git a/Reconstruction/tauMonitoring/CMakeLists.txt b/Reconstruction/tauMonitoring/CMakeLists.txt
index 6386f5efc0e69b2eceb3f76bd84b831399a608e2..faaed4bfa59482be2db314b1e607f10e920d95bf 100644
--- a/Reconstruction/tauMonitoring/CMakeLists.txt
+++ b/Reconstruction/tauMonitoring/CMakeLists.txt
@@ -1,20 +1,8 @@
-################################################################################
-# Package: tauMonitoring
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( tauMonitoring )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaMonitoring
-                          Event/xAOD/xAODTau
-                          GaudiKernel
-                          PRIVATE
-                          Event/xAOD/xAODEventInfo
-                          Event/xAOD/xAODTracking
-                          Trigger/TrigAnalysis/TrigDecisionTool )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
@@ -23,7 +11,7 @@ atlas_add_component( tauMonitoring
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringLib xAODTau GaudiKernel xAODEventInfo xAODTracking TrigDecisionToolLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringKernelLib AthenaMonitoringLib GaudiKernel StoreGateLib TrigDecisionToolLib xAODCore xAODEventInfo xAODTau xAODTracking )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
diff --git a/Reconstruction/tauRec/CMakeLists.txt b/Reconstruction/tauRec/CMakeLists.txt
index 58efb54427892632532af8e31771f757f48c00fb..ff32972471ceb4477d18ada95232e5781b53460c 100644
--- a/Reconstruction/tauRec/CMakeLists.txt
+++ b/Reconstruction/tauRec/CMakeLists.txt
@@ -1,39 +1,18 @@
-################################################################################
-# Package: tauRec
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( tauRec )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/AthenaKernel
-                          GaudiKernel
-                          InnerDetector/InDetDetDescr/InDetReadoutGeometry
-                          InnerDetector/InDetDetDescr/TRT_ReadoutGeometry
-                          PhysicsAnalysis/AnalysisCommon/ParticleEvent
-                          Reconstruction/tauRecTools
-                          PRIVATE
-                          Reconstruction/tauEvent )
-
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( Boost )
 
 # Component(s) in the package:
-atlas_add_library( tauRecLib
-                   src/*.cxx
-                   PUBLIC_HEADERS tauRec
-                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry ParticleEvent tauRecToolsLib CaloEvent xAODCaloEvent CaloUtilsLib
-                   PRIVATE_LINK_LIBRARIES tauEvent )
-
 atlas_add_component( tauRec
+                     src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel ParticleEvent tauRecToolsLib CaloEvent xAODCaloEvent CaloUtilsLib tauEvent tauRecLib )
+                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps CaloEvent CaloInterfaceLib CaloUtilsLib GaudiKernel InDetReadoutGeometry NavFourMom StoreGateLib TRT_ReadoutGeometry tauRecToolsLib xAODCaloEvent xAODCore xAODJet xAODPFlow xAODParticleEvent xAODTau xAODTracking )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
-
diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
index 0868a8ec7684d4cf0f08bcc49a2fcfab131ac44c..acd1dd0d5bcaf9b69c522d7bf986e3502b22334f 100644
--- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
+++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py
@@ -9,8 +9,7 @@
 #@author Felix Friedrich <felix.friedrich@cern.ch>
 ################################################################################
 
-from AthenaCommon.SystemOfUnits import *
-from AthenaCommon.Constants import *
+from AthenaCommon.SystemOfUnits import GeV, mm
 from tauRec.tauRecFlags import tauFlags
 
 cached_instances = {}
@@ -287,8 +286,6 @@ def getTauVertexVariables():
     if _name in cached_instances:
         return cached_instances[_name]
 
-    from tauRec.tauRecFlags import jobproperties
-
     from tauRecTools.tauRecToolsConf import TauVertexVariables
     TauVertexVariables = TauVertexVariables(  name = _name,
                                               VertexFitter = getTauAdaptiveVertexFitter(),
@@ -559,7 +556,6 @@ def getInDetTrackSelectorToolxAOD():
 # setup up JVA tools
 # Currently not used - moved into TauRecConfigured.py and added directly to topSequence
 def setupTauJVFTool():
-    from AthenaCommon.AppMgr import ToolSvc
 
     #Configures tau track selection tool for TJVA
     """
@@ -1023,7 +1019,7 @@ def getTauVertexCorrection():
 def getParticleCache():
     #If reading from ESD we not create a cache of extrapolations to the calorimeter, so we should signify this by setting the cache key to a null string
     from RecExConfig.RecFlags import rec
-    if True == rec.doESD:
+    if rec.doESD is True:
         ParticleCache = "ParticleCaloExtension"
     else : 
         ParticleCache = ""
diff --git a/Reconstruction/tauRec/python/TauRecAODBuilder.py b/Reconstruction/tauRec/python/TauRecAODBuilder.py
index deaa3be7cd7418a5e70a6a9af33fcb0e9a23bde3..5b784bd697c2fada6a09ea8bf82af6462f12af3d 100644
--- a/Reconstruction/tauRec/python/TauRecAODBuilder.py
+++ b/Reconstruction/tauRec/python/TauRecAODBuilder.py
@@ -17,17 +17,8 @@
 ################################################################################
 
 
-import os, sys, string
-
 from AthenaCommon.Logging import logging
-from AthenaCommon.SystemOfUnits import *
-from AthenaCommon.Constants import *
-from AthenaCommon.AlgSequence import AlgSequence
-from AthenaCommon.Resilience import treatException
-from AthenaCommon.Include import include
 import traceback
-
-from RecExConfig.Configured import Configured
 from TauRecConfigured import TauRecConfigured
 
 ################################################################################
@@ -89,12 +80,9 @@ class TauRecAODProcessor ( TauRecConfigured ) :
                 import TauDiscriminant.TauDiscriGetter as tauDisc
                 tauDiscTools=tauDisc.getTauDiscriminantTools(mlog)
                 if len(tauDiscTools)==0:
-                    try: import DOESNOTEXIST
-                    except Exception:
-                        mlog.error("No TauDiscriminantTools appended")
-                        traceback.print_exc()
-                        return False
-                    pass                
+                    mlog.error("No TauDiscriminantTools appended")
+                    traceback.print_stack()
+                    return False
                 tools+=tauDiscTools
                 pass
             
diff --git a/Reconstruction/tauRec/python/TauRecBuilder.py b/Reconstruction/tauRec/python/TauRecBuilder.py
index fc5db0cff396c58cdfb7f5306d7cba77868c9531..ec0c4400d6ed29b4d9162a12be0b4a232ee46faf 100644
--- a/Reconstruction/tauRec/python/TauRecBuilder.py
+++ b/Reconstruction/tauRec/python/TauRecBuilder.py
@@ -12,13 +12,8 @@
 #
 ################################################################################
 
-import os, sys, string
 from AthenaCommon.Logging import logging
-from AthenaCommon.SystemOfUnits import *
-from AthenaCommon.Constants import *
-from AthenaCommon.BeamFlags import jobproperties
 import traceback
-from RecExConfig.Configured import Configured
 from .TauRecConfigured import TauRecConfigured
 
 ################################################################################
diff --git a/Reconstruction/tauRec/python/TauRecConfigured.py b/Reconstruction/tauRec/python/TauRecConfigured.py
index 0e6b79a860528d95a0120da57a5298b385267751..d14c9781f087f6b74654e48bfffed319ce08bf26 100644
--- a/Reconstruction/tauRec/python/TauRecConfigured.py
+++ b/Reconstruction/tauRec/python/TauRecConfigured.py
@@ -15,7 +15,7 @@
 
 from RecExConfig.Configured import Configured
 from AthenaCommon.BeamFlags import jobproperties
-from AthenaCommon.SystemOfUnits import *
+from AthenaCommon.SystemOfUnits import mm
 
 ################################################################################
 ## @class TauRecConfigured
@@ -34,7 +34,6 @@ class TauRecConfigured ( Configured ) :
         from CaloRec.CaloRecConf import CaloCellContainerFinalizerTool
         # add calo cell finalizer tool
         TauCellContainerFinalizer = CaloCellContainerFinalizerTool(name='tauRec_tauPi0CellContainerFinalizer')
-        from AthenaCommon.AppMgr import ToolSvc
 
         self._TauProcessorAlgHandle = TauProcessorAlg ( name=self.name+'Alg',
                                                         Key_jetInputContainer=tauFlags.tauRecSeedJetCollection(),
diff --git a/Reconstruction/tauRec/python/TauRecRunConfigured.py b/Reconstruction/tauRec/python/TauRecRunConfigured.py
index a8a6415e0f364b60ff79d8af0b45e6df9b388cc8..7927097b9af0d7475ee518a507bb74583c609e99 100644
--- a/Reconstruction/tauRec/python/TauRecRunConfigured.py
+++ b/Reconstruction/tauRec/python/TauRecRunConfigured.py
@@ -27,8 +27,7 @@ class TauRecRunConfigured ( Configured ) :
     def __init__(self, name = "TauRecRunConfigured", msglevel=3, ignoreExistingDataObject=True) :
         self.name = name
         self.msglevel = msglevel
-        from tauRec.tauRecConf import TauRunnerAlg 
-        from tauRec.tauRecFlags import tauFlags
+        from tauRec.tauRecConf import TauRunnerAlg
         self._TauRunnerAlgHandle = TauRunnerAlg ( name=self.name+'Alg', 
                                                   Key_tauInputContainer="tmp_TauJets",
                                                   Key_Pi0ClusterInputContainer="TauPi0Clusters",
diff --git a/Reconstruction/tauRec/python/TauRecRunner.py b/Reconstruction/tauRec/python/TauRecRunner.py
index f87386826433f927eb51a839615740b0de05d4d6..91e3fa5f59c9b06e9d2256a93312bcae6b237cf0 100644
--- a/Reconstruction/tauRec/python/TauRecRunner.py
+++ b/Reconstruction/tauRec/python/TauRecRunner.py
@@ -12,13 +12,8 @@
 #
 ################################################################################
 
-import os, sys, string
 from AthenaCommon.Logging import logging
-from AthenaCommon.SystemOfUnits import *
-from AthenaCommon.Constants import *
 from AthenaCommon.BeamFlags import jobproperties
-import traceback
-from RecExConfig.Configured import Configured
 from .TauRecRunConfigured import TauRecRunConfigured
 
 ################################################################################
@@ -37,8 +32,7 @@ class TauRecRunner ( TauRecRunConfigured ) :
     def configure(self):
         mlog = logging.getLogger ('TauRecRunner.py::configure:')
         mlog.info('entering')
-                
-        from RecExConfig.RecFlags import rec                
+
         import tauRec.TauAlgorithmsHolder as taualgs        
         from tauRec.tauRecFlags import tauFlags                
         
diff --git a/Reconstruction/tauRec/src/ClusterCellRelinkAlg.cxx b/Reconstruction/tauRec/src/ClusterCellRelinkAlg.cxx
index 6d27dbea8eb578b86b5c5bf4f3ed25393dc59ff3..3ec7b97d9d580fb26fcb97d790ea38e5678b0b6e 100644
--- a/Reconstruction/tauRec/src/ClusterCellRelinkAlg.cxx
+++ b/Reconstruction/tauRec/src/ClusterCellRelinkAlg.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
 */
 
-#include "tauRec/ClusterCellRelinkAlg.h"
+#include "ClusterCellRelinkAlg.h"
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 #include "xAODCaloEvent/CaloClusterAuxContainer.h"
diff --git a/Reconstruction/tauRec/tauRec/ClusterCellRelinkAlg.h b/Reconstruction/tauRec/src/ClusterCellRelinkAlg.h
similarity index 100%
rename from Reconstruction/tauRec/tauRec/ClusterCellRelinkAlg.h
rename to Reconstruction/tauRec/src/ClusterCellRelinkAlg.h
diff --git a/Reconstruction/tauRec/src/TauCellThinningAlg.cxx b/Reconstruction/tauRec/src/TauCellThinningAlg.cxx
index 15dcd85b8e4bb5d4f09d9f668adc29653b14ddec..83f32876faaf241025e80852706c22035fb90bf5 100644
--- a/Reconstruction/tauRec/src/TauCellThinningAlg.cxx
+++ b/Reconstruction/tauRec/src/TauCellThinningAlg.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
 */
 
-#include "tauRec/TauCellThinningAlg.h"
+#include "TauCellThinningAlg.h"
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/ThinningHandle.h"
 #include "xAODCaloEvent/CaloCluster.h"
diff --git a/Reconstruction/tauRec/tauRec/TauCellThinningAlg.h b/Reconstruction/tauRec/src/TauCellThinningAlg.h
similarity index 100%
rename from Reconstruction/tauRec/tauRec/TauCellThinningAlg.h
rename to Reconstruction/tauRec/src/TauCellThinningAlg.h
diff --git a/Reconstruction/tauRec/src/TauProcessorAlg.cxx b/Reconstruction/tauRec/src/TauProcessorAlg.cxx
index 43136600269b3124febb7536b04428feb3fdee9e..0a904f8fa9319aacdade7fecb8827b230adbb7c7 100644
--- a/Reconstruction/tauRec/src/TauProcessorAlg.cxx
+++ b/Reconstruction/tauRec/src/TauProcessorAlg.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "tauRec/TauProcessorAlg.h"
+#include "TauProcessorAlg.h"
 #include "xAODTau/TauJetAuxContainer.h"
 #include "xAODTau/TauTrackAuxContainer.h"
 #include "xAODCaloEvent/CaloClusterAuxContainer.h"
diff --git a/Reconstruction/tauRec/tauRec/TauProcessorAlg.h b/Reconstruction/tauRec/src/TauProcessorAlg.h
similarity index 100%
rename from Reconstruction/tauRec/tauRec/TauProcessorAlg.h
rename to Reconstruction/tauRec/src/TauProcessorAlg.h
diff --git a/Reconstruction/tauRec/src/TauRunnerAlg.cxx b/Reconstruction/tauRec/src/TauRunnerAlg.cxx
index d7c255f922c0db4e5e2c2e4028df8b3edb8aa804..fe7655a953625da853bc6bfd96edf82602478259 100644
--- a/Reconstruction/tauRec/src/TauRunnerAlg.cxx
+++ b/Reconstruction/tauRec/src/TauRunnerAlg.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "tauRec/TauRunnerAlg.h"
+#include "TauRunnerAlg.h"
 
 #include "xAODJet/Jet.h"
 #include "xAODJet/JetContainer.h"
diff --git a/Reconstruction/tauRec/tauRec/TauRunnerAlg.h b/Reconstruction/tauRec/src/TauRunnerAlg.h
similarity index 100%
rename from Reconstruction/tauRec/tauRec/TauRunnerAlg.h
rename to Reconstruction/tauRec/src/TauRunnerAlg.h
diff --git a/Reconstruction/tauRec/src/components/tauRec_entries.cxx b/Reconstruction/tauRec/src/components/tauRec_entries.cxx
index 53f12d8ea3b79193fdceeda1b82741b02bda0e75..b95afa30f2c1cbfe0e31416300252f613e446658 100644
--- a/Reconstruction/tauRec/src/components/tauRec_entries.cxx
+++ b/Reconstruction/tauRec/src/components/tauRec_entries.cxx
@@ -1,7 +1,7 @@
-#include "tauRec/TauProcessorAlg.h"
-#include "tauRec/TauRunnerAlg.h"
-#include "tauRec/TauCellThinningAlg.h"
-#include "tauRec/ClusterCellRelinkAlg.h"
+#include "../TauProcessorAlg.h"
+#include "../TauRunnerAlg.h"
+#include "../TauCellThinningAlg.h"
+#include "../ClusterCellRelinkAlg.h"
 
 DECLARE_COMPONENT( TauProcessorAlg )
 DECLARE_COMPONENT( TauRunnerAlg )
diff --git a/Reconstruction/tauRecTools/CMakeLists.txt b/Reconstruction/tauRecTools/CMakeLists.txt
index d9b7d10bf341df1fc0abf9b384117951220a0cee..952f9e745c286326b6cc7067f43e36f449e4dd43 100644
--- a/Reconstruction/tauRecTools/CMakeLists.txt
+++ b/Reconstruction/tauRecTools/CMakeLists.txt
@@ -1,7 +1,4 @@
-# $Id: CMakeLists.txt 796274 2017-02-08 17:13:03Z griffith $
-################################################################################
-# Package: tauRecTools
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( tauRecTools )
diff --git a/Tools/PROCTools/data/master_q221_AOD_digest.ref b/Tools/PROCTools/data/master_q221_AOD_digest.ref
index b3af0f81166ac2c28463690c8d1055621e62224a..c1777b60863120ce59846c1e6f71fce0adfc339c 100644
--- a/Tools/PROCTools/data/master_q221_AOD_digest.ref
+++ b/Tools/PROCTools/data/master_q221_AOD_digest.ref
@@ -13,14 +13,14 @@
       284500    87473091          41          49           3           0           4           2           2           4           2           2
       284500    87473096          66          75           3           2           3           0           3           4           3           1
       284500    87473104          64          63           6           0           6           1           5           4           3           1
-      284500    87473114          89          80           7           2          12           1          11           9           6           3
-      284500    87473121          93         102           6           3          15           3          12           7           6           1
+      284500    87473114          89          81           7           2          12           1          11           9           6           3
+      284500    87473121          93         102           6           3          15           4          11           8           6           2
       284500    87473132          84          58           9           1          12           0          12           3           3           0
       284500    87473137          94          71           8           3          15           0          15           8           8           0
       284500    87473144          78          67           7           1           8           2           6           8           6           2
-      284500    87473154          86          88           7           0          14           3          11           9           4           5
+      284500    87473154          86          88           7           0          13           3          10          10           4           6
       284500    87473162          53          52           4           0           7           0           7           3           2           1
       284500    87473167          77          55           6           3          14           3          11          13           8           5
-      284500    87473171          77          70           8           3           4           2           2           5           4           1
+      284500    87473171          77          71           8           3           4           2           2           6           5           1
       284500    87473184          75          86           5           2           8           1           7           5           3           2
       284500    87473192          55          52           4           1           7           4           3           5           4           1
diff --git a/Tools/PROCTools/data/master_q431_AOD_digest.ref b/Tools/PROCTools/data/master_q431_AOD_digest.ref
index 8a7784cbb4c181c581a25132f77000d577e11938..00a87ae6b078ef1bc7d72b7eb4ba94b3dfd4fb46 100644
--- a/Tools/PROCTools/data/master_q431_AOD_digest.ref
+++ b/Tools/PROCTools/data/master_q431_AOD_digest.ref
@@ -1,12 +1,12 @@
          run       event       nTopo   nIdTracks       nJets      nMuons
       330470  1183722158           1           0           0           0
       330470  1183722342         394         412          18           0
-      330470  1183727953         532         581          11           4
-      330470  1183732647         467         465          12           1
+      330470  1183727953         532         578          11           4
+      330470  1183732647         467         466          12           1
       330470  1183733040         381         286           6           1
       330470  1183734651         361         361          14           4
-      330470  1183735332         406         384           9           1
-      330470  1183736475         741         674          13           2
+      330470  1183735332         406         383           9           1
+      330470  1183736475         741         677          13           1
       330470  1183738728           1           0           0           0
       330470  1183738949         368         430           9           1
       330470  1183742489         152         123           2           1
@@ -15,12 +15,12 @@
       330470  1183746710           6           0           0           0
       330470  1183751782         239         236           4           0
       330470  1183752624         347         339           8           3
-      330470  1183753006         357         373          11           3
-      330470  1183754806         470         406          15           0
-      330470  1183769295         342         325           8           2
+      330470  1183753006         357         373          10           3
+      330470  1183754806         470         407          15           0
+      330470  1183769295         342         326           8           2
       330470  1183769939         348         351          10           3
-      330470  1183773832         307         201           7           0
+      330470  1183773832         307         201           6           0
       330470  1183775209          57           0           0           0
       330470  1183787124         431         362           9           2
       330470  1183787946         321         313           5           1
-      330470  1183795329         458         336          18           0
+      330470  1183795329         458         335          18           0
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Charged.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Charged.h
index 551891e2e6d51fbd4a50243db36aea53fc69c33b..ff23cfe5ff9f060466893108dc8f9b5007e0395e 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Charged.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Charged.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -9,7 +9,6 @@
 #ifndef TRKPARAMETERSBASE_CHARGED_H
 #define TRKPARAMETERSBASE_CHARGED_H 1
 
-#include <iostream>
 #include <cmath>
 
 namespace Trk
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
index 4c725f27ef6e9757124ce69bdb948ef8f9392632..39fae85d410e833b544ac7fc97e2cf467de07060 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
@@ -96,6 +96,13 @@ public:
 
   void setcIdentifier(unsigned int cIdentifier);
 
+  /** Access method for the position */
+  virtual const Amg::Vector3D& position() const override final;
+
+  /** Access method for the momentum */
+  virtual const Amg::Vector3D& momentum() const override final;
+
+
   /** Test to see if there's a surface there. */
   virtual bool hasSurface() const override final;
 
@@ -135,9 +142,9 @@ protected:
    */
   using ParametersBase<DIM, T>::m_parameters;
   using ParametersBase<DIM, T>::m_covariance;
-  using ParametersBase<DIM, T>::m_position;
-  using ParametersBase<DIM, T>::m_momentum;
   using ParametersBase<DIM, T>::m_chargeDef;
+  Amg::Vector3D m_position; //!< point on track
+  Amg::Vector3D m_momentum; //!< momentum at this point on track
   SurfaceUniquePtrT<const S> m_surface; //!< surface template
   /** the curvilinear parameters identifier */
   unsigned int m_cIdentifier = 0;
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
index 5fb9b4e780b5d6d6e435963f5587ca933e8f81eb..acb1250dc09c82529cd69d2dbaa6325d2bdc9c8c 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
@@ -18,10 +18,9 @@ Trk::CurvilinearParametersT<DIM, T, S>::CurvilinearParametersT(
   const AmgVector(DIM + 2) & parameters,
   AmgSymMatrix(DIM) * covariance,
   unsigned int cIdentifier)
-  : ParametersBase<DIM, T>(
-      Amg::Vector3D(parameters[x], parameters[y], parameters[z]),
-      Amg::Vector3D(parameters[3], parameters[4], parameters[5]),
-      covariance)
+  : ParametersBase<DIM, T>(covariance)
+  , m_position(Amg::Vector3D(parameters[x], parameters[y], parameters[z]))
+  , m_momentum(Amg::Vector3D(parameters[3], parameters[4], parameters[5]))
   , m_surface{ nullptr }
   , m_cIdentifier(cIdentifier)
 {
@@ -119,9 +118,10 @@ CurvilinearParametersT<DIM, T, S>::CurvilinearParametersT(
   const CurvilinearParametersT<DIM, T, S>& rhs)
   : ParametersBase<DIM, T>(rhs.parameters(),
                            nullptr,
-                           rhs.position(),
-                           rhs.momentum(),
                            rhs.charge())
+
+  , m_position(rhs.position())
+  , m_momentum(rhs.momentum())
   , m_surface(nullptr)
   , m_cIdentifier(rhs.m_cIdentifier)
 {
@@ -169,6 +169,20 @@ CurvilinearParametersT<DIM, T, S>::setcIdentifier(unsigned int cIdentifier)
   m_cIdentifier = cIdentifier;
 }
 
+template<int DIM, class T, class S>
+const Amg::Vector3D&
+CurvilinearParametersT<DIM, T, S>::position() const
+{
+  return m_position;
+}
+
+template<int DIM, class T, class S>
+const Amg::Vector3D&
+CurvilinearParametersT<DIM, T, S>::momentum() const
+{
+  return m_momentum;
+}
+
 /** Test to see if there's a surface there. */
 template<int DIM, class T, class S>
 bool
@@ -257,7 +271,6 @@ CurvilinearParametersT<DIM, T, S>::surfaceType() const
   return S::staticType;
 }
 
-
 // Surface return (with on demand construction)
 template<int DIM, class T, class S>
 Amg::RotationMatrix3D
@@ -274,7 +287,6 @@ CurvilinearParametersT<DIM, T, S>::measurementFrame() const
   return mFrame;
 }
 
-
 template<int DIM, class T, class S>
 CurvilinearUVT
 CurvilinearParametersT<DIM, T, S>::curvilinearFrame() const
@@ -305,7 +317,6 @@ CurvilinearParametersT<DIM, T, S>::dump(std::ostream& out) const
   return out;
 }
 
-
 // private updateParametersHelper
 template<int DIM, class T, class S>
 void
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Neutral.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Neutral.h
index 7a350996b62144b1dc42de5dc8428b3655f0df11..de27cc600202b27d149509e12243d23439265807 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Neutral.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/Neutral.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -9,7 +9,6 @@
 #ifndef TRKPARAMETERSBASE_NEUTRAL_H
 #define TRKPARAMETERSBASE_NEUTRAL_H 1
 
-#include <iostream>
 #include <cmath>
 
 namespace Trk
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
index 8c3e8bbc6cf3a733a34a6dd028486b37f1387c83..7de00bea332196c4d95cd5e01aebaf4c43c02101 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
@@ -10,11 +10,11 @@
 #define TRKPARAMETERSBASE_PARAMETERSBASE_H
 
 // Amg
+#include "CxxUtils/checker_macros.h"
 #include "EventPrimitives/EventPrimitives.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "TrkParametersBase/Charged.h"
 #include "TrkParametersBase/Neutral.h"
-#include "CxxUtils/checker_macros.h"
 #include <memory>
 #include <type_traits>
 
@@ -84,12 +84,6 @@ public:
    * matrix is given */
   const AmgSymMatrix(DIM) * covariance() const;
 
-  /** Access method for the position */
-  virtual const Amg::Vector3D& position() const;
-
-  /** Access method for the momentum */
-  virtual const Amg::Vector3D& momentum() const;
-
   /** Access method for transverse momentum */
   double pT() const;
 
@@ -99,16 +93,12 @@ public:
   /** Returns true if Charged or false if Neutral
    */
   constexpr bool isCharged() const;
-  /** Returns the charge
-   * */
-  virtual double charge() const;
-
   /** Access method for the local coordinates, \f$(loc1,loc2)\f$
       local parameter definitions differ for each surface type. */
   Amg::Vector2D localPosition() const;
 
   /** Update parameters and covariance.
-   * 
+   *
    * Derived classes override the
    * implementation via updateParametersHelper
    */
@@ -122,6 +112,15 @@ public:
    * implementation via updateParametersHelper
    */
   void updateParameters(const AmgVector(DIM) &, const AmgSymMatrix(DIM) &);
+  /** Returns the charge
+   * */
+  virtual double charge() const;
+
+  /** Access method for the position */
+  virtual const Amg::Vector3D& position() const = 0;
+
+  /** Access method for the momentum */
+  virtual const Amg::Vector3D& momentum() const = 0;
 
   //** equality operator */
   virtual bool operator==(const ParametersBase<DIM, T>&) const;
@@ -138,7 +137,7 @@ public:
      transform */
   virtual Amg::RotationMatrix3D measurementFrame() const = 0;
 
-  /** clone method for polymorphic deep copy 
+  /** clone method for polymorphic deep copy
        @return new object copied from the concrete type of this object.*/
   virtual ParametersBase<DIM, T>* clone() const = 0;
 
@@ -164,13 +163,9 @@ protected:
   /* Helper ctors for derived classes*/
   ParametersBase(const AmgVector(DIM) parameters,
                  AmgSymMatrix(DIM) * covariance,
-                 const Amg::Vector3D& position,
-                 const Amg::Vector3D& momentum,
                  const T chargeDef);
 
-  ParametersBase(const Amg::Vector3D& pos,
-                 const Amg::Vector3D& mom,
-                 AmgSymMatrix(DIM) * covariance = nullptr);
+  ParametersBase(AmgSymMatrix(DIM) * covariance);
 
   ParametersBase(const AmgVector(DIM) & parameters,
                  AmgSymMatrix(DIM) * covariance = nullptr);
@@ -181,7 +176,6 @@ protected:
    */
   ParametersBase(ParametersBase&&) = default;
   ParametersBase& operator=(ParametersBase&&) = default;
-
   /*
    * Default copy ctor/assignment
    * Deleted due unique_ptr.
@@ -200,9 +194,7 @@ protected:
   AmgVector(DIM) m_parameters; //!< contains the n parameters
   //!< contains the n x n covariance matrix
   std::unique_ptr<AmgSymMatrix(DIM)> m_covariance;
-  Amg::Vector3D m_position; //!< point on track
-  Amg::Vector3D m_momentum; //!< momentum at this point on track
-  T m_chargeDef;            //!< charge definition for this track
+  T m_chargeDef; //!< charge definition for this track
 };
 
 /**Overload of << operator for both, MsgStream and std::ostream for debug
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.icc
index ce8e5218c3faf0c57ba7c7cdf60c1df60a37d777..9830476ac8243954690e46c605bffc53ca21d436 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.icc
@@ -14,8 +14,7 @@
 // Trk
 #include "TrkEventPrimitives/ParamDefs.h"
 
-namespace Trk
-{
+namespace Trk {
 
 namespace {
 template<typename T>
@@ -26,30 +25,21 @@ sgn(const T& val)
 }
 }
 
-//Helper protected ctor*/
+// Helper protected ctor*/
 template<int DIM, class T>
-ParametersBase<DIM, T>::ParametersBase(
-  const AmgVector(DIM) parameters,
-  AmgSymMatrix(DIM)* covariance,
-  const Amg::Vector3D& position,
-  const Amg::Vector3D& momentum,
-  const T chargeDef)
+ParametersBase<DIM, T>::ParametersBase(const AmgVector(DIM) parameters,
+                                       AmgSymMatrix(DIM) * covariance,
+                                       const T chargeDef)
   : m_parameters(parameters)
   , m_covariance(covariance)
-  , m_position(position)
-  , m_momentum(momentum)
   , m_chargeDef(chargeDef)
 {}
 
-//Helper protected ctor
-template<int DIM, class T >
-Trk::ParametersBase<DIM, T>::ParametersBase(const Amg::Vector3D& position,
-                                            const Amg::Vector3D& momentum,
-                                            AmgSymMatrix(DIM) * covariance)
+// Helper protected ctor
+template<int DIM, class T>
+Trk::ParametersBase<DIM, T>::ParametersBase(AmgSymMatrix(DIM) * covariance)
   : m_parameters()
   , m_covariance(covariance)
-  , m_position(position)
-  , m_momentum(momentum)
   , m_chargeDef{}
 {}
 // Protected Constructor with local arguments - persistency only
@@ -58,58 +48,22 @@ Trk::ParametersBase<DIM, T>::ParametersBase(const AmgVector(DIM) & parameters,
                                             AmgSymMatrix(DIM) * covariance)
   : m_parameters(parameters)
   , m_covariance(covariance)
-  , m_position{}
-  , m_momentum{}
   , m_chargeDef{}
 {
-  float qop = m_parameters[Trk::qOverP];
-  // decide the sign of the charge
-  if (qop < 0.) {
-    m_chargeDef.setCharge(-1);
-  }
-  double p = 0.0;
-  if (qop != 0.) {
-    p = fabs(1. / qop);
-  } else {
-    // qop is unphysical. No momentum measurement.
-    p = InvalidParam::INVALID_P;
-    qop = InvalidParam::INVALID_QOP;
-  }
-  // fill momentum & then position using the surface
-  m_momentum = Amg::Vector3D(
-    p * cos(m_parameters[Trk::phi]) * sin(m_parameters[Trk::theta]),
-    p * sin(m_parameters[Trk::phi]) * sin(m_parameters[Trk::theta]),
-    p * cos(m_parameters[Trk::theta]));
 }
 
 template<int DIM, class T>
-const AmgVector(DIM) & 
-ParametersBase<DIM, T>::parameters() const
+  const AmgVector(DIM) & ParametersBase<DIM, T>::parameters() const
 {
   return m_parameters;
 }
 
 template<int DIM, class T>
-const AmgSymMatrix(DIM)* 
-ParametersBase<DIM, T>::covariance() const
+  const AmgSymMatrix(DIM) * ParametersBase<DIM, T>::covariance() const
 {
   return m_covariance.get();
 }
 
-template<int DIM, class T>
-const Amg::Vector3D&
-ParametersBase<DIM, T>::position() const
-{
-  return m_position;
-}
-
-template<int DIM, class T>
-const Amg::Vector3D&
-ParametersBase<DIM, T>::momentum() const
-{
-  return m_momentum;
-}
-
 template<int DIM, class T>
 double
 ParametersBase<DIM, T>::pT() const
@@ -151,7 +105,8 @@ ParametersBase<DIM, T>::localPosition() const
 
 template<int DIM, class T>
 void
-ParametersBase<DIM, T>::updateParameters(const AmgVector(DIM) & updatedParameters,
+ParametersBase<DIM, T>::updateParameters(const AmgVector(DIM) &
+                                           updatedParameters,
                                          AmgSymMatrix(DIM) * updatedCovariance)
 {
   // update the covariance
@@ -167,8 +122,10 @@ ParametersBase<DIM, T>::updateParameters(const AmgVector(DIM) & updatedParameter
 // update function
 template<int DIM, class T>
 void
-ParametersBase<DIM, T>::updateParameters(const AmgVector(DIM) & updatedParameters,
-                                         const AmgSymMatrix(DIM) & updatedCovariance)
+ParametersBase<DIM, T>::updateParameters(const AmgVector(DIM) &
+                                           updatedParameters,
+                                         const AmgSymMatrix(DIM) &
+                                           updatedCovariance)
 {
   // if the covariance is there update in place
   if (m_covariance) {
@@ -194,9 +151,8 @@ ParametersBase<DIM, T>::operator==(const ParametersBase<DIM, T>& rhs) const
   // compare covariance
   if (((this->covariance() != nullptr) && (rhs.covariance() != nullptr) &&
        !this->covariance()->isApprox(*rhs.covariance(), tolerance)) ||
-      (!this->covariance() !=
-       !rhs.covariance())) { // <-- this is: covariance() XOR
-                                  // pCast->covariance()
+      (!this->covariance() != !rhs.covariance())) { // <-- this is: covariance()
+                                                    // XOR pCast->covariance()
     return false;
   }
 
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
index d7f0fa08279d5b5ec6dd15de54edb3be687e21ea..89558075417698375401edf8eaf7f94acc2efb4d 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
@@ -108,6 +108,12 @@ public:
   //** Destructor */
   virtual ~ParametersT() = default;
 
+  /** Access method for the position */
+  virtual const Amg::Vector3D& position() const override final;
+
+  /** Access method for the momentum */
+  virtual const Amg::Vector3D& momentum() const override final;
+
   /** Test to see if there's a surface there. */
   virtual bool hasSurface() const override final;
 
@@ -140,9 +146,9 @@ protected:
    */
   using ParametersBase<DIM, T>::m_parameters;
   using ParametersBase<DIM, T>::m_covariance;
-  using ParametersBase<DIM, T>::m_position;
-  using ParametersBase<DIM, T>::m_momentum;
   using ParametersBase<DIM, T>::m_chargeDef;
+  Amg::Vector3D m_position;             //!< point on track
+  Amg::Vector3D m_momentum;             //!< momentum at this point on track
   SurfaceUniquePtrT<const S> m_surface; //!< surface template
 
   /**
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
index c8c9e0778a515fa84164523f882e9d0462208d3c..3a224c1f5b674603b29db9352c25f24f0074f6d7 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
@@ -23,11 +23,9 @@ ParametersT<DIM, T, S>::ParametersT(double loc1,
                                     double qop,
                                     const S& surface,
                                     AmgSymMatrix(DIM) * cov)
-  : ParametersBase<DIM, T>(AmgVector(DIM)::Zero(),
-                           cov,
-                           Amg::Vector3D::Zero(),
-                           Amg::Vector3D::Zero(),
-                           sgn(qop))
+  : ParametersBase<DIM, T>(AmgVector(DIM)::Zero(), cov, sgn(qop))
+  , m_position(Amg::Vector3D::Zero())
+  , m_momentum(Amg::Vector3D::Zero())
   , m_surface(nullptr)
 {
   m_surface.reset((surface.isFree() ? surface.clone() : &surface));
@@ -57,11 +55,9 @@ template<int DIM, class T, class S>
 ParametersT<DIM, T, S>::ParametersT(const AmgVector(DIM) & parameters,
                                     const S& surface,
                                     AmgSymMatrix(DIM) * cov)
-  : ParametersBase<DIM, T>(parameters,
-                           cov,
-                           Amg::Vector3D::Zero(),
-                           Amg::Vector3D::Zero(),
-                           sgn(parameters[Trk::qOverP]))
+  : ParametersBase<DIM, T>(parameters, cov, sgn(parameters[Trk::qOverP]))
+  , m_position(Amg::Vector3D::Zero())
+  , m_momentum(Amg::Vector3D::Zero())
   , m_surface(nullptr)
 {
   m_surface.reset((surface.isFree() ? surface.clone() : &surface));
@@ -94,7 +90,9 @@ ParametersT<DIM, T, S>::ParametersT(const Amg::Vector3D& pos,
                                     double charge,
                                     const S& surface,
                                     AmgSymMatrix(DIM) * cov)
-  : ParametersBase<DIM, T>(AmgVector(DIM)::Zero(), cov, pos, mom, charge)
+  : ParametersBase<DIM, T>(AmgVector(DIM)::Zero(), cov, charge)
+  , m_position(pos)
+  , m_momentum(mom)
   , m_surface(surface.isFree() ? surface.clone() : &surface)
 {
   // get the local parameters via the surface
@@ -125,11 +123,9 @@ Trk::ParametersT<DIM, T, S>::ParametersT(const Amg::Vector3D& pos,
                                          double qop,
                                          const S& surface,
                                          AmgSymMatrix(DIM) * cov)
-  : ParametersBase<DIM, T>(AmgVector(DIM)::Zero(),
-                           cov,
-                           pos,
-                           Amg::Vector3D::Zero(),
-                           1.)
+  : ParametersBase<DIM, T>(AmgVector(DIM)::Zero(), cov, 1.)
+  , m_position(pos)
+  , m_momentum(Amg::Vector3D::Zero())
   , m_surface(surface.isFree() ? surface.clone() : &surface)
 {
   // decide the sign of the charge
@@ -164,11 +160,9 @@ Trk::ParametersT<DIM, T, S>::ParametersT(const Amg::Vector3D& pos,
 // Copy constructor
 template<int DIM, class T, class S>
 ParametersT<DIM, T, S>::ParametersT(const ParametersT<DIM, T, S>& rhs)
-  : ParametersBase<DIM, T>(rhs.parameters(),
-                           nullptr,
-                           rhs.position(),
-                           rhs.momentum(),
-                           rhs.charge())
+  : ParametersBase<DIM, T>(rhs.parameters(), nullptr, rhs.charge())
+  , m_position(rhs.position())
+  , m_momentum(rhs.momentum())
   , m_surface(nullptr)
 {
   m_surface.reset((rhs.m_surface && rhs.m_surface->isFree()
@@ -198,6 +192,21 @@ ParametersT<DIM, T, S>::operator=(const ParametersT<DIM, T, S>& rhs)
   }
   return *this;
 }
+
+template<int DIM, class T, class S>
+const Amg::Vector3D&
+ParametersT<DIM, T, S>::position() const
+{
+  return m_position;
+}
+
+template<int DIM, class T, class S>
+const Amg::Vector3D&
+ParametersT<DIM, T, S>::momentum() const
+{
+  return m_momentum;
+}
+
 /** Test to see if there's a surface there. */
 template<int DIM, class T, class S>
 bool
@@ -327,7 +336,25 @@ Trk::ParametersT<DIM, T, S>::ParametersT(const AmgVector(DIM) & pars,
   : ParametersBase<DIM, T>(pars, cov)
   , m_surface(surface)
 {
+  float qop = m_parameters[Trk::qOverP];
+  // decide the sign of the charge
+  if (qop < 0.) {
+    m_chargeDef.setCharge(-1);
+  }
+  double p = 0.0;
+  if (qop != 0.) {
+    p = fabs(1. / qop);
+  } else {
+    // qop is unphysical. No momentum measurement.
+    p = InvalidParam::INVALID_P;
+    qop = InvalidParam::INVALID_QOP;
+  }
   if (m_surface) {
+    // fill momentum & then position using the surface
+    m_momentum = Amg::Vector3D(
+      p * cos(m_parameters[Trk::phi]) * sin(m_parameters[Trk::theta]),
+      p * sin(m_parameters[Trk::phi]) * sin(m_parameters[Trk::theta]),
+      p * cos(m_parameters[Trk::theta]));
     m_surface->localToGlobal(this->localPosition(), m_momentum, m_position);
   } else {
     m_momentum.setZero();
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py
index 15c0a7a7f93d80c6f9c4216396d2feac4ad82e81..20953110eb2be451527a2a7022a8f88b5c2de371 100755
--- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py
@@ -43,6 +43,7 @@ def testUrl(url):
     return True
 
 def getFrontierCursor(url, schema):
+    log = logging.getLogger( "TrigConfFrontier.py" )
     if useFrontierClient:
         log.info("Using frontier_client from TrigConfDBConnection")
         return FrontierCursor2( url = url, schema = schema)
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaFastCaloHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaFastCaloHypoTool.py
index 1e6cc0ea7fc7fdc1c83b993fe9bb7e0e9303f898..e79e14e6ce19aac36a3fd37e83631332e58fc89c 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaFastCaloHypoTool.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaFastCaloHypoTool.py
@@ -172,8 +172,8 @@ def TrigEgammaFastCaloHypoToolFromDict( d ):
     """ Use menu decoded chain dictionary to configure the tool """
     cparts = [i for i in d['chainParts'] if ((i['signature']=='Electron') or (i['signature']=='Photon'))]
 
-    from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault
-    LuminosityCondAlgOnlineDefault()    
+    from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault
+    LuminosityCondAlgDefault()
 
     #def __mult(cpart):
      #   return int( cpart['multiplicity'] )
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
index e5a870341f8a5299f43ece301a8a91c71976cb64..a1e5c78989eb28ef3c7e0c546823be1e8d8ccb38 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
@@ -176,24 +176,8 @@ class TestDebugFlagIsFalse(unittest.TestCase):
         self.assertFalse(tool.visit_debug)
 
 
-def _tests():
-
-    from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
-
-    chainNameDecoder = DictFromChainName.DictFromChainName()
-
-    chain_names = (
-        'j80_0eta240_2j60_320eta490_L1J20',
-        'j80_0eta240_2j60_320eta490_j0_dijetSEP80j1etSEP0j1eta240SEP80j2etSEP0j2eta240SEP700djmass_L1J20',
-    )
-    for cn in chain_names:
-        chain_dict = chainNameDecoder.getChainDict(cn)
-
-        trigJetHypoToolFromDict(chain_dict)
-
 
 if __name__ == '__main__':
     unittest.main()
 
-    # run _tests outide untit tests so as to see stdout
-    # _tests()
+    # other local tests have been moved to testChainDictMaker.py
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py
index b60f1b83b9fea7c282242895b9822829884758ff..42d7d53e798c317e89f6927aa52c50a4cb63cfdb 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py
@@ -10,7 +10,9 @@ from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import (
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import dictFromChainName
 
-    
+from chainDict2jetLabel import chainDict2jetLabel 
+from TrigJetHypoToolConfig import trigJetHypoToolFromDict
+
 def testChainDictMaker():
 
     chain_props = [
@@ -20,6 +22,10 @@ def testChainDictMaker():
         ChainProp(name='HLT_j80_j60_L1J15',
                   l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup),
 
+        ChainProp(name='HLT_2j80_3j60_L1J15',
+                  l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup),
+
+
         ChainProp(name='HLT_j0_HTSEP1000htSEP100etSEP0eta320_L1J15',
                   l1SeedThresholds=['FSNOSEED'], groups=MultiJetGroup),
 
@@ -45,3 +51,16 @@ if __name__ == '__main__':
     for d in dicts:
         print('')
         print (d)
+
+    print ('\n chain_labels:\n')
+    
+    for d in dicts:
+        print (d[0])
+        print (chainDict2jetLabel(d[1]))
+        print ()
+
+    print ('\nMaking TrigJetHypoTool for each dictiomary\n')
+    for d in dicts:
+        print (d[0])
+        print (trigJetHypoToolFromDict(d[1]))
+        print ()
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
index cc704db08835720846664915e7c22c2d91ca29ed..fbdf5b60bf4927a31e7accbc0a6144fc104686ee 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
@@ -181,7 +181,6 @@ class ConditionsDictMaker(object):
 
 
     def makeDict(self, params):
-
         # conditions example: ['10et,0eta320', '20et']
         conditions = self.get_conditions(params)
 
@@ -256,8 +255,21 @@ class ConditionsDictMaker(object):
             
             result.append(cdict)
 
+
+        # Example: input condition string:
+        #
+        # 260et,320eta490
+        # 
+        # result:
+        #
+        # [
+        #  defaultdict(<class 'dict'>, {'et': {'min': '260000.0', 'max': 'inf'},
+        #                               'eta': {'min': '3.2', 'max': '4.9'}})
+        # ]
+
         msgs = ['ConditionsDict OK']
         error = False
+        print ('ConditionsDictMaker::makeDict(), result', result)
         return result, error, msgs
 
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h
new file mode 100644
index 0000000000000000000000000000000000000000..1455d594aca74b0d974e00e28cbf10abd9961a94
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h
@@ -0,0 +1,61 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGHLTJETHYPO_CAPACITYCHECKEDCONDITIONMT_H
+#define TRIGHLTJETHYPO_CAPACITYCHECKEDCONDITIONMT_H
+
+/********************************************************************
+ *
+ * NAME:     CapacityCheckedConditionMT.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ * AUTHOR:   P. Sherwood
+ * 
+ * an implementation of the  ICapacityCheckedConditionMT PABC.
+ *          
+ *********************************************************************/
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
+#include "ICapacityCheckedCondition.h"
+
+#include <memory>
+#include <string>
+
+
+class ITrigJetHypoInfoCollector;
+
+class CapacityCheckedCondition: public ICapacityCheckedCondition {
+ public:
+ CapacityCheckedCondition(std::unique_ptr<IConditionMT> cp):
+  m_condition{std::move(cp)} {
+  }
+  
+  virtual ~CapacityCheckedCondition(){
+  }
+
+  virtual bool
+    capacitySatisfied(std::size_t jgMultiplicity,
+		      const Collector&) const override {
+
+    return m_condition->capacity() <= jgMultiplicity;
+  }
+  
+  virtual bool isSatisfied(const HypoJetVector& v,
+                           const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const override {
+    return m_condition->isSatisfied(v, c);
+  }
+  
+  virtual unsigned int capacity() const override {
+    return m_condition->capacity();
+  }
+  
+  virtual std::string toString() const noexcept override {
+    return m_condition->toString();
+  }
+  
+ private:
+  std::unique_ptr<IConditionMT> m_condition;
+};
+
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedConditionsDefs.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedConditionsDefs.h
new file mode 100644
index 0000000000000000000000000000000000000000..f26ccc1bc85cb07b2aef955bdeb9169e818acee9
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedConditionsDefs.h
@@ -0,0 +1,23 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGHLTJETHYPO_CAPCACITYCHECKEDCONDITIONSDEFSMT_H
+#define TRIGHLTJETHYPO_CAPCACITYCHECKEDCONDITIONSDEFSMT_H
+/********************************************************************
+ *
+ * NAME:     ConditionsDefs.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ * AUTHOR:   P. Sherwood
+ *********************************************************************/
+
+#include <string>
+#include <memory>
+#include "./ICapacityCheckedCondition.h"
+
+using ConditionPtr = std::unique_ptr<ICapacityCheckedCondition>;
+using ConditionPtrs = std::vector<ConditionPtr>;
+using ConditionPtrsIter = ConditionPtrs::iterator;
+
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx
index 49c56a2e137775e9ec9a616e302272f501fa7342..f4f36af1ae37c9e77be29521401929ffdf265984 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx
@@ -38,7 +38,7 @@ struct IndexVecComp{
 
 FastReducer::FastReducer(const HypoJetGroupCIter& groups_b,
                          const HypoJetGroupCIter& groups_e,
-                         const ConditionsMT& conditions,
+                         const ConditionPtrs& conditions,
                          const Tree& tree,
                          const std::vector<std::vector<int>>& sharedConditions,
                          xAODJetCollector& jetCollector,
@@ -179,10 +179,10 @@ bool FastReducer::findInitialJetGroups(const std::vector<int>& leaves,
     }
   }
 
+
   // check all leaf conditions are satisfied
   for (const auto& i : leaves) {
-    auto& satisfiedBy = m_satisfiedBy.at(i);
-    if (satisfiedBy.empty()) {
+    if (!capacitySatisfied(i, collector)) {
       return false;
     }
   }
@@ -328,7 +328,7 @@ bool FastReducer::propagate_(std::size_t child,
    
   auto jg_product = JetGroupProduct(siblings, m_satisfiedBy);
    
-  // obtain the next product of hob groups passing siblings
+  // obtain the next product of jet groups passing siblings
   auto next = jg_product.next(collector);
 
   // step through the jet groups found by combining ghe child groups
@@ -351,7 +351,7 @@ bool FastReducer::propagate_(std::size_t child,
 		      m_jg2elemjgs[i].end());
     }
 
-    // if any of the elemetal jet group indices are repeated,
+    // if any of the elemental jet group indices are repeated,
     // stop processing of the new jet group. (do not allow sharing for
     // among leaf nodes. Sharing is handled by processing > 1 leaf groups
     // each of which does not share.
@@ -497,8 +497,24 @@ void FastReducer::recordJetGroup(std::size_t ind,
 	 << " et " << ip->et();
   }
   ss1 << '\n';
-  collector -> collect(ss0.str(), ss1.str());
+  collector->collect(ss0.str(), ss1.str());
 }
 
 bool FastReducer::pass() const { return m_pass; }
 
+
+bool FastReducer::capacitySatisfied(std::size_t ind,
+				    const Collector& collector) const {
+  // Check that the number of satisfying job groups is sufficient to
+  // satisfy the capacity of the Condition. Uses include handling
+  // of Conditions which represent multiple identical conditions.
+  
+  auto jgMult = m_satisfiedBy.at(ind).size();
+  auto capSat = m_conditions.at(ind)->capacitySatisfied(jgMult, collector);
+  if (!capSat and collector) {
+    collector->collect("FastReduce", "Condition " + std::to_string(ind)
+			 + " unsatisfied capacity, aborting"); 
+  }
+  
+  return capSat;
+}
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h
index 5aba889c93be587fc7327d8d96a7c293190af371..e92217ae5e438e3d06471d6dada1a3175d725a37 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h
@@ -5,8 +5,7 @@
 #ifndef TRIGHLTJETHYPO_FASTREDUCER_H
 #define TRIGHLTJETHYPO_FASTREDUCER_H
 
-
-#include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include "./Tree.h"
 #include "./JetGroupProduct.h"
 #include "./JetGroupIndAllocator.h"
@@ -30,7 +29,7 @@ class FastReducer {
 
   FastReducer(const HypoJetGroupCIter& groups_b,
               const HypoJetGroupCIter& groups_e,
-              const ConditionsMT& conditionObjects,
+              const ConditionPtrs& conditionObjects,
               const Tree& conditionsTree,
               const std::vector<std::vector<int>>& sharedConditions,
               xAODJetCollector& jetCollector,
@@ -47,7 +46,7 @@ class FastReducer {
 
  private:
 
-  const ConditionsMT& m_conditions;
+  const ConditionPtrs& m_conditions;
 
   /** tree structure for Conditions objects.
    The conditions tree gives relations among conditions (eg parent-child
@@ -114,6 +113,8 @@ class FastReducer {
   void collectLeafJets(xAODJetCollector& jetCollector,
 		       const Collector& collector) const;
 
+  bool capacitySatisfied(std::size_t ind,
+			 const Collector& collector) const;
 
 };
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx
index 7f78b0ca100e5cb2af754bdabb1184881526a309..4dfffac4ca42c542b11b33516585717d0b95716a 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.cxx
@@ -12,7 +12,7 @@
 
 
 
-FastReductionMatcher::FastReductionMatcher(ConditionsMT conditions,
+FastReductionMatcher::FastReductionMatcher(ConditionPtrs conditions,
 					   const Tree& tree,
 					   const std::vector<std::vector<int>>& sharedNodes):
   m_conditions(std::move(conditions)),
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h
index b7fe4d2eb74798727e77e033e913da80c944c347..62210f404a39f23639f2a4984ecba85e4ed2855b 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReductionMatcher.h
@@ -7,7 +7,7 @@
 
 
 #include "./IGroupsMatcherMT.h"
-#include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include "./Tree.h"
 
 using TreeVec = std::vector<std::size_t>;
@@ -16,9 +16,9 @@ class ITrigJetHypoInfoCollector;
 class FastReductionMatcher: public IGroupsMatcherMT {
  public:
 
-  FastReductionMatcher(ConditionsMT,
-			    const Tree&,
-			    const std::vector<std::vector<int>>&);
+  FastReductionMatcher(ConditionPtrs,
+		       const Tree&,
+		       const std::vector<std::vector<int>>&);
 
 
   /** determine whether a set of jets satisfies all hypo conditions.
@@ -42,7 +42,7 @@ class FastReductionMatcher: public IGroupsMatcherMT {
 
  private:
 
-  ConditionsMT m_conditions;
+  ConditionPtrs m_conditions;
 
   /** tree structure for Conditions objects.
    The conditions tree gives relations among conditions (eg parent-child
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h
new file mode 100644
index 0000000000000000000000000000000000000000..033ce81570cf017b1b735e9a459460049dbc31e8
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h
@@ -0,0 +1,38 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGHLTJETHYPO_ICAPACITYCHECKEDCONDITIONMT_H
+#define TRIGHLTJETHYPO_ICAPACITYCHECKEDCONDITIONMT_H
+
+/********************************************************************
+ *
+ * NAME:     ICapacityCheckedConditionMT.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ * AUTHOR:   P. Sherwood
+ * 
+ * extend IConditionMT by adding a method that checks whether the
+ * capacity of the Condition has been attained.
+ *          
+ *********************************************************************/
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h"
+#include "IConditionMT.h"
+
+#include <string>
+typedef std::unique_ptr<ITrigJetHypoInfoCollector> Collector;
+
+
+class ITrigJetHypoInfoCollector;
+
+class ICapacityCheckedCondition: public IConditionMT {
+ public:
+  virtual ~ICapacityCheckedCondition(){}
+
+  virtual bool capacitySatisfied(std::size_t jgMultiplicity,
+				 const Collector&) const = 0;
+  
+};
+
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx
index 051697a152ed5525bb3c3fe3ff74ad7c00deb355..4c4e6691b6d2caf4242090217cd3086d5d7e4c14 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx
@@ -15,6 +15,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerFactory.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TrigHLTJetHypoHelper2.h"
 #include "./groupsMatcherFactoryMT.h"
+#include "./CapacityCheckedCondition.h"
 
 #include "TrigCompositeUtils/TrigCompositeUtils.h"
 
@@ -126,20 +127,32 @@ StatusCode TrigJetHypoToolConfig_fastreduction::initialize() {
 
 
 
-std::optional<ConditionsMT>
-TrigJetHypoToolConfig_fastreduction::getConditions() const {
+std::optional<ConditionPtrs>
+TrigJetHypoToolConfig_fastreduction::getCapacityCheckedConditions() const {
 
-  ConditionsMT conditions;
+  ConditionPtrs conditions;
 
   // collect the Conditions objects from the various sources
   // return an invalid optional if any src signals a problem
+
   for(const auto& cm : m_conditionMakers){
-    conditions.push_back(cm->getCondition());
+    conditions.push_back(std::make_unique<CapacityCheckedCondition>(std::move(cm->getCondition())));
   }
-    
-  return std::make_optional<ConditionsMT>(std::move(conditions));
+      
+  return std::make_optional<ConditionPtrs>(std::move(conditions));
 }
 
+std::optional<ConditionsMT>
+TrigJetHypoToolConfig_fastreduction::getConditions() const {
+  /* obtain an unchecked set of conditions */
+  
+  ConditionsMT conditions;
+  for(const auto& cm : m_conditionMakers){
+    conditions.push_back(std::move(cm->getCondition()));
+  }
+  
+  return std::make_optional<ConditionsMT>(std::move(conditions));
+}
 
 // following function not used for treeless hypos
 std::size_t
@@ -156,7 +169,7 @@ TrigJetHypoToolConfig_fastreduction::getJetGrouper() const {
 std::unique_ptr<IGroupsMatcherMT>
 TrigJetHypoToolConfig_fastreduction::getMatcher () const {
 
-  auto opt_conds = getConditions();
+  auto opt_conds = getCapacityCheckedConditions();
 
   if(!opt_conds.has_value()){
     return std::unique_ptr<IGroupsMatcherMT>(nullptr);
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h
index 5625120313e9da076d19961faaebf4dbf0087dd1..2e70bf1b81674df6139e148c17ce8a25d1342f89 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h
@@ -14,7 +14,7 @@
 
 
 #include "ITrigJetHypoToolConfig.h"
-#include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include "TrigCompositeUtils/HLTIdentifier.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "TrigCompositeUtils/TrigCompositeUtils.h"
@@ -57,6 +57,8 @@ public extends<AthAlgTool, ITrigJetHypoToolConfig> {
     this, "sharedVector", {}, "nodeID groups for nodes that see input jets"};
 
   std::vector<std::vector<int>> m_sharedNodes{};
- 
+
+  std::optional<ConditionPtrs> getCapacityCheckedConditions() const;
+
 };
 #endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx
index 100bfcc525f308147a50a227649422fe5eae2d33..a580b25257e508076ea4c922811da62bac5ac510 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.cxx
@@ -47,7 +47,7 @@ groupsMatcherFactoryMT_Partitions (ConditionsMT&& conditions){
 
 
 std::unique_ptr<IGroupsMatcherMT> 
-groupsMatcherFactoryMT_FastReduction (ConditionsMT&& conditions,
+groupsMatcherFactoryMT_FastReduction (ConditionPtrs&& conditions,
 				      const std::vector<std::size_t>& treeVec,
 				      const std::vector<std::vector<int>>& sharedNodes){
   
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h
index 5b6d1f1f25ccb58089147b8384565ab9ff5be93f..1865de3d94bf3f4a37849b295db109fa3c1a7924 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/groupsMatcherFactoryMT.h
@@ -7,6 +7,7 @@
 
 #include "./IGroupsMatcherMT.h"
 #include "./ConditionsDefsMT.h"
+#include "./CapacityCheckedConditionsDefs.h"
 #include <memory>
 
 std::unique_ptr<IGroupsMatcherMT>
@@ -20,7 +21,7 @@ groupsMatcherFactoryMT_Partitions(ConditionsMT&&);
 
 
 std::unique_ptr<IGroupsMatcherMT>
-groupsMatcherFactoryMT_FastReduction(ConditionsMT&&,
+groupsMatcherFactoryMT_FastReduction(ConditionPtrs&&,
 				     const std::vector<std::size_t>& treeVec,
 				     const std::vector<std::vector<int>>&);
 #endif
diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt b/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt
index 160ea0b3cb7ca229e745b76b8ad6a6d7404f333f..21d91f2167f84158871d4bf685e20ccdc7d81083 100644
--- a/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt
+++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt
@@ -18,7 +18,7 @@ atlas_add_component( TrigCostMonitorMT
                      src/*.cxx
                      src/components/*.cxx 
                      INCLUDE_DIRS ${TBB_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TBB_LIBRARIES} AthContainers AthViews AthenaKernel TrigConfHLTData TrigCostMonitorMTLib TrigSteeringEvent TrigTimeAlgsLib )
+                     LINK_LIBRARIES ${TBB_LIBRARIES} AthContainers AthViews AthenaKernel TrigConfHLTData TrigCompositeUtilsLib TrigCostMonitorMTLib TrigSteeringEvent TrigTimeAlgsLib )
 
 
 atlas_add_test( AlgorithmIdentifier_test
diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/TrigCostMonitorMT/EnhancedBiasWeightCompAlg.h b/Trigger/TrigMonitoring/TrigCostMonitorMT/TrigCostMonitorMT/EnhancedBiasWeightCompAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b5dc055042c1628a9d13ed1efd71cdedbefbe7a
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/TrigCostMonitorMT/EnhancedBiasWeightCompAlg.h
@@ -0,0 +1,97 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIG_ENHANCEDBIASWEIGHTCOMPALG_H
+#define TRIG_ENHANCEDBIASWEIGHTCOMPALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "TrigCompositeUtils/TrigCompositeUtils.h"
+#include "TrigConfData/HLTMenu.h"
+#include "TrigConfData/HLTPrescalesSet.h"
+#include "TrigConfData/L1PrescalesSet.h"
+#include "xAODTrigger/TrigCompositeContainer.h"
+
+#include <vector>
+#include <string>
+
+/**
+ *  @class EnhancedBiasWeightCompAlg
+ *  @brief Compute Enhanced Bias weight
+ **/
+
+class EnhancedBiasWeightCompAlg : public AthReentrantAlgorithm {
+  public:
+
+    EnhancedBiasWeightCompAlg(const std::string& name, ISvcLocator* svcLoc);
+
+    virtual StatusCode initialize() override;
+    virtual StatusCode start() override;
+    virtual StatusCode execute(const EventContext& context) const override;
+
+  private:
+    /**
+     *  @class EBChainInfo
+     *  @brief Store necessary information for weight computing for Enhanced Bias chain 
+     **/
+
+    class EBChainInfo {
+      public:
+        EBChainInfo(const HLT::Identifier & id) : m_id(id), m_totalPrescale(1.0) {}
+
+        std::string getName() const {return m_id.name();}
+        TrigCompositeUtils::DecisionID getId() const {return m_id;}
+        float getPrescale() const {return m_totalPrescale;}
+        bool getIsRandom() const {return (getName().find("HLT_noalg_eb_L1RD") != std::string::npos);}
+        bool getIsNoPS() const {return (getName().find("noPS") != std::string::npos);}
+
+        void setPrescale(const float& prescale) {m_totalPrescale = prescale;}
+
+      private:
+        /// HLTID of the chain
+        HLT::Identifier m_id;
+
+        /// Value of total prescale L1 * HLT
+        float m_totalPrescale;
+    };
+
+    /**
+     *  @class EBResult
+     *  @brief Store result of EB weight calculation
+     **/
+    struct EBResult {
+      float weight {1.0};
+      uint8_t isUnbiased {};
+    };
+
+    SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{ this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu" };
+    SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalDecisionKey{ this, "FinalDecisionKey", "HLTNav_Summary", "Final stage of all decisions" };
+    SG::WriteHandleKey<xAOD::TrigCompositeContainer> m_EBWeightKey {this, "EBWeight", "HLT_EBWeight", "Computed EB Weight"};
+
+    SG::ReadCondHandleKey<TrigConf::HLTPrescalesSet> m_HLTPrescaleSetInputKey {this, "HLTPrescales", "HLTPrescales", "HLT prescales set"};
+    SG::ReadCondHandleKey<TrigConf::L1PrescalesSet> m_L1PrescaleSetInputKey {this, "L1Prescales", "L1Prescales", "L1 prescales set"};
+
+    /// Calculate EB result based on total prescales of chains
+    EBResult calculateEBWeight(const std::vector<EBChainInfo>& EBChains) const;
+
+    /// Retrieve total prescales (L1 * HLT) for chains into map
+    StatusCode getPrescales(const EventContext& context, std::vector<EBChainInfo>& EBChains) const;
+
+    /// Get list of Enhanced Bias chains that passed
+    std::vector<EBChainInfo> getPassedEBChains(const TrigCompositeUtils::Decision& decisionObject) const;
+
+    /// Check if any of random chains passed
+    bool checkIfTriggeredByRandomChain(const std::vector<EBChainInfo>& EBChain) const;
+
+    /// Parse list of l1 items
+    std::vector<std::string> parseItems(const std::string& itemStr);
+
+    /// Available EB chains' IDs from HLT Menu
+    std::vector<TrigCompositeUtils::DecisionID> m_EBChainIds;
+
+    /// L1 items for EB chains from HLT Menu
+    std::map<TrigCompositeUtils::DecisionID, std::vector<std::string>> m_EBChainIdToItem;
+
+};
+
+#endif //TRIG_ENHANCEDBIASWEIGHTCOMPALG_H
\ No newline at end of file
diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/EnhancedBiasWeightCompAlg.cxx b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/EnhancedBiasWeightCompAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..6f8398b80e9b860546a9d9d0142279e1d350e82d
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/EnhancedBiasWeightCompAlg.cxx
@@ -0,0 +1,160 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+#include "TrigCostMonitorMT/EnhancedBiasWeightCompAlg.h"
+
+#include <sstream>
+
+
+EnhancedBiasWeightCompAlg::EnhancedBiasWeightCompAlg(const std::string& name, ISvcLocator* svcLoc)
+    : AthReentrantAlgorithm(name, svcLoc) {}
+
+StatusCode EnhancedBiasWeightCompAlg::initialize(){
+    
+    ATH_CHECK( m_HLTMenuKey.initialize() );
+    ATH_CHECK( m_finalDecisionKey.initialize() );
+    ATH_CHECK( m_EBWeightKey.initialize() );
+
+    ATH_CHECK( m_HLTPrescaleSetInputKey.initialize() );
+    ATH_CHECK( m_L1PrescaleSetInputKey.initialize() );
+
+    return StatusCode::SUCCESS;
+}
+
+
+StatusCode EnhancedBiasWeightCompAlg::start() {
+    
+    SG::ReadHandle<TrigConf::HLTMenu> hltMenuHandle = SG::makeHandle( m_HLTMenuKey );
+    ATH_CHECK( hltMenuHandle.isValid() );
+
+    // Save ids of EB chains - that contain "_eb_"
+    m_EBChainIds = std::vector<TrigCompositeUtils::DecisionID>();
+    for (const TrigConf::Chain& chain : *hltMenuHandle){
+        std::vector<std::string> streams = chain.streams();
+        if (std::find(streams.begin(), streams.end(), "EnhancedBias") != streams.end()){
+            auto chainId = HLT::Identifier(chain.name());
+            m_EBChainIds.push_back(chainId);
+            m_EBChainIdToItem[chainId] = parseItems(chain.l1item());
+        }
+    }
+
+    return StatusCode::SUCCESS;
+}
+
+
+StatusCode EnhancedBiasWeightCompAlg::execute(const EventContext& context) const {
+
+    auto finalDecisionsHandle = SG::makeHandle( m_finalDecisionKey, context );
+    ATH_CHECK( finalDecisionsHandle.isValid() );
+
+    // Retrieve information about EB chains that passed
+    std::vector<EBChainInfo> EBChains;
+    for (const TrigCompositeUtils::Decision* decisionObject : *finalDecisionsHandle) {
+        if (decisionObject->name() == "HLTPassRaw") {
+           EBChains = getPassedEBChains(*decisionObject);
+           break;
+        }
+    }
+
+    // Setup output handle
+    SG::WriteHandle<xAOD::TrigCompositeContainer> outputHandle = TrigCompositeUtils::createAndStore(m_EBWeightKey, context);
+
+    // None of EB chains passed the algorithm
+    if (EBChains.empty()) return StatusCode::SUCCESS;
+
+    // Retrieve L1 and HLT prescales
+    ATH_CHECK( getPrescales(context, EBChains) );
+    
+    // Calculate EB weight
+    EBResult result = calculateEBWeight(EBChains);
+
+    // Save output values: EBWeight and EBUnbiased
+    xAOD::TrigComposite* tc = new xAOD::TrigComposite();
+    outputHandle->push_back(tc);
+
+    tc->setDetail<float>("EBWeight", result.weight);
+    tc->setDetail<uint8_t>("EBUnbiased", result.isUnbiased);
+
+    ATH_MSG_DEBUG("EnhacedBias EBWeight: " << result.weight << " EnhacedBias isUnbiased: " << result.isUnbiased );
+
+    return StatusCode::SUCCESS;
+}
+
+
+StatusCode EnhancedBiasWeightCompAlg::getPrescales(const EventContext& context, std::vector<EBChainInfo>& EBChains) const {
+
+    SG::ReadCondHandle<TrigConf::HLTPrescalesSet> HLTPrescalesSet (m_HLTPrescaleSetInputKey, context);
+    ATH_CHECK( HLTPrescalesSet.isValid() );
+    
+    SG::ReadCondHandle<TrigConf::L1PrescalesSet> L1PrescalesSet (m_L1PrescaleSetInputKey, context);
+    ATH_CHECK( L1PrescalesSet.isValid() );
+
+    for (EBChainInfo& chain : EBChains) {
+
+        double HLTPrescale = HLTPrescalesSet->prescale(chain.getId()).prescale;
+        double L1Prescale = 1.0;
+        if (!chain.getIsNoPS()) {
+            for (const std::string& item : m_EBChainIdToItem.at(chain.getId())){
+                L1Prescale *= L1PrescalesSet->prescale(item).prescale;
+            }
+        }
+
+        chain.setPrescale(HLTPrescale * L1Prescale);
+    }
+
+    return StatusCode::SUCCESS;
+}
+
+
+EnhancedBiasWeightCompAlg::EBResult EnhancedBiasWeightCompAlg::calculateEBWeight(const std::vector<EBChainInfo>& EBChains) const{
+
+    double weight = 1.;
+
+    for (const EBChainInfo& chain : EBChains){
+       weight *= 1. - ( 1. / chain.getPrescale() );
+    }
+
+    weight = (std::fabs(1.0 - weight) < 1e-10) ? 0. : (1. / (1. - weight));
+
+    // Check if the event was triggered by EB noalg random chain
+    bool isUnbiased = checkIfTriggeredByRandomChain(EBChains);
+    
+    return {float(weight), isUnbiased}; 
+}
+
+
+std::vector<EnhancedBiasWeightCompAlg::EBChainInfo> EnhancedBiasWeightCompAlg::getPassedEBChains(const TrigCompositeUtils::Decision& decisionObject) const {
+    
+    std::vector<EBChainInfo> passedEBChains;
+
+    for (const TrigCompositeUtils::DecisionID& chainId : m_EBChainIds) {
+        if (std::find(decisionObject.decisions().begin(), decisionObject.decisions().end(), chainId) != decisionObject.decisions().end()) {
+            passedEBChains.push_back(EBChainInfo(HLT::Identifier(chainId)));
+        }
+    }
+
+    return passedEBChains;
+}
+
+
+bool EnhancedBiasWeightCompAlg::checkIfTriggeredByRandomChain(const std::vector<EBChainInfo>& EBChains) const {
+    
+    return std::find_if (EBChains.begin(), EBChains.end(), 
+        [](const EBChainInfo& chain) -> bool { return chain.getIsRandom(); }) != EBChains.end();
+}
+
+std::vector<std::string> EnhancedBiasWeightCompAlg::parseItems(const std::string& itemStr) {
+    
+    std::vector<std::string> items;
+
+    std::stringstream itemStream (itemStr);
+    std::string item;
+
+    while (std::getline(itemStream, item, ',')) {
+        items.push_back(item);
+    }
+
+    return items;
+}
\ No newline at end of file
diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/components/TrigCostMonitorMT_entries.cxx b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/components/TrigCostMonitorMT_entries.cxx
index 982026a4cee8596b5b955c58fa5d7869a950066c..35b0f248de0f0f2ef662e6802491ccad50f9f3f9 100644
--- a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/components/TrigCostMonitorMT_entries.cxx
+++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/components/TrigCostMonitorMT_entries.cxx
@@ -1,9 +1,11 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "src/TrigCostMTSvc.h"
 #include "TrigCostMonitorMT/TrigCostMTAuditor.h"
+#include "TrigCostMonitorMT/EnhancedBiasWeightCompAlg.h"
 
 DECLARE_COMPONENT( TrigCostMTSvc )
 DECLARE_COMPONENT( TrigCostMTAuditor )
+DECLARE_COMPONENT( EnhancedBiasWeightCompAlg )
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py
index 6ee9f233a0c0333e8c6e2ed4a6bdbf04314d0a13..9c88314848daaf473db0fe68861ea0b524754392 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py
@@ -294,5 +294,10 @@ class TrigEgammaMonToolBuilder:
                             "TrigEgammaNavAnalysisTool/HLTEgammaElectronAnalysis"])
         else:
             tool = self.configureDefaultMonTool()
+
+        # Dependency required by TrigEgammaAnalysisBaseTool.
+        # Not propagated automatically though HLTEgammaMon
+        # because it doesn't use ToolHandle's as intended.
+        tool.ExtraInputs += [('LuminosityCondData', 'ConditionStore+LuminosityCondDataOnline')]
         
         return [tool]
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py
index 3bbf0ade1af4c02fd75ad4c07bff9b518c34a399..c002129da1621023ff68f969427110d7547e2a7b 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py
@@ -184,6 +184,7 @@ class TrigTauMonAlgBuilder:
     for trigger in triggers:
       info = self.getTrigInfo(trigger)
 
+
       if info.isRNN() is True:
         self.bookRNNInputVars( monAlg, trigger,nProng='1P', online=True )
         self.bookRNNInputVars( monAlg, trigger,nProng='MP', online=True )
@@ -193,13 +194,16 @@ class TrigTauMonAlgBuilder:
         self.bookRNNTrack( monAlg, trigger, online=False )
         self.bookRNNCluster( monAlg, trigger, online=True )
         self.bookRNNCluster( monAlg, trigger, online=False )
+        self.bookbasicVars( monAlg, trigger, online=True )
+        self.bookbasicVars( monAlg, trigger, online=False )
+
   #
   # Book RNN Variables
   #
   def bookRNNInputVars( self, monAlg, trigger,nProng, online ):
 
     monGroupName = trigger+'_RNN_'+('HLT' if online else 'Offline')+'_InputScalar_'+nProng
-    monGroupPath = trigger+'/RNN/'+('HLT' if online else 'Offline')+'/InputScalar_'+nProng
+    monGroupPath = 'RNN/InputScalar_'+nProng+'/'+trigger+('/HLT' if online else '/Offline')
 
     monGroup = self.helper.addGroup( monAlg, monGroupName, 
                               self.basePath+'/'+monGroupPath )
@@ -213,12 +217,13 @@ class TrigTauMonAlgBuilder:
     monGroup.defineHistogram('ptRatioEflowApprox', title='ptRatioEflowApprox ('+nProng+'); ptRatioEflowApprox; Events',xbins=50,xmin=0.0,xmax=2.0)
     monGroup.defineHistogram('mEflowApprox', title='mEflowApprox log ('+nProng+'); mEflowApprox_log; Events',xbins=50,xmin=0.,xmax=5.)
     monGroup.defineHistogram('ptDetectorAxis', title='ptDetectorAxis log ('+nProng+'); ptDetectorAxis_log; Events',xbins=50,xmin=0.,xmax=5.)
-    if nProng=='MP':  monGroup.defineHistogram('massTrkSys', title='massTrkSys log ('+nProng+'); massTrkSys_log; Events',xbins=50,xmin=0.,xmax=3.)
+    if nProng=='MP':  
+      monGroup.defineHistogram('massTrkSys', title='massTrkSys log ('+nProng+'); massTrkSys_log; Events',xbins=50,xmin=0.,xmax=3.)
 
   def bookRNNTrack( self, monAlg, trigger, online ):
 
     monGroupName = trigger+'_RNN_'+('HLT' if online else 'Offline')+'_InputTrack'
-    monGroupPath = trigger+'/RNN/'+('HLT' if online else 'Offline')+'/InputTrack'
+    monGroupPath = 'RNN/InputTrack/'+trigger+('/HLT' if online else '/Offline')
 
     monGroup = self.helper.addGroup( monAlg, monGroupName,
                               self.basePath+'/'+monGroupPath )
@@ -229,14 +234,14 @@ class TrigTauMonAlgBuilder:
     monGroup.defineHistogram('track_dPhi',title='track_dPhi;track_dPhi;Events',xbins=100,xmin=-0.5,xmax=0.5)
     monGroup.defineHistogram('track_d0_abs_log',title='track_d0_abs_log;track_d0_abs_log;Events',xbins=50,xmin=-7,xmax=2)
     monGroup.defineHistogram('track_z0sinThetaTJVA_abs_log',title='track_z0sinThetaTJVA_abs_log;track_z0sinThetaTJVA_abs_log;Events',xbins=50,xmin=-10,xmax=4)
-    monGroup.defineHistogram('track_nIBLHitsAndExp',title='track_nIBLHitsAndExp; track_nIBLHitsAndExp;Events',xbins=3,xmin=0,xmax=3)
+    monGroup.defineHistogram('track_nIBLHitsAndExp',title='track_nIBLHitsAndExp; track_nIBLHitsAndExp;Events',xbins=3,xmin=0,xmax=3)
     monGroup.defineHistogram('track_nPixelHitsPlusDeadSensors',title='track_nPixelHitsPlusDeadSensors;track_nPixelHitsPlusDeadSensors;Events',xbins=11,xmin=0,xmax=11)
     monGroup.defineHistogram('track_nSCTHitsPlusDeadSensors',title='track_nSCTHitsPlusDeadSensors;track_nSCTHitsPlusDeadSensors;Events',xbins=20,xmin=0,xmax=20)
-
+        
   def bookRNNCluster( self, monAlg, trigger, online ):
 
     monGroupName = trigger+'_RNN_'+('HLT' if online else 'Offline')+'_InputCluster'
-    monGroupPath = trigger+'/RNN/'+('HLT' if online else 'Offline')+'/InputCluster'
+    monGroupPath = 'RNN/InputCluster/'+trigger+('/HLT' if online else '/Offline')
 
     monGroup = self.helper.addGroup( monAlg, monGroupName,
                               self.basePath+'/'+monGroupPath )
@@ -248,4 +253,34 @@ class TrigTauMonAlgBuilder:
     monGroup.defineHistogram('cluster_SECOND_R_log10',title='cluster_SECOND_R_log10; cluster_SECOND_R_log10;Events',xbins=50,xmin=-3,xmax=7)
     monGroup.defineHistogram('cluster_SECOND_LAMBDA_log10',title='cluster_SECOND_LAMBDA_log10; cluster_SECOND_LAMBDA_log10;Events',xbins=50,xmin=-3,xmax=7)
     monGroup.defineHistogram('cluster_CENTER_LAMBDA_log10',title='cluster_CENTER_LAMBDA_log10; cluster_CENTER_LAMBDA_log10;Events',xbins=50,xmin=-2,xmax=5)
+    
+  def bookbasicVars( self, monAlg, trigger, online ):
+  
+    monGroupName = trigger+('HLT' if online else 'Offline')+'_basicVars'
+    monGroupPath = 'basicVars/'+trigger+('/HLT' if online else '/Offline')
+
+    monGroup = self.helper.addGroup( monAlg, monGroupName,
+                              self.basePath+'/'+monGroupPath )
+    
+    monGroup.defineHistogram('hEFEt', title='EF Et;E_{T}[GeV];Nevents',xbins=50,xmin=0,xmax=100)
+    monGroup.defineHistogram('hEFEta', title='EF TrigCaloCluster Eta; #eta ; Nevents',xbins=26,xmin=-2.6,xmax=2.6)
+    monGroup.defineHistogram('hEFPhi', title='EF TrigCaloCluster Phi; #phi ; Nevents',xbins=16,xmin=-3.2,xmax=3.2)
+    monGroup.defineHistogram('hEFnTrack', title='EF number of tracks;number of tracks;Nevents',xbins=10,xmin=0,xmax=10)
+
+    monGroup.defineHistogram('hEFEta;hEFPhi', type='TH2F', title='EF TrigCaloCluster Eta vs Phi; #eta ; #phi',
+                               path=monGroupPath,
+                               xbins=26,xmin=-2.6,xmax=2.6,ybins=16,ymin=-3.2,ymax=3.2)
+    #addHistogram(new TH2F("hEFEtaVsPhi","EF TrigCaloCluster Eta vs Phi; #eta ; #phi ; Nevents",26,-2.6,2.6,16,-3.2,3.2));
+    monGroup.defineHistogram('hEFEt;hEFPhi', type='TH2F', title='Et from tau Jet vs #phi; #phi^{EF}; Raw E_{T} [GeV]',
+                               path=monGroupPath,
+                               xbins=16,xmin=-3.2,xmax=3.2,ybins=50,ymin=0,ymax=100)
+   
+    monGroup.defineHistogram('hEFEta;hEFEt', type='TH2F', title='Et from tau Jet vs #eta; #eta^{EF}; Raw E_{T}[GeV]',
+                               path=monGroupPath,
+                               xbins=26,xmin=-2.6,xmax=2.6,ybins=50,ymin=0,ymax=100)
+   
+    monGroup.defineHistogram('hEFEtRaw', title='EF Et Raw;Uncalibrated E_{T}[GeV];Nevents',xbins=50,xmin=0,xmax=100)
+    monGroup.defineHistogram('hEFnWideTrack', title='EF number of wide tracks;number of tracks;Nevents',xbins=10,xmin=0,xmax=10)
 
+    #monGroup.defineHistogram('hEFIsoFrac', title='Iso Fraction at EF; isoFrac at EF; Candidates',xbins=50,xmin=-0.1,xmax=1.1)
+    #monGroup.defineHistogram('hEFEMFraction', title='Em Fraction at EF; EM Fraction at EF; Candidates',xbins=50,xmin=-0.05,xmax=1.1)
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
index 1fc9586e8c947a8318b8fab52184361bdf85137d..dc88474d2c6bb5a3604781663e4f485b34e94cf2 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
@@ -57,7 +57,7 @@ StatusCode TrigTauMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
 
     const TrigInfo info = getTrigInfo(trigger);
 
-    if ( executeNavigation( ctx, info.trigName,info.HLTthr,info.trigWP, pairObjs).isFailure() )                
+    if ( executeNavigation( ctx, info.trigName,info.HLTthr,info.trigWP, pairObjs).isFailure() || pairObjs.size()==0)                
     {                                                                                                                                                       
        ATH_MSG_WARNING("executeNavigation failed");                                                                                                       
        return StatusCode::SUCCESS;                                                                                                                         
@@ -133,14 +133,15 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
   {
     int nTracks=-1;
     pairObj.first->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
+    ATH_MSG_DEBUG("NTracks Offline: " << nTracks);
     if(nTracks==1){
        tau_vec_1p.push_back(pairObj.first);
     }else if(nTracks>1){
-       ATH_MSG_DEBUG("NTracks Offline: " << nTracks);
        tau_vec_np.push_back(pairObj.first);
     }
   }
     
+
   // Offline
   if(info.isRNN){
     fillRNNInputVars( trigger, tau_vec_1p,"1P", false );
@@ -149,6 +150,8 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
     fillRNNTrack( trigger, tau_vec_np, false );
     fillRNNCluster( trigger, tau_vec_1p, false );
     fillRNNCluster( trigger, tau_vec_np, false );
+    fillbasicVars( trigger, tau_vec_1p, false);
+    fillbasicVars( trigger, tau_vec_np, false);
   }
 
   tau_vec_1p.clear();
@@ -161,13 +164,14 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
     // If not pass, continue
     int nTracks=-1;
     feat->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
+    ATH_MSG_DEBUG("NTracks Online: " << nTracks);
     if(nTracks==1){
       tau_vec_1p.push_back(feat);
     }else if(nTracks>1){
-      ATH_MSG_DEBUG("NTracks Online: " << nTracks);
       tau_vec_np.push_back(feat);
     }
   }
+
   if(info.isRNN){ 
     fillRNNInputVars( trigger, tau_vec_1p,"1P", true );
     fillRNNInputVars( trigger, tau_vec_np,"MP", true );
@@ -175,6 +179,8 @@ void TrigTauMonitorAlgorithm::fillDistributions(std::vector< std::pair< const xA
     fillRNNTrack( trigger, tau_vec_np, true );
     fillRNNCluster( trigger, tau_vec_1p, true );
     fillRNNCluster( trigger, tau_vec_np, true );
+    fillbasicVars( trigger, tau_vec_1p, true);
+    fillbasicVars( trigger, tau_vec_np, true);
   }
   
   
@@ -231,9 +237,10 @@ void TrigTauMonitorAlgorithm::fillRNNInputVars(const std::string trigger, std::v
                                                 if ( tau->detail(xAOD::TauJetParameters::massTrkSys, detail) && nProng.find("MP") != std::string::npos ){
                                                   detail = TMath::Log10(std::max(detail, 140.0f));
                                                 }return detail;});
-
-    
+   
   fill(monGroup, centFrac,etOverPtLeadTrk,dRmax,absipSigLeadTrk,sumPtTrkFrac,emPOverTrkSysP,ptRatioEflowApprox,mEflowApprox,ptDetectorAxis,massTrkSys);     
+
+  ATH_MSG_DEBUG("After fill RNN input variables: " << trigger);
   
 }
 
@@ -243,6 +250,9 @@ void TrigTauMonitorAlgorithm::fillRNNTrack(const std::string trigger, std::vecto
   
 
   auto monGroup = getGroup(trigger+( online ? "_RNN_HLT_InputTrack" : "_RNN_Offline_InputTrack"));
+
+  auto track_pt_jetseed_log           = Monitored::Collection("track_pt_jetseed_log", tau_vec,  [] (const xAOD::TauJet* tau){ return TMath::Log10( tau->ptJetSeed());});
+  fill(monGroup,track_pt_jetseed_log);
   
     for(auto tau: tau_vec){
       // Don't call ->allTracks() unless the element links are valid
@@ -260,9 +270,6 @@ void TrigTauMonitorAlgorithm::fillRNNTrack(const std::string trigger, std::vecto
       }
 
       auto tracks = tau->allTracks();
- 
-      auto track_pt_jetseed_log           = Monitored::Collection("track_pt_jetseed_log", tau_vec,  [] (const xAOD::TauJet* tau){ return TMath::Log10( tau->ptJetSeed());});
-      fill(monGroup,track_pt_jetseed_log);
   
                                  
       auto cmp_pt = [](const xAOD::TauTrack *lhs, const xAOD::TauTrack *rhs) {
@@ -278,11 +285,11 @@ void TrigTauMonitorAlgorithm::fillRNNTrack(const std::string trigger, std::vecto
 
       auto track_pt_log = Monitored::Collection("track_pt_log", tracks, [](const xAOD::TauTrack *track){return TMath::Log10( track->pt()); }); 
   
-      auto track_dEta = Monitored::Collection("tracks_dEta", tracks, [&tau](const xAOD::TauTrack *track){auto ddeta=track->eta()- tau->eta();return ddeta; });
+      auto track_dEta = Monitored::Collection("tracks_dEta", tracks, [&tau](const xAOD::TauTrack *track){auto ddeta=track->eta()- tau->eta();std::cout << "ddeta: " << ddeta << std::endl;return ddeta; });
 
-      auto track_dPhi = Monitored::Collection("tracks_dPhi", tracks, [&tau](const xAOD::TauTrack *track){return track->p4().DeltaPhi(tau->p4()); }); 
+      auto track_dPhi = Monitored::Collection("tracks_dPhi", tracks, [&tau](const xAOD::TauTrack *track){std::cout << "ddphi: " << track->p4().DeltaPhi(tau->p4()) << std::endl;return track->p4().DeltaPhi(tau->p4());}); 
 
-      auto track_z0sinThetaTJVA_abs_log = Monitored::Collection("tracks_z0sinThetaTJVA_abs_log", tracks, [&tau](const xAOD::TauTrack *track){return track->z0sinThetaTJVA(*tau); }); 
+      auto track_z0sinThetaTJVA_abs_log = Monitored::Collection("tracks_z0sinThetaTJVA_abs_log", tracks, [&tau](const xAOD::TauTrack *track){std::cout <<"tracks_z0sinThetaTJVA_abs_log: "<<track->z0sinThetaTJVA(*tau) << std::endl;return track->z0sinThetaTJVA(*tau); }); 
 
       auto track_d0_abs_log = Monitored::Collection("tracks_d0_abs_log", tracks, [](const xAOD::TauTrack *track){return  TMath::Log10( TMath::Abs(track->track()->d0()) + 1e-6); }); 
 
@@ -395,6 +402,31 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string trigger, std::vec
 
 }
 
+void TrigTauMonitorAlgorithm::fillbasicVars(const std::string trigger, std::vector<const xAOD::TauJet*> tau_vec,bool online) const
+{
+  ATH_MSG_DEBUG("Fill Basic Variables: " << trigger); 
+
+  auto monGroup = getGroup(trigger+( online ? "HLT_basicVars" : "Offline_basicVars"));  
+
+
+
+  auto hEFEt           = Monitored::Collection("hEFEt", tau_vec,  [] (const xAOD::TauJet* tau){return tau->pt()/1000; });
+  auto hEFEta          = Monitored::Collection("hEFEta", tau_vec,  [] (const xAOD::TauJet* tau){return tau->eta(); });                                                     
+
+  auto hEFPhi          = Monitored::Collection("hEFPhi", tau_vec,  [] (const xAOD::TauJet* tau){return tau->phi(); });
+  auto hEFnTrack       = Monitored::Collection("hEFnTrack", tau_vec,  [] (const xAOD::TauJet* tau){
+      int EFnTrack=-1;
+      tau->detail(xAOD::TauJetParameters::nChargedTracks, EFnTrack);
+      return EFnTrack; }); 
+  auto hEFnWideTrack   = Monitored::Collection("hEFnWideTrack", tau_vec,  [] (const xAOD::TauJet* tau){
+      int EFWidenTrack(-1);
+      EFWidenTrack = tau->nTracksIsolation();
+      return EFWidenTrack; }); 
+
+  fill(monGroup, hEFEt,hEFEta,hEFPhi,hEFnTrack,hEFnWideTrack);
+
+}
+
 TrigInfo TrigTauMonitorAlgorithm::getTrigInfo(const std::string trigger) const{ 
   return m_trigInfo.at(trigger); 
 }
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.h
index bb51486e5c13d32e3f126f86706c6512d492d0b2..8cdade1c6761d6c02d0b43403f33fce587763d81 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.h
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.h
@@ -49,6 +49,7 @@ class TrigTauMonitorAlgorithm : public AthMonitorAlgorithm {
   void fillRNNInputVars(const std::string trigger, std::vector<const xAOD::TauJet*> tau_vec,const std::string nProng, bool online) const;
   void fillRNNTrack(const std::string trigger, std::vector<const xAOD::TauJet*> tau_vec, bool online) const;
   void fillRNNCluster(const std::string trigger, std::vector<const xAOD::TauJet*> tau_vec, bool online) const;
+  void fillbasicVars(const std::string trigger, std::vector<const xAOD::TauJet*> tau_vec, bool online) const;
   void fillDistributions(std::vector< std::pair< const xAOD::TauJet*, const TrigCompositeUtils::Decision * >> pairObjs, const std::string trigger) const;
 
   inline double dR(const double eta1, const double phi1, const double eta2, const double phi2) const
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/CMakeLists.txt b/Trigger/TrigT1/TrigT1CaloByteStream/CMakeLists.txt
index b725b4445bfacc97cfa7e06ff27364ed6ddf8318..602a537cc03fa5b1d84407e7f59511c6275f23d7 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/CMakeLists.txt
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/CMakeLists.txt
@@ -18,7 +18,7 @@ atlas_add_component( TrigT1CaloByteStream
                      src/xaod/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps AthenaKernel ByteStreamCnvSvcBaseLib ByteStreamData CxxUtils SGTools StoreGateLib TrigT1CaloByteStreamLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1CaloUtilsLib TrigT1Interfaces ZdcByteStreamLib )
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps AthenaKernel ByteStreamCnvSvcBaseLib ByteStreamCnvSvcLib ByteStreamData CxxUtils SGTools StoreGateLib TrigT1CaloByteStreamLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1CaloUtilsLib TrigT1Interfaces ZdcByteStreamLib )
 
 atlas_add_dictionary( TrigT1CaloByteStreamDict
                       TrigT1CaloByteStream/TrigT1CaloByteStreamDict.h
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx
index aa4f10e19a7b6b820ca92dc0e543a33c5640c625..2a15a702a685c7780460eabe9e77c8c51ccfa134 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 CpByteStreamCnv::CpByteStreamCnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("CpByteStreamCnv"),
-      m_tool("LVL1BS::CpByteStreamTool/CpByteStreamTool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::CpByteStreamTool/CpByteStreamTool")
 {
 }
 
@@ -60,7 +59,6 @@ long CpByteStreamCnv::storageType()
 StatusCode CpByteStreamCnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode CpByteStreamCnv::initialize()
 StatusCode CpByteStreamCnv::createRep( DataObject* pObj,
                                         IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::CPBSCollection* cp = 0;
   if( !SG::fromStorable( pObj, cp ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to CPBSCollection";
@@ -86,7 +82,7 @@ StatusCode CpByteStreamCnv::createRep( DataObject* pObj,
   pAddr = addr;
 
   // Convert to ByteStream
-  return m_tool->convert( cp, re );
+  return m_tool->convert( cp );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h
index 2bb844f9462e93f9c56dcc30731ddbea5acd698a..3552b649bfdc3d466a771904e4a7f8cb539d4e66 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h
@@ -59,9 +59,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::CpByteStreamTool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.cxx
index fdb34e00970efa4fc98f7dc5cbe5b64c6ec01364..f63df0b2fb9cbd6489eee8f961ef4f27752e404f 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.cxx
@@ -98,6 +98,7 @@ StatusCode CpByteStreamTool::initialize()
 
   ATH_CHECK( m_cpmMaps.retrieve() );
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -137,16 +138,17 @@ StatusCode CpByteStreamTool::convert(
 
 // Conversion of CP container to bytestream
 
-StatusCode CpByteStreamTool::convert(const LVL1::CPBSCollection* const cp,
-                                           RawEventWrite* const re) const
+StatusCode CpByteStreamTool::convert(const LVL1::CPBSCollection* const cp) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "CpByteStream") );
   const uint16_t minorVersion = m_srcIdMap.minorVersion();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -222,7 +224,7 @@ StatusCode CpByteStreamTool::convert(const LVL1::CPBSCollection* const cp,
         userHeader.setCpm(trigCpmNew);
 	const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
 	                                                        m_subDetector);
-	theROD = fea.getRodData(rodIdCpm);
+	theROD = fea->getRodData(rodIdCpm);
 	theROD->push_back(userHeader.header());
       }
       if (debug) msg() << "Module " << module << endmsg;
@@ -413,10 +415,6 @@ StatusCode CpByteStreamTool::convert(const LVL1::CPBSCollection* const cp,
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.h
index f6b3483b4109893e68bab8c31c925191710c941d..db4956f923413e6815a547d0b7f4734313aa10fe 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamTool.h
@@ -14,6 +14,7 @@
 #include "L1CaloSrcIdMap.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -75,12 +76,15 @@ class CpByteStreamTool : public AthAlgTool {
                       DataVector<LVL1::CMMCPHits>* hitCollection) const;
 
    /// Convert CP Container to bytestream
-   StatusCode convert(const LVL1::CPBSCollection* cp, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::CPBSCollection* cp) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs() const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
    struct LocalData
    {
      /// Tower channels to accept (1=Core, 2=Overlap)
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx
index 637d5bd0ecb964c86611fb820792c855f1e7d732..5ebacd113ad9e4864661681ea5a1d248c1fd9197 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 CpByteStreamV1Cnv::CpByteStreamV1Cnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("CpByteStreamV1Cnv"),
-      m_tool("LVL1BS::CpByteStreamV1Tool/CpByteStreamV1Tool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::CpByteStreamV1Tool/CpByteStreamV1Tool")
 {
 }
 
@@ -60,7 +59,6 @@ long CpByteStreamV1Cnv::storageType()
 StatusCode CpByteStreamV1Cnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode CpByteStreamV1Cnv::initialize()
 StatusCode CpByteStreamV1Cnv::createRep( DataObject* pObj,
                                         IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::CPBSCollectionV1* cp = 0;
   if( !SG::fromStorable( pObj, cp ) ) {
     REPORT_ERROR (StatusCode::FAILURE) <<  "Cannot cast to CPBSCollectionV1";
@@ -86,7 +82,7 @@ StatusCode CpByteStreamV1Cnv::createRep( DataObject* pObj,
   pAddr = addr;
 
   // Convert to ByteStream
-  return m_tool->convert( cp, re );
+  return m_tool->convert( cp );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h
index f5a2af4f15edfcf1e34c7648e34bdcc000d7801d..c1806828a515022313042bdd6f6d49fcd9b78068 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h
@@ -52,9 +52,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::CpByteStreamV1Tool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.cxx
index 762bf0b171b33c8d5d88cb7bd095aa9facfea595..2d952995abfe02bfba1e72b9e12b7945eb71f7a0 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.cxx
@@ -103,6 +103,7 @@ StatusCode CpByteStreamV1Tool::initialize()
 
   ATH_CHECK( m_cpmMaps.retrieve() );
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -142,16 +143,17 @@ StatusCode CpByteStreamV1Tool::convert(
 
 // Conversion of CP container to bytestream
 
-StatusCode CpByteStreamV1Tool::convert(const LVL1::CPBSCollectionV1* const cp,
-                                             RawEventWrite* const re) const
+StatusCode CpByteStreamV1Tool::convert(const LVL1::CPBSCollectionV1* const cp) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "CpByteStreamV1") );
   const uint16_t minorVersion = m_srcIdMap.minorVersionPreLS1();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -226,7 +228,7 @@ StatusCode CpByteStreamV1Tool::convert(const LVL1::CPBSCollectionV1* const cp,
         userHeader.setCpm(trigCpmNew);
 	const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                                       m_subDetector);
-	theROD = fea.getRodData(rodIdCpm);
+	theROD = fea->getRodData(rodIdCpm);
 	theROD->push_back(userHeader.header());
       }
       if (debug) msg() << "Module " << module << endmsg;
@@ -417,10 +419,6 @@ StatusCode CpByteStreamV1Tool::convert(const LVL1::CPBSCollectionV1* const cp,
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.h
index d799c2cbafdba623fa4bf3eef4e5976239c2a5bf..eae1de979d10d359816d7b974f8b5f4bfc32b613 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Tool.h
@@ -15,6 +15,7 @@
 #include "TrigT1CaloUtils/TriggerTowerKey.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -76,12 +77,15 @@ class CpByteStreamV1Tool : public AthAlgTool {
                       DataVector<LVL1::CMMCPHits>* hitCollection) const;
 
    /// Convert CP Container to bytestream
-   StatusCode convert(const LVL1::CPBSCollectionV1* cp, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::CPBSCollectionV1* cp) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs() const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
    struct LocalData
    {
      /// Tower channels to accept (1=Core, 2=Overlap)
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx
index 36d9aad6afbe1c8284b3382606127df0c3a0142a..397f75c8e627eb55b43c068c2fdd75e746779a06 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 CpByteStreamV2Cnv::CpByteStreamV2Cnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("CpByteStreamV2Cnv"),
-      m_tool("LVL1BS::CpByteStreamV2Tool/CpByteStreamV2Tool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::CpByteStreamV2Tool/CpByteStreamV2Tool")
 {
 }
 
@@ -61,7 +60,6 @@ StatusCode CpByteStreamV2Cnv::initialize()
 {
   StatusCode sc = Converter::initialize();
   ATH_CHECK( sc.isFailure() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -72,8 +70,6 @@ StatusCode CpByteStreamV2Cnv::initialize()
 StatusCode CpByteStreamV2Cnv::createRep( DataObject* pObj,
                                          IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::CPBSCollectionV2* cp = 0;
   if( !SG::fromStorable( pObj, cp ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to CPBSCollectionV2";
@@ -87,7 +83,7 @@ StatusCode CpByteStreamV2Cnv::createRep( DataObject* pObj,
   pAddr = addr;
 
   // Convert to ByteStream
-  return m_tool->convert( cp, re );
+  return m_tool->convert( cp );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h
index 7b83f410f1851d4db82fc16ae456a2907570eb34..32d30a799defd1f10f1695ad4f11e6de3433e120 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h
@@ -53,9 +53,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::CpByteStreamV2Tool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx
index 7b244a24693472ad9bed087d0cbdcbb0ee6602f3..b7c93f0174f8655edab1d41c7bba89954494f3ef 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.cxx
@@ -108,6 +108,7 @@ StatusCode CpByteStreamV2Tool::initialize()
     CHECK(m_cpmMaps.retrieve());
     CHECK(m_errorTool.retrieve());
     CHECK(m_robDataProvider.retrieve());
+    ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
     
     return StatusCode::SUCCESS;
 }
@@ -180,17 +181,17 @@ StatusCode CpByteStreamV2Tool::convert(
 
 // Conversion of CP container to bytestream
 
-StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp,
-                                       RawEventWrite *const re) const
+StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp) const
 {
     const bool debug = msgLvl(MSG::DEBUG);
     if (debug) msg(MSG::DEBUG);
 
-    // Clear the event assembler
-    FullEventAssembler<L1CaloSrcIdMap> fea;
-    fea.clear();
+    // Get the event assembler
+    FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+    ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                          "CpByteStreamV2") );
     const uint16_t minorVersion = m_srcIdMap.minorVersion();
-    fea.setRodMinorVersion(minorVersion);
+    fea->setRodMinorVersion(minorVersion);
 
     // Pointer to ROD data vector
 
@@ -272,7 +273,7 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp,
                 userHeader.setCpm(trigCpmNew);
                 const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                           m_subDetector);
-                theROD = fea.getRodData(rodIdCpm);
+                theROD = fea->getRodData(rodIdCpm);
                 theROD->push_back(userHeader.header());
             }
             if (debug) msg() << "Module " << module << endmsg;
@@ -475,10 +476,6 @@ StatusCode CpByteStreamV2Tool::convert(const LVL1::CPBSCollectionV2 *const cp,
         }
     }
 
-    // Fill the raw event
-
-    fea.fill(re, msg());
-
     return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h
index 12df1b1cf10f18c3292c138da41d60e05a855ae8..2a4f3de855e90c6400b08033767df34200aa2d15 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Tool.h
@@ -15,6 +15,7 @@
 #include "L1CaloSrcIdMap.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -81,12 +82,15 @@ class CpByteStreamV2Tool : public AthAlgTool {
                       DataVector<LVL1::CMXCPHits>* hitCollection) const;
 
    /// Convert CP Container to bytestream
-   StatusCode convert(const LVL1::CPBSCollectionV2* cp, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::CPBSCollectionV2* cp) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs() const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
    struct LocalData
    {
      /// Tower channels to accept (1=Core, 2=Overlap)
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx
index 62d3ba80fba4e87d11a85ff26fc3e3e9d941d19b..ea8b129c2c7a981867647b1c50e64e68388a54e7 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx
@@ -37,7 +37,6 @@ CpmRoiByteStreamCnv::CpmRoiByteStreamCnv( ISvcLocator* svcloc )
       m_name("CpmRoiByteStreamCnv"),
       m_tool("LVL1BS::CpmRoiByteStreamTool/CpmRoiByteStreamTool"),
       m_robDataProvider("ROBDataProviderSvc", m_name),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name),
       m_debug(false)
 {
 }
@@ -66,7 +65,6 @@ StatusCode CpmRoiByteStreamCnv::initialize()
   m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG;
 
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   // Get ROBDataProvider
@@ -128,8 +126,6 @@ StatusCode CpmRoiByteStreamCnv::createObj( IOpaqueAddress* pAddr,
 StatusCode CpmRoiByteStreamCnv::createRep( DataObject* pObj,
                                         IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   DataVector<LVL1::CPMRoI>* roiCollection = 0;
   if( !SG::fromStorable( pObj, roiCollection ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to DataVector<CPMRoI>";
@@ -138,12 +134,10 @@ StatusCode CpmRoiByteStreamCnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( roiCollection, re );
+  return m_tool->convert( roiCollection );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h
index 193989e3864e29d5977297d37406569398be27d4..9cca5c66fb50ba6ff87be34fcc1f96fc6e7865c7 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h
@@ -65,12 +65,9 @@ private:
 
   /// Service for reading bytestream
   ServiceHandle<IROBDataProviderSvc> m_robDataProvider;
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 
   /// Message log
   bool m_debug;
-
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.cxx
index a23c4cd0718885888a65663419afed08295837b3..8548442089a03fa913f86c2fc15cb1ff4ea22ec3 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.cxx
@@ -81,6 +81,7 @@ StatusCode CpmRoiByteStreamTool::initialize()
                 << PACKAGE_VERSION);
 
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -258,17 +259,18 @@ StatusCode CpmRoiByteStreamTool::convert(
 // Convert CPM RoI to bytestream
 
 StatusCode CpmRoiByteStreamTool::convert(
-           const DataVector<LVL1::CPMRoI>* const roiCollection,
-	   RawEventWrite* const re) const
+           const DataVector<LVL1::CPMRoI>* const roiCollection) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
+  // Get the event assembler
 
-  FullEventAssembler<L1CaloSrcIdMap> fea;
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "CpmRoiByteStream") );
   const uint16_t minorVersion = m_srcIdMap.minorVersion();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -310,7 +312,7 @@ StatusCode CpmRoiByteStreamTool::convert(
         }
 	const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
 	                                                        m_subDetector);
-	theROD = fea.getRodData(rodIdCpm);
+	theROD = fea->getRodData(rodIdCpm);
 	if (neutralFormat) {
           const L1CaloUserHeader userHeader;
 	  theROD->push_back(userHeader.header());
@@ -355,10 +357,6 @@ StatusCode CpmRoiByteStreamTool::convert(
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.h
index e2d38a4e3fa3c4a706d8c9e7c8b8e3812f306a85..ac0119a75f10d4b789fb1d522b8e10952a091365 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamTool.h
@@ -14,6 +14,7 @@
 #include "L1CaloSrcIdMap.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -60,13 +61,14 @@ class CpmRoiByteStreamTool : public AthAlgTool {
                       DataVector<LVL1::CPMRoI>* roiCollection) const;
 
    /// Convert CPM RoI to bytestream
-   StatusCode convert(const DataVector<LVL1::CPMRoI>* roiCollection,
-                      RawEventWrite* re) const;
+   StatusCode convert(const DataVector<LVL1::CPMRoI>* roiCollection) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
 
    typedef DataVector<LVL1::CPMRoI>                      CpmRoiCollection;
    typedef std::map<uint32_t, const LVL1::CPMRoI*>       CpmRoiMap;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx
index de4f2977fda595ec8bb3d8be591e368e9d5cb8c5..f85f3e17c1af28b24a2be120339ac6cc9022f82d 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx
@@ -37,7 +37,6 @@ CpmRoiByteStreamV1Cnv::CpmRoiByteStreamV1Cnv( ISvcLocator* svcloc )
       m_name("CpmRoiByteStreamV1Cnv"),
       m_tool("LVL1BS::CpmRoiByteStreamV1Tool/CpmRoiByteStreamV1Tool"),
       m_robDataProvider("ROBDataProviderSvc", m_name),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name),
       m_debug(false)
 {
 }
@@ -66,7 +65,6 @@ StatusCode CpmRoiByteStreamV1Cnv::initialize()
   m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG;
 
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK(  m_tool.retrieve() );
 
   // Get ROBDataProvider
@@ -128,8 +126,6 @@ StatusCode CpmRoiByteStreamV1Cnv::createObj( IOpaqueAddress* pAddr,
 StatusCode CpmRoiByteStreamV1Cnv::createRep( DataObject* pObj,
                                              IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   DataVector<LVL1::CPMRoI>* roiCollection = 0;
   if( !SG::fromStorable( pObj, roiCollection ) ) {
     REPORT_ERROR (StatusCode::FAILURE)  << " Cannot cast to DataVector<CPMRoI>";
@@ -138,12 +134,10 @@ StatusCode CpmRoiByteStreamV1Cnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( roiCollection, re );
+  return m_tool->convert( roiCollection );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h
index c7d5dc1e3b3c102bf5ea57227571c659fc9d45c1..ec52c70eed68e91097c54d4a7785e9a578f74670 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h
@@ -59,12 +59,9 @@ private:
 
   /// Service for reading bytestream
   ServiceHandle<IROBDataProviderSvc> m_robDataProvider;
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 
   /// Message log
   bool m_debug;
-
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.cxx
index c441b6957d02dcc5d63bcacfb2c35ad6c9a3389e..62bbc22621f37213ec90bf80383df940e53cbb0c 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.cxx
@@ -87,6 +87,7 @@ StatusCode CpmRoiByteStreamV1Tool::initialize()
                 << PACKAGE_VERSION);
 
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -270,17 +271,18 @@ StatusCode CpmRoiByteStreamV1Tool::convert(
 // Convert CPM RoI to bytestream
 
 StatusCode CpmRoiByteStreamV1Tool::convert(
-           const DataVector<LVL1::CPMRoI>* const roiCollection,
-	   RawEventWrite* const re) const
+           const DataVector<LVL1::CPMRoI>* const roiCollection) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
+  // Get the event assembler
 
-  FullEventAssembler<L1CaloSrcIdMap> fea;
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "CpmRoiByteStreamV1") );
   uint16_t minorVersion = m_srcIdMap.minorVersionPreLS1();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -322,7 +324,7 @@ StatusCode CpmRoiByteStreamV1Tool::convert(
         }
 	const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
 	                                                        m_subDetector);
-	theROD = fea.getRodData(rodIdCpm);
+	theROD = fea->getRodData(rodIdCpm);
 	if (neutralFormat) {
           const L1CaloUserHeader userHeader;
 	  theROD->push_back(userHeader.header());
@@ -367,10 +369,6 @@ StatusCode CpmRoiByteStreamV1Tool::convert(
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.h
index d80b57497febd67dd8861bd7f9f195eda4ee9569..818a1b132910310c29944a846a552eee4417b733 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Tool.h
@@ -14,6 +14,7 @@
 #include "L1CaloSrcIdMap.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -60,13 +61,14 @@ class CpmRoiByteStreamV1Tool : public AthAlgTool {
                       DataVector<LVL1::CPMRoI>* roiCollection) const;
 
    /// Convert CPM RoI to bytestream
-   StatusCode convert(const DataVector<LVL1::CPMRoI>* roiCollection,
-                      RawEventWrite* re) const;
+   StatusCode convert(const DataVector<LVL1::CPMRoI>* roiCollection) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
 
    typedef DataVector<LVL1::CPMRoI>                      CpmRoiCollection;
    typedef std::map<uint32_t, const LVL1::CPMRoI*>       CpmRoiMap;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx
index 4ecbe43930e1e582553074c1db256df78b688b52..07a86c82fee2cf1f0cf42899f64cc8703789bf44 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx
@@ -37,7 +37,6 @@ CpmRoiByteStreamV2Cnv::CpmRoiByteStreamV2Cnv( ISvcLocator* svcloc )
       m_name("CpmRoiByteStreamV2Cnv"),
       m_tool("LVL1BS::CpmRoiByteStreamV2Tool/CpmRoiByteStreamV2Tool"),
       m_robDataProvider("ROBDataProviderSvc", m_name),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name),
       m_debug(false)
 {
 }
@@ -66,7 +65,6 @@ StatusCode CpmRoiByteStreamV2Cnv::initialize()
   m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG;
 
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   // Get ROBDataProvider
@@ -128,8 +126,6 @@ StatusCode CpmRoiByteStreamV2Cnv::createObj( IOpaqueAddress* pAddr,
 StatusCode CpmRoiByteStreamV2Cnv::createRep( DataObject* pObj,
                                         IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   DataVector<LVL1::CPMTobRoI>* roiCollection = 0;
   if( !SG::fromStorable( pObj, roiCollection ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to DataVector<CPMTobRoI>";
@@ -138,12 +134,10 @@ StatusCode CpmRoiByteStreamV2Cnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( roiCollection, re );
+  return m_tool->convert( roiCollection );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h
index e97d2c4d8b2ad38eeab21b8ce10ada466e1b1e41..de63a402130564d95529e2f887942e44f7a2cdc6 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h
@@ -59,12 +59,9 @@ private:
 
   /// Service for reading bytestream
   ServiceHandle<IROBDataProviderSvc> m_robDataProvider;
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 
   /// Message log
   bool m_debug;
-
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.cxx
index da54e63937f58485f4f023ec22dda22b260ff310..47086f282a2b196974bb0a7afa6c0666cdf9144c 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.cxx
@@ -93,6 +93,7 @@ StatusCode CpmRoiByteStreamV2Tool::initialize()
                   << PACKAGE_VERSION);
 
     ATH_CHECK( m_errorTool.retrieve() );
+    ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
     return StatusCode::SUCCESS;
 }
@@ -331,16 +332,17 @@ StatusCode CpmRoiByteStreamV2Tool::convert(
 // Convert CPM RoI to bytestream
 
 StatusCode CpmRoiByteStreamV2Tool::convert(
-    const DataVector<LVL1::CPMTobRoI> *const roiCollection,
-    RawEventWrite *const re) const
+    const DataVector<LVL1::CPMTobRoI> *const roiCollection) const
 {
     const bool debug = msgLvl(MSG::DEBUG);
     if (debug) msg(MSG::DEBUG);
 
-    // Clear the event assembler
-    FullEventAssembler<L1CaloSrcIdMap> fea;
+    // Get the event assembler
+    FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+    ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                          "CpmRoiByteStreamV2") );
     const uint16_t minorVersion = m_srcIdMap.minorVersion();
-    fea.setRodMinorVersion(minorVersion);
+    fea->setRodMinorVersion(minorVersion);
 
     // Pointer to ROD data vector
 
@@ -394,7 +396,7 @@ StatusCode CpmRoiByteStreamV2Tool::convert(
                 }
                 const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                           m_subDetector);
-                theROD = fea.getRodData(rodIdCpm);
+                theROD = fea->getRodData(rodIdCpm);
                 if (neutralFormat)
                 {
                     const L1CaloUserHeader userHeader;
@@ -451,9 +453,6 @@ StatusCode CpmRoiByteStreamV2Tool::convert(
         msg() << "Number of RoIs written = " << count << endmsg;
     }
 
-    // Fill the raw event
-
-    fea.fill(re, msg());
     if (debug) msg() << MSG::dec; // fill seems to leave it in hex
 
     return StatusCode::SUCCESS;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.h
index fc56c0a6a8b317d8c8d46cd1f74c728eb6e17bac..8ccd8bbc14dae741549af2d55a137f4129ca4fda 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Tool.h
@@ -14,6 +14,7 @@
 #include "L1CaloSrcIdMap.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -62,13 +63,14 @@ class CpmRoiByteStreamV2Tool : public AthAlgTool {
                       DataVector<LVL1::CPMTobRoI>* roiCollection) const;
 
    /// Convert CPM RoI to bytestream
-   StatusCode convert(const DataVector<LVL1::CPMTobRoI>* roiCollection,
-                      RawEventWrite* re) const;
+   StatusCode convert(const DataVector<LVL1::CPMTobRoI>* roiCollection) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
 
    typedef DataVector<LVL1::CPMTobRoI>                   CpmRoiCollection;
    typedef std::map<uint32_t, const LVL1::CPMTobRoI*>    CpmRoiMap;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx
index 4d079ee4c3f3e1727b9d5583dd30a3edddc4770b..ec28c455b79f2808be74964e961d6f32c7b1160a 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 JepByteStreamCnv::JepByteStreamCnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("JepByteStreamCnv"),
-      m_tool("LVL1BS::JepByteStreamTool/JepByteStreamTool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::JepByteStreamTool/JepByteStreamTool")
 {
 }
 
@@ -60,7 +59,6 @@ long JepByteStreamCnv::storageType()
 StatusCode JepByteStreamCnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK(  m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode JepByteStreamCnv::initialize()
 StatusCode JepByteStreamCnv::createRep( DataObject* pObj,
                                         IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::JEPBSCollection* jep = 0;
   if( !SG::fromStorable( pObj, jep ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPBSCollection";
@@ -81,12 +77,10 @@ StatusCode JepByteStreamCnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( jep, re );
+  return m_tool->convert( jep );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h
index 0e5a5457a5d9f4d72897e3e7e07cf26417007b58..946dd91c08a1bbed87e0f98cadec9f1c3ce4ba50 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h
@@ -59,9 +59,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::JepByteStreamTool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.cxx
index c05177bf7e06fedc23c21f05f3f7c90330b61833..ddca8087365c0a6573bd8ca3afa1c95e43580fcf 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.cxx
@@ -110,6 +110,8 @@ StatusCode JepByteStreamTool::initialize()
     return sc;
   } else msg(MSG::INFO) << "Retrieved tool " << m_errorTool << endmsg;
 
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
+
   return StatusCode::SUCCESS;
 }
 
@@ -178,17 +180,17 @@ StatusCode JepByteStreamTool::convert(
 // Conversion of JEP container to bytestream
 
 // xxx
-StatusCode JepByteStreamTool::convert(const LVL1::JEPBSCollection* const jep,
-                                      RawEventWrite* const re) const
+StatusCode JepByteStreamTool::convert(const LVL1::JEPBSCollection* const jep) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
-  fea.clear();
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "JepByteStream") );
   const uint16_t minorVersion = m_srcIdMap.minorVersion();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -272,7 +274,7 @@ StatusCode JepByteStreamTool::convert(const LVL1::JEPBSCollection* const jep,
         userHeader.setJem(trigJemNew);
         const uint32_t rodIdJem = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                   m_subDetector);
-        theROD = fea.getRodData(rodIdJem);
+        theROD = fea->getRodData(rodIdJem);
         theROD->push_back(userHeader.header());
       }
       if (debug) msg() << "Module " << module << endmsg;
@@ -552,10 +554,6 @@ StatusCode JepByteStreamTool::convert(const LVL1::JEPBSCollection* const jep,
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.h
index e8e3b27f8aa23a8373ea995c5bf35db700fa18ca..7b478e4d86305b253443c693827cef8c404ce5b1 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamTool.h
@@ -15,6 +15,7 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "TrigT1CaloUtils/JetElementKey.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -88,13 +89,16 @@ class JepByteStreamTool : public AthAlgTool {
                       DataVector<LVL1::CMMEtSums>* etCollection) const;
 
    /// Convert JEP Container to bytestream
-   StatusCode convert(const LVL1::JEPBSCollection* jep, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::JEPBSCollection* jep) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs() const;
 
  private:
-   struct LocalData
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
+  struct LocalData
    {
      /// Jet elements to accept (0=Core, 1=Overlap)
      int coreOverlap = 0;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx
index 14ceefa9e1d720e19f233d4acc2ebd05ce360b51..081abbf6a9c35d51ecc33f15c6f1d158e4150c7e 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 JepByteStreamV1Cnv::JepByteStreamV1Cnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("JepByteStreamV1Cnv"),
-      m_tool("LVL1BS::JepByteStreamV1Tool/JepByteStreamV1Tool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::JepByteStreamV1Tool/JepByteStreamV1Tool")
 {
 }
 
@@ -60,7 +59,6 @@ long JepByteStreamV1Cnv::storageType()
 StatusCode JepByteStreamV1Cnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode JepByteStreamV1Cnv::initialize()
 StatusCode JepByteStreamV1Cnv::createRep( DataObject* pObj,
                                           IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::JEPBSCollectionV1* jep = 0;
   if( !SG::fromStorable( pObj, jep ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPBSCollectionV1";
@@ -81,12 +77,10 @@ StatusCode JepByteStreamV1Cnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( jep, re );
+  return m_tool->convert( jep );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h
index 1d8ebb467b25133873828ddb8d09fe0ca0781826..c11fe07d750e04294d45c69d91980638fc1742fb 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h
@@ -53,9 +53,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::JepByteStreamV1Tool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.cxx
index bcd54f35fd88d873f03bb62ecf28787cb73b3ef8..e0e333a15a24c30b3791eaa38059cb56b1379c04 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.cxx
@@ -108,6 +108,7 @@ StatusCode JepByteStreamV1Tool::initialize()
 
   ATH_CHECK( m_jemMaps.retrieve() );
   ATH_CHECK(  m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -176,17 +177,17 @@ StatusCode JepByteStreamV1Tool::convert(
 
 // Conversion of JEP container to bytestream
 
-StatusCode JepByteStreamV1Tool::convert(const LVL1::JEPBSCollectionV1* const jep,
-                                        RawEventWrite* const re) const
+StatusCode JepByteStreamV1Tool::convert(const LVL1::JEPBSCollectionV1* const jep) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
-  fea.clear();
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "JepByteStreamV1") );
   const uint16_t minorVersion = m_srcIdMap.minorVersionPreLS1();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -270,7 +271,7 @@ StatusCode JepByteStreamV1Tool::convert(const LVL1::JEPBSCollectionV1* const jep
         userHeader.setJem(trigJemNew);
         const uint32_t rodIdJem = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                   m_subDetector);
-        theROD = fea.getRodData(rodIdJem);
+        theROD = fea->getRodData(rodIdJem);
         theROD->push_back(userHeader.header());
       }
       if (debug) msg() << "Module " << module << endmsg;
@@ -553,10 +554,6 @@ StatusCode JepByteStreamV1Tool::convert(const LVL1::JEPBSCollectionV1* const jep
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.h
index fc9ebc2a7048c5df1d9c7f1e249c0d6caa57e860..5a874d6425d99f926fbfb1d7b7ea65cad18b87e0 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Tool.h
@@ -15,6 +15,7 @@
 #include "TrigT1CaloUtils/JetElementKey.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -88,13 +89,16 @@ class JepByteStreamV1Tool : public AthAlgTool {
                       DataVector<LVL1::CMMEtSums>* etCollection) const;
 
    /// Convert JEP Container to bytestream
-   StatusCode convert(const LVL1::JEPBSCollectionV1* jep, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::JEPBSCollectionV1* jep) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs() const;
 
  private:
-   struct LocalData
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
+  struct LocalData
    {
      /// Jet elements to accept (0=Core, 1=Overlap)
      int coreOverlap = 0;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx
index 057507e5fc14d38d4d454de62177b3b82369e15d..105167a80de55b71ae179d63c2961c1002f8177f 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 JepByteStreamV2Cnv::JepByteStreamV2Cnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("JepByteStreamV2Cnv"),
-      m_tool("LVL1BS::JepByteStreamV2Tool/JepByteStreamV2Tool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::JepByteStreamV2Tool/JepByteStreamV2Tool")
 {
 }
 
@@ -60,7 +59,6 @@ long JepByteStreamV2Cnv::storageType()
 StatusCode JepByteStreamV2Cnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode JepByteStreamV2Cnv::initialize()
 StatusCode JepByteStreamV2Cnv::createRep( DataObject* pObj,
                                           IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::JEPBSCollectionV2* jep = 0;
   if( !SG::fromStorable( pObj, jep ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPBSCollectionV2";
@@ -81,12 +77,10 @@ StatusCode JepByteStreamV2Cnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( jep, re );
+  return m_tool->convert( jep );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h
index 107bf8dc8af04c6d2e992c1dbc54670a04d54ad0..350f1fcf62b24c8aeed79483b940b91883f6bb21 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h
@@ -53,9 +53,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::JepByteStreamV2Tool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.cxx
index 1c3bcb9344ff37341b818dc482e79757b325b10e..5b08737bcfcc139edcca0e0f1958492f679fd461 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.cxx
@@ -109,6 +109,7 @@ StatusCode JepByteStreamV2Tool::initialize()
 
   ATH_CHECK( m_jemMaps.retrieve() );
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -234,16 +235,17 @@ StatusCode JepByteStreamV2Tool::convert(
 
 // Conversion of JEP container to bytestream
 
-StatusCode JepByteStreamV2Tool::convert(const LVL1::JEPBSCollectionV2* const jep,
-                                        RawEventWrite* const re) const
+StatusCode JepByteStreamV2Tool::convert(const LVL1::JEPBSCollectionV2* const jep) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "JepByteStreamV2") );
   const uint16_t minorVersion = m_srcIdMap.minorVersion();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -327,7 +329,7 @@ StatusCode JepByteStreamV2Tool::convert(const LVL1::JEPBSCollectionV2* const jep
         userHeader.setJem(trigJemNew);
 	const uint32_t rodIdJem = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
 	                                                        m_subDetector);
-	theROD = fea.getRodData(rodIdJem);
+	theROD = fea->getRodData(rodIdJem);
 	theROD->push_back(userHeader.header());
       }
       if (debug) msg() << "Module " << module << endmsg;
@@ -622,10 +624,6 @@ StatusCode JepByteStreamV2Tool::convert(const LVL1::JEPBSCollectionV2* const jep
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.h
index efeeeb3fece44681adde463795f2d5b8f0816f6f..cf08f6c24303f2bf8c3ec4ccd160db77fbbe15f2 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Tool.h
@@ -15,6 +15,7 @@
 #include "TrigT1CaloUtils/JetElementKey.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -99,12 +100,15 @@ class JepByteStreamV2Tool : public AthAlgTool {
                       DataVector<LVL1::CMXEtSums>* etCollection) const;
 
    /// Convert JEP Container to bytestream
-   StatusCode convert(const LVL1::JEPBSCollectionV2* jep, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::JEPBSCollectionV2* jep) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs() const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
   struct LocalData
   {
     /// Jet elements to accept (0=Core, 1=Overlap)
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx
index dab2dc2ce7eebaf11b9a018a2fa6c7893d8c42d7..49e4a67388df51f0c73be05204417618d4f4ee61 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 JepRoiByteStreamCnv::JepRoiByteStreamCnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("JepRoiByteStreamCnv"),
-      m_tool("LVL1BS::JepRoiByteStreamTool/JepRoiByteStreamTool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::JepRoiByteStreamTool/JepRoiByteStreamTool")
 {
 }
 
@@ -60,7 +59,6 @@ long JepRoiByteStreamCnv::storageType()
 StatusCode JepRoiByteStreamCnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode JepRoiByteStreamCnv::initialize()
 StatusCode JepRoiByteStreamCnv::createRep( DataObject* pObj,
                                         IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::JEPRoIBSCollection* jep = 0;
   if( !SG::fromStorable( pObj, jep ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPRoIBSCollection";
@@ -81,12 +77,10 @@ StatusCode JepRoiByteStreamCnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( jep, re );
+  return m_tool->convert( jep );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h
index edb9ce6ef309e23cea6db9eb839ab3e7cd2c7331..bfaa7086bbb35b44dae9886b2a9c93a337bbd820 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h
@@ -59,9 +59,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::JepRoiByteStreamTool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.cxx
index 3fc9985043671c7327223844b97b9ef41186dcd2..89bb4f98cd15a3e44b13321e13a35badd0d7321a 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.cxx
@@ -90,6 +90,7 @@ StatusCode JepRoiByteStreamTool::initialize()
                 << PACKAGE_VERSION );
 
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -122,17 +123,17 @@ StatusCode JepRoiByteStreamTool::convert(
 // Conversion of JEP container to bytestream
 
 StatusCode JepRoiByteStreamTool::convert(
-  const LVL1::JEPRoIBSCollection* const jep,
-  RawEventWrite* const re) const
+  const LVL1::JEPRoIBSCollection* const jep) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
-  fea.clear();
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "JepRoiByteStream") );
   const uint16_t minorVersion = m_srcIdMap.minorVersion();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -181,7 +182,7 @@ StatusCode JepRoiByteStreamTool::convert(
         }
         const uint32_t rodIdJem = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                   m_subDetector);
-        theROD = fea.getRodData(rodIdJem);
+        theROD = fea->getRodData(rodIdJem);
         if (neutralFormat) {
           const L1CaloUserHeader userHeader;
           theROD->push_back(userHeader.header());
@@ -387,10 +388,6 @@ StatusCode JepRoiByteStreamTool::convert(
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.h
index 6ab9c2dccb18c95dab5bf44968f26316d24c0152..acc684c0efc255963017cefdd9dc33341522b800 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamTool.h
@@ -14,6 +14,7 @@
 #include "L1CaloSrcIdMap.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -70,12 +71,15 @@ class JepRoiByteStreamTool : public AthAlgTool {
                       LVL1::CMMRoI* cmCollection) const;
 
    /// Convert JEP RoI Container to bytestream
-   StatusCode convert(const LVL1::JEPRoIBSCollection* jep, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::JEPRoIBSCollection* jep) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
    typedef DataVector<LVL1::JEMRoI>                      JemRoiCollection;
    typedef DataVector<LVL1::CMMJetHits>                  CmmHitsCollection;
    typedef DataVector<LVL1::CMMEtSums>                   CmmSumsCollection;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx
index f4545b970523da54c08391adba7322998936c4e7..1d332a01bd6f68dd3e87daf728d0710a19557da3 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 JepRoiByteStreamV1Cnv::JepRoiByteStreamV1Cnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("JepRoiByteStreamV1Cnv"),
-      m_tool("LVL1BS::JepRoiByteStreamV1Tool/JepRoiByteStreamV1Tool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::JepRoiByteStreamV1Tool/JepRoiByteStreamV1Tool")
 {
 }
 
@@ -60,7 +59,6 @@ long JepRoiByteStreamV1Cnv::storageType()
 StatusCode JepRoiByteStreamV1Cnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK( m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode JepRoiByteStreamV1Cnv::initialize()
 StatusCode JepRoiByteStreamV1Cnv::createRep( DataObject* pObj,
                                              IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::JEPRoIBSCollectionV1* jep = 0;
   if( !SG::fromStorable( pObj, jep ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPRoIBSCollectionV1";
@@ -81,12 +77,10 @@ StatusCode JepRoiByteStreamV1Cnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( jep, re );
+  return m_tool->convert( jep );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h
index 5ab627cda897dcfa46709c29c7be0748100a2bbc..4cf2f15c113af5e404ff774d8aebeddd91f8a5de 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h
@@ -54,9 +54,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::JepRoiByteStreamV1Tool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.cxx
index 352b5aa7756cf772a255bcde25fca8ecfa5eb955..24a1050c315b07ce0614f1b6b3efc110ce955b70 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.cxx
@@ -96,6 +96,7 @@ StatusCode JepRoiByteStreamV1Tool::initialize()
                 << PACKAGE_VERSION);
 
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -128,17 +129,17 @@ StatusCode JepRoiByteStreamV1Tool::convert(
 // Conversion of JEP container to bytestream
 
 StatusCode JepRoiByteStreamV1Tool::convert(
-  const LVL1::JEPRoIBSCollectionV1* const jep,
-  RawEventWrite* const re) const
+  const LVL1::JEPRoIBSCollectionV1* const jep) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
-  fea.clear();
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "JepRoiByteStreamV1") );
   const uint16_t minorVersion = m_srcIdMap.minorVersionPreLS1();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -187,7 +188,7 @@ StatusCode JepRoiByteStreamV1Tool::convert(
         }
         const uint32_t rodIdJem = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                   m_subDetector);
-        theROD = fea.getRodData(rodIdJem);
+        theROD = fea->getRodData(rodIdJem);
         if (neutralFormat) {
           const L1CaloUserHeader userHeader;
           theROD->push_back(userHeader.header());
@@ -390,10 +391,6 @@ StatusCode JepRoiByteStreamV1Tool::convert(
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.h
index 9d6a28ae499e7502826f990cad592ab942d19a55..d1ff9a40a8943af19c7fdc9f80d6a6ea55765238 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Tool.h
@@ -14,6 +14,7 @@
 #include "L1CaloSrcIdMap.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -70,12 +71,15 @@ class JepRoiByteStreamV1Tool : public AthAlgTool {
                       LVL1::CMMRoI* cmCollection) const;
 
    /// Convert JEP RoI Container to bytestream
-   StatusCode convert(const LVL1::JEPRoIBSCollectionV1* jep, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::JEPRoIBSCollectionV1* jep) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
    typedef DataVector<LVL1::JEMRoI>                      JemRoiCollection;
    typedef DataVector<LVL1::CMMJetHits>                  CmmHitsCollection;
    typedef DataVector<LVL1::CMMEtSums>                   CmmSumsCollection;
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx
index 4def9f1d8dae83f97a90ec0965b9879a6684d714..c9cc45eb597228be09fd1bf053fd41006b9ee2c9 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx
@@ -33,8 +33,7 @@ namespace LVL1BS {
 JepRoiByteStreamV2Cnv::JepRoiByteStreamV2Cnv( ISvcLocator* svcloc )
     : Converter( storageType(), classID(), svcloc ),
       m_name("JepRoiByteStreamV2Cnv"),
-      m_tool("LVL1BS::JepRoiByteStreamV2Tool/JepRoiByteStreamV2Tool"),
-      m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name)
+      m_tool("LVL1BS::JepRoiByteStreamV2Tool/JepRoiByteStreamV2Tool")
 {
 }
 
@@ -60,7 +59,6 @@ long JepRoiByteStreamV2Cnv::storageType()
 StatusCode JepRoiByteStreamV2Cnv::initialize()
 {
   ATH_CHECK( Converter::initialize() );
-  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
   ATH_CHECK(  m_tool.retrieve() );
 
   return StatusCode::SUCCESS;
@@ -71,8 +69,6 @@ StatusCode JepRoiByteStreamV2Cnv::initialize()
 StatusCode JepRoiByteStreamV2Cnv::createRep( DataObject* pObj,
                                              IOpaqueAddress*& pAddr )
 {
-  RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent();
-
   LVL1::JEPRoIBSCollectionV2* jep = 0;
   if( !SG::fromStorable( pObj, jep ) ) {
     REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPRoIBSCollectionV2";
@@ -81,12 +77,10 @@ StatusCode JepRoiByteStreamV2Cnv::createRep( DataObject* pObj,
 
   const std::string nm = pObj->registry()->name();
 
-  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
-
-  pAddr = addr;
+  pAddr = new ByteStreamAddress( classID(), nm, "" );
 
   // Convert to ByteStream
-  return m_tool->convert( jep, re );
+  return m_tool->convert( jep );
 }
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h
index b3f17797f9c06c1321d9b5587802ed8aebf5c9af..2cefd9e839660b0e55d3ea54bb9a85e6f948386c 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h
@@ -53,9 +53,6 @@ private:
 
   /// Tool that does the actual work
   ToolHandle<LVL1BS::JepRoiByteStreamV2Tool> m_tool;
-
-  /// Service for writing bytestream
-  ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
 };
 
 } // end namespace
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.cxx
index 5a244a6da7dd8fc4fdd0aed972056ed0fbda21cd..a13ed6edd6dbb905689682ac944234f085d8fe79 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.cxx
@@ -94,6 +94,7 @@ StatusCode JepRoiByteStreamV2Tool::initialize()
                 << PACKAGE_VERSION);
 
   ATH_CHECK( m_errorTool.retrieve() );
+  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
 
   return StatusCode::SUCCESS;
 }
@@ -150,17 +151,17 @@ StatusCode JepRoiByteStreamV2Tool::convert(
 // Conversion of JEP container to bytestream
 
 StatusCode JepRoiByteStreamV2Tool::convert(
-  const LVL1::JEPRoIBSCollectionV2* const jep,
-  RawEventWrite* const re) const
+  const LVL1::JEPRoIBSCollectionV2* const jep) const
 {
   const bool debug = msgLvl(MSG::DEBUG);
   if (debug) msg(MSG::DEBUG);
 
-  // Clear the event assembler
-  FullEventAssembler<L1CaloSrcIdMap> fea;
-  fea.clear();
+  // Get the event assembler
+  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
+  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
+                                                        "JepRoiByteStreamV2") );
   const uint16_t minorVersion = m_srcIdMap.minorVersion();
-  fea.setRodMinorVersion(minorVersion);
+  fea->setRodMinorVersion(minorVersion);
 
   // Pointer to ROD data vector
 
@@ -206,7 +207,7 @@ StatusCode JepRoiByteStreamV2Tool::convert(
         }
         const uint32_t rodIdJem = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
                                   m_subDetector);
-        theROD = fea.getRodData(rodIdJem);
+        theROD = fea->getRodData(rodIdJem);
         if (neutralFormat) {
           const L1CaloUserHeader userHeader;
           theROD->push_back(userHeader.header());
@@ -319,10 +320,6 @@ StatusCode JepRoiByteStreamV2Tool::convert(
     }
   }
 
-  // Fill the raw event
-
-  fea.fill(re, msg());
-
   return StatusCode::SUCCESS;
 }
 
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.h
index f49e6c2de612be6e951c239638750d78e51761bb..9bcfc8d049b3649c1391023cf9f69356b70103ce 100755
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Tool.h
@@ -13,6 +13,7 @@
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
+#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
 #include "ByteStreamData/RawEvent.h"
 #include "AthContainers/DataVector.h"
 #include "eformat/SourceIdentifier.h"
@@ -72,12 +73,15 @@ class JepRoiByteStreamV2Tool : public AthAlgTool {
                       LVL1::CMXRoI* cmCollection) const;
 
    /// Convert JEP RoI Container to bytestream
-   StatusCode convert(const LVL1::JEPRoIBSCollectionV2* jep, RawEventWrite* re) const;
+   StatusCode convert(const LVL1::JEPRoIBSCollectionV2* jep) const;
 
    /// Return reference to vector with all possible Source Identifiers
    const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
 
  private:
+   ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
+   { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
+
    typedef DataVector<LVL1::JEMTobRoI>                   JemRoiCollection;
    typedef DataVector<LVL1::CMXEtSums>                   CmxSumsCollection;
    typedef std::map<uint32_t, const LVL1::JEMTobRoI*>    JemRoiMap;
diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 1fdbf0dd4623c1be090390d909cfad5bfb02dd42..b50022aafc5954df0ff1c50257c760cf68092514 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -118,6 +118,7 @@ class TrigInDetAna(AthenaCheckerStep):
         AthenaCheckerStep.__init__(self, name, 'TrigInDetValidation/TrigInDetValidation_AODtoTrkNtuple.py')
         self.max_events=-1
         self.required = True
+        self.depends_on_previous = False
         self.input_file = in_file
 
 ##################################################
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index 30031821161bb8b6cae509da3aad0e34e9ae4fc5..5a58b88f36b603abb09d32bdc46554787a3d7b08 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -83,6 +83,8 @@ TriggerHLTListRun3 = [
     ('xAOD::TrigDecision#xTrigDecision' ,                    'ESD AODFULL AODSLIM', 'Steer'),
     ('xAOD::TrigDecisionAuxInfo#xTrigDecisionAux.',          'ESD AODFULL AODSLIM', 'Steer'),
     ('xAOD::TrigConfKeys#TrigConfKeys' ,                     'ESD AODFULL AODSLIM', 'Steer'),
+    ('xAOD::TrigCompositeContainer#HLT_EBWeight',            'ESD AODFULL AODSLIM', 'Steer'),
+    ('xAOD::TrigCompositeAuxContainer#HLT_EBWeightAux.EBWeight.EBUnbiased', 'ESD AODFULL AODSLIM', 'Steer'),
     ('xAOD::TrigConfKeys#TrigConfKeysOnline' ,               'BS ESD AODFULL AODSLIM', 'Steer'),
 
     ('TrigRoiDescriptorCollection#HLT_EMRoIs',                   'BS ESD AODFULL AODSLIM',  'Steer'),
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
index 7000180542862e648a1f2c20831064a91a64a441..d36900c6b439bdd1238da26decc9495a235c89df 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
@@ -489,6 +489,16 @@ class TriggerConfigGetter(Configured):
                                 ]
                 objKeyStore.addManyTypesMetaData( metadataItems )
 
+            if TriggerFlags.EDMDecodingVersion() >= 3:
+                from TrigEDMConfig.TriggerEDMRun3 import recordable
+                from AthenaConfiguration.ComponentFactory import CompFactory
+                from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
+
+                enhancedBiasWeightCompAlg = CompFactory.EnhancedBiasWeightCompAlg()
+                enhancedBiasWeightCompAlg.EBWeight = recordable("HLT_EBWeight")
+
+                topAlgs += conf2toConfigurable( enhancedBiasWeightCompAlg )
+
         except ImportError: # don't want to branch in rel 18
             pass
 
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 5b5c3d7e80507ef0cba506185cb61d2378e9df51..ca391ea9b078acf96d6bd388f00dd28e6be9a9ef 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -182,6 +182,7 @@ if not ConfigFlags.Input.isMC:
     globalflags.DatabaseInstance='CONDBR2' if opt.useCONDBR2 else 'COMP200'
     ConfigFlags.IOVDb.DatabaseInstance=globalflags.DatabaseInstance()
 athenaCommonFlags.isOnline.set_Value_and_Lock(opt.isOnline)
+ConfigFlags.Common.isOnline = athenaCommonFlags.isOnline()
 
 log.info('Configured the following global flags:')
 globalflags.print_JobProperties()
@@ -349,26 +350,6 @@ if not hasattr(topSequence,"SGInputLoader"):
     theApp.exit(1)
 topSequence.SGInputLoader.FailIfNoProxy = opt.failIfNoProxy
 
-
-#--------------------------------------------------------------
-# Event Info setup
-#--------------------------------------------------------------
-# If no xAOD::EventInfo is found in a POOL file, schedule conversion from old EventInfo
-if ConfigFlags.Input.Format == 'POOL':
-    from RecExConfig.ObjKeyStore import objKeyStore
-    from PyUtils.MetaReaderPeeker import convert_itemList
-    objKeyStore.addManyTypesInputFile(convert_itemList(layout='#join'))
-    if objKeyStore.isInInput("xAOD::EventInfo"):
-        topSequence.SGInputLoader.Load += [( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' )]
-    else:
-        from AthenaCommon.AlgSequence import AthSequencer
-        condSeq = AthSequencer("AthCondSeq")
-        if not hasattr(condSeq, "xAODMaker::EventInfoCnvAlg"):
-            from xAODEventInfoCnv.xAODEventInfoCnvAlgDefault import xAODEventInfoCnvAlgDefault
-            xAODEventInfoCnvAlgDefault(sequence=condSeq)
-else:
-    topSequence.SGInputLoader.Load += [( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' )]
-
 # ----------------------------------------------------------------
 # Detector geometry
 # ----------------------------------------------------------------
@@ -442,16 +423,40 @@ from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
 CAtoGlobalWrapper(L1ConfigSvcCfg,ConfigFlags)
 
 # ---------------------------------------------------------------
-# HLT prep: RoIBResult and L1Decoder
+# Create main sequences
 # ---------------------------------------------------------------
-
-# main HLT top sequence
 from AthenaCommon.CFElements import seqOR,parOR
 hltTop = seqOR("HLTTop")
 hltBeginSeq = parOR("HLTBeginSeq")
 hltTop += hltBeginSeq
 topSequence += hltTop
 
+# ---------------------------------------------------------------
+# Event Info setup
+# ---------------------------------------------------------------
+# If no xAOD::EventInfo is found in a POOL file, schedule conversion from old EventInfo
+if ConfigFlags.Input.Format == 'POOL':
+    from RecExConfig.ObjKeyStore import objKeyStore
+    from PyUtils.MetaReaderPeeker import convert_itemList
+    objKeyStore.addManyTypesInputFile(convert_itemList(layout='#join'))
+    if objKeyStore.isInInput("xAOD::EventInfo"):
+        topSequence.SGInputLoader.Load += [( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' )]
+    else:
+        if not hasattr(hltBeginSeq, "xAODMaker::EventInfoCnvAlg"):
+            from xAODEventInfoCnv.xAODEventInfoCnvAlgDefault import xAODEventInfoCnvAlgDefault
+            xAODEventInfoCnvAlgDefault(sequence=hltBeginSeq)
+else:
+    topSequence.SGInputLoader.Load += [( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' )]
+
+# ---------------------------------------------------------------
+# Add LumiBlockMuWriter creating xAOD::EventInfo decorations for pileup values
+# ---------------------------------------------------------------
+from LumiBlockComps.LumiBlockMuWriterDefault import LumiBlockMuWriterDefault
+LumiBlockMuWriterDefault(sequence=hltBeginSeq)
+
+# ---------------------------------------------------------------
+# Add L1Decoder providing inputs to HLT
+# ---------------------------------------------------------------
 if opt.doL1Unpacking:
     if ConfigFlags.Input.Format == 'BS' or opt.doL1Sim:
         ConfigFlags.Trigger.L1Decoder.forceEnableAllChains = opt.forceEnableAllChains
@@ -628,11 +633,6 @@ include("TriggerTest/disableChronoStatSvcPrintout.py")
 if ConfigFlags.Input.isMC:
     svcMgr.MessageSvc.setError += ['HepMcParticleLink']
 
-#-------------------------------------------------------------
-# Enable xAOD::EventInfo decorations for pileup values
-#-------------------------------------------------------------
-include ("LumiBlockComps/LumiBlockMuWriter_jobOptions.py")
-
 #-------------------------------------------------------------
 # Apply modifiers
 #-------------------------------------------------------------
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
index 978d8f603141be59f6a39c0e5296e9a5305c2f6b..8a58635cbda9a7c2276e1f1df9674a4451f4c867 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
@@ -3,9 +3,6 @@
 # Declare the package name:
 atlas_subdir( TriggerMenuMT )
 
-# External dependencies:
-find_package( six )
-
 atlas_add_test( flake8
    SCRIPT flake8 --select=ATL,F,E7,E9,W6,E101 --enable-extension=ATL900,ATL901,ATL902
    ${CMAKE_CURRENT_SOURCE_DIR}/python ${CMAKE_CURRENT_SOURCE_DIR}/scripts
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py
index 07e528d660e5a49f03bca4172ffdcc0dbf86303c..f4f3a71a5579223056018c55df1fff3ff7cb3de6 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
@@ -29,7 +29,7 @@ class BjetChainConfiguration(ChainConfigurationBase):
     # Assemble the chain depending on information from chainName
     # ----------------------
     def assembleChain(self):                            
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         # --------------------
         # define here the names of the steps and obtain the chainStep configuration 
@@ -64,7 +64,7 @@ class BjetChainConfiguration(ChainConfigurationBase):
     # --------------------
     def getBjetSequence(self):
         stepName = "Step2_bjet"
-        log.debug("Configuring step " + stepName)
+        log.debug("Configuring step %s", stepName)
         
         return self.getStep(2, stepName, [bjetSequenceCfg])        
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsDef.py
index 64b514870e3dbc9c22eaba4c3e4ae929cfe000af..10bddb46f2a60e4095eacb824f4279c71000939e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsDef.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ########################################################################
 #
@@ -35,7 +35,7 @@ class BphysicsChainConfiguration(MuonChainConfiguration):
     # ----------------------
     def assembleBphysChain(self):
 
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         stepDictionary = self.getBphysStepDictionary()
         key = self.getBphysKey()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py
index 41fce5817ef833cce87552861c5a0d3095423e5e..c1cd7911254bb0f0d54d86323009c87ada44ca60 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
@@ -83,7 +83,7 @@ class BeamspotChainConfiguration(ChainConfigurationBase):
     # ----------------------
     def assembleChain(self):                            
         chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         stepDictionary = self.getStepDictionary()
       
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
index bf77bfef96571fabf3c91684730a248a67fb3b3f..1108806ab7fc52ef43b74aa785eddf3c3f5cbcec 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CalibChainConfiguration.py
@@ -18,7 +18,7 @@ class CalibChainConfiguration(ChainConfigurationBase):
     def assembleChain(self):       
                          
         chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
         if self.chainPartName == 'larnoiseburst':
            chainSteps.append(self.getLArNoiseBurst())
         myChain = self.buildChain(chainSteps)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CosmicChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CosmicChainConfiguration.py
index 333d56e5cdd5f689e751cc922aa05e4294df2056..a682b80081f1d62cdef38a79daeabaedfee23a68 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CosmicChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/CosmicChainConfiguration.py
@@ -18,7 +18,7 @@ class CosmicChainConfiguration(ChainConfigurationBase):
     def assembleChain(self):       
                          
         chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
         # --------------------
         # define here the names of the steps and obtain the chainStep configuration 
         # --------------------
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py
index 53fa0c40e0a6ad840025941f2c35ddd3aec4b0a1..656d3dcd85321ee5f0c8437cc3cda3c0b85e4241 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/EnhancedBiasChainConfiguration.py
@@ -122,7 +122,7 @@ class EnhancedBiasChainConfiguration(ChainConfigurationBase):
 
     def assembleChain(self):
         chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         chainSteps.append( self.getStep(1,"EnhancedBias", [enahncedBiasSequence_Cfg]) )
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py
index 97f82f80bc9c3ce9b4076ca13b085f2182eea23b..1edc59f84bb49acb74d52d241bb14817e594ee12 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py
@@ -47,7 +47,7 @@ class MonitorChainConfiguration(ChainConfigurationBase):
     # ----------------------
     def assembleChain(self):                            
         chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         if self.chainPartName == 'costmonitor':
             pass  # costmonitor is a streamer so has no steps
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py
index 3b2f0f9dbb398d8fe215f89c36849aefd1317e2f..5fa74ab7687d7d0e18285847ef021abbb2cd8ad9 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py
@@ -27,7 +27,7 @@ def TrigElectronSelectors(sel):
     # Configure the LH selectors
     from AthenaCommon import CfgMgr
     #TrigEgammaKeys.pidVersion.set_On()
-    mlog.info("TrigEgammaPidTools version " + str(TrigEgammaKeys.pidVersion))
+    mlog.info("TrigEgammaPidTools version %s", TrigEgammaKeys.pidVersion)
     ConfigFilePath = 'ElectronPhotonSelectorTools/trigger/'+TrigEgammaKeys.pidVersion
     
     SelectorNames = {
@@ -47,10 +47,10 @@ def TrigElectronSelectors(sel):
 
     mlog.info('Configuring electron PID tools...')
     if sel not in SelectorNames:
-        mlog.error('No selector defined for working point '+sel+' for electrons :-( ')
+        mlog.error('No selector defined for working point %s for electrons :-( ', sel)
         return
     else:
-        mlog.info('Configuring electron PID for '+sel)
+        mlog.info('Configuring electron PID for %s', sel)
         SelectorTool=CfgMgr.AsgElectronLikelihoodTool(SelectorNames[sel])
         SelectorTool.ConfigFile = ConfigFilePath + '/' + ElectronToolConfigFile[sel]
         SelectorTool.usePVContainer = False 
@@ -93,14 +93,14 @@ def TrigPhotonSelectors(sel):
 
     mlog.info('Configuring photon PID tools...')
     if sel not in SelectorNames:
-        mlog.error('No selector defined for working point '+sel+' for photons :-( ')
+        mlog.error('No selector defined for working point %s for photons :-( ', sel)
         return
     else:
-        mlog.info('Configuring photon PID for '+sel)
+        mlog.info('Configuring photon PID for %s', sel)
         SelectorTool = ConfiguredAsgPhotonIsEMSelector(SelectorNames[sel], SelectorPID[sel])
         ConfigFilePath = 'ElectronPhotonSelectorTools/trigger/'+TrigEgammaKeys.pidVersion
         ConfigFile = ConfigFilePath + '/' + PhotonToolConfigFile[sel] 
-        mlog.info('Configuration file: '+ConfigFile)
+        mlog.info('Configuration file: %s', ConfigFile)
         SelectorTool.ConfigFile = ConfigFile
         SelectorTool.ForceConvertedPhotonPID = True
         SelectorTool.isEMMask = PhotonIsEMBits[sel] 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
index 6bf1450f6ab1e9300bf6fb25cd64ebe5e9bb5ccb..2cd2fadec6b5d8376e3fc70e63abe6fd7189f9cd 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
@@ -61,7 +61,7 @@ class ElectronChainConfiguration(ChainConfigurationBase):
     # ----------------------
     def assembleChain(self):
         chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         # --------------------
         # define here the names of the steps and obtain the chainStep configuration
@@ -90,21 +90,21 @@ class ElectronChainConfiguration(ChainConfigurationBase):
                 'lhtightivartight'   : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionTracking', 'getPrecisionElectron'],
                 }
 
-        log.debug('electron chain part = ' + str(self.chainPart))
+        log.debug('electron chain part = %s', self.chainPart)
         key = self.chainPart['extra'] + self.chainPart['IDinfo'] + self.chainPart['L2IDAlg'] + self.chainPart['isoInfo']
 
 
         for addInfo in self.chainPart['addInfo']:
             key+=addInfo
 
-        log.debug('electron key = ' + key)
+        log.debug('electron key = %s', key)
         if key in stepDictionary:
             steps=stepDictionary[key]
         else:
             raise RuntimeError("Chain configuration unknown for electron chain with key: " + key )
         
         for step in steps:
-            log.debug('Adding electron trigger step ' + str(step))
+            log.debug('Adding electron trigger step %s', step)
             chainstep = getattr(self, step)()
             chainSteps+=[chainstep]
 
@@ -136,7 +136,7 @@ class ElectronChainConfiguration(ChainConfigurationBase):
     def getPrecisionElectron(self):
 
         isocut = self.chainPart['isoInfo']
-        log.debug(' isolation cut = ' + str(isocut))
+        log.debug(' isolation cut = %s', isocut)
 
         if "Zee" in self.chainName:
             stepName = "precision_topoelectron"+isocut
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py
index d5505e52f60b135acb4e1ca2ce486f1bea61a367..fb82bd518e21e6b603078cf45d180f32f4e192d2 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 
 from AthenaCommon.Logging import logging
@@ -53,7 +53,7 @@ class PhotonChainConfiguration(ChainConfigurationBase):
     # Assemble the chain depending on information from chainName
     # ----------------------
     def assembleChain(self):                            
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         # --------------------
         # define here the names of the steps and obtain the chainStep configuration 
@@ -76,12 +76,12 @@ class PhotonChainConfiguration(ChainConfigurationBase):
         }
         
         ## This needs to be configured by the Egamma Developer!!
-        log.debug('photon chain part = ' + str(self.chainPart))
+        log.debug('photon chain part = %s', self.chainPart)
         key = self.chainPart['extra'] + self.chainPart['IDinfo'] + self.chainPart['isoInfo']
         for addInfo in self.chainPart['addInfo']:
             key+=addInfo
             
-        log.debug('photon key = ' + key)
+        log.debug('photon key = %s', key)
         if key in stepDictionary:
             steps=stepDictionary[key]
         else:
@@ -90,7 +90,7 @@ class PhotonChainConfiguration(ChainConfigurationBase):
         chainSteps = []
 
         for step in steps:
-            log.debug('Adding photon trigger step ' + str(step))
+            log.debug('Adding photon trigger step %s', step)
             chainstep = getattr(self, step)()
             chainSteps+=[chainstep]
     
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
index feef2d17126acd1e046da1dac8ed1ea10d20918c..e3754153984ee8a2ebe427dd36352a9af3341949 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
@@ -56,7 +56,7 @@ class JetChainConfiguration(ChainConfigurationBase):
     # Assemble the chain depending on information from chainName
     # ----------------------
     def assembleChain(self):                            
-        log.debug("Assembling chain " + self.chainName)
+        log.debug("Assembling chain %s", self.chainName)
 
         # --------------------
         # define here the names of the steps and obtain the chainStep configuration 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
index 1d6109a0dcc4485c00877e343afc7ef59f49f0bc..d02b8838e59359d972a551e8c3058018f2c51b48 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py
@@ -33,8 +33,7 @@ def extractRecoDict(chainParts):
                 # found the key, check for consistency with other chain parts of this chain
                 if k in recoDict.keys():
                     if p[k] != recoDict[k]:
-                        log.error('Inconsistent reco setting for' + k)
-                        exit(1)
+                        raise RuntimeError('Inconsistent reco setting for %s' % k)
                 # copy this entry to the reco dictionary
                 recoDict[k] = p[k]
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/ConfigHelpers.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/ConfigHelpers.py
index 683dbad2d431c8af3c0201246c2b866f4b9c9a74..a502306913d06ff9938c33db0c37be815fc2c0df 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/ConfigHelpers.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/ConfigHelpers.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 """ Helper functions for configuring MET chains
 """
@@ -124,7 +124,7 @@ class AlgConfig(ABC):
 
         inputMakers = self.inputMakers()
         # Retrieve the inputss
-        log.verbose(f"Create inputs for {self._suffix}")
+        log.verbose("Create inputs for %s", self._suffix)
         steps, inputs = self.inputRegistry.build_steps(
             self._inputs, metFSRoIs, self.recoDict
         )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METChainConfiguration.py
index 1f8d05ba344bee160e820febda14cf12f2c90881..c9f414318a3099b09b9a43d8d7c2c602d604a1a8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METChainConfiguration.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
 
@@ -38,6 +38,6 @@ class METChainConfiguration(ChainConfigurationBase):
     # Assemble the chain depending on information from chainName
     # ----------------------
     def assembleChain(self):
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
         conf = AlgConfig.fromRecoDict(**self.recoDict)
         return self.buildChain(conf.make_steps(self.dict))
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
index c3553ff78002a65c4f259830d39a4a5b0a64f2e7..1fead3dfadfa33173487c7cb1c2b621532814951 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 
 from AthenaCommon.Logging import logging
@@ -47,7 +47,7 @@ class ChainConfigurationBase(object):
         stepName = 'Step%d'%stepID + '_%d'%self.mult + stepPartName
         if self.mult >1 :
             stepName = 'Step%d'%stepID + '_N' + stepPartName
-        log.debug("Configuring step " + stepName)
+        log.debug("Configuring step %s", stepName)
         seqArray = []
         for sequenceCfg in sequenceCfgArray:
             seqArray.append( RecoFragmentsPool.retrieve( sequenceCfg, None))
@@ -55,7 +55,7 @@ class ChainConfigurationBase(object):
 
     def getEmptyStep(self, stepID, stepPartName):
         stepName = 'Step%d'%stepID + '_%d'%self.mult + stepPartName
-        log.debug("Configuring empty step " + stepName)        
+        log.debug("Configuring empty step %s", stepName)
         return ChainStep(stepName, Sequences=[], multiplicity=[] ,chainDicts=[self.dict])
  
     def buildChain(self, chainSteps):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
index d0e5832554b1a68d3b789f5b7700bce9641be7eb..6c4a49f123ef6ae1440a745938efb5a6485c3b67 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
@@ -127,13 +127,13 @@ def serial_zip(allSteps, chainName, chainDefList):
     newsteps = []
     for chain_index, chainsteps in enumerate(allSteps):
         for step_index, step in enumerate(chainsteps):
-            log.debug('chain_index: ' + str(chain_index) + " step_index: " + str(step_index))
+            log.debug('chain_index: %s step_index: %s', chain_index, step_index)
             # create list of correct length
             stepList = [None]*n_chains
             
             # put the step from the current sub-chain into the right place
             stepList[chain_index] = step
-            log.debug('Put step: ' + str(step.name))
+            log.debug('Put step: %s', step.name)
 
             # all other steps should contain an empty sequence
             for step_index2, emptyStep in enumerate(stepList):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index 057d6f7eef225344288f6875251663b97bbdf2ca..17c7be9e9d0645b9df6c09fbfa254c758c920059 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 """
 Class to obtain the chain configuration dictionary from the short or long name
@@ -281,7 +281,7 @@ def analyseChainName(chainName, L1thresholds, L1item):
                                   (AllowedBeamspotChainIdentifiers, 'Beamspot', 'beamspot'),
                                   (['eb'], 'EnhancedBias', 'eb')]:
                 if cpart in chainCategory[0]:
-                    log.debug('Doing chain type {}'.format(chainCategory[1]))
+                    log.debug('Doing chain type %s', chainCategory[1])
                     multichainindex.append(hltChainNameShort.index(cpart))
                     buildDict(chainCategory[1], chainCategory[2])
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index e67017394db74b71353750ba8319288a414aba0f..4e30ed524ad460dd8f80ddb85fe9dc2b2a0ab98e 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -1,7 +1,6 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from PyUtils.Decorators import memoize
-from six import add_metaclass
 
 # Configure the scheduler
 from AthenaCommon.AlgScheduler import AlgScheduler
@@ -33,8 +32,7 @@ class Singleton(type):
 
 
 # for now we make this a singleton because calling menu generation twice leads to problems
-@add_metaclass(Singleton)
-class GenerateMenuMT(object):
+class GenerateMenuMT(object, metaclass=Singleton):
 
     @staticmethod
     def overwriteSignaturesWith(f):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index ad2ca2e8bbd522d0b70ae0a4238987888b6fd1bc..6afa8ae8ff9953fd374a5dcc6cc49bd9acfa5047 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
@@ -6,7 +6,6 @@ from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import generateDecisionT
 from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitInterSignatureChainDict
-from six import iteritems
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger( __name__ )
@@ -46,7 +45,7 @@ def generateMenu( flags ):
     menuAcc.addSequence( seqAND(mainSequenceName) )
 
 
-    for name, cfgFlag in list(iteritems(flags._flagdict)):
+    for name, cfgFlag in list(flags._flagdict.items()):
         if 'Trigger.menu.' not in name:
             continue
         value = flags._get(name)
@@ -86,7 +85,7 @@ def generateMenu( flags ):
                 signature = chainDict['signature'].lower()
 
                 if signature not in signatureToGenerator:
-                    log.warning('Generator for {} is missing. Chain dict will not be built'.format(signature))
+                    log.warning('Generator for %s is missing. Chain dict will not be built', signature)
                     continue
 
                 chainConfig = signatureToGenerator[signature](flags, chainDict)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GroupInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GroupInfo.py
index 3e653e722bfaf3a5f7b05acabb7837c20fea034c..c7d9f825efb720d847949c1f14ab10b7e7a82e2e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GroupInfo.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GroupInfo.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger( __name__ )
@@ -36,5 +36,4 @@ def getAllAllowedGroups(menu):
     elif 'HI' in menu:
         return AllowedGroups+AllowedGroup_HI
     else:
-        log.error("No list of allowed groups for "+menu)
-    
+        log.error("No list of allowed groups for %s", menu)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
index 2e2d2bd671a390eb29e6e4dcf9fcfd7ec8339eba..1624a5ab8fb705c4903a4f6aef20fef53bcec9dc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
@@ -181,7 +181,7 @@ def generateDecisionTree(chains):
             acc.addEventAlgo(filterAlg, sequenceName=filtersStep.name)
         acc.addEventAlgo(filterAlg, sequenceName=singleMenuSeq.name)
 
-        log.debug('Created filter {}'.format(filterAlg.name))
+        log.debug('Created filter %s', filterAlg.name)
         return acc.getEventAlgo(filterAlg.name)
 
 
@@ -410,29 +410,35 @@ def generateDecisionTree(chains):
 
 
     for chain in chains:
-        log.info( "CF algorithms for chain {}".format(chain.name))
+        log.info("CF algorithms for chain %s", chain.name)
         for stepCounter, step in enumerate( chain.steps, 1 ):
             filterAlg = getFilterAlg( stepCounter, step.name, isEmpty(step))
             if filterAlg and hasattr(filterAlg, "Input"):
-                log.info("{} FilterAlg: {} input: {} output: {} IO mapping: {}".format(stepCounter, filterAlg.name, ", ".join(filterAlg.Input), ", ".join(filterAlg.Output), filterAlg.IOMapping))
+                log.info("%s FilterAlg: %s input: %s output: %s IO mapping: %s",
+                         stepCounter, filterAlg.name, ", ".join(filterAlg.Input),
+                         ", ".join(filterAlg.Output), filterAlg.IOMapping)
                 for inIndex, input in enumerate(filterAlg.Input):
-                    log.info("{} filered chains from input: {} : {}".format( stepCounter, input,  ", ".join(filterAlg.ChainsPerInput[inIndex]) ))
+                    log.info("%s filered chains from input: %s : %s",
+                             stepCounter, input,  ", ".join(filterAlg.ChainsPerInput[inIndex]))
                 assert len(filterAlg.IOMapping) == len(filterAlg.Output), "Not all output will be filled in filter"
 
             imAlgs = findAllInputMakers( stepCounter, step.name )
             for imAlg in imAlgs:
                 if imAlg:
-                    log.info("{}  InputMaker: {} input: {} output: {}".format(stepCounter, imAlg.name, ", ".join(imAlg.InputMakerInputDecisions), imAlg.InputMakerOutputDecisions))
+                    log.info("%s  InputMaker: %s input: %s output: %s", stepCounter, imAlg.name,
+                             ", ".join(imAlg.InputMakerInputDecisions), imAlg.InputMakerOutputDecisions)
 
             hypoAlgs = findAllHypoAlgs(stepCounter, step.name)
             for hypoAlg in hypoAlgs:
                 if hypoAlg:
-                    log.info("{}  HypoAlg: {} input: {} output: {}".format(stepCounter, hypoAlg.name, hypoAlg.HypoInputDecisions, hypoAlg.HypoOutputDecisions))
-                    log.info("{}  hypo tools: {}".format(stepCounter, ",".join([t.name for t in hypoAlg.HypoTools])))
+                    log.info("%s  HypoAlg: %s input: %s output: %s", stepCounter, hypoAlg.name,
+                             hypoAlg.HypoInputDecisions, hypoAlg.HypoOutputDecisions)
+                    log.info("%s  hypo tools: %s", stepCounter, ",".join([t.name for t in hypoAlg.HypoTools]))
             combo = findComboHypoAlg(stepCounter, step.name)
             if combo:
-                log.info("{}  ComboHypoAlg: {} input: {} output: {}".format(stepCounter, combo.name, ". ".join(combo.HypoInputDecisions), ", ".join(combo.HypoOutputDecisions)))
-                log.info("{}  multiplicities: {}".format(stepCounter, combo.MultiplicitiesMap))
+                log.info("%s  ComboHypoAlg: %s input: %s output: %s", stepCounter, combo.name,
+                         ". ".join(combo.HypoInputDecisions), ", ".join(combo.HypoOutputDecisions))
+                log.info("%s  multiplicities: %s", stepCounter, combo.MultiplicitiesMap)
                 assert len(combo.HypoInputDecisions) == len(combo.HypoInputDecisions), "Missconfiguraiton of {} ComboHypo input/output counts differ".format(combo.name)
         log.info("-"*50)
     log.info("")
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 929dfc215d8a596a42fd227fde795cd49d73c22e..e8beca540b95a89983c9a0b3a0bf887c32775665 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -90,7 +90,10 @@ def setupMenu():
         ChainProp(name="HLT_mu24_L1MU20", groups=SingleMuonGroup),
         ChainProp(name="HLT_mu26_L1MU20", groups=SingleMuonGroup),
 
-
+        #ATR-21003
+        ChainProp(name='HLT_mu4_l2io_L1MU4', groups=SingleMuonGroup),
+        ChainProp(name='HLT_2mu14_l2io_L12MU10', groups=MultiMuonGroup),
+        ChainProp(name='HLT_2mu6_l2io_L12MU6',     l1SeedThresholds=['MU6'],   groups=MultiMuonGroup),
     ]
 
     TriggerFlags.EgammaSlice.signatures = TriggerFlags.EgammaSlice.signatures() + [
@@ -355,10 +358,6 @@ def setupMenu():
         ChainProp(name='HLT_2mu4_bUpsimumu_L12MU4', groups=BphysicsGroup),
         #ATR-20839
         ChainProp(name='HLT_2mu4_bDimu_L12MU4', groups=BphysicsGroup),
-        #ATR-21003
-        ChainProp(name='HLT_mu4_l2io_L1MU4', groups=SingleMuonGroup),
-        ChainProp(name='HLT_2mu14_l2io_L12MU10', groups=MultiMuonGroup),
-        ChainProp(name='HLT_2mu6_l2io_L12MU6',     l1SeedThresholds=['MU6'],   groups=MultiMuonGroup),
     ]
 
     TriggerFlags.CombinedSlice.signatures = TriggerFlags.CombinedSlice.signatures() + [
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
index 1e95b4e6f7087133c734d574701bb0ba72279945..0e814f98b5bdf83c7775875cd43a9083ee3107b7 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
@@ -1,8 +1,6 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 
-import six
-
 # def get_flag_item(chainName, L1itemsChainParts, groups):
 #     PhysicsStream = 'Main'
 
@@ -109,7 +107,7 @@ if __name__ == "__main__":
     # print all hypo algs and their hypo tools for debugging
     from AthenaCommon.CFElements import flatAlgorithmSequences    
     fs = flatAlgorithmSequences( menu.getSequence('HLTAllSteps') )
-    for seq, algs in six.iteritems (fs):
+    for seq, algs in fs.items():
         for alg in algs:
             if 'HypoTools' in alg._properties:
                 log.verbose("%s %s", alg.name, [ t.getFullJobOptName() for t in alg.HypoTools ])
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
index 4ec9960baa200040c759335b03260a11aeff39fd..e0386d159123520b36e2f069c4d15abf87f053d6 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
@@ -172,8 +172,8 @@ class MenuAlignment():
     def single_align(self, chainDict, chainConfig):
       
       if len(set(chainDict['alignmentGroups'])) != 1:
-          log.error("Cannot call single_align on chain {} with alignment groups {}".format(
-            chainDict['chainName'], ",".join(chainDict['alignmentGroups'])))
+          log.error("Cannot call single_align on chain %s with alignment groups %s",
+                    chainDict['chainName'], ",".join(chainDict['alignmentGroups']))
           raise Exception("Will not proceed, the chain is not suitable for single alignment.")
 
       alignment_grp = chainDict['alignmentGroups'][0]
@@ -292,6 +292,3 @@ class MenuAlignment():
         chainConfig.numberAllSteps()
         
         return chainConfig
-        
-
-    
\ No newline at end of file
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
index 3f362b689a69d0e5dfd8498ae33f4d57077cc113..5f03984a6b5d13929e58257c241c0e3059913647 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
@@ -177,7 +177,8 @@ class HypoAlgNode(AlgNode):
         elif self.initialOutput in outputs:
             AlgNode.addOutput(self, name)
         else:
-            log.error("Hypo " + self.name +" has already %s as configured output: you may want to duplicate the Hypo!" + outputs[0])
+            log.error("Hypo %s has already %s as configured output: you may want to duplicate the Hypo!",
+                      self.name, outputs[0])
 
 
     def addHypoTool (self, hypoToolConf):
@@ -632,7 +633,7 @@ class Chain(object):
         for stepID in range(1,n_new_steps+1):
             new_step_name =  prev_step_name+'_'+empty_step_name+'%d_'%stepID+next_step_name
 
-            log.debug("Configuring empty step " + new_step_name)
+            log.debug("Configuring empty step %s", new_step_name)
             steps_to_add += [ChainStep(new_step_name, [], [], chainDicts=prev_chain_dict, comboHypoCfg=ComboHypoCfg)]
         
         self.steps = chain_steps_pre_split + steps_to_add + chain_steps_post_split
@@ -682,7 +683,7 @@ class Chain(object):
             log.debug("N(seq)=%d, N(chainDicts)=%d", len(step.sequences), len(step.stepDicts))
             for seq, onePartChainDict in zip(step.sequences, step.stepDicts):
                 log.debug('    seq: %s, onePartChainDict:', seq.name)
-                log.debug('    ' + str(onePartChainDict))
+                log.debug('    %s', onePartChainDict)
                 seq.createHypoTools( onePartChainDict )
 
             step.createComboHypoTools(self.name) 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
index ca403b3980e93eeb69ae5500c510d4d9f4d0eb62..7ff099548b03ac841e6697e37a1920f19d88c760 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
@@ -1,7 +1,6 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags
-from six import iteritems
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger( __name__ )
@@ -22,10 +21,9 @@ def MenuPrescaleConfig(triggerConfigHLT):
     elif menu_name == 'MC_tight_default': 
         menu_name = 'LS2_v1'
 
-    log.info( 'Menu name: '+ menu_name)
+    log.info('Menu name: %s', menu_name)
 
     if menu_name.startswith('LS2_v1'):
-        log.info('LS2_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1 import setupMenu
         setupMenu()
         if 'tight_mc_prescale' in menu_name:
@@ -40,7 +38,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
             HLTPrescales = Prescales.HLTPrescales        
 
     elif menu_name.startswith('Physics_pp_run3_v1'):
-        log.info('Physics_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import setupMenu
         setupMenu()
         if 'tight_mc_prescale' in menu_name:
@@ -51,7 +48,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
             HLTPrescales = Prescales.HLTPrescales        
 
     elif menu_name.startswith('PhysicsP1_pp_run3_v1'):
-        log.info('PhysicsP1_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_pp_run3_v1 import setupMenu
         setupMenu()
         if 'tight_mc_prescale' in menu_name:
@@ -62,7 +58,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
             HLTPrescales = Prescales.HLTPrescales        
 
     elif menu_name.startswith('MC_pp_run3_v1'):
-        log.info('MC_pp_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.MC_pp_run3_v1 import setupMenu
         setupMenu()
         if 'tight_mc_prescale' in menu_name:
@@ -73,7 +68,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
             HLTPrescales = Prescales.HLTPrescales        
 
     elif menu_name.startswith('PhysicsP1_HI_run3_v1'):
-        log.info('PhysicsP1_HI_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_HI_run3_v1 import setupMenu
         setupMenu()
         if 'tight_mc_prescale' in menu_name:
@@ -84,7 +78,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
             HLTPrescales = Prescales.HLTPrescales        
 
     elif menu_name.startswith('Dev_HI_run3_v1'):
-        log.info('Dev_HI_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Dev_HI_run3_v1 import setupMenu
         setupMenu()
         if 'tight_mc_prescale' in menu_name:
@@ -95,7 +88,6 @@ def MenuPrescaleConfig(triggerConfigHLT):
             HLTPrescales = Prescales.HLTPrescales        
 
     elif menu_name.startswith('LS2_emu_v1'):
-        log.info('LS2_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1 import setupMenu
         setupMenu()
         if 'tight_mc_prescale' in menu_name:
@@ -106,14 +98,13 @@ def MenuPrescaleConfig(triggerConfigHLT):
             HLTPrescales = Prescales.HLTPrescales        
 
     elif menu_name.startswith('Cosmic_run3_v1'):
-        log.info('Cosmic_run3_v1 menu setup')
         from TriggerMenuMT.HLTMenuConfig.Menu.Cosmic_run3_v1 import setupMenu
         setupMenu()
         L1Prescales = Prescales.L1Prescales
         HLTPrescales = Prescales.HLTPrescales
             
     else:
-        log.fatal ('Menu with name %s is not known in this version of TriggerMenu! ', menu_name)
+        log.fatal('Menu with name %s is not known in this version of TriggerMenu! ', menu_name)
         return
 
     return (L1Prescales, HLTPrescales)
@@ -126,7 +117,7 @@ def disableChains(flags, trigvalid_prescales, type_group):
         if slice.signatures():
             signatures.extend(slice.signatures())
         else:
-            log.debug('SKIPPING ' + str(slice_prop))
+            log.debug('SKIPPING %s', slice_prop)
 
     chain_online_list=[]
 
@@ -138,7 +129,7 @@ def disableChains(flags, trigvalid_prescales, type_group):
 
 
 def applyHLTPrescale(triggerPythonConfig, HLTPrescale, signaturesOverwritten):
-    for item, prescales in iteritems(HLTPrescale):
+    for item, prescales in HLTPrescale.items():
         # prescales is a list of 3 integers [HLT_prescale, HLT_pass_through, rerun_prescale]
         if item not in triggerPythonConfig.dicts().keys():
             if signaturesOverwritten:
@@ -151,7 +142,7 @@ def applyHLTPrescale(triggerPythonConfig, HLTPrescale, signaturesOverwritten):
         hltchain = triggerPythonConfig.dicts()[item]
         if n > 0:
             hltchain['prescale'] = str(prescales[0])
-        log.info('Applied HLTPS to the item '+item+': PS'+ hltchain['prescale'])
+        log.info('Applied HLTPS to the item %s: PS %s', item, hltchain['prescale'])
        
 class PrescaleClass(object):
     #   Item name             | Prescale
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
index 3c965544e20f73645211a33fffdbe37024367e35..cc7a4f23d06891a72352b97568bd9add35986184 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 from AthenaCommon.Logging import logging
@@ -8,7 +8,7 @@ def checkGroups(triggerPythonConfig):
     """ Make sure the groups used in Physics and MC menu exists
     """
     menu_name = TriggerFlags.triggerMenuSetup()
-    log.info( "Menu: " + menu_name)
+    log.info("Menu: %s", menu_name)
     
     from TriggerMenuMT.HLTMenuConfig.Menu.GroupInfo       import getAllAllowedGroups
     allgroup=getAllAllowedGroups(menu_name)
@@ -31,7 +31,7 @@ def checkTriggerGroupAssignment(triggerPythonConfig):
     which allows only primary, supporting and calibration triggers. 
     """
     menu_name = TriggerFlags.triggerMenuSetup()
-    log.info( "Menu: " + menu_name)
+    log.info("Menu: %s", menu_name)
     GroupItems = []
     CheckGroups=False
 
@@ -60,7 +60,7 @@ def checkStreamConsistency(triggerPythonConfig):
     Checks that all chains are assigned to existing streams
     """
     menu_name = TriggerFlags.triggerMenuSetup()
-    log.info( "Menu: " + menu_name)
+    log.info("Menu: %s", menu_name)
 
     from TriggerMenuMT.HLTMenuConfig.Menu.StreamInfo       import getAllStreams
 
@@ -75,14 +75,15 @@ def checkStreamConsistency(triggerPythonConfig):
         else:
             for stream in chain.stream_tag:
                 if stream[0] not in allStreams:
-                    log.error(' Chain: ' + chain.chain_name + ' has the wrong streamer ' + stream[0])
+                    log.error('Chain: %s has the wrong streamer %s', chain.chain_name, stream[0])
                 else:
                     ##check data scouting streaming name
                     if "DataScouting" in stream[0]:
                         rob_id= stream[0].split("_")[1]                        
                         if rob_id  in already_used_robs and stream[0] is not already_used_robs[rob_id]:
-                            log.error( "Duplicated ROB in stream " + stream[0] + 
-                                       "(ROB number " + str(stream[0].split("_")[1]) + " already used in stream " +  already_used_robs[stream[0].split("_")[1]] + ")")
+                            log.error("Duplicated ROB in stream %s (ROB number %s already used in stream %s)",
+                                      stream[0], stream[0].split("_")[1],
+                                      already_used_robs[stream[0].split("_")[1]])
                             already_used_robs[rob_id]=stream[0]
                         else:                 
                             already_used_robs[rob_id]=stream[0] 
@@ -94,8 +95,8 @@ def checkStreamConsistency(triggerPythonConfig):
         if "DataScouting" in stream:
             rob_id= stream.split("_")[1]                        
             if rob_id  in already_used_robs:
-                log.error( "Duplicated ROB in stream " + stream + 
-                           "(ROB number " + str(rob_id) + " already used in stream " +  already_used_robs[rob_id] + ")")
+                log.error("Duplicated ROB in stream %s (ROB number %s already used in stream %s)",
+                          stream, rob_id, already_used_robs[rob_id])
                 already_used_robs[rob_id]=stream
             else:
                 already_used_robs[rob_id]=stream
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index dad431596e854b456fe150af542e72ec3305e063..8ea012e8f2eeacb12605701e488128740a22875f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -4,7 +4,6 @@ log = logging.getLogger( __name__ )
 log.info("Importing %s",__name__)
 
 from copy import deepcopy
-import six
 
 #==========================================================
 # This is stored in chainDict['Signature']
@@ -894,7 +893,7 @@ AllowedTopos = AllowedTopos_e + AllowedTopos_mu + AllowedTopos_Bphysics + Allowe
 #==========================================================
 def getSignatureNameFromToken(chainpart):
     theMatchingTokens = []
-    reverseSliceIDDict = dict([(value, key) for key, value in six.iteritems (SliceIDDict)]) #reversed SliceIDDict
+    reverseSliceIDDict = { value: key for key, value in SliceIDDict.items() } #reversed SliceIDDict
     for sig,token in SliceIDDict.items():
         if (token in chainpart):
             theMatchingTokens += [token]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
index d55b693e617f915e2a4e6caa6097bc645bd2e7da..688b27cbcb755d8e68b14e0e0cfd893cdde51209 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 #########################################################################################
 #
@@ -7,7 +7,6 @@
 #########################################################################################
 
 import sys
-from six import itervalues
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
@@ -51,11 +50,11 @@ class TriggerConfigHLT(object):
     @classmethod
     def dictsList(cls):
 
-        return list(itervalues(cls.__allChainDicts))
+        return list(cls.__allChainDicts.values())
 
     @classmethod
     def configsList(cls):
-        return list(itervalues(cls.__allChainConfigs))
+        return list(cls.__allChainConfigs.values())
 
     @classmethod
     def getChainDictFromChainName(cls, chainName):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
index 1214b696d22898e61c114707bddad089ae1e1e9a..80b73fb57195700f87cc3af56565bdb8f2cc405b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
@@ -28,7 +28,7 @@ class MinBiasChainConfig(ChainConfigurationBase):
     # Assemble the chain depending on information from chainName
     # ----------------------
     def assembleChain(self):
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
         SpStep = self.getMinBiasSpStep()
         TrkStep = self.getMinBiasTrkStep()
         return self.buildChain([SpStep,TrkStep])
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py
index b2ef5d75c6835feabfc19a0938f1acc7105b6ec2..7091e3fe471461c9eb8f0e09b8bbb32fcb594660 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py
@@ -72,7 +72,7 @@ class TauChainConfiguration(ChainConfigurationBase):
     # ----------------------
     def assembleChain(self):                            
         chainSteps = []
-        log.debug("Assembling chain for " + self.chainName)
+        log.debug("Assembling chain for %s", self.chainName)
 
         # --------------------
         # define here the names of the steps and obtain the chainStep configuration 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
index 0fcd582641eeab1cbc6e2d176b9fb0546f6cdbff..8a7e9b14dd8cdfea591ea13cdc7d035aca8ebfae 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
@@ -81,7 +81,7 @@ class TestChainConfiguration(ChainConfigurationBase):
         stepDictionary = self.getStepDictionary()
         key = self.chainPart['extra']
 
-        log.debug('testChain key = ' + key)
+        log.debug('testChain key = %s', key)
         if key in stepDictionary:
             steps=stepDictionary[key]
         else:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py
index 4721965a9c2ce6cb8b8d716c346223636a997ca7..8aad0a9da32fe6d2cb62e2fb92439592e24af184 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py
@@ -4,13 +4,10 @@ from TriggerMenuMT.HLTMenuConfig.Menu.CFValidation import findViewAlgs, checkVDV
 from AthenaCommon.AlgSequence import AlgSequence
 from AthenaCommon.CFElements import seqOR
 import AthenaCommon.CfgMgr as CfgMgr
-import six
 
 import unittest
 
 class ViewCFTest( unittest.TestCase ):
-    if six.PY2:
-        assertRaisesRegex = unittest.TestCase.assertRaisesRegexp        
 
     def runTest( self ):
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
index bb83906a355eb50d2769129232fad814e3fb6f46..f400f129a253ce0a4e74ae6947b8e73ad8772c2b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py
@@ -29,7 +29,7 @@ class UnconventionalTrackingChainConfiguration(ChainConfigurationBase):
     # Assemble the chain depending on information from chainName
     # ----------------------
     def assembleChain(self):                            
-        log.debug("Assembling chain " + self.chainName)
+        log.debug("Assembling chain %s", self.chainName)
 
         chainSteps = []
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py
index 521644ecc203c0ac1e5f5c24020705c9189822cc..8d50cb2ac757dcaaa940d94a6339761f4f6b848c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py
@@ -4,7 +4,6 @@ __doc__="Level 1 specific configuration for L1 Run 3"
 
 from .Limits import Limits
 from collections import Iterable, OrderedDict
-import six
 
 
 class FlagWrapper:
@@ -37,12 +36,12 @@ class L1MenuFlagsCont(object):
     statusOn = set()
 
     __slots__ = {
-        "MenuSetup"               :  FlagArgs( six.string_types ),
+        "MenuSetup"               :  FlagArgs( str ),
         "CTPVersion"              :  FlagArgs( int, 4,   val_check = lambda x: x in range(5), action = lambda x: Limits.setLimits(x) ),
         "BunchGroupPartitioning"  :  FlagArgs( Iterable, val_check = lambda x: len(list(filter(lambda y: y not in range(16), x)))==0 ),
-        "BunchGroupNames"         :  FlagArgs( Iterable, val_check = lambda x: len(list(filter(lambda y: not isinstance(y, six.string_types), x)))==0),
+        "BunchGroupNames"         :  FlagArgs( Iterable, val_check = lambda x: len(list(filter(lambda y: not isinstance(y, str), x)))==0),
         "MenuPartitioning"        :  FlagArgs( Iterable, val_check = lambda x: len(list(filter(lambda y: y not in range(512), x)))==0 ),
-        "items"                   :  FlagArgs( Iterable, val_check = lambda x: len(list(filter(lambda y: not isinstance(y, six.string_types), x)))==0),
+        "items"                   :  FlagArgs( Iterable, val_check = lambda x: len(list(filter(lambda y: not isinstance(y, str), x)))==0),
         "boards"                  :  FlagArgs( OrderedDict, OrderedDict() ),
         "legacyBoards"            :  FlagArgs( OrderedDict, OrderedDict() ),
         "prescales"               :  FlagArgs( dict, dict() ),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Limits.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Limits.py
index b930e16df61a94b6199e1c621f86a818a00f9e9e..d263cda51dc83f1d428f1b5bcd77d74b58ec8bec 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Limits.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Limits.py
@@ -1,9 +1,8 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 """
 This temporarily holds CTP sizes
 """
-import six
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger('Menu.L1.Base.Limits')
@@ -40,8 +39,7 @@ class Access(type):
 
 
 
-@six.add_metaclass(Access)
-class Limits(object):
+class Limits(object, metaclass=Access):
 
     CTPVersion      = None
     L1CommonVersion = None
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py
index 0fe451494a081dece84f43723913021bae7e3f3c..844bb1e48f0b0faa72b1532ca710742228ad8bc1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py
@@ -1,6 +1,5 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-import six
 from collections import OrderedDict as odict
 
 from AthenaCommon.Logging import logging
@@ -9,7 +8,7 @@ log = logging.getLogger('Menu.L1.Config.TypeWideThresholdConfig')
 from ..Base.ThresholdType import ThrType
 
 def getTypeWideThresholdConfig(ttype):
-    if isinstance(ttype,six.string_types):
+    if isinstance(ttype, str):
         ttype = ThrType[ttype]
 
     if ttype == ThrType.MU:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py
index 00da7cbbb708fd0e59dc8688754eb96663a92ad5..8dcc7ffce8c11b933ce5dc6133bc38009f01ad1c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py
@@ -124,7 +124,7 @@ class L1MenuConfig(object):
         if algo.name in self._registeredTopoAlgos[self.currentAlgoDef]:
             raise RuntimeError('%s algo %s is already registered as such' % (self.currentAlgoDef.desc, algo.name))
         self._registeredTopoAlgos[self.currentAlgoDef][algo.name] = algo
-        log.debug("Added in the {0} type the algo: {1} ID:{2}" .format(self.currentAlgoDef.desc, algo.name,algo.algoId))
+        log.debug("Added in the %s type the algo: %s ID:%s", self.currentAlgoDef.desc, algo.name, algo.algoId)
 
         return algo
 
@@ -285,7 +285,8 @@ class L1MenuConfig(object):
             log.info("... L1 legacy menu %s contains %i legacy boards (%s)", self.menuFilesToLoad, len(L1MenuFlags.legacyBoards()), ', '.join(L1MenuFlags.legacyBoards().keys()))
         except ImportError as ie:
             if ie.name == 'TriggerMenuMT.L1.Menu.Menu_%s_inputs_legacy' % self.menuFilesToLoad:
-                log.info(f"==> No menu defining the legacy inputs was found, will assume this intended. {ie.msg} {ie.name} {ie.path}")
+                log.info("==> No menu defining the legacy inputs was found, will assume this intended. %s %s %s",
+                         ie.msg, ie.name, ie.path)
             else:
                 raise
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py
index 333ce939ed8a8883fa0b35c78178651376352533..f371bb7b725c5c7da55e108696db8b379a2c36cc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py
@@ -1,9 +1,8 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 """
 This temporarily holds CTP sizes
 """
-import six
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger('LVL1.Limits')
@@ -40,8 +39,7 @@ class Access(type):
 
 
 
-@six.add_metaclass(Access)
-class Limits(object):
+class Limits(object, metaclass=Access):
 
     CTPVersion      = None
     L1CommonVersion = None
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py
index 2b7849f1b70ab8716aab689b27dead67593af499..d74fe35b8cfcd50e9c554b31e6f25417b11dcc33 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from .Limits import CaloLimits as CL
 IsolationOff = CL.IsolationOff
@@ -6,7 +6,6 @@ IsolationOff = CL.IsolationOff
 from copy import deepcopy
 
 from past.builtins import cmp
-import six
 
 class ThresholdValue(object):
 
@@ -385,11 +384,8 @@ class LVL1Thresholds(object):
         return None
 
     def xml(self, ind=1, step=2):
-        if six.PY2:
-            self.thresholds.sort(LVL1Thresholds.compThreshold)
-        else:
-            import functools
-            self.thresholds.sort(key=functools.cmp_to_key(LVL1Thresholds.compThreshold))
+        import functools
+        self.thresholds.sort(key=functools.cmp_to_key(LVL1Thresholds.compThreshold))
         s = ind * step * ' ' + '<TriggerThresholdList>\n'
         for thr in self.thresholds:
             s += thr.xml(ind+1,step)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py
index 4d21191b48571dfeffdb0da890218a2ab9bca157..83771f8854a65341e1a8db5ce075dd53be8c653e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py
@@ -66,7 +66,7 @@ class TriggerConfigL1Topo(object):
             raise RuntimeError('L1Topo algo %s is already registered' % algo.name)
             
         self.registeredAlgos[algo.name] = algo
-        log.debug("Added in the algo list: {0}, ID:{1}" .format(algo.name,algo.algoId))
+        log.debug("Added in the algo list: %s, ID:%s", algo.name, algo.algoId)
         return algo