diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx
index 54760df0cf5e3182ba963bf45b76b4a3ffe8cf73..71802d794d10d78b1529b1256fce62d8c050cd0b 100755
--- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx
+++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx
@@ -41,6 +41,8 @@
 
 #include "TileDetDescr/TileDetDescrManager.h"
 
+#include <GaudiKernel/ThreadLocalContext.h>
+
 long int CaloMgrDetDescrCnv::repSvcType() const
 {
   return storageType();
@@ -71,7 +73,12 @@ StatusCode CaloMgrDetDescrCnv::finalize()
 
 StatusCode CaloMgrDetDescrCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) 
 {
-  MsgStream log(msgSvc(), "CaloMgrDetDescrCnv");
+  // Ensure that this object is created inside the event loop
+  auto ctx = Gaudi::Hive::currentContext();
+  MsgStream log( msgSvc(), "CaloMgrDetDescrCnv" );
+  if ( !ctx.valid() ) {
+    log << MSG::WARNING << "Attempting to create a Calo Detector Manager object outside of the event loop. Geometry may not be aligned." << endmsg;
+  }
   log << MSG::INFO << "in createObj: creating a Calo Detector Manager object in the detector store" << endmsg;
 
   bool debug = log.level()<=MSG::DEBUG; 
diff --git a/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h b/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h
index cbe92ee49e9f5f062f1653d1043d4e10842e6502..37e72bf9d3785641c26dfbf27814a999178173df 100755
--- a/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h
+++ b/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h
@@ -27,6 +27,8 @@
 #include "CaloGeoHelpers/CaloPhiRange.h"
 #include "CaloDetDescr/CaloSubdetNames.h"
 
+#include <mutex>
+
 class CaloDetDescrManager;
 class ICaloCoordinateTool;
 class IMessageSvc;
@@ -143,19 +145,20 @@ public:
 private:
 
   // fill cashed surfaces
-  void fill_tg_surfaces();
+  void fill_tg_surfaces() const;
 
   // CaloDetDescr usal stuff
   //const CaloCell_ID* m_calo_id;
-  const CaloDetDescrManager* m_calo_dd;
+  const mutable CaloDetDescrManager* m_calo_dd;
 
   //TileDetDescr stuff
   const TileDetDescrManager* m_tile_dd;
 
   // cash the surfaces for TG builder
-  mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerEntries;  
-  mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerExits;  
-  
+  mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerEntries;
+  mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerExits;
+  mutable std::once_flag m_fillOnce;
+
 // needed to cover TestBeam
 //  ToolHandle<ICaloCoordinateTool>               m_calo_tb_coord;
 
@@ -173,11 +176,17 @@ private:
   //IMessageSvc*  m_msgSvc;
 };
 
-inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::entrySurfaces() const
-{ return m_layerEntries; }
+inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::entrySurfaces ATLAS_THREAD_SAFE() const
+{
+  std::call_once( m_fillOnce, [this](){fill_tg_surfaces();} );
+  return m_layerEntries;
+}
 
-inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::exitSurfaces() const
-{ return m_layerExits; }
+inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::exitSurfaces ATLAS_THREAD_SAFE() const
+{
+  std::call_once( m_fillOnce, [this](){fill_tg_surfaces();} );
+  return m_layerExits;
+}
 
  
 #endif // CALOTRACKINGGEOMETRY_CALOSURFACEBUILDER_H
diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx
index 1fd7d04e27c22b7aab759740a5d809061163d34a..587a211e719c4fda85951d1f22766d64e80da892 100755
--- a/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx
+++ b/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx
@@ -121,19 +121,11 @@ CaloSurfaceBuilder::initialize()
         ATH_MSG_DEBUG("Sucessfully retrieved "<< m_tileVolumeBuilder << ".");
   */
 
-  if (detStore()->retrieve(m_calo_dd).isFailure()) {
-     ATH_MSG_WARNING("Could not find CaloDetDescriptorManager in DetStore, calling CaloDetDescrManager::instance() instead");
-     m_calo_dd = CaloDetDescrManager::instance();
-     if (!m_calo_dd) return StatusCode::FAILURE;
-  }
-
   if (detStore()->retrieve(m_tile_dd).isFailure()){
     ATH_MSG_FATAL("Could not find TileDetDescrManager in DetStore" );
     return StatusCode::FAILURE;
   }
 
-  fill_tg_surfaces(); 
-
   return StatusCode::SUCCESS;
 }
 
@@ -146,16 +138,18 @@ CaloSurfaceBuilder::finalize()
     delete m_layerEntries[i].second;
   }
 
-  delete m_layerExits[CaloCell_ID::TileBar2].first;
-  delete m_layerExits[CaloCell_ID::TileBar2].second;
-  delete m_layerExits[CaloCell_ID::TileExt2].first;
-  delete m_layerExits[CaloCell_ID::TileExt2].second;
-  delete m_layerExits[CaloCell_ID::TileGap2].first;
-  delete m_layerExits[CaloCell_ID::TileGap2].second;
-  delete m_layerExits[CaloCell_ID::TileGap3].first;
-  delete m_layerExits[CaloCell_ID::TileGap3].second;
-  delete m_layerExits[CaloCell_ID::HEC3].first;
-  delete m_layerExits[CaloCell_ID::HEC3].second;
+  if ( m_layerExits.size() ) {
+    delete m_layerExits[CaloCell_ID::TileBar2].first;
+    delete m_layerExits[CaloCell_ID::TileBar2].second;
+    delete m_layerExits[CaloCell_ID::TileExt2].first;
+    delete m_layerExits[CaloCell_ID::TileExt2].second;
+    delete m_layerExits[CaloCell_ID::TileGap2].first;
+    delete m_layerExits[CaloCell_ID::TileGap2].second;
+    delete m_layerExits[CaloCell_ID::TileGap3].first;
+    delete m_layerExits[CaloCell_ID::TileGap3].second;
+    delete m_layerExits[CaloCell_ID::HEC3].first;
+    delete m_layerExits[CaloCell_ID::HEC3].second;
+  }
   
   StatusCode sc = StatusCode::SUCCESS;
   return sc;
@@ -236,9 +230,12 @@ Trk::Surface*  CaloSurfaceBuilder:: CreateUserSurface (const CaloCell_ID::CaloSa
 					                                   const double offset,
 					                                   const double etaCaloLocal) const
 {
+  if (sample == CaloCell_ID::Unknown) return nullptr;
 
- if (sample == CaloCell_ID::Unknown) return 0;
- if (!m_calo_dd) return 0;
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if (!m_calo_dd) {
+    if ( detStore()->retrieve(m_calo_dd).isFailure() ) return nullptr;
+  }
 
   // NB: the Transform3D created here belong to the surface,
   //     and will be deleted by it
@@ -369,7 +366,10 @@ CaloSurfaceBuilder::CreateLastSurface (const CaloCell_ID::CaloSample sample,
 {
   ATH_MSG_DEBUG( "In CreateLastSurface()" );
 
-  if (!m_calo_dd) return 0;
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if (!m_calo_dd) {
+    if ( detStore()->retrieve(m_calo_dd).isFailure() ) return nullptr;
+  }
 
   Trk::Surface* surf =0;
 
@@ -640,7 +640,10 @@ CaloSurfaceBuilder::get_cylinder_surface (CaloCell_ID::CaloSample sample, int si
 
   bool result = false;
 
-  if (!m_calo_dd) return result;
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if (!m_calo_dd) {
+    if ( detStore()->retrieve(m_calo_dd).isFailure() ) return result;
+  }
 
   // strips are spread on several descriptor, which all have the same
   // htrans, radius, hphi, but not the same hlength
@@ -731,7 +734,10 @@ CaloSurfaceBuilder::get_disk_surface (CaloCell_ID::CaloSample sample, int side,
   rmin = 999999.;
   rmax = 0.;
 
-  if (!m_calo_dd) return result;
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if (!m_calo_dd) {
+    if ( detStore()->retrieve(m_calo_dd).isFailure() ) return result;
+  }
 
   // strips are spread on several descriptor, which all have the same
   // htrans, hphisec, but not the same rmin and rmax
@@ -1037,7 +1043,7 @@ std::vector<const Trk::Surface*> CaloSurfaceBuilder::allHECSurfaces() const
 }
 
 //store all the surfaces into a vector 
-void CaloSurfaceBuilder::fill_tg_surfaces()
+void CaloSurfaceBuilder::fill_tg_surfaces() const
 {
   //for (float eta=1.4; eta<3.2; eta+=0.1 ) {
   //  const Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EME2,0.,eta);
diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt
index 3dfcd9b94bcde61752282d5dc82d606c74d0b523..a7a37b92e2a3a6f56a9e38a00e5eb14df7241c03 100644
--- a/Calorimeter/CaloUtils/CMakeLists.txt
+++ b/Calorimeter/CaloUtils/CMakeLists.txt
@@ -66,7 +66,7 @@ atlas_add_test( CaloTowerStore_test
 atlas_add_test( CaloTowerBuilderTool_test
    SCRIPT test/CaloTowerBuilderTool_test.sh
    LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment"
-   ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-12"
+   ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-13"
    PROPERTIES TIMEOUT 500 )
 
 atlas_add_test( ToolWithConstants_test
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h b/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h
index 7dfa8d11030bbbff951f3f3ec08cac6d33df0069..5553571ae5673a06d75e9f8647d5ef931bea470f 100644
--- a/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h
+++ b/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h
@@ -25,7 +25,6 @@
 class CaloTower;
 class CaloTowerStore;
 class CaloTowerContainer;
-class CaloDetDescrManager;
 class StoreGateSvc;
 class MsgStream;
 
@@ -104,7 +103,6 @@ private:
   // Specific Initialization //
   /////////////////////////////
 
-  const CaloDetDescrManager* m_caloDDM;
   CaloTowerStore m_cellStore;
 
   virtual StatusCode checkSetup(MsgStream& log);
diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
index e1a355baef8b8ee34aeaa39b12c9659b697a5416..b597552a0de5f775d80f5c35eb038e0b7c555fb4 100644
--- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
+++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
@@ -1,16 +1,16 @@
-Tue Aug  6 20:30:51 CEST 2019
+Wed Aug  5 18:46:10 CEST 2020
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.3] [x86_64-centos7-gcc8-opt] [atlas-work3/da00b53be39] -- built on [2019-08-06T1723]
+Py:Athena            INFO using release [WorkDir-22.0.17] [x86_64-centos7-gcc8-opt] [CaloMgrTooEarlyError/1cd056abc58] -- built on [2020-08-05T1835]
 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 "CaloUtils/CaloTowerStore_test.py"
-SetGeometryVersion.py obtained major release version 22
+Py:Athena            INFO including file "CaloTowerStore_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 5520 configurables from 75 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5547 configurables from 23 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.3
+EventInfoMgtInit: Got release version  Athena-22.0.17
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "CaloIdCnv/CaloIdCnv_joboptions.py"
 Py:Athena            INFO including file "CaloConditions/CaloConditions_jobOptions.py"
@@ -18,28 +18,25 @@ Py:Athena            INFO including file "CaloConditions/LArTTCellMap_ATLAS_jobO
 Py:Athena            INFO including file "CaloConditions/CaloTTIdMap_ATLAS_jobOptions.py"
 Py:Athena            INFO including file "TileIdCnv/TileIdCnv_jobOptions.py"
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
-ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
-ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v32r0)
-                                          running on lxplus724.cern.ch on Tue Aug  6 20:31:01 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
+                                          running on 05d0ccd909cb on Wed Aug  5 18:46:19 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
-ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
-StatusCodeSvc        INFO initialize
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3542 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3581 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
 AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-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://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.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/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus724.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO No specific match for domain found - use default fallback
+DBReplicaSvc         INFO Total of 2 servers found for host 05d0ccd909cb [ATLF atlas_dd ]
 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
@@ -49,6 +46,7 @@ PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.x
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
 MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
+OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
 IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
 IOVDbSvc             INFO Only 5 POOL conditions files will be open at once
 IOVDbSvc             INFO Cache alignment will be done in 3 slices
@@ -56,6 +54,7 @@ IOVDbSvc             INFO Global tag: OFLCOND-SDR-BS14T-IBL-06 set from joboptio
 IOVDbFolder          INFO Read from meta data only for folder /TagInfo
 IOVDbSvc             INFO Initialised with 3 connections and 7 folders
 IOVDbSvc             INFO Service IOVDbSvc initialised successfully
+ClassIDSvc           INFO  getRegistryEntries: read 1488 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
@@ -69,9 +68,9 @@ IOVDbSvc             INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTOn
 IOVDbSvc             INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas
 IOVDbSvc             INFO Added taginfo remove for /LAR/LArCellPositionShift
 IOVDbSvc             INFO Added taginfo remove for /LAR/Identifier/LArTTCellMapAtlas
-ClassIDSvc           INFO  getRegistryEntries: read 2165 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 17 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 287 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 268 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 24 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 239 CLIDRegistry entries for module ALL
 DetDescrCnvSvc       INFO  initializing 
 DetDescrCnvSvc       INFO Found DetectorStore service
 DetDescrCnvSvc       INFO  filling proxies for detector managers 
@@ -106,8 +105,6 @@ DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and st
 DetDescrCnvSvc       INFO  filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for STGCIDHELPER with CLID 4174 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for MMIDHELPER with CLID 4175 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store 
@@ -158,7 +155,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 5934 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 5947 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
@@ -176,7 +173,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 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/2019-08-05T2130/Athena/22.0.3/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-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -188,9 +185,9 @@ 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/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/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-08-04T2146/Athena/22.0.17/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-08-04T2146/Athena/22.0.17/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-08-04T2146/Athena/22.0.17/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.
@@ -201,9 +198,23 @@ AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version Athe
 CondInputLoader      INFO Initializing CondInputLoader...
 CondInputLoader      INFO Adding base classes:
 CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr       INFO Application Manager Started successfully
+AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
+EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
+EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
+ClassIDSvc           INFO  getRegistryEntries: read 2529 CLIDRegistry entries for module ALL
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
+IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align
+IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift
+IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARIdentifierLArTTCellMapAtlas-HadFcalFix2 for folder /LAR/Identifier/LArTTCellMapAtlas
+IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC
+Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root
+RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO  getRegistryEntries: read 2409 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 198 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -220,30 +231,15 @@ 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/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/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-08-04T2146/Athena/22.0.17/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-08-04T2146/Athena/22.0.17/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-08-04T2146/Athena/22.0.17/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/2019-08-05T2130/Athena/22.0.3/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-08-04T2146/Athena/22.0.17/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 
-HistogramPersis...WARNING Histograms saving not required.
-ApplicationMgr       INFO Application Manager Initialized successfully
-ApplicationMgr       INFO Application Manager Started successfully
-AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
-EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
-EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
-ClassIDSvc           INFO  getRegistryEntries: read 109 CLIDRegistry entries for module ALL
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align
-IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift
-IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARIdentifierLArTTCellMapAtlas-HadFcalFix2 for folder /LAR/Identifier/LArTTCellMapAtlas
-IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC
-Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root
-RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
@@ -260,25 +256,25 @@ IncidentProcAlg1     INFO Finalize
 CondInputLoader      INFO Finalizing CondInputLoader...
 IncidentProcAlg2     INFO Finalize
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.04 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     1.07 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.03 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 ((     0.03 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.69 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 ((     0.77 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      0.09 ))s
+IOVDbSvc             INFO  bytes in ((      2.53 ))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: 3 ReadTime: ((     0.09 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     2.53 ))s
 IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  370 [ms] Ave/Min/Max=  185(+-  175)/   10/  360 [ms] #=  2
-cObj_ALL             INFO Time User   : Tot=  430 [ms] Ave/Min/Max=  215(+-  185)/   30/  400 [ms] #=  2
-ChronoStatSvc        INFO Time User   : Tot= 2.34  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=  210 [ms] Ave/Min/Max=     105(+-     105)/       0/     210 [ms] #=  2
+cObj_ALL             INFO Time User   : Tot=  270 [ms] Ave/Min/Max=     135(+-     125)/      10/     260 [ms] #=  2
+ChronoStatSvc        INFO Time User   : Tot= 1.71  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx b/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx
index f55cf88b789af4963969ad7dd3db3f05d0ca71a5..250bcb88c704646ceefccd1eea0c6db4f5483c11 100644
--- a/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx
+++ b/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx
@@ -28,8 +28,7 @@
 CaloTowerBuilderTool::CaloTowerBuilderTool(const std::string& name,
 					   const std::string& type,
 					   const IInterface* parent)
-  : CaloTowerBuilderToolBase(name,type,parent),
-    m_caloDDM(nullptr)
+  : CaloTowerBuilderToolBase(name,type,parent)
     //  , m_errorCounter(0)
 {
   declareInterface<ICaloTowerBuilderToolBase>(this);    
@@ -52,7 +51,6 @@ CaloTowerBuilderTool::~CaloTowerBuilderTool()
 
 // protected!
 StatusCode CaloTowerBuilderTool::initializeTool() {
-  ATH_CHECK( detStore()->retrieve (m_caloDDM, "CaloMgr") );
   m_caloIndices = parseCalos (m_includedCalos);
   return this->checkSetup(msg());
 }
@@ -304,7 +302,12 @@ CaloTowerBuilderTool::parseCalos
 StatusCode CaloTowerBuilderTool::rebuildLookup()
 {
   if (towerSeg().neta() != 0 && towerSeg().nphi() != 0) {
-    if (m_cellStore.buildLookUp(*m_caloDDM, towerSeg(), m_caloIndices)) {
+
+    // Cannot do this in initialize: see ATLASRECTS-5012
+    const CaloDetDescrManager* caloDDM = nullptr;
+    ATH_CHECK( detStore()->retrieve (caloDDM, "CaloMgr") );
+
+    if (m_cellStore.buildLookUp(*caloDDM, towerSeg(), m_caloIndices)) {
       return StatusCode::SUCCESS;
     }
   }
diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
index b5bca2b1fd45fcaf7c6bbb0baa17003089c2ecff..0e14584134aae524a0ec8cbb7005a4a5a11b7c4f 100644
--- a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
+++ b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
@@ -23,22 +23,11 @@
  */
 CaloTowerStoreTestAlg::CaloTowerStoreTestAlg (const std::string& name,
                                               ISvcLocator* pSvcLocator)
-  : AthAlgorithm (name, pSvcLocator),
-    m_caloDDM (nullptr)
+  : AthAlgorithm (name, pSvcLocator)
 {
 }
 
 
-/** 
- * @brief Standard Gaudi initialize method.
- */
-StatusCode CaloTowerStoreTestAlg::initialize()
-{
-  ATH_CHECK( detStore()->retrieve (m_caloDDM, "CaloMgr") );
-  return StatusCode::SUCCESS;
-}
-
-
 void
 CaloTowerStoreTestAlg::iterate_full (const CaloTowerStore& store,
                                      test_tows_t& tows)
@@ -90,9 +79,14 @@ CaloTowerStoreTestAlg::test_subseg_iter (const CaloTowerStore& store1,
                                          const std::vector<CaloCell_ID::SUBCALO>& calos,
                                          const CaloTowerSeg::SubSeg& subseg)
 {
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  const CaloDetDescrManager* caloDDM = nullptr;
+  StatusCode sc = detStore()->retrieve( caloDDM, "CaloMgr" );
+  if ( !sc.isSuccess() ) std::abort();
+
   CaloTowerSeg seg = subseg.segmentation();
   CaloTowerStore store2;
-  if (!store2.buildLookUp (*m_caloDDM, seg, calos)) {
+  if (!store2.buildLookUp (*caloDDM, seg, calos)) {
     std::abort();
   }
 
@@ -111,13 +105,19 @@ CaloTowerStoreTestAlg::test_subseg_iter (const CaloTowerStore& store1,
 void CaloTowerStoreTestAlg::test1()
 {
   std::cout << "test1\n";
+
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  const CaloDetDescrManager* caloDDM = nullptr;
+  StatusCode sc = detStore()->retrieve( caloDDM, "CaloMgr" );
+  if ( !sc.isSuccess() ) std::abort();
+
   CaloTowerSeg seg (50, 64, -2.5, 2.5);
   std::vector<CaloCell_ID::SUBCALO> calos;
   calos.push_back (CaloCell_ID::LAREM);
   calos.push_back (CaloCell_ID::LARHEC);
   calos.push_back (CaloCell_ID::TILE);
   CaloTowerStore store;
-  if (!store.buildLookUp (*m_caloDDM, seg, calos)) {
+  if (!store.buildLookUp (*caloDDM, seg, calos)) {
     std::abort();
   }
 
diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
index 817e9137a9250aa509b917ebf8c12022d1920fc5..b64cdbfe6c920bf0d643aacdaabe48a531ff562c 100644
--- a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
+++ b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
@@ -19,7 +19,6 @@
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "CaloUtils/CaloTowerStore.h"
-class CaloDetDescrManager;
 
 
 class CaloTowerStoreTestAlg
@@ -33,12 +32,6 @@ public:
                          ISvcLocator* pSvcLocator);
 
 
-  /** 
-   * @brief Standard Gaudi initialize method.
-   */
-  virtual StatusCode initialize() override;
-
-
   /** 
    * @brief Standard Gaudi execute method.
    */
@@ -50,8 +43,6 @@ public:
   void dump_tows (const test_tows_t& t);
 
 private:
-  const CaloDetDescrManager* m_caloDDM;
-
   void iterate_full (const CaloTowerStore& store,
                      test_tows_t& tows);
   void iterate_subseg (const CaloTowerStore& store,
diff --git a/Control/AthContainers/AthContainers/tools/copyThinned.icc b/Control/AthContainers/AthContainers/tools/copyThinned.icc
index c510efa4b66590e01af4e538158a45b720632f0c..1a14ebf50585c9af5359be2c415bc316ecc374b8 100644
--- a/Control/AthContainers/AthContainers/tools/copyThinned.icc
+++ b/Control/AthContainers/AthContainers/tools/copyThinned.icc
@@ -122,18 +122,13 @@ copyThinned1 (const CONTAINER& orig,
 {
   // T->P conversion is done from within copyAuxStoreThinned,
   // so we need to call it regardless of whether or not
-  // thinning is actually done.  Don't call it though if the
-  // container is empty.
-  // The cast is needed because some xAOD aux store classes
-  // declare a data member `size'.
-  if (static_cast<const SG::IAuxStore&>(orig).size() > 0)
-  {
-    auto newcont = std::make_unique<CONTAINER>();
-    copyAuxStoreThinned (orig, *newcont, info);
-    return newcont;
-  }
-
-  return std::make_unique<CONTAINER> (orig);
+  // thinning is actually done.  Variable selection happens there
+  // as well, so need to call it even if the container is empty.
+  // (Actually, in that case, all dynamic variables will be removed,
+  // but that's ok.)
+  auto newcont = std::make_unique<CONTAINER>();
+  copyAuxStoreThinned (orig, *newcont, info);
+  return newcont;
 }
 
 
diff --git a/Control/AthenaServices/share/AthenaOutputStream_test.ref b/Control/AthenaServices/share/AthenaOutputStream_test.ref
index a52c1c87c779a786b39432dd15239a424f7db458..77fc1b609ceb35cb2b75de202581443fed081b27 100644
--- a/Control/AthenaServices/share/AthenaOutputStream_test.ref
+++ b/Control/AthenaServices/share/AthenaOutputStream_test.ref
@@ -1,20 +1,24 @@
 *** AthenaOutputStream_test starts ***
 
 
-Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt
-JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt
+Initializing Gaudi ApplicationMgr using job opts /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt
+JobOptionsSvc        INFO # =======> /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt
 JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 2
 JobOptionsSvc        INFO # (6,1): StoreGateSvc.OutputLevel = 2
 JobOptionsSvc        INFO # (8,1): AthenaOutputStream.OutputLevel = 1
-JobOptionsSvc        INFO # (10,1): AthenaOutputStream.ItemList = ["Bar#uno", "Bar#due", "Bar#tre", "8101#*", "Fee#quattro", "Fee!#cinque", "Baz#sei", "BazAuxContainer#seiAux.aaa.ccc", "13#*"]
-JobOptionsSvc        INFO # (17,1): AthenaOutputStream.AcceptAlgs = ["AthenaOutputStream", "aSFQS"]
-JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt
+JobOptionsSvc        INFO # (10,1): AthenaOutputStream.ItemList = ["Bar#uno", "Bar#due", "Bar#tre", "8101#*", "Fee#quattro", "Fee!#cinque", "Baz#sei", "BazAuxContainer#seiAux.aaa.ccc", "Baz#comp", "BazAuxContainer#compAux.foo.bar.zzz", "13#*"]
+JobOptionsSvc        INFO # (20,1): AthenaOutputStream.CompressionBitsHigh = 10
+JobOptionsSvc        INFO # (21,1): AthenaOutputStream.CompressionListHigh = ["BazAuxContainer#compAux.foo.bar"]
+JobOptionsSvc        INFO # (22,1): AthenaOutputStream.CompressionBitsLow = 16
+JobOptionsSvc        INFO # (23,1): AthenaOutputStream.CompressionListLow = ["BazAuxContainer#compAux.zzz"]
+JobOptionsSvc        INFO # (25,1): AthenaOutputStream.AcceptAlgs = ["AthenaOutputStream", "aSFQS"]
+JobOptionsSvc        INFO Job options successfully read in from /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt
 MessageSvc          DEBUG Service base class initialized successfully
 ApplicationMgr      DEBUG Getting my own properties
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r1)
-                                          running on lxplus706.cern.ch on Thu Jul 30 17:07:50 2020
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
+                                          running on atpc002 on Fri Aug  7 15:13:36 2020
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 ServiceManager      DEBUG Initializing service AppMgrRunable
@@ -35,23 +39,25 @@ ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 ClassIDSvc          DEBUG Service base class initialized successfully
 IncidentSvc         DEBUG Adding [ModuleLoaded] listener 'ClassIDSvc' with priority 100
-ClassIDSvc           INFO  getRegistryEntries: read 1579 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1581 CLIDRegistry entries for module ALL
 ClassIDSvc          FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <B1> for CLID 8111: Known name for this ID <Baz> It was set by AthenaServices-00-00-00
 ClassIDSvc          FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <D1> for CLID 8112: Known name for this ID <BazAuxContainer> It was set by AthenaServices-00-00-00
-ClassIDSvc          FATAL uncheckedSetTypePackageForID: AthenaServices-00-00-00 can not set type name <SG::SelectionVetoesRef> for CLID 3789442: Known name for this ID <SG::SelectionVetoes> It was set by AthenaServices-00-00-00
-ClassIDSvc          DEBUG processCLIDDB: read 1745 entries from CLIDDB file: /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/clid.db
+ClassIDSvc          DEBUG processCLIDDB: read 1747 entries from CLIDDB file: /atlas/scratch0/amete/athena-workspace/build/x86_64-centos7-gcc8-opt/share/clid.db
 ClassIDSvc          FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <B1> for CLID 8111: Known name for this ID <Baz> It was set by AthenaServices-00-00-00
 ClassIDSvc          FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <D1> for CLID 8112: Known name for this ID <BazAuxContainer> It was set by AthenaServices-00-00-00
-ClassIDSvc          DEBUG processCLIDDB: read 1745 entries from CLIDDB file: /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-07-28T2136/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/clid.db
+ClassIDSvc          DEBUG processCLIDDB: read 1746 entries from CLIDDB file: /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/clid.db
 StoreGateSvc        DEBUG Service base class initialized successfully
 StoreGateSvc        DEBUG trying to create store SGImplSvc/StoreGateSvc_Impl
 StoreGateSvc_Impl   DEBUG Service base class initialized successfully
 ProxyProviderSvc    DEBUG Service base class initialized successfully
 IncidentSvc         DEBUG Adding [EndEvent] listener 'StoreGateSvc' with priority 100
 IncidentSvc         DEBUG Adding [BeginEvent] listener 'StoreGateSvc' with priority 100
-ClassIDSvc           INFO  getRegistryEntries: read 2385 CLIDRegistry entries for module ALL
-ToolSvc             DEBUG Service base class initialized successfully
+ClassIDSvc           INFO  getRegistryEntries: read 2389 CLIDRegistry entries for module ALL
 AthenaOutputStream  DEBUG Property update for OutputLevel : new value = 1
+ToolSvc             DEBUG Service base class initialized successfully
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
 AthenaOutputStreamVERBOSE ServiceLocatorHelper::service: found service EventDataSvc
 TimelineSvc         DEBUG Service base class initialized successfully
 TimelineSvc         DEBUG initialize
@@ -86,8 +92,10 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.x
 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        DEBUG Service base class initialized successfully
+DBReplicaSvc        DEBUG HOSTNAME atpc002 has no domain - try hostname --fqdn
+DBReplicaSvc        DEBUG HOSTNAME from fqdn: atpc002.dyndns.cern.ch
 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-07-28T2136/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
 DBReplicaSvc        DEBUG Candidate server ATLF (priority -2700)
 DBReplicaSvc        DEBUG Candidate server ATLAS_COOLPROD (priority -695)
 DBReplicaSvc        DEBUG Candidate server atlas_dd (priority -690)
@@ -98,7 +106,7 @@ DBReplicaSvc        DEBUG Candidate server ATONR_COOL (priority -670)
 DBReplicaSvc        DEBUG Candidate server ATONR_CONF (priority -665)
 DBReplicaSvc        DEBUG Candidate server DEVDB11 (priority -660)
 DBReplicaSvc        DEBUG Candidate server ATLF (priority -2200)
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -118,48 +126,56 @@ IoComponentMgr      DEBUG --> io_hasitem()
 AthenaOutputStream   INFO I/O reinitialization...
 IncidentSvc         DEBUG Adding [MetaDataStop] listener 'AthenaOutputStream' with priority 50
 AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
-AthenaOutputStreamVERBOSE Both high and low float compression lists are empty. Float compression will NOT be applied.
+AthenaOutputStream   INFO Either high or low (or both) float compression lists are defined. Float compression will be applied.
+AthenaOutputStream   INFO High compression will use 10 mantissa bits, and low compression will use 16 mantissa bits.
 AthenaOutputStream  DEBUG End initialize
 AthenaOutputStreamVERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc
 AlgExecStateSvc     DEBUG preInit: will add Alg AthenaOutputStream later
 AthenaOutputStream  DEBUG input handles: 0
-AthenaOutputStream  DEBUG output handles: 1
+AthenaOutputStream  DEBUG output handles: 2
 AthenaOutputStream  DEBUG Registering all Tools in ToolHandleArray HelperTools
 AthenaOutputStream  DEBUG Adding private ToolHandle tool AthenaOutputStream.AthenaOutputStreamTool (AthenaOutputStreamTool)
 AthenaOutputStream  DEBUG Data Deps for AthenaOutputStream
   + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_AthenaOutputStream' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_AthenaOutputStream' ) 
-StoreGateSvc        DEBUG Recorded object @0x631dc70 with key uno of type Foo(CLID 8101)
- in DataObject @0x631dd20
+StoreGateSvc        DEBUG Recorded object @0x667f4c0 with key uno of type Foo(CLID 8101)
+ in DataObject @0x667f6b0
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x667fc50 with key due of type Foo(CLID 8101)
+ in DataObject @0x667fe00
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x667fbd0 with key uno of type Bar(CLID 8107)
+ in DataObject @0x66800d0
  object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x631c990 with key due of type Foo(CLID 8101)
- in DataObject @0x631d830
+StoreGateSvc        DEBUG Recorded object @0x667fbb0 with key due of type Bar(CLID 8107)
+ in DataObject @0x6680400
  object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x640ec60 with key uno of type Bar(CLID 8107)
- in DataObject @0x631c8d0
+StoreGateSvc        DEBUG Recorded object @0x6680790 with key quattro of type Bar(CLID 8107)
+ in DataObject @0x6680700
  object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x631c9b0 with key due of type Bar(CLID 8107)
- in DataObject @0x640ef60
+StoreGateSvc        DEBUG Recorded object @0x6680b80 with key cinque of type Bar(CLID 8107)
+ in DataObject @0x6680ad0
  object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x640f2f0 with key quattro of type Bar(CLID 8107)
- in DataObject @0x640f260
+StoreGateSvc        DEBUG Recorded object @0x6681120 with key sei of type Baz(CLID 8111)
+ in DataObject @0x6687a40
  object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x640f650 with key cinque of type Bar(CLID 8107)
- in DataObject @0x640f5a0
+StoreGateSvc        DEBUG Recorded object @0x6681150 with key seiAux. of type BazAuxContainer(CLID 8112)
+ in DataObject @0x667f960
  object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x640fc80 with key sei of type Baz(CLID 8111)
- in DataObject @0x64165a0
+StoreGateSvc        DEBUG Recorded object @0x66881a0 with key comp of type Baz(CLID 8111)
+ in DataObject @0x2767290
  object modifiable when retrieved
-StoreGateSvc        DEBUG Recorded object @0x640fcb0 with key seiAux. of type BazAuxContainer(CLID 8112)
- in DataObject @0x631c820
+StoreGateSvc        DEBUG Recorded object @0x6688710 with key compAux. of type BazAuxContainer(CLID 8112)
+ in DataObject @0x6689530
  object modifiable when retrieved
-ClassIDSvc           INFO  getRegistryEntries: read 724 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 714 CLIDRegistry entries for module ALL
 AthenaOutputStr...WARNING add: can not find clid 13 in clid db
 AthenaOutputStream  DEBUG addItemObjects(13,"*") called
 AthenaOutputStream  DEBUG            Key:*
 AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
 MetaDataSvc         DEBUG Service base class initialized successfully
 InputMetaDataStore  DEBUG Service base class initialized successfully
@@ -184,16 +200,16 @@ IoComponentMgr      DEBUG     registering IoComponent "MetaDataSvc"
 AthenaOutputStream  DEBUG  Failed to receive proxy iterators from StoreGate for 13,"*". Skipping
 AthenaOutputStream  DEBUG addItemObjects(8101,"*") called
 AthenaOutputStream  DEBUG            Key:*
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], *, *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [, ], *, *)
 AthenaOutputStream  DEBUG  Added object 8101,"due"
 AthenaOutputStream  DEBUG  Added object 8101,"uno"
 AthenaOutputStream  DEBUG addItemObjects(8107,"due") called
 AthenaOutputStream  DEBUG            Key:due
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], due, *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [due], due, *)
 AthenaOutputStreamVERBOSE Calling matchKey( [due], cinque)
@@ -208,8 +224,8 @@ AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
 AthenaOutputStreamVERBOSE Done calling matchKey( [due], uno) with result: 0
 AthenaOutputStream  DEBUG addItemObjects(8107,"tre") called
 AthenaOutputStream  DEBUG            Key:tre
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], tre, *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [tre], tre, *)
 AthenaOutputStreamVERBOSE Calling matchKey( [tre], cinque)
@@ -227,8 +243,8 @@ AthenaOutputStreamVERBOSE Done calling matchKey( [tre], uno) with result: 0
 AthenaOutputStream  DEBUG  No object matching 8107,"tre" found
 AthenaOutputStream  DEBUG addItemObjects(8107,"uno") called
 AthenaOutputStream  DEBUG            Key:uno
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], uno, *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [uno], uno, *)
 AthenaOutputStreamVERBOSE Calling matchKey( [uno], cinque)
@@ -243,8 +259,8 @@ AthenaOutputStreamVERBOSE Done calling matchKey( [uno], quattro) with result: 0
 AthenaOutputStream  DEBUG  Added object 8107,"uno"
 AthenaOutputStream  DEBUG addItemObjects(8108,"cinque") called
 AthenaOutputStream  DEBUG            Key:cinque
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], cinque, *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [cinque], cinque, *)
 AthenaOutputStream  DEBUG  Added object 8108,"cinque"
@@ -253,31 +269,64 @@ AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
 AthenaOutputStreamVERBOSE Done calling matchKey( [cinque], quattro) with result: 0
 AthenaOutputStream  DEBUG addItemObjects(8108,"quattro") called
 AthenaOutputStream  DEBUG            Key:quattro
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], quattro, *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [quattro], quattro, *)
 AthenaOutputStreamVERBOSE Calling matchKey( [quattro], cinque)
 AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
 AthenaOutputStreamVERBOSE Done calling matchKey( [quattro], cinque) with result: 0
 AthenaOutputStream  DEBUG  Added object 8108,"quattro"
+AthenaOutputStream  DEBUG addItemObjects(8111,"comp") called
+AthenaOutputStream  DEBUG            Key:comp
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], comp, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [comp], comp, *)
+AthenaOutputStream  DEBUG  Added object 8111,"comp"
+AthenaOutputStreamVERBOSE Calling matchKey( [comp], sei)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [comp], sei) with result: 0
 AthenaOutputStream  DEBUG addItemObjects(8111,"sei") called
 AthenaOutputStream  DEBUG            Key:sei
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], sei, *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [sei], sei, *)
+AthenaOutputStreamVERBOSE Calling matchKey( [sei], comp)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [sei], comp) with result: 0
 AthenaOutputStream  DEBUG  Added object 8111,"sei"
+AthenaOutputStream  DEBUG addItemObjects(8112,"compAux.") called
+AthenaOutputStream  DEBUG            Key:compAux.
+AthenaOutputStream  DEBUG       Aux Attr:foo.bar.zzz
+AthenaOutputStream  DEBUG      Comp Attr High: 2 with 10 mantissa bits.
+AthenaOutputStream  DEBUG        >> bar
+AthenaOutputStream  DEBUG        >> foo
+AthenaOutputStream  DEBUG      Comp Attr Low: 1 with 16 mantissa bits.
+AthenaOutputStream  DEBUG        >> zzz
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], compAux., *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [compAux.], compAux., *)
+AthenaOutputStream  DEBUG  Added object 8112,"compAux."
+AthenaOutputStream  DEBUG Lossy float compression level 10 contains 1 elements for container comp
+AthenaOutputStream  DEBUG Lossy float compression level 16 contains 1 elements for container comp
+AthenaOutputStreamVERBOSE Calling matchKey( [compAux.], seiAux.)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [compAux.], seiAux.) with result: 0
 AthenaOutputStream  DEBUG addItemObjects(8112,"seiAux.") called
 AthenaOutputStream  DEBUG            Key:seiAux.
 AthenaOutputStream  DEBUG       Aux Attr:aaa.ccc
-AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
-AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
-AthenaOutputStream  DEBUG      Comp Attr High: 0 with 7 mantissa bits.
-AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 15 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr High: 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr Low: 0 with 16 mantissa bits.
 AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], seiAux., *)
 AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [seiAux.], seiAux., *)
+AthenaOutputStreamVERBOSE Calling matchKey( [seiAux.], compAux.)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [seiAux.], compAux.) with result: 0
 AthenaOutputStream  DEBUG  Added object 8112,"seiAux."
+AthenaOutputStream  DEBUG Lossy float compression level 10 contains 0 elements for container sei
+AthenaOutputStream  DEBUG Lossy float compression level 16 contains 0 elements for container sei
+8112 compAux.
 8112 seiAux.
 8101 due
 8101 uno
@@ -285,6 +334,8 @@ AthenaOutputStream  DEBUG  Added object 8112,"seiAux."
 8107 uno
 8108 cinque
 8107 quattro
+8111 comp
 8111 sei
 StoreGateSvc        DEBUG Retrieved const pointer to object SelectionVetoes_AthenaOutputStream  of type SG::SelectionVetoes(CLID 3789442)
+StoreGateSvc        DEBUG Retrieved const pointer to object CompressionInfo_AthenaOutputStream  of type SG::CompressionInfo(CLID 39950991)
 *** AthenaOutputStream_test OK ***
diff --git a/Control/AthenaServices/share/AthenaOutputStream_test.txt b/Control/AthenaServices/share/AthenaOutputStream_test.txt
index f93bafc781012ed1152bb328119ffc40d32d933b..e2ea2eac38937f05908ad8733938789dfecbf0ef 100644
--- a/Control/AthenaServices/share/AthenaOutputStream_test.txt
+++ b/Control/AthenaServices/share/AthenaOutputStream_test.txt
@@ -13,5 +13,13 @@ AthenaOutputStream.ItemList={"Bar#uno", "Bar#due", "Bar#tre" ,
                              "Fee!#cinque",
                              "Baz#sei",
                              "BazAuxContainer#seiAux.aaa.ccc",
+                             "Baz#comp",
+                             "BazAuxContainer#compAux.foo.bar.zzz",
                              "13#*"};       
+
+AthenaOutputStream.CompressionBitsHigh = 10;
+AthenaOutputStream.CompressionListHigh = { "BazAuxContainer#compAux.foo.bar" };
+AthenaOutputStream.CompressionBitsLow = 16;
+AthenaOutputStream.CompressionListLow = { "BazAuxContainer#compAux.zzz" };
+
 AthenaOutputStream.AcceptAlgs={"AthenaOutputStream", "aSFQS"};
diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx
index 7de904ec9c20a686e6962752026261267e383a35..973d575a279e6ff3d6ad4e8a09417c430943c9c7 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.cxx
+++ b/Control/AthenaServices/src/AthenaOutputStream.cxx
@@ -29,6 +29,7 @@
 #include "SGTools/SGIFolder.h"
 #include "AthenaKernel/CLIDRegistry.h"
 #include "xAODCore/AuxSelection.h"
+#include "xAODCore/AuxCompression.h"
 
 #include "AthContainersInterfaces/IAuxStore.h"
 #include "AthContainersInterfaces/IAuxStoreIO.h"
@@ -319,6 +320,9 @@ StatusCode AthenaOutputStream::initialize() {
    m_selVetoesKey = "SelectionVetoes_" + streamName;
    ATH_CHECK( m_selVetoesKey.initialize() );
 
+   m_compInfoKey = "CompressionInfo_" + streamName;
+   ATH_CHECK( m_compInfoKey.initialize() );
+
    ATH_MSG_DEBUG("End initialize");
    return StatusCode::SUCCESS;
 }
@@ -623,13 +627,14 @@ StatusCode AthenaOutputStream::collectAllObjects() {
    }
 
    auto vetoes = std::make_unique<SG::SelectionVetoes>();
+   auto compInfo = std::make_unique<SG::CompressionInfo>();
 
    m_p2BWritten->updateItemList(true);
    std::vector<CLID> folderclids;
    // Collect all objects that need to be persistified:
    //FIXME refactor: move this in folder. Treat as composite
    for (SG::IFolder::const_iterator i = m_p2BWritten->begin(), iEnd = m_p2BWritten->end(); i != iEnd; i++) {
-     addItemObjects(*i, *vetoes);
+     addItemObjects(*i, *vetoes, *compInfo);
       folderclids.push_back(i->id());
    }
 
@@ -661,12 +666,18 @@ StatusCode AthenaOutputStream::collectAllObjects() {
      ATH_CHECK( SG::makeHandle (m_selVetoesKey).record (std::move (vetoes)) );
    }
 
+   // Store the lossy float compression information in the SG.
+   if (!compInfo->empty()) {
+     ATH_CHECK( SG::makeHandle (m_compInfoKey).record (std::move (compInfo)) );
+   }
+
    return StatusCode::SUCCESS;
 }
 
 //FIXME refactor: move this in folder. Treat as composite
 void AthenaOutputStream::addItemObjects(const SG::FolderItem& item,
-                                        SG::SelectionVetoes& vetoes)
+                                        SG::SelectionVetoes& vetoes,
+                                        SG::CompressionInfo& compInfo)
 {
    // anything after a dot is a list of dynamic Aux attrubutes, separated by dots
    size_t dotpos = item.key().find('.');
@@ -912,6 +923,41 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item,
                     auxcomp->setCompressedAuxIDs( comp_attr );
                     auxcomp->setCompressionBits( comp_bits );
                   }
+
+                  // New Compression Logic
+                  SG::IAuxStore* auxstore( nullptr );
+                  try {
+                    SG::fromStorable( itemProxy->object(), auxstore, true );
+                  } catch( const std::exception& ) {
+                    ATH_MSG_DEBUG( "Error in casting object with CLID "
+                                   << itemProxy->clID() << " to SG::IAuxStore*" );
+                    auxstore = nullptr;
+                  }
+                  if ( auxstore ) {
+                    // Get a hold of all AuxIDs for this store (static, dynamic etc.)
+                    const SG::auxid_set_t allVars = auxstore->getAuxIDs();
+
+                    // Get a handle on the compression information for this store
+                    std::string key = item_key;
+                    key.erase (key.size()-4, 4);
+                    SG::ThinningInfo::compression_map_t& compMap = compInfo[key];
+
+                    // Build the compression list, retrieve the relevant AuxIDs and
+                    // store it in the relevant map that is going to be inserted into
+                    // the ThinningCache later on by the ThinningCacheTool
+                    xAOD::AuxCompression compression;
+                    compression.setCompressedAuxIDs( comp_attr );
+                    compression.setCompressionBits( comp_bits );
+
+                    compMap[comp_bits[0]] = compression.getCompressedAuxIDs( allVars, true ); // High
+                    compMap[comp_bits[1]] = compression.getCompressedAuxIDs( allVars, false ); // Low
+
+                    for(auto& it : compMap) {
+                      ATH_MSG_DEBUG( "Lossy float compression level " << it.first <<
+                                     " contains " << it.second.size() <<  " elements"
+                                     " for container " << key );
+                    }
+                  }
                }
 
                added = true;
diff --git a/Control/AthenaServices/src/AthenaOutputStream.h b/Control/AthenaServices/src/AthenaOutputStream.h
index 21806fcabd02823d7351cebbe091d384434474d5..dee78c511c8aa76e023425e3f3bf4da83a8c9aca 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.h
+++ b/Control/AthenaServices/src/AthenaOutputStream.h
@@ -27,6 +27,7 @@
 #include "GaudiKernel/IIoComponent.h"
 
 #include "SelectionVetoes.h"
+#include "CompressionInfo.h"
 
 // forward declarations
 class IClassIDSvc;
@@ -158,6 +159,11 @@ private:
    SG::WriteHandleKey<SG::SelectionVetoes> m_selVetoesKey
    { this, "SelVetoesKey", "" };
 
+   /// Key used for recording lossy float compressed variable information
+   /// to the event store.
+   SG::WriteHandleKey<SG::CompressionInfo> m_compInfoKey
+   { this, "CompInfoKey", "" };
+
 protected:
    /// Handler for ItemNames Property
    void itemListHandler(Property& /* theProp */);
@@ -201,7 +207,7 @@ public:
 
 private:
    /// Add item data objects to output streamer list
-  void addItemObjects(const SG::FolderItem&, SG::SelectionVetoes& vetoes);
+  void addItemObjects(const SG::FolderItem&, SG::SelectionVetoes& vetoes, SG::CompressionInfo& compInfo);
 
    void handleVariableSelection (SG::IAuxStoreIO& auxio,
                                  SG::DataProxy& itemProxy,
diff --git a/Control/AthenaServices/src/CompressionInfo.h b/Control/AthenaServices/src/CompressionInfo.h
new file mode 100644
index 0000000000000000000000000000000000000000..e243be2210d9ffd983b83ea1d101ebe85ab160fb
--- /dev/null
+++ b/Control/AthenaServices/src/CompressionInfo.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
+ */
+
+/**
+ * @file AthenaServices/CompressionInfo.h
+ * @author Alaettin Serhan Mete <amete@cern.ch>
+ * @date Aug, 2020
+ * @brief Communicate between AthenaOuptutStream and ThinningCacheTool.
+ *
+ * AthenaOutputStream processes ItemList entries, including the selections
+ * of which static or dynamic variables to be lossy float compressed.
+ * This last information is later used by the ThinningCacheTool to
+ * populate the ThinningCache. To convey this information,
+ * AthenaOutputStream records a CompressionInfo object in the events store
+ * with a key of `CompressionInfo_STREAM`, for stream STREAM.
+ * CompressionInfo then contains a map from object names to
+ * a set of variables to be lossy float compressed and the associated 
+ * compression levels (nmantissa).
+ */
+
+#ifndef ATHENASERVICES_COMPRESSIONINFO_H
+#define ATHENASERVICES_COMPRESSIONINFO_H
+
+#include "AthenaKernel/ThinningInfo.h"
+
+#include <string>
+#include <unordered_map>
+
+
+namespace SG {
+
+  /**
+   * @brief Map of compressed variables and their compression levels
+   */
+
+  using CompressionInfo = std::unordered_map<std::string, SG::ThinningInfo::compression_map_t>;
+
+} // namespace SG
+
+CLASS_DEF( SG::CompressionInfo, 39950991, 1)
+
+#endif
diff --git a/Control/AthenaServices/src/DelayedConditionsCleanerSvc.cxx b/Control/AthenaServices/src/DelayedConditionsCleanerSvc.cxx
index bddcbdf3bd687bee41dcfcde4b5840c84c3c8016..23a29511087dfbcffaf695a533553b8869e8bd32 100644
--- a/Control/AthenaServices/src/DelayedConditionsCleanerSvc.cxx
+++ b/Control/AthenaServices/src/DelayedConditionsCleanerSvc.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 /*
  */
@@ -18,7 +18,6 @@
 #include "CxxUtils/StrFormat.h"
 #include "GaudiKernel/EventContext.h"
 #include "GaudiKernel/ServiceHandle.h"
-#include "tbb/task.h"
 #include <algorithm>
 
 
@@ -32,6 +31,11 @@
 #define USE_ASYNC_TASK 0
 
 
+#if USE_ASYNC_TASK
+#include "tbb/task.h"
+#endif
+
+
 namespace Athena {
 
 
diff --git a/Control/AthenaServices/src/ThinningCacheTool.cxx b/Control/AthenaServices/src/ThinningCacheTool.cxx
index f48816028bfd6c0bfe4c211088b46a3dcbd2463f..ed6393832205d18f7ffb6a814fd4a47276d517fc 100644
--- a/Control/AthenaServices/src/ThinningCacheTool.cxx
+++ b/Control/AthenaServices/src/ThinningCacheTool.cxx
@@ -16,7 +16,7 @@
 #include "AthenaKernel/ExtendedEventContext.h"
 #include "GaudiKernel/ThreadLocalContext.h"
 #include "SelectionVetoes.h"
-
+#include "CompressionInfo.h"
 
 namespace Athena {
 
@@ -106,6 +106,16 @@ StatusCode ThinningCacheTool::preStream()
     }
   }
 
+  // Look for any compression info
+  const std::string compInfoKey = "CompressionInfo_" + m_streamName;
+  const SG::CompressionInfo* compInfo = nullptr;
+  if (evtStore()->contains<SG::CompressionInfo> (compInfoKey)) {
+    ATH_CHECK( evtStore()->retrieve (compInfo, compInfoKey) );
+    for (const auto& p : *compInfo) {
+      m_cache.setCompression (p.first, p.second);
+    }
+  }
+
   // Set the TrigNavigation thinning tool if needed.
   if (!m_trigNavigationThinningSvc.empty()) {
     m_cache.setTrigNavigationThinningSvc (m_trigNavigationThinningSvc.get());
diff --git a/Control/AthenaServices/test/AthenaOutputStream_test.cxx b/Control/AthenaServices/test/AthenaOutputStream_test.cxx
index ca384f81d8650c5f29fe0c47b6e19e90025b20be..ec7891337355a36a787593514921af4711c20cc2 100644
--- a/Control/AthenaServices/test/AthenaOutputStream_test.cxx
+++ b/Control/AthenaServices/test/AthenaOutputStream_test.cxx
@@ -29,6 +29,7 @@
 
 #include "../src/AthenaOutputStream.h"
 #include "../src/SelectionVetoes.h"
+#include "../src/CompressionInfo.h"
 #include "TInterpreter.h"
 
 using std::cerr;
@@ -87,6 +88,18 @@ int main() {
   assert( (pStore->record(std::move(baz), "sei")).isSuccess() );
   assert( (pStore->record(std::move(bazaux), "seiAux.")).isSuccess() );
   
+  auto baz4lfc = std::make_unique<Baz>();
+  auto bazaux4lfc = std::make_unique<BazAuxContainer>();
+  baz4lfc->setStore (bazaux4lfc.get());
+  SG::AuxElement::Accessor<float> foo ("foo");
+  SG::AuxElement::Accessor<double> bar ("bar");
+  SG::AuxElement::Accessor<float> zzz ("zzz");
+  foo (*baz4lfc);
+  bar (*baz4lfc);
+  zzz (*baz4lfc);
+  assert( (pStore->record(std::move(baz4lfc), "comp")).isSuccess() );
+  assert( (pStore->record(std::move(bazaux4lfc), "compAux.")).isSuccess() );
+
   AthenaOutputStream* pStream(dynamic_cast<AthenaOutputStream*>(pAlg));
   assert( pStream );
 
@@ -97,7 +110,7 @@ int main() {
   //    pStream->selectedObjects()->begin() <<endl;
   // verify that we got the right objects in the list
   //  this of course depends on AthenaOutputStream_test.txt
-  assert( 8 == (pStream->selectedObjects()->end() - 
+  assert( 10 == (pStream->selectedObjects()->end() -
   		pStream->selectedObjects()->begin()) );
 
   for (DataObject* obj : *pStream->selectedObjects()) {
@@ -109,13 +122,22 @@ int main() {
 
   const SG::SelectionVetoes* selvetoes = nullptr;
   assert (pStore->retrieve (selvetoes, "SelectionVetoes_AthenaOutputStream").isSuccess());
-  assert (selvetoes->size() == 1);
+  assert (selvetoes->size() == 2);
   auto it = selvetoes->find("sei");
   assert (it != selvetoes->end());
   assert (!it->second.test (aaa.auxid()));
   assert ( it->second.test (bbb.auxid()));
   assert (!it->second.test (ccc.auxid()));
-  
+
+  const SG::CompressionInfo* compInfo = nullptr;
+  assert (pStore->retrieve (compInfo, "CompressionInfo_AthenaOutputStream").isSuccess());
+  assert (compInfo->size() == 2); // 2 levels of compression as high/low
+  auto val = compInfo->find("comp");
+  assert (val != compInfo->end());
+  assert (val->second.at(10).test(foo.auxid()));  // compress foo high
+  assert (!val->second.at(10).test(bar.auxid())); // don't compress bar since it's double
+  assert (val->second.at(16).test(zzz.auxid()));  // compress zzz low
+
   pStream->clearSelection();
   assert( 0 == (pStream->selectedObjects()->end() - 
 		pStream->selectedObjects()->begin()) );
diff --git a/Control/AthenaServices/test/ThinningCacheTool_test.cxx b/Control/AthenaServices/test/ThinningCacheTool_test.cxx
index e16bbf18dcd0cf7a42d1d8d7a2ff9f73009c6285..2045e2d80119d529f299f2db24a873e8077940d3 100644
--- a/Control/AthenaServices/test/ThinningCacheTool_test.cxx
+++ b/Control/AthenaServices/test/ThinningCacheTool_test.cxx
@@ -11,6 +11,7 @@
 
 #undef NDEBUG
 #include "../src/SelectionVetoes.h"
+#include "../src/CompressionInfo.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "AthenaBaseComps/AthService.h"
 #include "AthContainers/DataVector.h"
@@ -152,7 +153,47 @@ void test1()
   assert (!SG::getThinningInfo ("v3")->vetoed (10));
   assert (SG::getThinningInfo ("v3")->vetoed (11));
   assert (SG::getThinningInfo ("v3")->vetoed (12));
-  
+
+  // Set dummy lossy float compression information
+  auto compInfo = std::make_unique<SG::CompressionInfo>();
+
+  SG::ThinningInfo::compression_map_t compression1;
+  SG::auxid_set_t s4; s4.set(10); s4.set(11);
+  compression1[7] = s4;
+  (*compInfo).emplace ("f1", compression1);
+
+  SG::ThinningInfo::compression_map_t compression2;
+  SG::auxid_set_t s5; s5.set(10); s5.set(11); s5.set(33);
+  compression2[15] = s5;
+  compression2[16] = s5;
+  (*compInfo).emplace ("f2", compression2);
+
+  // Record the compression information in the SG
+  assert (sg->record (std::move (compInfo), "CompressionInfo_MyStream").isSuccess());
+
+  assert (tool->preStream().isSuccess());
+  assert (SG::getThinningCache() != nullptr);
+
+  // Test that we can get the thinning information for the relevant keys
+  assert (SG::getThinningInfo ("f1") != nullptr);
+  assert (SG::getThinningInfo ("f2") != nullptr);
+
+  // Test that we have the correct size of the compression maps for the relevant keys
+  assert (SG::getThinningInfo ("f1")->m_compression.size() == 1); // 1 level
+  assert (SG::getThinningInfo ("f2")->m_compression.size() == 2); // 2 levels
+  // Test that we have the correct size of the AuxIDs for the relevant compression levels
+  assert (SG::getThinningInfo ("f1")->m_compression.at(7).size() == 2); // 2 AuxIDs
+  assert (SG::getThinningInfo ("f2")->m_compression.at(15).size() == 3); // 3 AuxIDs
+  assert (SG::getThinningInfo ("f2")->m_compression.at(16).size() == 3);
+  // Test that we can get the correct compression information overall
+  assert (SG::getThinningInfo ("f1")->compression(10) == 7);
+  assert (SG::getThinningInfo ("f1")->compression(11) == 7);
+  assert (SG::getThinningInfo ("f1")->compression(12) == 0);
+  assert (SG::getThinningInfo ("f2")->compression(10) == 15);
+  assert (SG::getThinningInfo ("f2")->compression(11) == 15);
+  assert (SG::getThinningInfo ("f2")->compression(10) != 16);
+  assert (SG::getThinningInfo ("f2")->compression(33) != 16);
+
   assert (tool->postExecute().isSuccess());
   assert (SG::getThinningCache() == nullptr);
 
diff --git a/Control/CxxUtils/CxxUtils/get_unaligned.h b/Control/CxxUtils/CxxUtils/get_unaligned.h
index 48a2df6faa82f4ab879cb833e8e012923db3aeaa..02aa49fa19d3a553ec72889faecaa46f617f98cb 100644
--- a/Control/CxxUtils/CxxUtils/get_unaligned.h
+++ b/Control/CxxUtils/CxxUtils/get_unaligned.h
@@ -1,6 +1,6 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 /*
- * 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 CxxUtils/get_unaligned.h
@@ -12,7 +12,7 @@
  *@code
  *   char* p = ...;
  *   int* ip = reinterpret_cast<int*>(p);
- *   int i = *ip;
+ *   int i = *ip++;
  @endif
  *
  * is undefined if @c p isn't aligned to an int boundary.  It further
@@ -50,9 +50,10 @@ namespace CxxUtils {
 
 /**
  * @brief Read a 2-byte little-endian value from a possibly unaligned pointer.
- * @param p Pointer from which to read.
+ * @param p Pointer from which to read.  Advanced to the next value.
  *
- * Reads a little-endian value, regardless of the host byte ordering.
+ * Reads a little-endian value, regardless of the host byte ordering,
+ * and advances the pointer.
  * Should not rely on undefined behavior, regardless of the alignment of @c p.
  *
  * If used in a loop, you'll get better code with a restricted pointer.
@@ -69,9 +70,10 @@ uint16_t get_unaligned16 (const uint8_t* ATH_RESTRICT &  p)
 
 /**
  * @brief Read a 4-byte little-endian value from a possibly unaligned pointer.
- * @param p Pointer from which to read.
+ * @param p Pointer from which to read.  Advanced to the next value.
  *
- * Reads a little-endian value, regardless of the host byte ordering.
+ * Reads a little-endian value, regardless of the host byte ordering,
+ * and advances the pointer.
  * Should not rely on undefined behavior, regardless of the alignment of @c p.
  *
  * If used in a loop, you'll get better code with a restricted pointer.
@@ -88,9 +90,10 @@ uint32_t get_unaligned32 (const uint8_t* ATH_RESTRICT &  p)
 
 /**
  * @brief Read a 8-byte little-endian value from a possibly unaligned pointer.
- * @param p Pointer from which to read.
+ * @param p Pointer from which to read.  Advanced to the next value.
  *
- * Reads a little-endian value, regardless of the host byte ordering.
+ * Reads a little-endian value, regardless of the host byte ordering,
+ * and advances the pointer.
  * Should not rely on undefined behavior, regardless of the alignment of @c p.
  *
  * If used in a loop, you'll get better code with a restricted pointer.
@@ -107,9 +110,10 @@ uint64_t get_unaligned64 (const uint8_t* ATH_RESTRICT &  p)
 
 /**
  * @brief Read little-endian float value from a possibly unaligned pointer.
- * @param p Pointer from which to read.
+ * @param p Pointer from which to read.  Advanced to the next value.
  *
- * Reads a little-endian value, regardless of the host byte ordering.
+ * Reads a little-endian value, regardless of the host byte ordering,
+ * and advances the pointer.
  * Should not rely on undefined behavior, regardless of the alignment of @c p.
  *
  * If used in a loop, you'll get better code with a restricted pointer.
@@ -128,9 +132,10 @@ float get_unaligned_float (const uint8_t* ATH_RESTRICT &  p)
 
 /**
  * @brief Read little-endian float value from a possibly unaligned pointer.
- * @param p Pointer from which to read.
+ * @param p Pointer from which to read.  Advanced to the next value.
  *
- * Reads a little-endian value, regardless of the host byte ordering.
+ * Reads a little-endian value, regardless of the host byte ordering,
+ * and advances the pointer.
  * Should not rely on undefined behavior, regardless of the alignment of @c p.
  *
  * If used in a loop, you'll get better code with a restricted pointer.
diff --git a/Control/PileUpTools/PileUpTools/PileUpMergeSvc.h b/Control/PileUpTools/PileUpTools/PileUpMergeSvc.h
index e17497eb62a41b457fe416dd2624efe49653657e..501b633c81605ffecfca9596c911238b138a9969 100755
--- a/Control/PileUpTools/PileUpTools/PileUpMergeSvc.h
+++ b/Control/PileUpTools/PileUpTools/PileUpMergeSvc.h
@@ -1,7 +1,7 @@
 /* -*- C++ -*- */
 
 /*
-  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 PileUpMergeSvc.h
@@ -26,6 +26,7 @@
 #include "GaudiKernel/ToolHandle.h"
 
 #include "AthLinks/DataLink.h"
+#include "AthenaKernel/SlotSpecificObj.h"
 
 #include "PileUpTools/IPileUpXingFolder.h"
 
@@ -34,6 +35,7 @@
 #include <list>
 #include <map>
 #include <utility> /*std::pair*/
+#include <mutex>
 
 class ActiveStoreSvc;
 class ISvcLocator;
@@ -123,6 +125,10 @@ private:
   ServiceHandle<ActiveStoreSvc> p_activeStore;  ///< current active store
   ToolHandleArray<IPileUpXingFolder> m_intervals; ///< Property: bunch xing intervals
 
+  // Protect against multiple threads trying to make EventInfo
+  // for the same slot.
+  mutable SG::SlotSpecificObj<std::mutex> m_slotMutex;
+
   template <typename DATA, typename KEY>
   bool isLive(const KEY& key, int iXing);   ///< is iXing live for DATA/key?
   bool isLive(CLID id, const std::string& dataKey, int iXing);
diff --git a/Control/PileUpTools/src/PileUpMergeSvc.cxx b/Control/PileUpTools/src/PileUpMergeSvc.cxx
index e71413a676df0e9f6fbe6d5073cecbbc751a78a9..b5af613ade38f6e56266bc0da338728eb39a4a6d 100755
--- a/Control/PileUpTools/src/PileUpMergeSvc.cxx
+++ b/Control/PileUpTools/src/PileUpMergeSvc.cxx
@@ -146,6 +146,11 @@ const xAOD::EventInfo* PileUpMergeSvc::getPileUpEvent( StoreGateSvc* sg, const s
          }
       }
    } else {
+      // Don't allow more than one thread per slot through here.
+      // Otherwise, we can get errors with multiple threads trying
+      // to record the EventInfo object.
+      std::lock_guard<std::mutex> lock (*m_slotMutex);
+
       // Try reading old EventInfo
       const EventInfo* pEvent = einame.empty()?
          sg->tryConstRetrieve< ::EventInfo >()
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
index 5dd8b78c7465387a025128620bd1236ba789e724..a8c03cec08640d098c5d2808da1ce8af68a727ed 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
@@ -1,22 +1,22 @@
-Mon Aug  3 17:11:40 CEST 20?0
+Fri Aug  7 15:15:34 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ConcatJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5545 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5548 configurables from 5 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
-                                          running on lxplus706.cern.ch on Mon Aug  3 17:11:48 20?0
+                                          running on atpc002 on Fri Aug  7 15:15:42 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3312 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3316 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 705 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 581 CLIDRegistry entries for module ALL
@@ -32,8 +32,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.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/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -44,7 +44,7 @@ MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
 OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
 xAODMaker::Even...WARNING Beam conditions service not available
 xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo
-ClassIDSvc           INFO  getRegistryEntries: read 1147 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1137 CLIDRegistry entries for module ALL
 WriteData           DEBUG Property update for OutputLevel : new value = 2
 WriteData            INFO in initialize()
 WriteData           DEBUG input handles: 0
@@ -82,13 +82,14 @@ Stream1              INFO I/O reinitialization...
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
 Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 1
+Stream1             DEBUG output handles: 2
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream1' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) 
 MakeInputDataHe...   INFO Initializing MakeInputDataHeader - package version OutputStreamAthenaPool-00-00-00
 MakeInputDataHe...   INFO Name of Stream to be made Input: Stream1
@@ -115,13 +116,14 @@ Stream2              INFO I/O reinitialization...
 Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
 Stream2             DEBUG End initialize
 Stream2             DEBUG input handles: 0
-Stream2             DEBUG output handles: 1
+Stream2             DEBUG output handles: 2
 Stream2             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream2             DEBUG Adding private ToolHandle tool Stream2.ThinningCacheTool_Stream2 (Athena::ThinningCacheTool)
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2Tool (AthenaOutputStreamTool)
 Stream2             DEBUG Data Deps for Stream2
   + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream2' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream2' ) 
 EventSelector        INFO  Enter McEventSelector Initialization 
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
@@ -1701,11 +1703,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=  0.0513(+-   0.714)/       0/      10 [ms] #=390
-commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.238(+-    1.52)/       0/      10 [ms] #= 42
-cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.242(+-    1.54)/       0/      10 [ms] #=124
-fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.242(+-    1.54)/       0/      10 [ms] #=124
-ChronoStatSvc        INFO Time User   : Tot=  300 [ms]  #=  1
+commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 42
+cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.161(+-    1.26)/       0/      10 [ms] #=124
+cRepR_ALL            INFO Time User   : Tot=   60 [ms] Ave/Min/Max=   0.154(+-    1.23)/       0/      10 [ms] #=390
+fRep_ALL             INFO Time User   : Tot=   60 [ms] Ave/Min/Max=   0.484(+-    2.15)/       0/      10 [ms] #=124
+ChronoStatSvc        INFO Time User   : Tot=  330 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
index 77923852e2d1d51110981af5389db1aef7ac3a29..36521a79644d0a0921967039a695cb62ea7a46c5 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
@@ -1,22 +1,22 @@
-Mon Aug  3 17:56:12 CEST 20?0
+Fri Aug  7 15:14:55 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_CopyJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5545 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5548 configurables from 5 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
-                                          running on lxplus706.cern.ch on Mon Aug  3 17:56:21 20?0
+                                          running on atpc002 on Fri Aug  7 15:15:03 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3312 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3316 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 609 CLIDRegistry entries for module ALL
 MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
@@ -28,8 +28,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.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/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -107,7 +107,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1652 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1642 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -142,13 +142,14 @@ Stream1              INFO I/O reinitialization...
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
 Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 1
+Stream1             DEBUG output handles: 2
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream1' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) 
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -833,13 +834,13 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 62
+commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
 fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.161(+-    1.26)/       0/      10 [ms] #= 62
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.156(+-    1.24)/       0/      10 [ms] #= 64
 cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.154(+-    1.23)/       0/      10 [ms] #= 65
 cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  350 [ms]  #=  1
+ChronoStatSvc        INFO Time User   : Tot=  300 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
index d4f218ec832b3d1bd0f3fb7a13073533260c675f..477a0266fc310e652b88a878141892066b9f23fb 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
@@ -1,22 +1,22 @@
-Mon Aug  3 17:18:44 CEST 20?0
+Fri Aug  7 15:14:35 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RWJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5545 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5548 configurables from 5 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
-                                          running on lxplus706.cern.ch on Mon Aug  3 17:18:52 20?0
+                                          running on atpc002 on Fri Aug  7 15:14:43 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3312 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3316 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 846 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 344 CLIDRegistry entries for module ALL
@@ -32,8 +32,8 @@ PoolSvc             DEBUG Service base class initialized successfully
 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/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -114,7 +114,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1652 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1642 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -164,13 +164,14 @@ Stream1              INFO I/O reinitialization...
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
 Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 1
+Stream1             DEBUG output handles: 2
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream1' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) 
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -1906,13 +1907,13 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 62
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.317(+-    1.75)/       0/      10 [ms] #= 63
-cObjR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.303(+-    1.71)/       0/      10 [ms] #= 66
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.139(+-    1.17)/       0/      10 [ms] #=144
-fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.484(+-    2.15)/       0/      10 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  310 [ms]  #=  1
+commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
+cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.159(+-    1.25)/       0/      10 [ms] #= 63
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.152(+-    1.22)/       0/      10 [ms] #= 66
+cRepR_ALL            INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.208(+-    1.43)/       0/      10 [ms] #=144
+fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=   0.645(+-    2.46)/       0/      10 [ms] #= 62
+ChronoStatSvc        INFO Time User   : Tot=  290 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
index 19f77965187744cd963e125c6144429618b282f6..24e0640b8edad78541599cf89eb107b33d4b681e 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
@@ -1,22 +1,22 @@
-Mon Aug  3 17:53:13 CEST 20?0
+Fri Aug  7 15:15:05 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteAgainJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5545 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5548 configurables from 5 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
-                                          running on lxplus706.cern.ch on Mon Aug  3 17:53:22 20?0
+                                          running on atpc002 on Fri Aug  7 15:15:13 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3312 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3316 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 846 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 344 CLIDRegistry entries for module ALL
@@ -32,8 +32,8 @@ PoolSvc             DEBUG Service base class initialized successfully
 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/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -108,7 +108,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1649 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1639 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolRepli...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -158,13 +158,14 @@ Stream1              INFO I/O reinitialization...
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
 Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 1
+Stream1             DEBUG output handles: 2
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream1' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) 
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -1961,13 +1962,13 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 62
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 65
-cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.159(+-    1.25)/       0/      10 [ms] #= 63
+fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.161(+-    1.26)/       0/      10 [ms] #= 62
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0694(+-    0.83)/       0/      10 [ms] #=144
-fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  310 [ms]  #=  1
+commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.476(+-    2.13)/       0/      10 [ms] #= 21
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.317(+-    1.75)/       0/      10 [ms] #= 63
+cObjR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.308(+-    1.73)/       0/      10 [ms] #= 65
+ChronoStatSvc        INFO Time User   : Tot=  250 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
index 526e9f83ade4a27d72589b2b9777b2efb78ea134..06a2c48dac9800f1649f1822bf0e246f032659b4 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
@@ -1,22 +1,22 @@
-Mon Aug  3 17:50:27 CEST 20?0
+Fri Aug  7 15:15:15 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteNextJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5545 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5548 configurables from 5 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
-                                          running on lxplus706.cern.ch on Mon Aug  3 17:50:36 20?0
+                                          running on atpc002 on Fri Aug  7 15:15:23 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3312 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3316 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 846 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 344 CLIDRegistry entries for module ALL
@@ -32,8 +32,8 @@ PoolSvc             DEBUG Service base class initialized successfully
 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/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -114,7 +114,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1652 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1642 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -164,13 +164,14 @@ Stream1              INFO I/O reinitialization...
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
 Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 1
+Stream1             DEBUG output handles: 2
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream1' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) 
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -1266,11 +1267,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 62
-fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.161(+-    1.26)/       0/      10 [ms] #= 62
-cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.154(+-    1.23)/       0/      10 [ms] #= 65
-cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0694(+-    0.83)/       0/      10 [ms] #=144
+cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #=144
+cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 65
+fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.323(+-    1.77)/       0/      10 [ms] #= 62
 cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.317(+-    1.75)/       0/      10 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot=  310 [ms]  #=  1
+ChronoStatSvc        INFO Time User   : Tot=  260 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
index 898cba10a90c0412b7058e0345da860525675d79..0a15f91cbe6a3e96750de24478a980ec023116d2 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
@@ -1,22 +1,22 @@
-Mon Aug  3 16:49:55 CEST 20?0
+Fri Aug  7 15:16:13 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WMetaJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5545 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5548 configurables from 5 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
-                                          running on lxplus706.cern.ch on Mon Aug  3 16:50:04 20?0
+                                          running on atpc002 on Fri Aug  7 15:16:21 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3312 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3316 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 705 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 344 CLIDRegistry entries for module ALL
@@ -32,8 +32,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog2.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/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -44,7 +44,7 @@ MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
 OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
 xAODMaker::Even...WARNING Beam conditions service not available
 xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo
-ClassIDSvc           INFO  getRegistryEntries: read 1147 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1137 CLIDRegistry entries for module ALL
 WriteData           DEBUG Property update for OutputLevel : new value = 2
 WriteData            INFO in initialize()
 WriteData           DEBUG input handles: 0
@@ -76,13 +76,14 @@ Stream1              INFO I/O reinitialization...
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
 Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 1
+Stream1             DEBUG output handles: 2
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream1' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) 
 EventSelector        INFO  Enter McEventSelector Initialization 
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
@@ -983,10 +984,10 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #= 21
-cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.317(+-    1.75)/       0/      10 [ms] #= 63
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=  0.0613(+-   0.781)/       0/      10 [ms] #=326
-fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.476(+-    2.13)/       0/      10 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot=  280 [ms]  #=  1
+cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0307(+-   0.553)/       0/      10 [ms] #=326
+cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.476(+-    2.78)/       0/      20 [ms] #= 63
+fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=   0.635(+-    2.44)/       0/      10 [ms] #= 63
+ChronoStatSvc        INFO Time User   : Tot=  300 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
index 4d667a510dbd0327241fc2d4301885aa681472ec..166dddac8a761b5d3994fd6c842ef8dde5b09e8b 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
@@ -1,22 +1,22 @@
-Mon Aug  3 19:21:45 CEST 20?0
+Fri Aug  7 15:14:24 CEST 20?0
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WriteJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5545 configurables from 8 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5548 configurables from 5 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v33r2)
-                                          running on lxplus706.cern.ch on Mon Aug  3 19:22:04 20?0
+                                          running on atpc002 on Fri Aug  7 15:14:32 20?0
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO  getRegistryEntries: read 3312 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3316 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 705 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 581 CLIDRegistry entries for module ALL
@@ -32,8 +32,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.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/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-06T2137/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host atpc002.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -44,7 +44,7 @@ MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
 OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
 xAODMaker::Even...WARNING Beam conditions service not available
 xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo
-ClassIDSvc           INFO  getRegistryEntries: read 1147 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1137 CLIDRegistry entries for module ALL
 WriteData           DEBUG Property update for OutputLevel : new value = 2
 WriteData            INFO in initialize()
 WriteData           DEBUG input handles: 0
@@ -77,13 +77,14 @@ Stream1              INFO I/O reinitialization...
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
 Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 1
+Stream1             DEBUG output handles: 2
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool)
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream1' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) 
 Stream2             DEBUG Property update for OutputLevel : new value = 2
 Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
@@ -108,13 +109,14 @@ Stream2              INFO I/O reinitialization...
 Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
 Stream2             DEBUG End initialize
 Stream2             DEBUG input handles: 0
-Stream2             DEBUG output handles: 1
+Stream2             DEBUG output handles: 2
 Stream2             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2_MakeEventStreamInfo (MakeEventStreamInfo)
 Stream2             DEBUG Adding private ToolHandle tool Stream2.ThinningCacheTool_Stream2 (Athena::ThinningCacheTool)
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2Tool (AthenaOutputStreamTool)
 Stream2             DEBUG Data Deps for Stream2
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+RunEventTag' ) 
+  + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_Stream2' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream2' ) 
 DecisionSvc          INFO Inserting stream: Stream3 with no Algs
 Stream3.Stream3...   INFO Initializing Stream3.Stream3Tool - package version AthenaServices-00-00-00
@@ -1327,11 +1329,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=   0.233(+-    1.51)/       0/      10 [ms] #= 43
-cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0368(+-   0.605)/       0/      10 [ms] #=272
-cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.189(+-    1.36)/       0/      10 [ms] #=106
-fRep_ALL             INFO Time User   : Tot=   60 [ms] Ave/Min/Max=   0.566(+-    2.31)/       0/      10 [ms] #=106
-ChronoStatSvc        INFO Time User   : Tot=  360 [ms]  #=  1
+commitOutput         INFO Time User   : Tot=   20 [ms] Ave/Min/Max=   0.465(+-    2.11)/       0/      10 [ms] #= 43
+cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.283(+-    1.66)/       0/      10 [ms] #=106
+cRepR_ALL            INFO Time User   : Tot=   30 [ms] Ave/Min/Max=    0.11(+-    1.04)/       0/      10 [ms] #=272
+fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=   0.377(+-    1.91)/       0/      10 [ms] #=106
+ChronoStatSvc        INFO Time User   : Tot=  390 [ms]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/DetectorDescription/AGDD/AGDD2GeoSvc/CMakeLists.txt b/DetectorDescription/AGDD/AGDD2GeoSvc/CMakeLists.txt
index 4aa3c259c299827df0e922b7d0a9b39e05678b8d..bcc473f78cb27f8c484978ba50b1a3c67f75c2f0 100644
--- a/DetectorDescription/AGDD/AGDD2GeoSvc/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDD2GeoSvc/CMakeLists.txt
@@ -1,27 +1,15 @@
-################################################################################
-# Package: AGDD2GeoSvc
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( AGDD2GeoSvc )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          DetectorDescription/AGDD/AGDDControl
-                          DetectorDescription/AGDD/AGDDKernel
-                          GaudiKernel
-                          PRIVATE
-                          DetectorDescription/AGDD/AGDDHandlers )
-
 atlas_add_library ( AGDD2GeoSvcLib
                     INTERFACE
                     PUBLIC_HEADERS AGDD2GeoSvc
-                    LINK_LIBRARIES GaudiKernel )
+                    LINK_LIBRARIES AGDDControl AGDDKernel AthenaBaseComps GaudiKernel )
 
 # Component(s) in the package:
 atlas_add_component( AGDD2GeoSvc
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps AGDDControl AGDDKernel GaudiKernel AGDDHandlers )
-
+                     LINK_LIBRARIES AGDD2GeoSvcLib AGDDHandlers )
diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h
index 31afdb6b9826064429664c37cea37054812b4d95..e3be9284eeda9383ed4b85e001e6840c5563a4c6 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h
@@ -1,9 +1,9 @@
 /*
-  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 EXPRESSION_EVALUATOR_H
-#define EXPRESSION_EVALUATOR_H 1
+#define EXPRESSION_EVALUATOR_H
 
 #include "CLHEP/Evaluator/Evaluator.h"
 
@@ -11,9 +11,9 @@
 #include <vector>
 #include <map>
 
-typedef std::map< std::string, double >         ConstantsTable;
-typedef std::map< std::string, double >         PhysicalConstantsTable;
-typedef std::map< std::string, std::string >       ExpressionsTable;
+typedef std::map< std::string, double> ConstantsTable;
+typedef std::map< std::string, double> PhysicalConstantsTable;
+typedef std::map< std::string, std::string> ExpressionsTable;
 
 class ExpressionEvaluator
 {
diff --git a/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt b/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt
index c8986c02c8f685c9f1fd7ac01928e6bd6bda951a..23db9a386de32c133bbc63d75c7646317aff33b9 100644
--- a/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt
@@ -1,35 +1,19 @@
-################################################################################
-# Package: AGDDControl
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( AGDDControl )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          DetectorDescription/AGDD/AGDDKernel
-                          PRIVATE
-                          Control/StoreGate
-                          DetectorDescription/AGDD/AGDDModel
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-                          DetectorDescription/GeoModel/GeoModelUtilities
-			              DetectorDescription/GeoPrimitives
-                          GaudiKernel
-                          Tools/PathResolver )
-
 # External dependencies:
 find_package( CLHEP )
 find_package( XercesC )
-find_package( Eigen )
 find_package( GeoModelCore )
+find_package( ROOT COMPONENTS Core )
 
 # Component(s) in the package:
 atlas_add_library( AGDDControl
                    src/*.cxx
                    PUBLIC_HEADERS AGDDControl
-                   INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIR}
+                   INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AGDDKernel StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES AGDDModel GeoModelUtilities GaudiKernel PathResolver )
-
+                   LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AGDDKernel GaudiKernel
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AGDDModel AthenaKernel GeoModelInterfaces GeoModelUtilities PathResolver StoreGateLib )
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
index f218cb84dca7e7ac083e67a8db58b4eb3dad06c4..e5b6a83a1ae7ce26eeca8e4205e74078757d10b2 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
@@ -58,7 +58,6 @@
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
 #include "GeoModelInterfaces/StoredMaterialManager.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 #include <sstream>
@@ -226,20 +225,20 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 	static GeoShape *s2=new GeoShapeShift(box1,ttt2);
 	
 	double radius=v->Radius();
-	CLHEP::Hep3Vector axis0(v->GetPoint(0)-v->GetPoint(1));
-	CLHEP::Hep3Vector axis(v->GetPoint(1)-v->GetPoint(0));
-	CLHEP::Hep3Vector axis1;
-	CLHEP::Hep3Vector axis2(v->GetPoint(2)-v->GetPoint(1));
-	double length=axis.mag();
+	GeoTrf::Vector3D axis0(v->GetPoint(0)-v->GetPoint(1));
+	GeoTrf::Vector3D axis(v->GetPoint(1)-v->GetPoint(0));
+	GeoTrf::Vector3D axis1 = GeoTrf::Vector3D::Identity();
+	GeoTrf::Vector3D axis2(v->GetPoint(2)-v->GetPoint(1));
+	double length=axis.norm();
 	double angle1=0;
-	double angle2=std::abs(axis.angle(axis2))/2;
+	double angle2=std::abs(std::atan2(axis.cross(axis2).norm(), axis.dot(axis2)))/2;
 	double delta_l1=0;
 	double delta_l2=radius*std::tan(angle2);
 	double lengthnew=length+delta_l2;
 	GeoShape* solid=new GeoTubs(0.,radius,lengthnew/2.,0.,4*std::asin(1.));
 	
 	const GeoTrf::Vector3D vt(0.,0.,-lengthnew/2.+delta_l2+2.);
-	GeoTrf::Transform3D rrr = GeoTrf::RotateY3D(angle2)*GeoTrf::RotateZ3D(axis2.phi());
+	GeoTrf::Transform3D rrr = GeoTrf::RotateY3D(angle2)*GeoTrf::RotateZ3D(phi(axis2));
 	GeoShape *ssnew=new GeoShapeShift(s1,GeoTrf::Translation3D(vt)*rrr);
 	
 	solid = new GeoShapeSubtraction(solid,ssnew);
@@ -247,7 +246,7 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 	GeoTrf::Vector3D vref(0.,0.,-lengthnew/2.);
 	GeoTrf::Transform3D tref = GeoTrf::Transform3D::Identity()*GeoTrf::Translation3D(vref);
 	solid=new GeoShapeShift(solid,tref);
-	GeoTrf::Transform3D r1 = GeoTrf::RotateZ3D(axis0.phi())*GeoTrf::RotateY3D(axis0.theta());
+	GeoTrf::Transform3D r1 = GeoTrf::RotateZ3D(phi(axis0))*GeoTrf::RotateY3D(theta(axis0));
 	GeoTrf::Vector3D vtt(v->GetPoint(0).x(),v->GetPoint(0).y(),v->GetPoint(0).z());
 	solid=new GeoShapeShift(solid,GeoTrf::Translation3D(vtt)*r1);
 	
@@ -257,17 +256,17 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 		axis=v->GetPoint(i+1)-v->GetPoint(i);
 		axis1=v->GetPoint(i)-v->GetPoint(i-1);
 
-		length=axis.mag();
-		angle1=std::abs(axis.angle(axis1))/2;
+		length=axis.norm();
+		angle1=std::abs(std::atan2(axis.cross(axis1).norm(), axis.dot(axis1)))/2;
 		delta_l1=radius*std::tan(angle1);
 		delta_l2=0;
 		if (i<(v->NrOfPoints()-2)) 
 		{
 			axis2=v->GetPoint(i+2)-v->GetPoint(i+1);
-			angle2=std::abs(axis.angle(axis2))/2;
+			angle2=std::abs(std::atan2(axis.cross(axis2).norm(), axis.dot(axis2)))/2;
 			delta_l2=radius*std::tan(angle2);
 		}
-		length=axis.mag();
+		length=axis.norm();
 		lengthnew=length+delta_l1+delta_l2;
 
 		GeoTrf::Vector3D vvref(0.,0.,-lengthnew/2+delta_l1);
@@ -277,8 +276,8 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 
 		const GeoTrf::Vector3D vt1(0.,0.,+lengthnew/2.-delta_l1-2.);
 		const GeoTrf::Vector3D vt2(0.,0.,-lengthnew/2.+delta_l2+2.);
-		GeoTrf::Transform3D rrr1 = GeoTrf::RotateZ3D(-axis1.phi())*GeoTrf::RotateY3D(angle1);
-		GeoTrf::Transform3D rrr2 = GeoTrf::RotateZ3D(axis2.phi())*GeoTrf::RotateY3D(-angle2);
+		GeoTrf::Transform3D rrr1 = GeoTrf::RotateZ3D(-phi(axis1))*GeoTrf::RotateY3D(angle1);
+		GeoTrf::Transform3D rrr2 = GeoTrf::RotateZ3D(phi(axis2))*GeoTrf::RotateY3D(-angle2);
 		GeoTrf::Transform3D ttt1 = rrr1*GeoTrf::Translation3D(vt1);
 		GeoTrf::Transform3D ttt2 = rrr2*GeoTrf::Translation3D(vt2);
 		GeoShape *ssnew1=new GeoShapeShift(s2,ttt1);
@@ -291,7 +290,7 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 
 		ss=new GeoShapeShift(ss,ttref);
 		
-		GeoTrf::Transform3D rr1 = GeoTrf::RotateZ3D(axis0.phi())*GeoTrf::RotateY3D(axis0.theta());
+		GeoTrf::Transform3D rr1 = GeoTrf::RotateZ3D(phi(axis0))*GeoTrf::RotateY3D(theta(axis0));
 		const GeoTrf::Vector3D vv(v->GetPoint(i).x(),v->GetPoint(i).y(),v->GetPoint(i).z());
 		ss=new GeoShapeShift(ss,GeoTrf::Translation3D(vv)*rr1);
 		solid=new GeoShapeUnion(solid,ss);
@@ -364,14 +363,14 @@ void AGDD2GeoModelBuilder::CreateUnion(AGDDUnion* v)
 	AGDDVolume *vol=pos->GetVolume();
 	vol->CreateSolid();
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
-	sV=new GeoShapeShift(sV,Amg::CLHEPTransformToEigen(pos->Transform()));
+	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
  		vv->CreateSolid();
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
-		nsV=new GeoShapeShift(nsV,Amg::CLHEPTransformToEigen(pp->Transform()));
+		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeUnion(sV,nsV);
  	}
 	v->SetMaterial(vol->GetMaterial());
@@ -385,14 +384,14 @@ void AGDD2GeoModelBuilder::CreateIntersection(AGDDIntersection* v)
 	AGDDVolume *vol=pos->GetVolume();
 	vol->CreateSolid();
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
-	sV=new GeoShapeShift(sV,Amg::CLHEPTransformToEigen(pos->Transform()));
+	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
  		vv->CreateSolid();
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
-		nsV=new GeoShapeShift(nsV,Amg::CLHEPTransformToEigen(pp->Transform()));
+		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeIntersection(sV,nsV);
  	}
 	v->SetMaterial(vol->GetMaterial());
@@ -405,14 +404,14 @@ void AGDD2GeoModelBuilder::CreateSubtraction(AGDDSubtraction* v)
 	AGDDVolume *vol=pos->GetVolume();
 	vol->CreateSolid();
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
-	sV=new GeoShapeShift(sV,Amg::CLHEPTransformToEigen(pos->Transform()));
+	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
  		vv->CreateSolid();
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
-		nsV=new GeoShapeShift(nsV,Amg::CLHEPTransformToEigen(pp->Transform()));
+		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeSubtraction(sV,nsV);
  	}
 	v->SetMaterial(vol->GetMaterial());
@@ -499,7 +498,7 @@ void AGDD2GeoModelBuilder::CreateComposition(AGDDComposition *v)
 					log<<MSG::WARNING<<"CreateComposition() - AGDDDetectorPositioner is nullptr"<<endmsg;
 				}
 			}
-			GeoTrf::Transform3D trf=Amg::CLHEPTransformToEigen(pos->Transform());
+			GeoTrf::Transform3D trf=pos->Transform();
 			GeoTransform *geotrf=new GeoTransform(trf);
 			void *temp=vol->GetVolume();
 			
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
index 236a138742e799c433cd623c5f0a6afa23a1ce74..307f982b2eeab68cac0ae4f6f0259458308c695e 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
@@ -3,6 +3,7 @@
 */
 
 #include "AGDDControl/AGDDController.h"
+
 #include "AGDDKernel/AGDDBuilder.h"
 #include "AGDDControl/IAGDDParser.h"
 #include "AGDDControl/XercesParser.h"
@@ -12,21 +13,21 @@
 #include "AGDDKernel/AGDDVolume.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "AGDDKernel/AliasStore.h"
-
 #include "GeoModelInterfaces/IGeoModelSvc.h"
 #include "GeoModelUtilities/GeoModelExperiment.h"
 #include "GeoModelKernel/GeoVDetectorManager.h"
 #include "GeoModelKernel/GeoPhysVol.h"
 #include "GeoModelKernel/GeoVPhysVol.h"
 #include "GeoModelKernel/GeoPVConstLink.h"
-
 #include "StoreGate/StoreGateSvc.h"
+
 #include <map>
 #include <vector>
 #include <string>
 #include <fstream>
 #include <ctime>
 #include <TString.h> // for Form
+#include <iostream>
 
 std::vector<const GeoLogVol*> volumeMap;
 
diff --git a/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx b/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx
index 7b32e81636873a1ce8f0fa720aa825de5a2b5b54..7b9d4bcaec4ba7d59326cd4cc8efc494f409c230 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx
@@ -1,13 +1,10 @@
 /*
-  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 "AGDDControl/ExpressionEvaluator.h"
 #include "AGDDControl/AGDDTokenizer.h"
-#include "CLHEP/Units/PhysicalConstants.h"
-#include <string>
-#include <vector>
+
 #include <cstdlib>
 #include <cctype>
 #include <cstring>
@@ -15,14 +12,10 @@
 #include <sstream>
 #include <algorithm>
 
-namespace CLHEP {}
-using namespace CLHEP;
-
 ExpressionEvaluator::ExpressionEvaluator()
 {
   m_calc.clear();
   m_calc.setStdMath();                 // set standard constants and functions
-  //m_calc.setSystemOfUnits();           // set SI units
   // Set Geant4 system of units
   m_calc.setSystemOfUnits(1.e+3, 1./1.60217733e-25, 1.e+9, 1./1.60217733e-10,1.0, 1.0, 1.0);
   m_fileCurrentlyParsed = "";
@@ -47,7 +40,6 @@ bool ExpressionEvaluator::RegisterConstant( std::string& c, double v )
     return false;
   }
 
-  //RegisterVariable( c->get_name(), c->get_value() );
   RegisterVariable( c, value );
   return true;
 }
@@ -61,7 +53,6 @@ bool ExpressionEvaluator::RegisterArray( std::string& c, std::vector<double> v)
     ss << i;
     ss >> index;
     std::string name = c+"_"+index+"_";
-//    std::cout << "setting variable: " << name << " with value: " << value << std::endl;
     RegisterVariable( name, value );       
    }
    return true;
@@ -102,8 +93,6 @@ bool ExpressionEvaluator::is_delimiter(char c)
 double ExpressionEvaluator::EvaluateString(const std::string& str)
 {
  std::string str_mod = str;
-// if(m_fileCurrentlyParsed != "")
-// {
   const char* c_str_mod = str.c_str(); //string to be modified with file namespace! 
   std::vector<int> variable_ends;  //variable names to be changed
   int cur_variable_end = 0;
@@ -139,7 +128,6 @@ double ExpressionEvaluator::EvaluateString(const std::string& str)
     c_str_mod++;
     cur_variable_end++;
    }
-//  }// variable ends stored in vector
   std::string::size_type shift = 0;
   std::string::size_type ns_length = m_fileCurrentlyParsed.size();
   for(unsigned int i=0; i<variable_ends.size(); i++)
@@ -164,10 +152,7 @@ bool ExpressionEvaluator::RegisterPhysConstant( std::string& c, std::string valu
   expr += unit;
   expr += ")";
 
-  //std::cout << "Expression evaluator:: evaluating string: " << expr << std::endl;
-
   double dvalue      = EvaluateString( expr );
-//  double unit_value = EvaluateString( unit );
 
   if( m_calc.status() != HepTool::Evaluator::OK )
   {
@@ -178,7 +163,6 @@ bool ExpressionEvaluator::RegisterPhysConstant( std::string& c, std::string valu
     return false;
   }
 
-  //RegisterVariable( physc->get_name(), expr );
   RegisterVariable( c, dvalue );
   return true;
 }
@@ -198,7 +182,6 @@ bool ExpressionEvaluator::RegisterExpression( std::string& name, std::string tex
     return false;
   }
 
-  //RegisterVariable( e->get_name(), e->get_text() );
   RegisterVariable( name, value );
   return true;
 }
@@ -217,9 +200,7 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
   while(true)
   {
    start_index = expr.find('[', start_index); 
-//   std::cout<<"*** start_index "<<start_index<<" "<<expr<<std::endl;  
    if(start_index == std::string::npos) break;
-//   std::cout << " start index "<<start_index<<std::endl;
    std::string::size_type boundary_index = expr.find(']', start_index);
    expr.replace(start_index,1,1,'_');
    end_index = expr.find(',', start_index);
@@ -228,7 +209,6 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
     start_index++;
     std::string var1 = expr.substr(start_index, end_index-start_index);
     double eval1 = EvaluateString( var1 );
-    //std::cout<<"Evaluated "<<var1<<" to: "<<eval1<<std::endl;
     std::stringstream ss1;
     std::string str1;
     ss1 << eval1;
@@ -238,19 +218,16 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
    else
    {
     end_index = boundary_index;
-//    std::cout << " end index "<<end_index<<std::endl;
     if(end_index != std::string::npos)
     {
      start_index++;
      std::string var1 = expr.substr(start_index, end_index-start_index);
      double eval1 = EvaluateString( var1 );
-     //std::cout<<"Evaluated "<<var1<<" to: "<<eval1<<std::endl;
      std::stringstream ss1;
      std::string str1;
      ss1 << eval1;
      ss1 >> str1;
      expr.replace(start_index, end_index-start_index, str1, 0, str1.size());
-//     std::cout <<" str1 "<<str1<<std::endl;
     }
    }
   }
@@ -265,7 +242,6 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
    start_index++;
    std::string var2 = expr.substr(start_index, end_index-start_index);
    double eval2 = EvaluateString( var2 );
-   //std::cout<<"Evaluated "<<var2<<" to: "<<eval2<<std::endl;
    std::stringstream ss2;
    std::string str2;
    ss2 << eval2;
@@ -280,12 +256,10 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
    if(start_index == std::string::npos) break;
    expr.replace(start_index,1,1,'_');
   }
-//  std::cout<<"***************** "<<expr<<std::endl;
   double result = EvaluateString( expr );
   if( m_calc.status() != HepTool::Evaluator::OK )
   {
     std::cerr << expr << std::endl;
-    //std::cerr << "------";
     for (int i=0; i<m_calc.error_position(); i++)
     {
       std::cerr << "-";
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h
index 121054a6b1ae050bc4eac0807c4ad6f8e21e52c3..d80b989c691205f65e8ada85f6e00f9fc938d73e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.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 snake_pointHandler_H
@@ -7,7 +7,7 @@
 
 #include "AGDDControl/XMLHandler.h"
 
-#include "CLHEP/Vector/ThreeVector.h"
+#include "GeoModelKernel/GeoDefinitions.h"
 
 #include <string>
 
@@ -15,9 +15,9 @@ class snake_pointHandler:public XMLHandler {
 public:
 	snake_pointHandler(std::string);
 	void ElementHandle();
-	static CLHEP::Hep3Vector CurrentPoint() {return s_point;}
+	static GeoTrf::Vector3D CurrentPoint() {return s_point;}
 private:
-	static CLHEP::Hep3Vector s_point;
+	static GeoTrf::Vector3D s_point;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt b/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt
index a4093c7bf8e7d6b15bb5db1b0601b9e19a439526..616d8db2eb9557043f30a5d6a2f28a90e6b200bb 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt
@@ -5,13 +5,6 @@
 # Declare the package name:
 atlas_subdir( AGDDHandlers )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/AGDD/AGDDControl
-                          DetectorDescription/AGDD/AGDDKernel
-                          PRIVATE
-                          DetectorDescription/AGDD/AGDDModel )
-
 # External dependencies:
 find_package( CLHEP )
 
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
index 235a65b70dcc6e7ba099d0dd188e64e55aded80b..50ec56b22bcf34221dfdf0bb831d38e337f703da 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
@@ -9,7 +9,6 @@
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 
@@ -66,7 +65,7 @@ void chamberPositionerHandler::ElementHandle()
  			double zpos=zPos;
  			GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
  			AGDDDetectorPositioner *p __attribute__((__unused__));
- 			p=new AGDDDetectorPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+ 			p=new AGDDDetectorPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 			p->SensitiveDetector(true);
 			p->ID.phiIndex=i;
 			p->ID.sideIndex=1;
@@ -96,7 +95,7 @@ void chamberPositionerHandler::ElementHandle()
             double zpos=zPos;
             GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,-zpos);
             AGDDDetectorPositioner *p __attribute__((__unused__));
-            p=new AGDDDetectorPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+            p=new AGDDDetectorPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 			p->SensitiveDetector(true);
 			p->ID.phiIndex=i;
 			p->ID.sideIndex=-1;
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
index bd7d0c3f0d13f6ba0f6a081c1a23a62fd0df7f13..2df718c06066d27ca116445a084f3d0568354862 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
@@ -7,7 +7,6 @@
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 
@@ -72,6 +71,6 @@ void mposPhiHandler::ElementHandle()
 		if (s!="false"&&i>0) crot = GeoTrf::RotateZ3D(dphi*GeoModelKernelUnits::degree)*crot;
 		else if (s!="false"&&i==0) crot = GeoTrf::RotateZ3D(phi0*GeoModelKernelUnits::degree)*crot;
 
-		p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+		p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 	}
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
index 4808379f990a9f6f22980bc3e85736316170f10e..e6ebb99cdaac786cb53cc1177c9c320e4e201f30 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
@@ -5,7 +5,6 @@
 #include "AGDDHandlers/mposWedgeHandler.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "GeoModelKernel/Units.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 #include <vector>
@@ -34,6 +33,6 @@ void mposWedgeHandler::ElementHandle()
 		double zpos=0;
 		GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
 
-		p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+		p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 	}
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
index 10986c214e1c3defae180d38123110d5e1042827..2e76c3b625c1de8cd7361aa3a23807b6e118676f 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
@@ -5,7 +5,6 @@
 #include "AGDDHandlers/posRPhiZHandler.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "GeoModelKernel/Units.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 #include <vector>
@@ -35,5 +34,5 @@ void posRPhiZHandler::ElementHandle()
 	double y=radius*std::sin(phi*GeoModelKernelUnits::degree);
 	GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
 
-	p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+	p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
index 58c2172ddea2beede3211dc9635037bf8d306078..6b2a8afd7b476d0cf8c8a3f0dbc96b077683c0f3 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
@@ -12,6 +12,7 @@
 #include "CLHEP/Vector/Rotation.h"
 #include "CLHEP/Vector/ThreeVector.h"
 #include "CLHEP/Geometry/Transform3D.h"
+#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 posXYZHandler::posXYZHandler(std::string s):XMLHandler(s)
 {
@@ -45,6 +46,6 @@ void posXYZHandler::ElementHandle()
 		if (rotRet) std::cout<<" rot= ("<<rot[0]<<";"<<rot[1]<<";"<<rot[2]<<")";
 		std::cout<<std::endl;
 	}
-	AGDDPositioner *p=new AGDDPositioner(volume,HepGeom::Transform3D(crot,cvec));
+	AGDDPositioner *p=new AGDDPositioner(volume,Amg::CLHEPTransformToEigen(HepGeom::Transform3D(crot,cvec)));
 	globals::currentPositioner=p;
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
index 29d19f4da30731af558aa289f1788aad5bc9064f..1be4ced7c7050fe777ea19f45f635aab75193e85 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
@@ -1,32 +1,29 @@
 /*
-  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 "AGDDHandlers/snakeHandler.h"
 #include "AGDDControl/XercesParser.h"
 #include "AGDDHandlers/snake_pointHandler.h"
 #include "AGDDModel/AGDDSnake.h"
-#include <iostream>
-
-#include "CLHEP/Vector/ThreeVector.h"
 
+#include <iostream>
 #include <vector>
 
 using namespace xercesc;
 
 snakeHandler::snakeHandler(std::string s):XMLHandler(s)
 {
-//	std::cout<<"Creating handler for snake"<<std::endl;
 }
 
 void snakeHandler::ElementHandle()
 {
-	bool res;
+	bool res=false;
 	std::string name=getAttributeAsString("name",res);
 	std::string material=getAttributeAsString("material",res);
 	double radius=getAttributeAsDouble("radius",res);
 	
-	std::vector<CLHEP::Hep3Vector> points;
+	std::vector<GeoTrf::Vector3D> points;
 	
 	AGDDSnake *vol=new AGDDSnake(name);
  	vol->SetMaterial(material);
@@ -40,7 +37,7 @@ void snakeHandler::ElementHandle()
     {
         if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
         XercesParser::elementLoop(child);
-		CLHEP::Hep3Vector p=snake_pointHandler::CurrentPoint();
+		GeoTrf::Vector3D p=snake_pointHandler::CurrentPoint();
 		points.push_back(p);
        }
     }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
index e3856df0ce348187da674631259bb12a7d7f2065..b452eda67f899a671df30f50d34b48dba6825db7 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
@@ -1,25 +1,20 @@
 /*
-  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 "AGDDHandlers/snake_pointHandler.h"
 
-#include "CLHEP/Vector/ThreeVector.h"
-
 #include <iostream>
 
-CLHEP::Hep3Vector snake_pointHandler::s_point(0.,0.);
+GeoTrf::Vector3D snake_pointHandler::s_point(GeoTrf::Vector3D::Identity());
 
 snake_pointHandler::snake_pointHandler(std::string s):XMLHandler(s)
 {
-//	std::cout<<"Creating handler for snake_point"<<std::endl;
 }
 
 void snake_pointHandler::ElementHandle()
 {
-	bool res;
+	bool res=false;
 	std::vector<double> vvv=getAttributeAsVector("X_Y_Z",res);
-	s_point.setX(vvv[0]);
-	s_point.setY(vvv[1]);
-	s_point.setZ(vvv[2]);
+	s_point = GeoTrf::Vector3D(vvv[0], vvv[1], vvv[2]);
 }
diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h
index f5b5739717ddbd9db40a13e25e65e671881a2b03..e97ec996234fb4b6e6f558539a288a568750904d 100644
--- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h
+++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.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 AGDDDetectorPositioner_H
@@ -7,9 +7,6 @@
 
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/GeoFullPhysVol.h"
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
 
 #include "AGDDKernel/AGDDPositioner.h"
 
@@ -41,7 +38,8 @@ struct DetectorPositionParameters {
 
 class AGDDDetectorPositioner:public AGDDPositioner {
 public:
-	AGDDDetectorPositioner(std::string n,HepGeom::Transform3D t);
+	AGDDDetectorPositioner(const std::string& n, GeoTrf::Transform3D t);
+    virtual ~AGDDDetectorPositioner()=default;
 
 	Identifiers ID;
 
diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h
index ed08246b9395bfeeb5d4f6ae3a96482fae6eedb4..2f7148df96a82af3a789815de604ee5a7d736c37 100644
--- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h
+++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h
@@ -5,9 +5,6 @@
 #ifndef AGDDPositioner_H
 #define AGDDPositioner_H
 
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
 #include "GeoModelKernel/GeoDefinitions.h"
 
 #include <string>
@@ -16,20 +13,20 @@ class AGDDVolume;
 
 class AGDDPositioner {
 public:
-	AGDDPositioner(std::string n,HepGeom::Transform3D t);
-	virtual ~AGDDPositioner() {;}
-	std::string Volume();
-	AGDDVolume *GetVolume();
-	const HepGeom::Transform3D& Transform();
+    AGDDPositioner(const std::string& n, GeoTrf::Transform3D t);
+    virtual ~AGDDPositioner()=default;
+    std::string Volume();
+    AGDDVolume *GetVolume();
+    const GeoTrf::Transform3D& Transform();
     bool IsSensitiveDetector() {return m_isSensitiveDetector;}
-	void SensitiveDetector(bool a) {m_isSensitiveDetector=a;}
+    void SensitiveDetector(bool a) {m_isSensitiveDetector=a;}
 	
 private:
 
 	bool m_isSensitiveDetector;
 	std::string m_volume;
 	AGDDVolume *m_theVolume;
-	HepGeom::Transform3D m_transform;
+	GeoTrf::Transform3D m_transform;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt b/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt
index b0c239c981327d8fb6a749f90ca240c2fdbeec0e..aef2cb8fb3d55e9fc32ab8fd67c8c422696d9823 100644
--- a/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt
@@ -1,23 +1,15 @@
-################################################################################
-# Package: AGDDKernel
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( AGDDKernel )
 
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/GeoPrimitives )
-
 # External dependencies:
-find_package( CLHEP )
-find_package( Eigen )
 find_package( GeoModelCore )
 
 # Component(s) in the package:
 atlas_add_library( AGDDKernel
                    src/*.cxx
                    PUBLIC_HEADERS AGDDKernel
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
-                   DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES GeoPrimitives ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} )
+                   INCLUDE_DIRS ${GEOMODELCORE_INCLUDE_DIRS}
+                   LINK_LIBRARIES GeoPrimitives ${GEOMODELCORE_LIBRARIES} )
 
diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx
index f929ef033b6d954d966eb20771aecdf8c17e6e78..41e446253894724701c65377a3fbd25a69743490 100644
--- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx
+++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.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 "AGDDKernel/AGDDDetectorPositioner.h"
@@ -7,10 +7,8 @@
 #include "AGDDKernel/AGDDVolume.h"
 #include "AGDDKernel/AGDDVolumeStore.h"
 
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
-
-AGDDDetectorPositioner::AGDDDetectorPositioner(std::string n,HepGeom::Transform3D t):AGDDPositioner(n,t),theDetector(0),theVolume(0)
-{
-}
\ No newline at end of file
+AGDDDetectorPositioner::AGDDDetectorPositioner(const std::string& n, GeoTrf::Transform3D t) :
+  AGDDPositioner(n,t),
+  theDetector(nullptr),
+  theVolume(nullptr) {
+}
diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx
index 6257e84ec34abf49981466dcf803bd71832e8843..c06ad59ea68718db6f3cba879d102a73adf5f667 100644
--- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx
+++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.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 "AGDDKernel/AGDDPositioner.h"
@@ -7,26 +7,23 @@
 #include "AGDDKernel/AGDDVolume.h"
 #include "AGDDKernel/AGDDVolumeStore.h"
 
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
-
-AGDDPositioner::AGDDPositioner(std::string n,HepGeom::Transform3D t):m_isSensitiveDetector(false),m_volume(n),m_transform(t)
-{
+AGDDPositioner::AGDDPositioner(const std::string& n, GeoTrf::Transform3D t) :
+  m_isSensitiveDetector(false),
+  m_volume(n),
+  m_transform(t) {
 	AGDDPositionerStore::GetPositionerStore()->RegisterPositioner(this);
 	m_theVolume=AGDDVolumeStore::GetVolumeStore()->GetVolume(Volume());
 }
-std::string AGDDPositioner::Volume() 
-{
+
+std::string AGDDPositioner::Volume() {
 	return m_volume;
 }
-const HepGeom::Transform3D& AGDDPositioner::Transform() 
-{
+
+const GeoTrf::Transform3D& AGDDPositioner::Transform() {
 	return m_transform;
 } 
 
-AGDDVolume* AGDDPositioner::GetVolume() 
-{
+AGDDVolume* AGDDPositioner::GetVolume() {
 	return m_theVolume;
 } 
 
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
index 84a7677c3c2bc0fec81c70f6902ae923704c32ce..803f0fbc3fda79578132b2678646965ec58d1f51 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
@@ -1,33 +1,32 @@
 /*
-  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 AGDDSnake_H
 #define AGDDSnake_H
 
 #include "AGDDKernel/AGDDVolume.h"
+
 #include <string>
 #include <vector>
 #include <iostream>
 
-#include "CLHEP/Vector/ThreeVector.h"
-
 class AGDDSnake: public AGDDVolume {
 public:
 	AGDDSnake(std::string s):AGDDVolume(s),m_radius(0) {}
-	void SetPoint(CLHEP::Hep3Vector p)
+	void SetPoint(GeoTrf::Vector3D p)
 	{
 		m_points.push_back(p);
 	}
 	int NrOfPoints() {return m_points.size();}
 	double Radius() {return m_radius;}
 	void Radius(double d) {m_radius=d;}
-	CLHEP::Hep3Vector GetPoint(int i) {return m_points[i];}
+	GeoTrf::Vector3D GetPoint(int i) {return m_points[i];}
 	void CreateVolume();
 	void CreateSolid();
 private:
 	double m_radius;
-	std::vector<CLHEP::Hep3Vector> m_points;
+	std::vector<GeoTrf::Vector3D> m_points;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt b/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt
index bcae1501378e78f7902b3bd1e056e848554db9bd..85adb2ae41c5443b514bb8b03973ad8bb7f5d45a 100644
--- a/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt
@@ -1,22 +1,10 @@
-################################################################################
-# Package: AGDDModel
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( AGDDModel )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/AGDD/AGDDKernel )
-
-# External dependencies:
-find_package( CLHEP )
-
 # Component(s) in the package:
 atlas_add_library( AGDDModel
                    src/*.cxx
                    PUBLIC_HEADERS AGDDModel
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                   DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} AGDDKernel )
-
+                   LINK_LIBRARIES AGDDKernel )
diff --git a/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt b/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt
index 1f42b034a8263973db0a34dc8a2c312a0552308a..1b50fc8e47e3916f231074628c05f61fd850ff20 100644
--- a/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt
+++ b/Event/xAOD/xAODTrigMuonAthenaPool/CMakeLists.txt
@@ -30,7 +30,7 @@ find_package( AthenaPoolUtilitiesTest )
 
 if( ATHENAPOOLUTILITIESTEST_FOUND )
   set( XAODTRIGMONATHENAPOOL_REFERENCE_TAG
-       xAODTrigMuonAthenaPoolReference-01-00-00 )
+       xAODTrigMuonAthenaPoolReference-01-00-01 )
   run_tpcnv_legacy_test( xAODTrigMuonAthenaPool_20.1.7.2   AOD-20.1.7.2-full
                    REQUIRED_LIBRARIES xAODTrigMuonAthenaPoolPoolCnv
                    REFERENCE_TAG ${XAODTRIGMONATHENAPOOL_REFERENCE_TAG} )
diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py
index e7d41a6c2208a763c258a4beb0dc51e66fe15595..9a328f352eb55bde3d2767460c2dc15dc4f2d1cf 100644
--- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py
+++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py
@@ -129,7 +129,7 @@ def make_l1_seq(options=default_options):
     # This should be done by the L1Decoder configuration in new-style job options (with component accumulator)
     from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc
     from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-    svcMgr += getL1ConfigSvc()
+    svcMgr += getL1ConfigSvc(ConfigFlags)
 
     # Initialise L1 decoding tools
     from L1Decoder.L1DecoderConf import CTPUnpackingTool
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_FlaggedConditionTestAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_FlaggedConditionTestAlg.cxx
index 9671e1a4c05d9e0232f3ed080af201536207d473..e84e9551a182ca599eed77e2a4a8743e2fc04b00 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_FlaggedConditionTestAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_FlaggedConditionTestAlg.cxx
@@ -33,7 +33,7 @@ StatusCode SCT_FlaggedConditionTestAlg::execute(const EventContext& ctx) const {
   ATH_MSG_ALWAYS("------------------------------------------------------------");
   ATH_MSG_ALWAYS(" numBadIds " << m_flaggedTool->numBadIds(ctx));
   const SCT_FlaggedCondData* badIds{m_flaggedTool->getBadIds(ctx)};
-  for (const std::pair<IdentifierHash, std::string>& badId : *badIds) {
+  for (const std::pair<const IdentifierHash, std::string>& badId : *badIds) {
     ATH_MSG_ALWAYS("  Wafer hash " << badId.first << " reason " << badId.second);
   }
 
diff --git a/InnerDetector/InDetConfig/python/InDetRecToolConfig.py b/InnerDetector/InDetConfig/python/InDetRecToolConfig.py
index b64a1fe6a64790da73775f80d5c2d0dd60d613ec..45b097ae3a97b4cdab545a7d25b9e030a3a8f086 100644
--- a/InnerDetector/InDetConfig/python/InDetRecToolConfig.py
+++ b/InnerDetector/InDetConfig/python/InDetRecToolConfig.py
@@ -408,7 +408,7 @@ def SCT_TdaqEnabledCondAlgCfg(flags, name="SCT_TdaqEnabledCondAlg", **kwargs):
   result.merge( addFolders(flags, [folder], detDb="TDAQ", className="CondAttrListCollection") )
   
   acc = SCT_CablingToolCfg(flags)
-  kwargs.setdefault( "SCT_CablingTool", acc.popPrivateTool() )
+  kwargs.setdefault( "SCT_CablingTool", acc.popPrivateTools() )
   result.merge(acc)
 
   result.addCondAlgo( CompFactory.SCT_TdaqEnabledCondAlg(name=name, **kwargs) )
diff --git a/MagneticField/MagFieldServices/CMakeLists.txt b/MagneticField/MagFieldServices/CMakeLists.txt
index 4d89f8435c5b9a1d0342ea036ef7cac935db4aeb..ebf11dfafe4e445ffb0e875c8d797578a388980f 100644
--- a/MagneticField/MagFieldServices/CMakeLists.txt
+++ b/MagneticField/MagFieldServices/CMakeLists.txt
@@ -19,7 +19,13 @@ atlas_install_headers( MagFieldServices )
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
 if( NOT SIMULATIONBASE )
-  atlas_add_test( MagFieldServicesConfig    SCRIPT python -m MagFieldServices.MagFieldServicesConfig
+  atlas_add_test( MagFieldServicesConfig
+                  SCRIPT python -m MagFieldServices.MagFieldServicesConfig
                   PROPERTIES TIMEOUT 300
                   POST_EXEC_SCRIPT nopost.sh )
+
+  atlas_add_test( MagFieldCondAlg
+                  SCRIPT athena --threads=1 ${CMAKE_CURRENT_SOURCE_DIR}/share/test_magFieldCondAlg.py
+                  PROPERTIES TIMEOUT 300
+                  LOG_SELECT_PATTERN "MagFieldCondReader" )
 endif()
diff --git a/MagneticField/MagFieldServices/share/MagFieldCondAlg.ref b/MagneticField/MagFieldServices/share/MagFieldCondAlg.ref
new file mode 100644
index 0000000000000000000000000000000000000000..b64570735df90c48a9167888391bc10810fcfbe9
--- /dev/null
+++ b/MagneticField/MagFieldServices/share/MagFieldCondAlg.ref
@@ -0,0 +1,30 @@
+MagFieldCondReader                         0   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                         0   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                         1   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                         1   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                         2   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                         2   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                         3   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                         3   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                         4   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                         4   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                         5   0    INFO Field status: solenoid=0, toroids=0
+MagFieldCondReader                         5   0    INFO Field xyz: 100, 100, 100, 0, 0, 0
+MagFieldCondReader                         6   0    INFO Field status: solenoid=0, toroids=0
+MagFieldCondReader                         6   0    INFO Field xyz: 100, 100, 100, 0, 0, 0
+MagFieldCondReader                         7   0    INFO Field status: solenoid=0, toroids=0
+MagFieldCondReader                         7   0    INFO Field xyz: 100, 100, 100, 0, 0, 0
+MagFieldCondReader                         8   0    INFO Field status: solenoid=0, toroids=0
+MagFieldCondReader                         8   0    INFO Field xyz: 100, 100, 100, 0, 0, 0
+MagFieldCondReader                         9   0    INFO Field status: solenoid=0, toroids=0
+MagFieldCondReader                         9   0    INFO Field xyz: 100, 100, 100, 0, 0, 0
+MagFieldCondReader                        10   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                        10   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                        11   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                        11   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                        12   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                        12   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                        13   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                        13   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
+MagFieldCondReader                        14   0    INFO Field status: solenoid=1, toroids=1
+MagFieldCondReader                        14   0    INFO Field xyz: 100, 100, 100, 1.58913e-06, -2.49264e-07, 0.00199734
diff --git a/MagneticField/MagFieldServices/share/test_magFieldCondAlg.py b/MagneticField/MagFieldServices/share/test_magFieldCondAlg.py
new file mode 100644
index 0000000000000000000000000000000000000000..58bc3ca1d068c6c906187833bc3d43246ee0ccfd
--- /dev/null
+++ b/MagneticField/MagFieldServices/share/test_magFieldCondAlg.py
@@ -0,0 +1,78 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
+# Job options to test magnetic field conditions algs with varying currents.
+#
+
+# Testing IOVs and currents: (since LB, solenoid, toroids)
+currents = [(0, 7730, 20400),
+            (5, 0, 0),
+            (10, 7730, 20400)]
+
+# Folder name
+folder = '/EXT/DCS/MAGNETS/SENSORDATA'
+
+def createDB():
+   """Create sqlite file with DCS currents"""
+   from PyCool import cool
+   from CoolConvUtilities import AtlCoolLib, AtlCoolTool
+
+   # Cleanup previous file
+   import os
+   if os.path.isfile("magfield.db"):
+      os.remove("magfield.db")
+
+   db = cool.DatabaseSvcFactory.databaseService().createDatabase('sqlite://;schema=magfield.db;dbname=CONDBR2')
+   spec = cool.RecordSpecification()
+   spec.extend("value", cool.StorageType.Float)
+   spec.extend("quality_invalid", cool.StorageType.Bool)
+   f = AtlCoolLib.ensureFolder(db, folder, spec, AtlCoolLib.athenaDesc(True, 'CondAttrListCollection'))
+
+   for v in currents:
+      sol = cool.Record(spec)
+      sol['value'] = v[1]
+      sol['quality_invalid'] = False
+      tor = cool.Record(spec)
+      tor['value'] = v[2]
+      tor['quality_invalid'] = False
+      f.storeObject(v[0], cool.ValidityKeyMax, sol, 1)  # channel 1
+      f.storeObject(v[0], cool.ValidityKeyMax, tor, 3)  # channel 3
+
+   # print database content
+   act = AtlCoolTool.AtlCoolTool(db)
+   print (act.more(folder))
+
+
+# Create sqlite file with DCS currents
+createDB()
+
+# basic job configuration
+import AthenaCommon.AtlasUnixGeneratorJob  # noqa: F401
+from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
+from AthenaCommon.AlgSequence import AthSequencer, AlgSequence
+
+# Increment LBN every event
+from McEventSelector import McEventSelectorConf
+svcMgr += McEventSelectorConf.McEventSelector('EventSelector', EventsPerLB=1)
+
+# Conditions folder setup
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DataSource='data'
+globalflags.ConditionsTag='CONDBR2-BLKPA-RUN2-01'
+
+from IOVDbSvc.CondDB import conddb
+conddb.setGlobalTag(globalflags.ConditionsTag())
+conddb.addFolder('GLOBAL', '/GLOBAL/BField/Maps <noover/>', className="CondAttrListCollection")
+conddb.addFolder('magfield.db', folder, className='CondAttrListCollection')
+
+# Magnetic field algorithm setup
+from AthenaCommon.CfgGetter import getAlgorithm
+condSeq = AthSequencer("AthCondSeq")
+condSeq += getAlgorithm( "AtlasFieldMapCondAlg" )
+condSeq += getAlgorithm( "AtlasFieldCacheCondAlg" )
+condSeq.AtlasFieldCacheCondAlg.LockMapCurrents = False
+
+from MagFieldUtils.MagFieldUtilsConf import MagField__CondReader
+topSequence = AlgSequence()
+topSequence += MagField__CondReader("MagFieldCondReader")
+
+theApp.EvtMax = currents[-1][0]+5   # 5 events per IOV
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc
index 644ac83701a0d46acb55bf6f8a53c2887345edef..03a94f198646a0615402f1226fd36e80b63720f8 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc
@@ -320,7 +320,7 @@ const MuonGM::MuonDetectorManager& make_dd()
   ddsdet.roParameters.nWireGroups.push_back(0);
   ddsdet.roParameters.wireCutout.push_back(0);
 
-  HepGeom::Transform3D xform;
+  GeoTrf::Transform3D xform = GeoTrf::Transform3D::Identity();
   AGDDDetectorPositioner* spos2 = new AGDDDetectorPositioner ("psdum2", xform);
   deleter.add (spos2);
   spos2->theDetector = &ddsdet;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt
index 3d00f656c93a95561418ea9c703149e12bd92b03..3fe96c40d108e7096cdc227711eb89c4494dddf5 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt
@@ -8,13 +8,12 @@ atlas_subdir( MuonAGDDDescription )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/AGDD/AGDDKernel
-                          PRIVATE
-                          DetectorDescription/AGDD/AGDDModel )
+                          DetectorDescription/AGDD/AGDDModel
+                        )
 
 # Component(s) in the package:
 atlas_add_library( MuonAGDDDescription
                    src/*.cxx
                    PUBLIC_HEADERS MuonAGDDDescription
-                   LINK_LIBRARIES AGDDKernel
-                   PRIVATE_LINK_LIBRARIES AGDDModel )
+                   LINK_LIBRARIES AGDDKernel AGDDModel )
 
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripResponse.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripResponse.h
index f3b5d1612d697bc4cd54d4e2ffe9f2c6ac794fd7..672888aad21546cfbd3e6157b0319affb566b7fc 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripResponse.h
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_StripResponse.h
@@ -40,6 +40,7 @@ class MM_StripResponse {
   std::vector<float> getTimeMaxChargeVec() const;
 
   int getNElectrons();
+  float getTotalCharge();
   std::vector<MM_Electron*> getElectrons();
 
  private:
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_ElectronicsResponseSimulation.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_ElectronicsResponseSimulation.cxx
index 72509ec96b449ea2a0febcefaf37f95933fec54a..a36dbfc41ec8dcbe414495bbf9ee75f1dd055b1c 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_ElectronicsResponseSimulation.cxx
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_ElectronicsResponseSimulation.cxx
@@ -7,9 +7,10 @@
 *  MC for micromegas athena integration
 *
 **/
-
 #include "MM_Digitization/MM_ElectronicsResponseSimulation.h"
 
+#include <numeric>
+
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
 #include "TF1.h"
@@ -110,19 +111,25 @@ void MM_ElectronicsResponseSimulation::vmmPeakResponseFunction(const std::vector
       if ( ii > 0 ) {
 	shaperInputTime = tStrip.at(ii-1);
 	shaperInputCharge = qStrip.at(ii-1);
-	maxChargeLeftNeighbor = m_h_intFn->GetMaximum(m_timeWindowLowerOffset,m_timeWindowUpperOffset);
+    // for now by pass the VMM charge measurement and use the total charge on the strip
+    // maxChargeLeftNeighbor = m_h_intFn->GetMaximum(m_timeWindowLowerOffset,m_timeWindowUpperOffset);
+    maxChargeLeftNeighbor = std::accumulate(shaperInputCharge.begin(), shaperInputCharge.end(), 0.0);
       }
       
       if ( ii+1 < numberofStrip.size() ) {
 	shaperInputTime = tStrip.at(ii+1);
 	shaperInputCharge = qStrip.at(ii+1);
-	maxChargeRightNeighbor = m_h_intFn->GetMaximum(m_timeWindowLowerOffset,m_timeWindowUpperOffset);
+    // for now by pass the VMM charge measurement and use the total charge on the strip
+    //maxChargeRightNeighbor = m_h_intFn->GetMaximum(m_timeWindowLowerOffset,m_timeWindowUpperOffset);
+    maxChargeRightNeighbor = std::accumulate(shaperInputCharge.begin(), shaperInputCharge.end(), 0.0);
       }
     }
     shaperInputTime = tStrip.at(ii);
     shaperInputCharge = qStrip.at(ii);
-    maxChargeThisStrip = m_h_intFn->GetMaximum(m_timeWindowLowerOffset,m_timeWindowUpperOffset);
-  
+    //  for now by pass the VMM charge measurement and use the total charge on the strip
+    //  maxChargeThisStrip = m_h_intFn->GetMaximum(m_timeWindowLowerOffset,m_timeWindowUpperOffset);
+    maxChargeThisStrip = std::accumulate(shaperInputCharge.begin(), shaperInputCharge.end(), 0.0);
+
     float scaledThreshold = m_electronicsThreshold * thresholdScaleFactor;
     
     //check if neighbor strip was above threshold
@@ -134,27 +141,30 @@ void MM_ElectronicsResponseSimulation::vmmPeakResponseFunction(const std::vector
       shaperInputCharge = qStrip.at(ii);
       // float localPeak = 0;
       float localPeakt = 0;
-      float localPeakq = 0;
-      
-      float stepSize = 0.1; //ns(?) step size corresponding to VMM discriminator
-      
+      // not used for now since VMM charge measurement is temporarily by passed
+      // float localPeakq = 0;
+
+      float stepSize = 0.1;  // ns(?) step size corresponding to VMM discriminator
+
       for (int jj = 0; jj < (m_timeWindowUpperOffset-m_timeWindowLowerOffset)/stepSize; jj++) {
-	
+
 	float thisStep = m_timeWindowLowerOffset+jj*stepSize;
 	float nextStep = m_timeWindowLowerOffset+(jj+1)*stepSize;
 	float oneAfterStep = m_timeWindowLowerOffset+(jj+2)*stepSize;
-	
-	
+
+
 	//check if the charge for the next points is less than the current step and the derivative of the first point is positive or 0 and the next point is negative:
 	if ( ( m_h_intFn->Eval(thisStep,0,0) < m_h_intFn->Eval(nextStep,0,0) ) && ( m_h_intFn->Eval(nextStep,0,0) > m_h_intFn->Eval(oneAfterStep,0,0) ) && (m_h_intFn->Eval(thisStep+0.001)-m_h_intFn->Eval(thisStep-0.001))/0.001 > 0.0 && (m_h_intFn->Eval(oneAfterStep+0.001)-m_h_intFn->Eval(oneAfterStep-0.001))/0.001 < 0.0 ){ // m_h_intFn->Derivative() does not work. WHY? 2016/07/18
-	  
-	  localPeakt = nextStep;
-	  localPeakq = m_h_intFn->Eval(nextStep,0,0);
-	  
-	  m_nStripElectronics.push_back(numberofStrip.at(ii));
-	  m_tStripElectronicsAbThr.push_back(localPeakt);
-	  m_qStripElectronics.push_back(localPeakq);
-	}
+
+      localPeakt = nextStep;
+      // not used for now since VMM charge measurement is temporarily by passed
+      // localPeakq = m_h_intFn->Eval(nextStep,0,0);
+
+      m_nStripElectronics.push_back(numberofStrip.at(ii));
+      m_tStripElectronicsAbThr.push_back(localPeakt);
+      // m_qStripElectronics.push_back(localPeakq);
+      m_qStripElectronics.push_back(std::accumulate(shaperInputCharge.begin(), shaperInputCharge.end(), 0.0));
+    }
 	//                }
       }
     }
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx
index 2ab98c8e481eb2e1b4dd27681695a1d6f35433de..a1af25ef29a67d0b0df18c42f7610c37e1c2033d 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripResponse.cxx
@@ -18,6 +18,14 @@ int MM_StripResponse::getNElectrons(){
 	return m_Electrons.size();
 }
 
+float MM_StripResponse::getTotalCharge(){
+	float qtot = 0;
+	for(const MM_Electron* electron : m_Electrons) {
+		qtot += electron->getCharge();
+	}
+	return qtot;
+}
+
 std::vector<MM_Electron*> MM_StripResponse::getElectrons(){
 	return m_Electrons;
 }
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripsResponseSimulation.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripsResponseSimulation.cxx
index 1448f771682b47f68766f6b5167e9ba494513087..2e71f603fb9fc3bc183e9f498273aed4d4835e63 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripsResponseSimulation.cxx
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_StripsResponseSimulation.cxx
@@ -23,6 +23,9 @@ Check Lorentz Angle is in correct direction...
 
 */
 
+namespace {
+    static constexpr float electronsToFC = 1./6241.;
+}
 
 /*******************************************************************************/
 MM_StripsResponseSimulation::MM_StripsResponseSimulation():
@@ -68,6 +71,8 @@ void MM_StripsResponseSimulation::initHistos()
 	m_mapOfHistograms["lorentzAngle"] = new TH1F("lorentzAngle","lorentzAngle",100,0,3);
 	m_mapOfHistograms["effectiveCharge"] = new TH1F("effectiveCharge","effectiveCharge",100,0,1e5);
 	m_mapOfHistograms["effectiveNElectrons"] = new TH1F("effectiveNElectrons","effectiveNElectrons",200,0,200);
+	m_mapOfHistograms["totalEffectiveCharge"] = new TH1F("totalEffectiveCharge","totalEffectiveCharge",400,0,200);
+	m_mapOf2DHistograms["totalEffectiveChargeVsTheta"] = new TH2F("totalEffectiveChargeVsTheta","totalEffectiveChargeVsTheta",17,0,35,300,0,300);
 
 	m_mapOf2DHistograms["pathLengthVsTheta"] = new TH2F("pathLengthVsTheta","pathLengthVsTheta",  100,0,10,  100,-3,3);
 	m_mapOf2DHistograms["pathLengthVsAlpha"] = new TH2F("pathLengthVsAlpha","pathLengthVsAlpha",  100,0,10,  100,-3,3);
@@ -265,7 +270,7 @@ void MM_StripsResponseSimulation::whichStrips( const float & hitx,
 			tmpEffectiveNElectrons+= effectiveCharge;
 		}
 
-		m_mapOfHistograms["effectiveNElectrons"]->Fill( tmpEffectiveNElectrons*1e-4 );
+		m_mapOfHistograms["effectiveNElectrons"]->Fill( tmpEffectiveNElectrons / m_avalancheGain);
 
 		//---
 		m_IonizationClusters.push_back(IonizationCluster);
@@ -297,11 +302,16 @@ void MM_StripsResponseSimulation::whichStrips( const float & hitx,
 
 
 
-	// Output diagnostic hists and graphs
-	//
-	m_mapOfHistograms["nInteractions"]->Fill(nPrimaryIons);
-	m_mapOfHistograms["nElectrons"]->Fill( stripResponseObject.getNElectrons() );
-	m_mapOfHistograms["lorentzAngle"]->Fill( lorentzAngle );
+    // Output diagnostic hists and graphs
+    //
+    m_mapOfHistograms["nInteractions"]->Fill(nPrimaryIons);
+    m_mapOfHistograms["nElectrons"]->Fill(stripResponseObject.getNElectrons());
+    m_mapOfHistograms["totalEffectiveCharge"]->Fill(stripResponseObject.getTotalCharge() * electronsToFC);
+    m_mapOf2DHistograms["totalEffectiveChargeVsTheta"]->Fill(std::abs(incidentAngleXZ),
+                                                   stripResponseObject.getTotalCharge() * electronsToFC);
+    ATH_MSG_DEBUG("incidentAngleXZ" << incidentAngleXZ << "charge [fC]"
+                  << stripResponseObject.getTotalCharge() / 6241.);
+    m_mapOfHistograms["lorentzAngle"]->Fill(lorentzAngle);
 
 	if(m_writeEventDisplays){
 		if(m_outputFile) m_outputFile->cd();
diff --git a/MuonSpectrometer/MuonGeoModel/CMakeLists.txt b/MuonSpectrometer/MuonGeoModel/CMakeLists.txt
index 38fab36fef7175cddf6ab519c65b0245f992a7d1..9686f3767c2581fa904235214f4b903793431aa4 100644
--- a/MuonSpectrometer/MuonGeoModel/CMakeLists.txt
+++ b/MuonSpectrometer/MuonGeoModel/CMakeLists.txt
@@ -5,7 +5,6 @@
 # Declare the package name:
 atlas_subdir( MuonGeoModel )
 
-
 # External dependencies:
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
@@ -17,8 +16,8 @@ atlas_add_library( MuonGeoModelLib
                    src/*.cxx
                    PUBLIC_HEADERS MuonGeoModel
                    PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects StoreGateLib SGtests MuonIdHelpersLib AmdcDbLib
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities AGDDKernel IdDictDetDescr MuonAGDDDescription MuonDetDescrUtils )
+                   LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects StoreGateLib SGtests MuonIdHelpersLib MuonAGDDDescription AGDDKernel AmdcDbLib
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities IdDictDetDescr MuonDetDescrUtils )
 
 atlas_add_component( MuonGeoModel
                      src/components/*.cxx
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h
deleted file mode 100644
index 206464e6960ed8fd81381a5a3094d66e209838ab..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-// Dear emacs, this is -*-c++-*-
-
-#ifndef __ASGELECTRONMULTILEPTONSELECTOR__
-#define __ASGELECTRONMULTILEPTONSELECTOR__
-
-/**
-   @class AsgElectronMultiLeptonSelector
-   @brief Tool to select electrons
-
-   @author Karsten Koeneke
-   @date   October 2012
-
-   12-MAR-2014, convert to ASGTool (Jovan Mitrevski)
-
-*/
-
-// Atlas includes
-#include "AsgTools/AsgTool.h"
-#include "EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h"
-
-namespace Root{
-  class TElectronMultiLeptonSelector;
-}
-
-
-class AsgElectronMultiLeptonSelector : public asg::AsgTool,
-	    virtual public IAsgElectronMultiLeptonSelector
-{
-  ASG_TOOL_CLASS2(AsgElectronMultiLeptonSelector, IAsgElectronMultiLeptonSelector,
-		  CP::ISelectionTool)
-
-public: 
-  /** Standard constructor */
-  AsgElectronMultiLeptonSelector(const std::string& myname);
-
-
-  /** Standard destructor */
-  virtual ~AsgElectronMultiLeptonSelector();
-
-
-public:
-  /** Gaudi Service Interface method implementations */
-  virtual StatusCode initialize();
-
-  /** Gaudi Service Interface method implementations */
-  virtual StatusCode finalize();
-
-  // Main methods for IAsgSelectionTool interface
-
-  /** Method to get the plain AcceptInfo.
-      This is needed so that one can already get the AcceptInfo 
-      and query what cuts are defined before the first object 
-      is passed to the tool. */
-  const asg::AcceptInfo& getAcceptInfo() const;
-
-  /** The main accept method: the actual cuts are applied here */
-  asg::AcceptData accept( const xAOD::IParticle* part ) const;
-
-  /** The main accept method: the actual cuts are applied here */
-  asg::AcceptData accept( const xAOD::Electron* eg ) const;
-
-  /** Method to get the operating point */
-  virtual std::string getOperatingPointName( ) const;
-
-
-  // Private member variables
-private:
-  /** Pointer to the underlying ROOT based tool */
-  Root::TElectronMultiLeptonSelector* m_rootTool;
-  
-}; // End: class definition
-
-
-
-
-
-
-#endif
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
index bc85cb058afb3300220b1681e14792636b816c87..54ac5d791c014c9ebc10760615c1c8a8448dd19a 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/ElectronPhotonSelectorToolsPythonDict.h
@@ -8,7 +8,6 @@
 // for python
 #include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h"
 #include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
 #include "ElectronPhotonSelectorTools/EGammaAmbiguityTool.h"
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml
index 3f816ee712fd6461e97da31d2c8004106a49e2c2..ed74a007c048e50a96e30b5c08a3bf784711dcb0 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/selectionPython.xml
@@ -1,10 +1,9 @@
 <lcgdict>
-  <class name="AsgElectronIsEMSelector" /> 
-  <class name="AsgForwardElectronIsEMSelector" /> 
+  <class name="AsgElectronIsEMSelector" />
+  <class name="AsgForwardElectronIsEMSelector" />
   <class name="AsgPhotonIsEMSelector" />
-  <class name="AsgElectronMultiLeptonSelector" /> 
-  <class name="AsgElectronLikelihoodTool" /> 
-  <class name="EGammaAmbiguityTool" /> 
-  <class name="AsgDeadHVCellRemovalTool" /> 
+  <class name="AsgElectronLikelihoodTool" />
+  <class name="EGammaAmbiguityTool" />
+  <class name="AsgDeadHVCellRemovalTool" />
   <class name="AsgElectronChargeIDSelectorTool"/>
 </lcgdict>
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronMultiLeptonSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronMultiLeptonSelector.cxx
deleted file mode 100644
index 4ea5adbe38fa749ad107e9f21da12d98253f752c..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronMultiLeptonSelector.cxx
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
-   @class AsgElectronMultiLeptonSelector
-   @brief Electron selector tool to select objects in Asgena using an underlying pure ROOT tool.
-
-   @author Karsten Koeneke
-   @date   October 2012
-
-   12-MAR-2014 convert to ASG tool (Jovan Mitrevski)
-
-*/
-
-// Include this class's header
-#include "ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h"
-#include "TElectronMultiLeptonSelector.h"
-#include "xAODEgamma/Electron.h"
-#include "xAODTracking/TrackParticle.h"
-#include "xAODCaloEvent/CaloCluster.h"
-
-#include <cmath>
-#include <cstdint>
-
-//=============================================================================
-// Standard constructor
-//=============================================================================
-AsgElectronMultiLeptonSelector::AsgElectronMultiLeptonSelector(const std::string& myname) :
-  AsgTool(myname),
-  m_rootTool(nullptr)
-{
- 
-  // Create an instance of the underlying ROOT tool
-  m_rootTool = new Root::TElectronMultiLeptonSelector(myname.c_str());
-
-}
-
-
-//=============================================================================
-// Standard destructor
-//=============================================================================
-AsgElectronMultiLeptonSelector::~AsgElectronMultiLeptonSelector()
-{
-  if(finalize().isFailure()){
-    ATH_MSG_ERROR ( "Failure in AsgElectronMultiLeptonSelector finalize()");
-  }
-  delete m_rootTool;
-}
-
-
-//=============================================================================
-// Asgena initialize method
-//=============================================================================
-StatusCode AsgElectronMultiLeptonSelector::initialize()
-{
-
-  ATH_MSG_INFO ("Initialize ");
-    
-
-    // We need to initialize the underlying ROOT TSelectorTool
-  m_rootTool->msg().setLevel(this->msg().level());
-  if ( m_rootTool->initialize().isFailure() )
-    {
-      ATH_MSG_ERROR ( "ERROR! Could not initialize the TElectronMultiLeptonSelector!" );
-      return StatusCode::FAILURE;
-    }
-
-  ATH_MSG_INFO ("Initialize end ");
-  
-  return StatusCode::SUCCESS ;
-}
-
-
-
-//=============================================================================
-// finalize method (now called by destructor)
-//=============================================================================
-StatusCode AsgElectronMultiLeptonSelector::finalize()
-{
-  return StatusCode::SUCCESS;
-}
-
-
-//=============================================================================
-// return the accept info object
-//=============================================================================
-
-const asg::AcceptInfo& AsgElectronMultiLeptonSelector::getAcceptInfo() const
-{
-    return m_rootTool->getAcceptInfo();
-}
-
-
-//=============================================================================
-// The main accept method: the actual cuts are applied here 
-//=============================================================================
-asg::AcceptData AsgElectronMultiLeptonSelector::accept( const xAOD::Electron* eg ) const
-{
-  if ( !eg )
-    {
-      ATH_MSG_DEBUG ("Failed, no egamma object.");
-      return m_rootTool->accept();
-    }
-  
-  const xAOD::CaloCluster* cluster = eg->caloCluster();
-  if ( !cluster )
-    {
-      ATH_MSG_DEBUG ("Failed, no cluster.");
-      return m_rootTool->accept();
-    }  
-  
-  float eta = fabsf(cluster->etaBE(2)); 
-  if ( eta > 100.0 )
-    {
-      ATH_MSG_DEBUG ("Failed, eta range.");
-      return m_rootTool->accept();
-    }
-  
-  // transverse energy of the electron (using the track eta) 
-  double et = eg->pt();
-  
-  bool allFound = true;
-
-  float Reta(0);
-  float Rhad1(0);
-  float Rhad(0);
-  float w2(0);
-  float f1(0);
-  float f3(0);
-  float wstot(0);
-  float Eratio(0);
-  float deltaEta(0);
-  float deltaPhiRescaled(0);
-
-  // Reta
-  allFound = allFound && eg->showerShapeValue(Reta, xAOD::EgammaParameters::Reta);
-  allFound = allFound && eg->showerShapeValue(Rhad1, xAOD::EgammaParameters::Rhad1);
-  allFound = allFound && eg->showerShapeValue(Rhad, xAOD::EgammaParameters::Rhad);
-  // shower width in 2nd sampling
-  allFound = allFound && eg->showerShapeValue(w2, xAOD::EgammaParameters::weta2);
-  // fraction of energy reconstructed in the 1st sampling
-  allFound = allFound && eg->showerShapeValue(f1, xAOD::EgammaParameters::f1);
-  // E of 1st max in strips
-  allFound = allFound && eg->showerShapeValue(Eratio, xAOD::EgammaParameters::Eratio);
-  // fraction of energy reconstructed in the 3rd sampling
-  allFound = allFound && eg->showerShapeValue(f3, xAOD::EgammaParameters::f3);
-  // total shower width in 1st sampling
-  allFound = allFound && eg->showerShapeValue(wstot, xAOD::EgammaParameters::wtots1);
-      
-  
-
-  // delta eta
-  allFound = allFound && eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1);
-  
-  // difference between the cluster phi (sampling 2) and the eta of the track extrapolated from the last measurement point.
-  allFound = allFound && eg->trackCaloMatchValue(deltaPhiRescaled, xAOD::EgammaParameters::deltaPhiRescaled2);
-  
-  // number of track hits
-  uint8_t nSCT(0);
-  uint8_t nSCTDeadSensors(0);
-  uint8_t nSi(0);
-  uint8_t nSiDeadSensors(0);
-  uint8_t nPix(0);
-  uint8_t nPixDeadSensors(0); 
-  uint8_t nTRThigh(0); 
-  uint8_t nTRThighOutliers(0); 
-  uint8_t nTRT(0); 
-  uint8_t nTRTOutliers(0);
-  uint8_t expectBlayer(1);
-  uint8_t nBlayerHits(0); 
-  double trackqoverp(0.0);
-  double dpOverp(0.0);
-  // retrieve associated track
-  const xAOD::TrackParticle* t  = eg->trackParticle();    
-
-  if (t) {
-    trackqoverp = t->qOverP();
-    
-    allFound = allFound && t->summaryValue(nBlayerHits, xAOD::numberOfInnermostPixelLayerHits);
-    allFound = allFound && t->summaryValue(nPix, xAOD::numberOfPixelHits);
-    allFound = allFound && t->summaryValue(nSCT, xAOD::numberOfSCTHits);
-    allFound = allFound && t->summaryValue(nPixDeadSensors, xAOD::numberOfPixelDeadSensors);
-    allFound = allFound && t->summaryValue(nSCTDeadSensors, xAOD::numberOfSCTDeadSensors);
-    
-    allFound = allFound && t->summaryValue(nTRThigh, xAOD::numberOfTRTHighThresholdHits);
-    allFound = allFound && t->summaryValue(nTRThighOutliers, xAOD::numberOfTRTHighThresholdOutliers);
-    allFound = allFound && t->summaryValue(nTRT, xAOD::numberOfTRTHits);
-    allFound = allFound && t->summaryValue(nTRTOutliers, xAOD::numberOfTRTOutliers);
-    
-    allFound = allFound && t->summaryValue(expectBlayer, xAOD::expectInnermostPixelLayerHit);
-    
-    
-    nSi = nPix+nSCT;
-    nSiDeadSensors = nPixDeadSensors+nSCTDeadSensors;
-
-    unsigned int index;
-    if( t->indexOfParameterAtPosition(index, xAOD::LastMeasurement) ) {
-      
-      double refittedTrack_LMqoverp  = 
-	t->charge() / sqrt(std::pow(t->parameterPX(index), 2) +
-			   std::pow(t->parameterPY(index), 2) +
-			   std::pow(t->parameterPZ(index), 2));
-
-      dpOverp = 1 - trackqoverp/(refittedTrack_LMqoverp);
-    }
-  } else {
-    ATH_MSG_DEBUG ( "Failed, no track particle: et= " << et << "eta= " << eta );
-    allFound = false;
-  }
-  
-  // TRT high-to-low threshold hits ratio
-  double rTRT(0.0);
-  rTRT = (nTRT+nTRTOutliers) > 0 ?  ((double) ((double)(nTRThigh+nTRThighOutliers))/((double)(nTRT+nTRTOutliers)) ) : 0.;
-  int nTRTTotal = nTRT+nTRTOutliers;
-
-  if (!allFound) {
-     // if object is bad then use the bit for "bad eta"
-    ATH_MSG_WARNING("Have some variables missing.");
-    return m_rootTool->accept();
-  }
-
-  // Get the answer from the underlying ROOT tool
-  return m_rootTool->accept(eta, et,
-                            Rhad, Rhad1,
-                            Reta, w2,
-                            f1, f3,
-                            wstot, Eratio, 
-                            deltaEta,
-                            nSi, nSiDeadSensors, nPix, nPixDeadSensors,
-                            deltaPhiRescaled,
-                            dpOverp,
-                            rTRT, nTRTTotal,
-                            nBlayerHits, expectBlayer);
-}
-
-
-asg::AcceptData AsgElectronMultiLeptonSelector::accept(const xAOD::IParticle* part) const
-{
-  ATH_MSG_DEBUG("Entering accept( const IParticle* part )");
-  if(part->type()==xAOD::Type::Electron){
-    const xAOD::Electron* eg =static_cast<const xAOD::Electron*> (part);
-    return accept(eg);
-  }
-  
-    ATH_MSG_ERROR("AsgElectronMultiLeptonSelector::could not convert argument to accept");
-    return m_rootTool->accept();
-  
-}
-
-//=============================================================================
-/// Get the name of the current operating point
-//=============================================================================
-std::string AsgElectronMultiLeptonSelector::getOperatingPointName() const{
-  return "MultiLepton";
-}
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.cxx
deleted file mode 100644
index fac5afe6c1758a693d2daea3e7526a90219c3e9d..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.cxx
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-/******************************************************************************
-Name:        TElectronMultiLeptonSelector
-
-Author:      Karsten Koeneke
-Created:     October 2012
-
-Description: Electron selector tool to select objects in pure ROOT using the multi-lepton cuts
-******************************************************************************/
-
-
-// This class header
-#include "TElectronMultiLeptonSelector.h"
-// STL includes
-#include <cmath>
-
-//=============================================================================
-// Constructor
-//=============================================================================
-Root::TElectronMultiLeptonSelector::TElectronMultiLeptonSelector(const char* name) :
-  asg::AsgMessaging(std::string(name)),
-  GeV(1000.0),
-  m_cutPosition_Coverage(-9),
-  m_cutPosition_RHad(-9),
-  m_cutPosition_F3(-9),
-  m_cutPosition_Reta(-9),
-  m_cutPosition_W2(-9),
-  m_cutPosition_Wstot(-9),
-  m_cutPosition_Eratio(-9),
-  m_cutPosition_DeltaEta(-9),
-  m_cutPosition_DeltaPhiRes(-9),
-  m_cutPosition_NSilicon(-9),
-  m_cutPosition_NPixel(-9),
-  m_cutPosition_NBlayer(-9),
-  m_cutPosition_TR(-9),
-  m_cutPosition_TightDeltaPhi(-9)
-{
-}
-
-
-
-//=============================================================================
-// Destructor
-//=============================================================================
-Root::TElectronMultiLeptonSelector::~TElectronMultiLeptonSelector()
-{
-}
-
-
-
-//=============================================================================
-// Initialize this selector tool
-//=============================================================================
-StatusCode Root::TElectronMultiLeptonSelector::initialize()
-{
-
-  StatusCode sc(StatusCode::SUCCESS);
-
-  // --------------------------------------------------------------------------
-  // Register the cuts and check that the registration worked:
-  // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,...
-  // if ( m_cutPosition_nSCTMin < 0 ) sc = StatusCode::FAILURE; // Exceeded the number of allowed cuts (32)
-
-
-  // RHad
-  m_cutPosition_Coverage = m_acceptInfo.addCut( "Coverage", "Coverage" );
-  if ( m_cutPosition_Coverage < 0 ) sc = StatusCode::FAILURE; 
-
-  // RHad
-  m_cutPosition_RHad = m_acceptInfo.addCut( "RHad", "RHad" );
-  if ( m_cutPosition_RHad < 0 ) sc = StatusCode::FAILURE; 
-
-  // f3
-  m_cutPosition_F3 = m_acceptInfo.addCut( "F3", "F3" );
-  if ( m_cutPosition_F3 < 0 ) sc = StatusCode::FAILURE; 
-
-  // Reta
-  m_cutPosition_Reta = m_acceptInfo.addCut( "Reta", "Reta" );
-  if ( m_cutPosition_Reta < 0 ) sc = StatusCode::FAILURE; 
-
-  // w2
-  m_cutPosition_W2 = m_acceptInfo.addCut( "W2", "W2" );
-  if ( m_cutPosition_W2 < 0 ) sc = StatusCode::FAILURE; 
-
-  // Check the energy in the strips before cutting on it
-  m_cutPosition_Wstot = m_acceptInfo.addCut( "Wstot", "Wstot" );
-  if ( m_cutPosition_Wstot < 0 ) sc = StatusCode::FAILURE; 
-
-  // Eratio
-  m_cutPosition_Eratio = m_acceptInfo.addCut( "Eratio", "Eratio" );
-  if ( m_cutPosition_Eratio < 0 ) sc = StatusCode::FAILURE; 
-
-  // Delta Eta
-  m_cutPosition_DeltaEta = m_acceptInfo.addCut( "DeltaEta", "DeltaEta" );
-  if ( m_cutPosition_DeltaEta < 0 ) sc = StatusCode::FAILURE; 
-
-  // Rescale deltaPhi
-  m_cutPosition_DeltaPhiRes = m_acceptInfo.addCut( "DeltaPhiRes", "DeltaPhiRes" );
-  if ( m_cutPosition_DeltaPhiRes < 0 ) sc = StatusCode::FAILURE; 
-
-  // Si
-  m_cutPosition_NSilicon = m_acceptInfo.addCut( "NSilicon", "NSilicon" );
-  if ( m_cutPosition_NSilicon < 0 ) sc = StatusCode::FAILURE; 
-
-  //Pix
-  m_cutPosition_NPixel = m_acceptInfo.addCut( "NPixel", "NPixel" );
-  if ( m_cutPosition_NPixel < 0 ) sc = StatusCode::FAILURE; 
-
-  //Blayer
-  
-  m_cutPosition_NBlayer = m_acceptInfo.addCut( "NBLayer", "NBLayer" );
-  if ( m_cutPosition_NBlayer < 0 ) sc = StatusCode::FAILURE; 
-
-  //TRT Ratio in crack
-  m_cutPosition_TR = m_acceptInfo.addCut( "TR", "TR" );
-  if ( m_cutPosition_TR < 0 ) sc = StatusCode::FAILURE; 
-
-  //Tight deltaPhi
-  m_cutPosition_TightDeltaPhi = m_acceptInfo.addCut( "TightDeltaPhi", "TightDeltaPhi" );
-  if ( m_cutPosition_TightDeltaPhi < 0 ) sc = StatusCode::FAILURE; 
-
-  return sc;
-}
-
-
-//=============================================================================
-// Calculate the actual accept of each cut individually.
-//=============================================================================
-asg::AcceptData Root::TElectronMultiLeptonSelector::accept( const double eta,
-                                                            const double eT,
-                                                            const double rHad,
-                                                            const double rHad1,
-                                                            const double Reta,
-                                                            const double w2, 
-                                                            const double f1,
-                                                            const double f3,
-                                                            const double wstot,
-                                                            const double DEmaxs1, 
-                                                            const double deltaEta,
-                                                            const int nSi,
-                                                            const int nSiDeadSensors,
-                                                            const int nPix, 
-                                                            const int nPixDeadSensors, 
-                                                            const double deltaPhiRes,
-                                                            const double dpOverp, 
-                                                            const double TRratio,
-                                                            const int nTRTTotal,
-                                                            const int nBlayerHits,
-                                                            const bool expectBlayer
-                                                            )  const
-{
-
-  // -----------------------------------------------------------
-  // Setup return accept with AcceptInfo
-  asg::AcceptData acceptData(&m_acceptInfo);
-
-  
-  //Get eta/et bins
-  unsigned int eTBin = this->getEtBinH4l(eT);
-  unsigned int etaBin = this->getEtaBinH4l(eta);
-  
-  //High Low Brem
-  bool isBrem = this->getBremCategoryH4l(dpOverp, eTBin, etaBin);
-
-
-  // Do the actual selection
-
-  // Coverage
-  bool doPassCoverage = fabs(eta) <= 2.47 ;
-  if(  !doPassCoverage ){ ATH_MSG_DEBUG("Failed Coverage, et=" << eT << ", eta=" << eta);}
-  acceptData.setCutResult( m_cutPosition_Coverage, doPassCoverage );
-
-  // RHad
-  bool doPassRHad = passRHad(rHad,rHad1,eTBin,etaBin) ;
-  if(  !doPassRHad ){ ATH_MSG_DEBUG("Failed RHad, et=" << eT << ", eta=" << eta);}
-  acceptData.setCutResult( m_cutPosition_RHad, doPassRHad );
-
-  // f3
-  bool doPassF3 = eT>=90*GeV || passF3(f3,eTBin,etaBin) ;
-  if(  !doPassF3 ){ ATH_MSG_DEBUG("Failed F3, et=" << eT << ", eta=" << eta);}
-  acceptData.setCutResult( m_cutPosition_F3, doPassF3 );
-
-  // Reta
-  bool doPassReta = passReta(Reta,eTBin,etaBin) ;
-  if(  !doPassReta ){ ATH_MSG_DEBUG("Failed Reta, et=" << eT << ", eta=" << eta);}
-  acceptData.setCutResult( m_cutPosition_Reta, doPassReta );
-
-  // w2
-  bool doPassW2 = passW2(w2,eTBin,etaBin) ;
-  if(  !doPassW2 ){ ATH_MSG_DEBUG("Failed W2, et=" << eT << ", eta=" << eta);}
-  acceptData.setCutResult( m_cutPosition_W2, doPassW2 );
-
-  // Check the energy in the strips before cutting on it
-  bool doPassWstot = f1 <= 0.005 || passWstot(wstot,eTBin,etaBin) ;
-  if(  !doPassWstot ){ ATH_MSG_DEBUG("Failed Wstot, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_Wstot, doPassWstot );
-
-  // Eratio
-  bool doPassEratio = f1 <= 0.005 || passEratio(DEmaxs1,eTBin,etaBin) ;
-  if(  !doPassEratio ){ ATH_MSG_DEBUG("Failed Eratio, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_Eratio, doPassEratio );
-  
-  // Delta Eta
-  bool doPassDeltaEta = passDeltaEta(deltaEta, eTBin, etaBin) ;
-  if(  !doPassDeltaEta ){ ATH_MSG_DEBUG("Failed DeltaEta, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_DeltaEta, doPassDeltaEta );
-
-  // Rescale deltaPhi
-  bool doPassDeltaPhiRes = passDeltaPhiRes(deltaPhiRes, isBrem, eTBin, etaBin) ;
-  if(  !doPassDeltaPhiRes ){ ATH_MSG_DEBUG("Failed DeltaPhiRes, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_DeltaPhiRes, doPassDeltaPhiRes );
-  
-  //Si
-  bool doPassNSilicon = (nSi + nSiDeadSensors) >= 7 ;
-  if(  !doPassNSilicon ){ ATH_MSG_DEBUG("Failed NSilicon, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_NSilicon, doPassNSilicon );
-
-  //Pix
-  bool doPassNPixel = (nPix+nPixDeadSensors) >= 2 ;
-  if(  !doPassNPixel ){ ATH_MSG_DEBUG("Failed NPixel, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_NPixel, doPassNPixel );
- 
-  //BLayer
-  bool doPassNBLayer = !(expectBlayer && nBlayerHits < 1) ;
-  if(  !doPassNBLayer ){ ATH_MSG_DEBUG("Failed NBLayer, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_NBlayer, doPassNBLayer ); 
-  
-  //TRT Ratio in crack
-  bool doPassTR = passTR(TRratio,eta,nTRTTotal) ;
-  if(  !doPassTR ){ ATH_MSG_DEBUG("Failed TR, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_TR, doPassTR );
-
-  //TightDeltaPhi cut 
-  bool doPassTightDeltaPhi = passTightDeltaPhi(deltaPhiRes,  expectBlayer, nBlayerHits ,eTBin, etaBin) ;
-  if(  !doPassTightDeltaPhi ){ ATH_MSG_DEBUG("Failed TightDeltaPhi, et=" << eT << ", eta=" << eta );}
-  acceptData.setCutResult( m_cutPosition_TightDeltaPhi, doPassTightDeltaPhi );
-
-  return acceptData;
-}
-
-
-
-
-// Helper functions
-
-//---------------------------------------------------------------------------------------
-// Gets the Eta bin [0-9] given the eta
-unsigned int Root::TElectronMultiLeptonSelector::getEtaBinH4l(double eta) const {
-  const unsigned int nEtaBins = 10;
-  static const double etaBins[nEtaBins] = {0.1,0.6,0.8,1.15,1.37,1.52,1.81,2.01,2.37,2.47};
-  
-  for(unsigned int etaBin = 0; etaBin < nEtaBins; ++etaBin){
-    if(fabs(eta) < etaBins[etaBin])
-      return etaBin;
-  }
-  return 9;
-}
-
-
-//---------------------------------------------------------------------------------------
-// Gets the Et bin [0-10] given the et (MeV)
-unsigned int Root::TElectronMultiLeptonSelector::getEtBinH4l(double eT) const {
-  const unsigned int nEtBins = 10;
-  static const double eTBins[nEtBins] = {5*GeV,10*GeV,15*GeV,20*GeV,30*GeV,40*GeV,50*GeV,60*GeV,70*GeV,80*GeV};
-  
-  for(unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin){
-    if(eT < eTBins[eTBin])
-      return eTBin;
-  }
-  return 10;
-}
-
-
-//----------------------------------------------------------------------------------------
-
-// Determine whether electron is high- or low-brem using dp/p
-bool Root::TElectronMultiLeptonSelector::getBremCategoryH4l(double dpOverp, unsigned int eTBin, unsigned int etaBin) const {
-
-    //                                      0.0    0.1    0.6    0.8    1.15   1.37   1.52   1.81   2.01   2.37    2.47
-
- static const double bremThresholds[11][10] = {{0.098, 0.098, 0.154, 0.270, 0.306, 0.422, 0.482, 0.606, 0.306, 0.382}, // 0-5 GeV
-					       {0.110, 0.110, 0.178, 0.374, 0.410, 0.478, 0.610, 0.658, 0.314, 0.410}, // 5-10 GeV
-					       {0.118, 0.118, 0.194, 0.430, 0.438, 0.502, 0.642, 0.674, 0.322, 0.434}, // 10-15 GeV
-					       {0.122, 0.122, 0.202, 0.438, 0.458, 0.538, 0.678, 0.722, 0.330, 0.440}, // 15-20 GeV
-					       {0.142, 0.142, 0.226, 0.506, 0.574, 0.586, 0.714, 0.730, 0.338, 0.462}, // 20-30 GeV
-					       {0.242, 0.242, 0.362, 0.654, 0.674, 0.630, 0.798, 0.806, 0.362, 0.490}, // 30-40 GeV
-					       {0.242, 0.242, 0.362, 0.654, 0.674, 0.630, 0.798, 0.806, 0.362, 0.490}, // 40-50 GeV
-					       {0.242, 0.242, 0.362, 0.654, 0.674, 0.630, 0.798, 0.806, 0.362, 0.490}, // 50-60 GeV
-					       {0.242, 0.242, 0.362, 0.654, 0.674, 0.630, 0.798, 0.806, 0.362, 0.490}, // 60-70 GeV
-					       {0.242, 0.242, 0.362, 0.654, 0.674, 0.630, 0.798, 0.806, 0.362, 0.490}, // 70-80 GeV
-					       {0.242, 0.242, 0.362, 0.654, 0.674, 0.630, 0.798, 0.806, 0.362, 0.490}};// >80 GeV
-	
-  if(dpOverp < bremThresholds[eTBin][etaBin]) return false; // Low-brem electron
-  return true; // High-brem electron
-}
-
-//----------------------------------------------------------------------------------------
-bool Root::TElectronMultiLeptonSelector::passRHad(double rhad, double rhad1,unsigned int etbin,unsigned int etabin) const {
-
-
-  static const double cutrhad[11][10] = {{ 0.258,  0.258, 0.208,  0.206,  0.256,  0.188,  0.254,  0.254,  0.226,  0.176 } // 0 - 5 GeV
-                                         ,{ 0.155,  0.155, 0.115,  0.125,  0.125,  0.100,  0.140,  0.135,  0.125,  0.105 } // 5 - 10 GeV
-                                         ,{ 0.075,  0.075, 0.065,  0.065,  0.065,  0.055,  0.080,  0.080,  0.065,  0.050 } // 10 - 15 GeV
-                                         ,{ 0.055,  0.055, 0.045,  0.045,  0.045,  0.040,  0.055,  0.055,  0.050,  0.040 } // 15 - 20 GeV
-                                         ,{ 0.038,  0.038, 0.032,  0.032,  0.032,  0.026,  0.040,  0.040,  0.035,  0.030 } // 20 - 30 GeV
-                                         ,{ 0.025,  0.025, 0.022,  0.022,  0.022,  0.019,  0.030,  0.030,  0.025,  0.020 } // 30 - 40 GeV
-                                         ,{ 0.025,  0.025, 0.021,  0.022,  0.021,  0.019,  0.028,  0.028,  0.023,  0.020 } // 40 - 50 GeV
-                                         ,{ 0.025,  0.025, 0.021,  0.022,  0.021,  0.019,  0.028,  0.028,  0.023,  0.020 } // 50 - 60 GeV
-                                         ,{ 0.025,  0.025, 0.021,  0.022,  0.021,  0.019,  0.028,  0.028,  0.023,  0.020 } // 60 - 70 GeV
-                                         ,{ 0.025,  0.025, 0.021,  0.022,  0.021,  0.019,  0.028,  0.028,  0.023,  0.020 } // 70 - 80 GeV
-                                         ,{ 0.025,  0.025, 0.021,  0.022,  0.021,  0.019,  0.028,  0.028,  0.023,  0.020 } }; // 80 - inf GeV
-
-  if(etabin == 3 || etabin == 4){
-    if (rhad > cutrhad[etbin][etabin])
-      return false;
-  } else{
-    if(rhad1 > cutrhad[etbin][etabin])
-      return false;
-  }
-  return true;
-}
-
-//----------------------------------------------------------------------------------------
-bool Root::TElectronMultiLeptonSelector::passF3(double f3,unsigned int etbin,unsigned int etabin) const{
-
-  //                             0.0     0.1       0.6       0.8    1.15      1.37     1.52    1.81    2.01     2.37     2.47
-  static const double cutf3[11][10] = {{  0.0593 , 0.0593 , 0.0540 , 0.0430 , 0.0481 ,  9999 , 0.0363 , 0.0391 , 0.0420 , 9999 } // 0 - 5 GeV
-                                       ,{ 0.0377 , 0.0377 , 0.0356 , 0.0327 , 0.0365 ,  9999 , 0.0275 , 0.0315 , 0.0360 , 9999 } // 5 - 10 GeV
-                                       ,{ 0.0279 , 0.0279 , 0.0261 , 0.0239 , 0.0267 ,  9999 , 0.0217 , 0.0261 , 0.0270 , 9999 } // 10 - 15 GeV
-                                       ,{ 0.0259 , 0.0259 , 0.0219 , 0.0211 , 0.0239 ,  9999 , 0.0203 , 0.0253 , 0.0270 , 9999 } // 15 - 20 GeV
-                                       ,{ 0.0252 , 0.0252 , 0.0199 , 0.0196 , 0.0225 ,  9999 , 0.0207 , 0.0261 , 0.0270 , 9999 } // 20 - 30 GeV
-                                       ,{ 0.0259 , 0.0259 , 0.0197 , 0.0193 , 0.0215 ,  9999 , 0.0223 , 0.0274 , 0.0270 , 9999 } // 30 - 40 GeV
-                                       ,{ 0.0265 , 0.0265 , 0.0201 , 0.0201 , 0.0222 ,  9999 , 0.0240 , 0.0291 , 0.0290 , 9999 } // 40 - 50 GeV
-                                       ,{ 0.0265 , 0.0265 , 0.0201 , 0.0201 , 0.0222 ,  9999 , 0.0240 , 0.0291 , 0.0290 , 9999 } // 50 - 60 GeV
-                                       ,{ 0.0292 , 0.0292 , 0.0219 , 0.0215 , 0.0241 ,  9999 , 0.0264 , 0.0327 , 0.0315 , 9999 } // 60 - 70 GeV
-                                       ,{ 0.0292 , 0.0292 , 0.0219 , 0.0215 , 0.0241 ,  9999 , 0.0264 , 0.0327 , 0.0315 , 9999 } // 70 - 80 GeV
-                                       ,{  9999  ,  9999  ,  9999  ,  9999  ,  9999  ,  9999 ,  9999  ,  9999  ,  9999  , 9999 } }; // 80 - inf GeV
-  
-  return f3 <= cutf3[etbin][etabin];
-}
-
-//----------------------------------------------------------------------------------------
-bool Root::TElectronMultiLeptonSelector::passReta(double rEta, unsigned int eTBin, unsigned int etaBin) const {
- 
-  //                                    0.0     0.1      0.6       0.8     1.15      1.37     1.52     1.81     2.01     2.37     2.47
-  static const double cutReta37[11][10] = {{    0.600 ,  0.600 ,  0.600 ,  0.600 ,  0.650 ,  0.650 ,  0.700 ,  0.690 ,  0.690 ,  0.690 }    // 0 - 5 GeV
-                                           , {  0.750 ,  0.750 ,  0.730 ,  0.730 ,  0.735 ,  0.700 ,  0.735 ,  0.735 ,  0.775 ,  0.775 }    // 5 - 10 GeV
-                                           , {  0.827 ,  0.827 ,  0.804 ,  0.826 ,  0.770 ,  0.700 ,  0.770 ,  0.802 ,  0.830 ,  0.830 }    // 10 - 15 GeV
-                                           , {  0.863 ,  0.863 ,  0.845 ,  0.826 ,  0.770 ,  0.700 ,  0.813 ,  0.847 ,  0.853 ,  0.853 }    // 15 - 20 GeV
-                                           , {  0.893 ,  0.893 ,  0.878 ,  0.864 ,  0.839 ,  0.700 ,  0.851 ,  0.873 ,  0.879 ,  0.878 }    // 20 - 30 GeV
-                                           , {  0.893 ,  0.893 ,  0.878 ,  0.864 ,  0.839 ,  0.700 ,  0.851 ,  0.873 ,  0.879 ,  0.878 }    // 30 - 40 GeV
-                                           , {  0.917 ,  0.917 ,  0.908 ,  0.900 ,  0.888 ,  0.700 ,  0.883 ,  0.898 ,  0.898 ,  0.896 }    // 40 - 50 GeV
-                                           , {  0.917 ,  0.917 ,  0.908 ,  0.900 ,  0.888 ,  0.700 ,  0.883 ,  0.898 ,  0.898 ,  0.896 }    // 50 - 60 GeV
-                                           , {  0.917 ,  0.917 ,  0.908 ,  0.900 ,  0.888 ,  0.700 ,  0.883 ,  0.898 ,  0.898 ,  0.896 }    // 60 - 70 GeV
-                                           , {  0.917 ,  0.917 ,  0.908 ,  0.900 ,  0.888 ,  0.700 ,  0.883 ,  0.898 ,  0.898 ,  0.896 }    // 70 - 80 GeV
-                                           , {  0.917 ,  0.917 ,  0.908 ,  0.900 ,  0.888 ,  0.700 ,  0.883 ,  0.898 ,  0.898 ,  0.896 } }; // 80 - inf GeV
-  return rEta >= cutReta37[eTBin][etaBin];
-}
-
-//----------------------------------------------------------------------------------------
-
-bool Root::TElectronMultiLeptonSelector::passW2(double w2, unsigned int eTBin, unsigned int etaBin) const{
-
-  //                                  0.0       0.1      0.6     0.8       1.15      1.37    1.52     1.81      2.01      2.37     2.47
-  static const double cutWeta2[11][10] = { {   0.0166 , 0.0166 , 0.0172 , 0.0167 , 0.0170 , 0.0385 , 0.0164 , 0.0152 , 0.0156 , 0.0157 }   // 0 - 5 GeV
-                                           , { 0.0145 , 0.0145 , 0.0152 , 0.0154 , 0.0158 , 0.0347 , 0.0159 , 0.0140 , 0.0150 , 0.0150 }   // 5 - 10 GeV
-                                           , { 0.0129 , 0.0129 , 0.0137 , 0.0141 , 0.0146 , 0.0311 , 0.0151 , 0.0133 , 0.0140 , 0.0140 }   // 10 - 15 GeV
-                                           , { 0.0122 , 0.0122 , 0.0129 , 0.0133 , 0.0139 , 0.0278 , 0.0145 , 0.0128 , 0.0140 , 0.0140 }   // 15 - 20 GeV
-                                           , { 0.0117 , 0.0117 , 0.0123 , 0.0126 , 0.0131 , 0.0257 , 0.0139 , 0.0124 , 0.0135 , 0.0135 }   // 20 - 30 GeV
-                                           , { 0.0117 , 0.0117 , 0.0123 , 0.0126 , 0.0131 , 0.0257 , 0.0139 , 0.0124 , 0.0135 , 0.0135 }   // 30 - 40 GeV
-                                           , { 0.0112 , 0.0112 , 0.0118 , 0.0121 , 0.0125 , 0.0247 , 0.0132 , 0.0120 , 0.0130 , 0.0135 }   // 40 - 50 GeV
-                                           , { 0.0112 , 0.0112 , 0.0118 , 0.0121 , 0.0125 , 0.0247 , 0.0132 , 0.0120 , 0.0130 , 0.0135 }   // 50 - 60 GeV
-                                           , { 0.0112 , 0.0112 , 0.0118 , 0.0121 , 0.0125 , 0.0247 , 0.0132 , 0.0120 , 0.0130 , 0.0135 }   // 60 - 70 GeV
-                                           , { 0.0112 , 0.0112 , 0.0118 , 0.0121 , 0.0125 , 0.0247 , 0.0132 , 0.0120 , 0.0130 , 0.0135 }   // 70 - 80 GeV
-                                           , { 0.0112 , 0.0112 , 0.0118 , 0.0121 , 0.0125 , 0.0247 , 0.0132 , 0.0120 , 0.0130 , 0.0135 } };// 80 - inf GeV
-  
-
-  return w2 <= cutWeta2[eTBin][etaBin];
-}
-
-//----------------------------------------------------------------------------------------
-bool Root::TElectronMultiLeptonSelector::passWstot(double wstot, unsigned int eTBin, unsigned int etaBin) const {  
-
-  //                                       0.0     0.1      0.6       0.8       1.15      1.37      1.52      1.81      2.01      2.37     2.47
-  static const double cutWstot[11][10] = { {   3.926,   3.926,   4.069,   4.501,   4.986,   9999,   4.650,   3.190,   1.966,   9999 }    // 0 - 5 GeV
-                                           , { 3.296,   3.296,   3.427,   3.936,   4.309,   9999,   4.313,   2.845,   1.818,   9999 }    // 5 - 10 GeV
-                                           , { 3.095,   3.095,   3.202,   3.708,   4.095,   9999,   3.968,   2.692,   1.754,   9999 }    // 10 - 15 GeV
-                                           , { 3.035,   3.035,   3.129,   3.553,   3.941,   9999,   3.758,   2.555,   1.714,   9999 }    // 15 - 20 GeV
-                                           , { 3.035,   3.035,   3.129,   3.508,   3.793,   9999,   3.609,   2.505,   1.703,   9999 }    // 20 - 30 GeV
-                                           , { 2.881,   2.881,   2.941,   3.319,   3.506,   9999,   3.380,   2.381,   1.644,   9999 }    // 30 - 40 GeV
-                                           , { 2.881,   2.881,   2.941,   3.319,   3.506,   9999,   3.380,   2.381,   1.644,   9999 }    // 40 - 50 GeV
-                                           , { 2.881,   2.881,   2.941,   3.319,   3.506,   9999,   3.380,   2.381,   1.644,   9999 }    // 50 - 60 GeV
-                                           , { 2.881,   2.881,   2.941,   3.319,   3.506,   9999,   3.380,   2.381,   1.644,   9999 }    // 60 - 70 GeV
-                                           , { 2.881,   2.881,   2.941,   3.319,   3.506,   9999,   3.380,   2.381,   1.644,   9999 }    // 70 - 80 GeV
-                                           , { 2.881,   2.881,   2.941,   3.319,   3.506,   9999,   3.380,   2.381,   1.644,   9999 } }; // 80 - inf GeV
-  
-  return wstot <= cutWstot[eTBin][etaBin];
-}
-//----------------------------------------------------------------------------------------
-bool Root::TElectronMultiLeptonSelector::passEratio(double DEmaxs1, unsigned int eTBin, unsigned int etaBin) const {  
-
-    static const double cutDEmaxs1[11][10] = { {    0.278 ,  0.278 ,  0.150 ,  0.150 ,  0.250 , -9999 ,  0.100 ,  0.136 ,  0.492 , -9999 }    // 0 - 5 GeV
-                                               , {  0.506 ,  0.506 ,  0.320 ,  0.281 ,  0.250 , -9999 ,  0.250 ,  0.281 ,  0.543 , -9999 }    // 5 - 10 GeV
-                                               , {  0.587 ,  0.587 ,  0.509 ,  0.420 ,  0.335 , -9999 ,  0.335 ,  0.369 ,  0.616 , -9999 }    // 10 - 15 GeV
-                                               , {  0.591 ,  0.591 ,  0.556 ,  0.420 ,  0.335 , -9999 ,  0.335 ,  0.369 ,  0.639 , -9999 }    // 15 - 20 GeV
-                                               , {  0.627 ,  0.627 ,  0.617 ,  0.420 ,  0.335 , -9999 ,  0.417 ,  0.505 ,  0.653 , -9999 }    // 20 - 30 GeV
-                                               , {  0.627 ,  0.627 ,  0.617 ,  0.420 ,  0.335 , -9999 ,  0.417 ,  0.505 ,  0.653 , -9999 }    // 30 - 40 GeV
-                                               , {  0.627 ,  0.627 ,  0.617 ,  0.420 ,  0.335 , -9999 ,  0.417 ,  0.505 ,  0.653 , -9999 }    // 40 - 50 GeV
-                                               , {  0.627 ,  0.627 ,  0.617 ,  0.420 ,  0.335 , -9999 ,  0.417 ,  0.505 ,  0.653 , -9999 }    // 50 - 60 GeV
-                                               , {  0.627 ,  0.627 ,  0.617 ,  0.420 ,  0.335 , -9999 ,  0.417 ,  0.505 ,  0.653 , -9999 }    // 60 - 70 GeV
-                                               , {  0.627 ,  0.627 ,  0.617 ,  0.420 ,  0.335 , -9999 ,  0.417 ,  0.505 ,  0.653 , -9999 }    // 70 - 80 GeV
-                                               , {  0.627 ,  0.627 ,  0.617 ,  0.420 ,  0.335 , -9999 ,  0.417 ,  0.505 ,  0.653 , -9999 } }; // 80 -    GeV
-  return DEmaxs1 >= cutDEmaxs1[eTBin][etaBin];
-}
-
-//----------------------------------------------------------------------------------------
-bool Root::TElectronMultiLeptonSelector::passDeltaEta(double deltaEta, unsigned int eTBin, unsigned int etaBin) const {
-  //                                        0.0     0.1      0.6      0.8      1.15      1.37    1.52     1.81    2.01    2.37    2.47
-  static const double cutDeltaEta[11][10]  = {{0.017,   0.017,   0.020,   0.020,   0.020,   0.020,   0.020,   0.020,   0.020,   0.020}, // 0 - 5 GeV   
-                                              {0.012,   0.009,   0.009,   0.011,   0.013,   0.014,   0.013,   0.011,   0.011,   0.014}, // 5 - 10 GeV  
-                                              {0.012,   0.009,   0.008,   0.009,   0.009,   0.013,   0.010,   0.010,   0.008,   0.013}, // 10 - 15 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}, // 15 - 20 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}, // 20 - 30 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}, // 30 - 40 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}, // 40 - 50 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}, // 50 - 60 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}, // 60 - 70 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}, // 70 - 80 GeV 
-                                              {0.011,   0.008,   0.007,   0.007,   0.009,   0.013,   0.009,   0.007,   0.007,   0.011}};// 80 - inf GeV 
-  return fabs(deltaEta) <= cutDeltaEta[eTBin][etaBin];
-
-}
-
-//----------------------------------------------------------------------------------------
-bool Root::TElectronMultiLeptonSelector::passDeltaPhiRes(double deltaPhiRes, bool isBrem, unsigned int eTBin, unsigned int etaBin) const{
-
-  //                                             0.0      0.1  x    0.6      0.8  x   1.15    1.37     1.52   x 1.81    2.01  x 2.37     2.47   
-  static const double maxDeltaPhiResHigh[11][10]= {{0.083,   0.083,   0.071,   0.050,   0.043,   0.048,   0.047,   0.038,   0.032,   0.044}, // 0 - 5 GeV   
-                                                   {0.038,   0.030,   0.028,   0.023,   0.023,   0.028,   0.023,   0.023,   0.023,   0.038}, // 5 - 10 GeV  
-                                                   {0.020,   0.015,   0.013,   0.013,   0.020,   0.023,   0.020,   0.018,   0.023,   0.033}, // 10 - 15 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}, // 15 - 20 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}, // 20 - 30 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}, // 30 - 40 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}, // 40 - 50 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}, // 50 - 60 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}, // 60 - 70 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}, // 70 - 80 GeV 
-                                                   {0.017,   0.015,   0.013,   0.013,   0.018,   0.018,   0.018,   0.018,   0.023,   0.028}};// 80 
-
-  //                                             0.0      0.1      0.6       0.8     1.15      1.37     1.52      1.81     2.01    2.37     2.47   
-  static const double minDeltaPhiResHigh[11][10]= {{-0.100,  -0.100,  -0.100,  -0.100,  -0.115,  -0.120,  -0.090,  -0.735,  -0.050,  -0.038},// 0 - 5 GeV   
-                                                   {-0.086,  -0.078,  -0.078,  -0.078,  -0.083,  -0.053,  -0.048,  -0.028,  -0.023,  -0.023},// 5 - 10 GeV  
-                                                   {-0.038,  -0.038,  -0.038,  -0.043,  -0.047,  -0.038,  -0.028,  -0.023,  -0.014,  -0.017},// 10 - 15 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.029,  -0.014,  -0.014,  -0.014},// 15 - 20 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.026,  -0.014,  -0.014,  -0.014},// 20 - 30 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.026,  -0.014,  -0.014,  -0.014},// 30 - 34 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.026,  -0.014,  -0.014,  -0.014},// 34 - 50 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.026,  -0.014,  -0.014,  -0.014},// 50 - 60 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.026,  -0.014,  -0.014,  -0.014},// 60 - 70 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.026,  -0.014,  -0.014,  -0.014},// 70 - 80 GeV 
-                                                   {-0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.032,  -0.026,  -0.014,  -0.014,  -0.014}};// 80
-  
-  //                                            0.0      0.1      0.6       0.8     1.15      1.37     1.52      1.81     2.01    2.37     2.47   
-  static const double maxDeltaPhiResLow[11][10] = {{0.100,   0.100,   0.100,   0.075,   0.075,   0.080,   0.075,   0.060,   0.045,   0.070}, // 0 - 5 GeV   
-                                                   {0.038,   0.038,   0.038,   0.023,   0.027,   0.038,   0.028,   0.028,   0.028,   0.068}, // 5 - 10 GeV  
-                                                   {0.020,   0.017,   0.018,   0.020,   0.020,   0.026,   0.023,   0.023,   0.023,   0.062}, // 10 - 15 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}, // 15 - 20 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}, // 20 - 30 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}, // 30 - 40 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}, // 40 - 50 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}, // 50 - 60 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}, // 60 - 70 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}, // 70 - 80 GeV 
-                                                   {0.017,   0.017,   0.017,   0.018,   0.018,   0.018,   0.020,   0.022,   0.031,   0.053}};// 80
-
-  //                                        0.0      0.1      0.6       0.8     1.15     1.37     1.52      1.81     2.01    2.37     2.47   
-  static const double minDeltaPhiResLow[11][10]= {{-0.100,  -0.100,  -0.100,  -0.100,  -0.095,  -0.080,  -0.070,  -0.060,  -0.045,  -0.035}, // 0 - 5 GeV   
-                                                  {-0.074,  -0.068,  -0.068,  -0.071,  -0.057,  -0.048,  -0.038,  -0.026,  -0.011,  -0.020}, // 5 - 10 GeV  
-                                                  {-0.041,  -0.028,  -0.028,  -0.038,  -0.028,  -0.028,  -0.020,  -0.011,  -0.011,  -0.011}, // 10 - 15 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}, // 15 - 20 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}, // 20 - 25 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}, // 25 - 40 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}, // 40 - 50 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}, // 50 - 60 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}, // 60 - 70 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}, // 70 - 80 GeV 
-                                                  {-0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.023,  -0.020,  -0.011,  -0.011,  -0.011}};// 80   
-  
-  if(isBrem){
-    if(deltaPhiRes < minDeltaPhiResHigh[eTBin][etaBin] || deltaPhiRes > maxDeltaPhiResHigh[eTBin][etaBin]) return false;
-  }
-  if(!isBrem){
-    if(deltaPhiRes < minDeltaPhiResLow[eTBin][etaBin] || deltaPhiRes > maxDeltaPhiResLow[eTBin][etaBin]) return false;
-  }
-  return true;
-  
-}
-
-//----------------------------------------------------------------------------------------
-
-bool Root::TElectronMultiLeptonSelector::passTR(double TRratio, double eta, unsigned int  nTRTTotal ) const {  
-    if (fabs(eta)>1.37 && fabs(eta)<1.52 ){
-
-        return (nTRTTotal >10 && TRratio > 0.1);
-    }
-    return true; 
-}
-
-
-bool Root::TElectronMultiLeptonSelector::passTightDeltaPhi(double deltaPhiRes, bool expectBlayer, int nBlayerHits,
-                                                        unsigned int eTBin, unsigned int etaBin) const {  
-
-                //                           0.0     0.1      0.6      0.8   1.15      1.37   1.52    1.81    2.01    2.37     2.47 
-  static const double maxDeltaPhiResBL[11][10] = {{  0.020 , 0.020,  0.020,  0.020,  0.020,  0.016,  0.020,  0.023,  0.023,  0.032}, // 0  
-						  {  0.014,  0.014,  0.014,  0.014,  0.014,  0.015,  0.020,  0.022,  0.022,  0.032}, // 5  
-						  {  0.008,  0.008,  0.008,  0.009,  0.009,  0.011,  0.015,  0.015,  0.018,  0.030}, // 10 
-						  {  0.006,  0.006,  0.007,  0.008,  0.008,  0.019,  0.013,  0.015,  0.017,  0.025}, // 15 
-						  {  0.006,  0.006,  0.006,  0.006,  0.006,  0.008,  0.012,  0.013,  0.015,  0.021}, // 20 
-						  {  0.006 , 0.006,  0.006,  0.006,  0.006,  0.007,  0.012,  0.013,  0.014,  0.020}, // 30 
-						  {  0.005,  0.005,  0.005,  0.005,  0.005,  0.006,  0.012,  0.013,  0.014,  0.020}, // 40 
-						  {  0.005,  0.005,  0.005,  0.005,  0.005,  0.006,  0.012,  0.013,  0.014,  0.020}, // 50 
-						  {  0.005,  0.005,  0.005,  0.005,  0.005,  0.006,  0.012,  0.013,  0.014,  0.020}, // 60 
-						  {  0.005,  0.005,  0.005,  0.005,  0.005,  0.006,  0.012,  0.013,  0.014,  0.020}, // 70 
-						  {  0.005,  0.005,  0.005,  0.005,  0.005,  0.006,  0.012,  0.013,  0.014,  0.020}}; // 80
-
-
-  if (expectBlayer && nBlayerHits<1) {	
-     if(deltaPhiRes > maxDeltaPhiResBL[eTBin][etaBin]){
-       return false;
-     }
-   }
-  
-
-  return true;
-}
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.h
deleted file mode 100644
index d6d877b7066718373c5fa1b1209d9fd5f22f464e..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __TELECTRONMULTILEPTONSELECTOR__
-#define __TELECTRONMULTILEPTONSELECTOR__
-
-/**
-   @class TElectronMultiLeptonSelector
-   @brief Electron selector tool to select objects in pure ROOT using the multi-lepton cuts
-
-   @author Karsten Koeneke
-   @date   October 2012
-*/
-
-
-// Include the return object and the base class
-#include "AsgTools/AsgMessaging.h"
-#include "PATCore/AcceptInfo.h"
-#include "PATCore/AcceptData.h"
-
-
-namespace Root {
-    class TElectronMultiLeptonSelector : public asg::AsgMessaging
-    {
-
-    public: 
-        /** Standard constructor */
-        TElectronMultiLeptonSelector(const char* name="TElectronMultiLeptonSelector");
-
-        /** Standard destructor */
-        ~TElectronMultiLeptonSelector();
-
-
-        // Main methods
-    public:
-        /** Initialize this class */
-        StatusCode initialize();
-
-        /// accesss to the accept info object
-        const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; }
-        
-        /** The main accept method: the actual cuts are applied here */
-        asg::AcceptData accept( const double eta,
-                                const double eT,
-                                const double rHad,
-                                const double rHad1,
-                                const double Reta,
-                                const double w2, 
-                                const double f1,
-                                const double f3,
-                                const double wstot,
-                                const double DEmaxs1, 
-                                const double deltaEta,
-                                const int nSi,
-                                const int nSiDeadSensors,
-                                const int nPix, 
-                                const int nPixDeadSensors, 
-                                const double deltaPhiRes,
-                                const double dpOverp, 
-                                const double TRratio,
-                                const int nTRTTotal,
-                                const int nBlayerHits,
-                                const bool expectBlayer
-                                ) const;
-
-
-        /** Return dummy accept with only info */
-        asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); }
-        
-    private:
-        // Private helper methods
-        bool passRHad(double rhad, double rhad1, unsigned int etbin, unsigned int etabin) const;
-        bool passF3(double f3, unsigned int etbin, unsigned int etabin) const;
-        bool passReta(double reta, unsigned int etbin, unsigned int etabin)const ;
-        bool passW2(double w2, unsigned int etbin, unsigned int etabin) const ;
-        bool passWstot(double wstot, unsigned int etbin, unsigned int etabin) const ;
-        bool passEratio(double demaxs1, unsigned int etbin, unsigned int etabin) const ;
-        bool passDeltaEta(double deltaEta, unsigned int etbin, unsigned int etabin) const ;
-        bool passDeltaPhiRes(double deltaPhiRes, bool isBrem, unsigned int etbin, unsigned int etabin) const ;
-        bool passTR(double TRratio, double eta, unsigned int  nTRTTotal ) const ;
-        bool passTightDeltaPhi(double deltaPhiRes,
-                               bool expectBlayer, int nBlayerHits,
-                               unsigned int eTBin, unsigned int etaBin) const ;
-
-        // Helper Fuctions
-        unsigned int getEtaBinH4l(double eta) const ;
-        unsigned int getEtBinH4l(double eT) const ;
-        bool getBremCategoryH4l( double dpOverp, unsigned int etbin, unsigned int etabin) const ;
-
-    private:
-        /// Accept info
-        asg::AcceptInfo     m_acceptInfo;
-
-        const double GeV;
-  
-        int m_cutPosition_Coverage; 
-        int m_cutPosition_RHad; 
-        int m_cutPosition_F3; 
-        int m_cutPosition_Reta; 
-        int m_cutPosition_W2;
-        int m_cutPosition_Wstot; 
-        int m_cutPosition_Eratio; 
-        int m_cutPosition_DeltaEta; 
-        int m_cutPosition_DeltaPhiRes;
-        int m_cutPosition_NSilicon;
-        int m_cutPosition_NPixel;
-        int m_cutPosition_NBlayer;
-        int m_cutPosition_TR; 
-        int m_cutPosition_TightDeltaPhi; 
-    
-    }; // End: class definition
-  
-} // End: namespace Root
-
-#endif
-
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
index 5cfdd1c4ce651cb311690efd869771576270ad13..1cfb85d02dd6965e132c50c633575d024deb5b49 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/src/components/ElectronPhotonSelectorTools_entries.cxx
@@ -1,5 +1,4 @@
 #include "ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h"
-#include "ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h"
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
 #include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h"
 #include "ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h"
@@ -7,7 +6,6 @@
 #include "ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h"
 
 DECLARE_COMPONENT( AsgElectronIsEMSelector )
-DECLARE_COMPONENT( AsgElectronMultiLeptonSelector )
 DECLARE_COMPONENT( AsgElectronLikelihoodTool )
 DECLARE_COMPONENT( AsgPhotonIsEMSelector )
 DECLARE_COMPONENT( AsgForwardElectronIsEMSelector )
diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt
index 3c1b7f674146fd6e433fa11215110b1411c85eef..c0b885324f71e1eac612d6a61c4f01370140ddca 100644
--- a/Projects/Athena/version.txt
+++ b/Projects/Athena/version.txt
@@ -1 +1 @@
-22.0.17
+22.0.18
diff --git a/Reconstruction/Jet/JetMomentTools/CMakeLists.txt b/Reconstruction/Jet/JetMomentTools/CMakeLists.txt
index 8946417b2a89a3be4c38c9e9e874697a7e18091d..9efabbe1482098f87b34a1226feba6f4c9f96cb1 100644
--- a/Reconstruction/Jet/JetMomentTools/CMakeLists.txt
+++ b/Reconstruction/Jet/JetMomentTools/CMakeLists.txt
@@ -78,7 +78,7 @@ atlas_add_library( JetMomentToolsLib
    LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES}
    AsgTools xAODCaloEvent xAODJet xAODMissingET xAODTracking xAODTruth JetEDM JetInterface TrackVertexAssociationToolLib
    JetRecLib JetUtils PFlowUtilsLib JetCalibToolsLib
-   xAODMetaData
+   xAODMetaData InDetTrackSelectionToolLib
    PRIVATE_LINK_LIBRARIES CaloGeoHelpers xAODEventInfo xAODPFlow PathResolver )
 
 if( NOT XAOD_STANDALONE )
diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h
index 241e8e9fc1c5f82948974dd299c724891c92dd37..4e14ebfcdd418243fa6e56f988f718cc6f9a3ffe 100644
--- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h
+++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h
@@ -33,8 +33,8 @@ private:
 
   ToolHandle<IJetSelector> m_selectTool;
   ToolHandle<IJetEventSelector> m_eventSelTool;
+  Gaudi::Property<bool> m_inverseJetSel {this,"InverseJetSel", false};
   Gaudi::Property<int> m_selIndex {this,"SelectedIndex", -1};
-
   ToolHandle<IJetHistoVarTool> m_sortVar;
 
   
diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
index 9577ba56a446f77652588b2d79fc19f77b2e6875..3fcd54da34b19dd3936dac6dad4488b1e4b8eb36 100644
--- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
+++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py
@@ -445,6 +445,7 @@ class SelectSpec(ToolSpec):
             args['Selector'] = selSpec
 
 
+
         self.name = selname
         self.path = path
         ConfigDict.__init__(self, **args)
@@ -460,7 +461,7 @@ class SelectSpec(ToolSpec):
         from AthenaConfiguration.ComponentFactory import CompFactory
         # conf = self.clone(self.name)
         # name = conf.pop('name')
-        selTool = CompFactory.JetHistoSelectSort(self.name, SelectedIndex=self.get('SelectedIndex',-1))
+        selTool = CompFactory.JetHistoSelectSort(self.name, SelectedIndex=self.get('SelectedIndex',-1), InverseJetSel=self.get('InverseJetSel',False))
         if hasattr(self,'Selector'):
             self.Selector.topLevelDir = self.topLevelDir
             self.Selector.bottomLevelDir = self.bottomLevelDir
diff --git a/Reconstruction/Jet/JetMonitoring/src/JetHistoSelectSort.cxx b/Reconstruction/Jet/JetMonitoring/src/JetHistoSelectSort.cxx
index ec9a1a8d913dae26aec6b449a65df812cd48ed99..d5cbf62192c9fbcda8a5141cd433e72cc69eba98 100644
--- a/Reconstruction/Jet/JetMonitoring/src/JetHistoSelectSort.cxx
+++ b/Reconstruction/Jet/JetMonitoring/src/JetHistoSelectSort.cxx
@@ -10,7 +10,6 @@ JetHistoSelectSort::JetHistoSelectSort( const std::string& type,  const std::str
   , m_selectTool(this)
   , m_eventSelTool(this)
   , m_sortVar(this)
-  
 
 {
   declareInterface<IJetHistoFiller>(this);
@@ -19,7 +18,6 @@ JetHistoSelectSort::JetHistoSelectSort( const std::string& type,  const std::str
   declareProperty("Selector",m_selectTool);
   declareProperty("EventSelector",m_eventSelTool);
   declareProperty("SortVariable",m_sortVar);
-  
 }
 
 
@@ -38,6 +36,9 @@ StatusCode JetHistoSelectSort::initialize() {
     ATH_CHECK(m_selectTool.retrieve());
     ATH_MSG_INFO( " Selecting with "<< m_selectTool->name() );
   }
+  if(m_inverseJetSel){
+    ATH_MSG_DEBUG( "   inverse Jet Selection will be applied" );
+  }
 
   if(m_eventSelTool.isEnabled()){
     ATH_CHECK(m_eventSelTool.retrieve());
@@ -73,8 +74,14 @@ StatusCode JetHistoSelectSort::processJetContainer(const JetMonitoringAlg& paren
 
   // select if needed
   if(m_selectTool.isEnabled()){
-    auto sel = [this] (const xAOD::Jet * j) {return ! m_selectTool->keep(*j) ; } ;
-    tmpList.remove_if( sel );
+    if (m_inverseJetSel) {
+      auto sel = [this] (const xAOD::Jet * j) {return  m_selectTool->keep(*j) ; } ;
+      tmpList.remove_if( sel );
+    }
+    else {
+      auto sel = [this] (const xAOD::Jet * j) {return ! m_selectTool->keep(*j) ; } ;
+      tmpList.remove_if( sel );
+    }
   }
 
   if(m_eventSelTool.isEnabled()){
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
index 60192db003db861549d50582a12e491f31f0dcd4..093f0c8cd9345cfdf8d6b306ea5e78621f6c2c26 100755
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h
@@ -21,6 +21,7 @@
 // --- STL ---
 #include <map>
 #include <vector>
+#include <mutex>
 
 // --- Forward declarations ---
 class CaloCellContainer;
@@ -123,8 +124,10 @@ class TrackDepositInCaloTool: public AthAlgTool, virtual public ITrackDepositInC
   private:
     /**
        Invoked from initialize(), initializes the CaloLayerMap.
+       Marked const because it must be called from some const methods
+       Actually will change mutable member variables
     */
-    StatusCode initializeDetectorInfo();
+    StatusCode initializeDetectorInfo() const;
     /**
        Extrapolate track to cylinder surface along straight line.
        (x0, y0, z0) is the starting position, (phi0,theta0) is the direction of the momentum, r is the bound of 
@@ -162,24 +165,25 @@ class TrackDepositInCaloTool: public AthAlgTool, virtual public ITrackDepositInC
 
     // Services & Tools
     ITHistSvc*                          m_histSvc{};
-    ToolHandle<Trk::IExtrapolator>     m_extrapolator{this, "ExtrapolatorHandle", ""};
-    const CaloDetDescrManager*          m_caloDDM{};                             //!< Calorimeter detector description manager
+    ToolHandle<Trk::IExtrapolator>      m_extrapolator{this, "ExtrapolatorHandle", ""};
+    const mutable CaloDetDescrManager*  m_caloDDM{};                           //!< Calorimeter detector description manager
     const TileDetDescrManager*          m_tileDDM{};
     
     ToolHandle <Trk::IParticleCaloExtensionTool> m_caloExtensionTool{this, "ParticleCaloExtensionTool", "", "Tool to make the step-wise extrapolation"};
     ToolHandle <Rec::IParticleCaloCellAssociationTool> m_caloCellAssociationTool{this, "ParticleCaloCellAssociationTool", ""};
     
     // Members
-    const CaloCellContainer*    m_cellContainer;                       //!< CaloCell container.
-
-    bool            m_doExtr;                                                  //!< Flag to perform extrapolations using m_extrapolator
-    bool            m_doHist;                                                  //!< Flag to write histograms to track performance
-    bool            m_debugMode;                                               //!< Flag to run in specialized debug mode
-    bool            m_showNeighbours;
-    double          m_solenoidRadius;                                          //!< Radius of the solenoid surrounding the ID
-    CaloLayerMap    m_barrelLayerMap;                                          //!< std::map of \f$r\f$ distance versus descriptor for cylindrical calo regions
-    CaloLayerMap    m_endCapLayerMap;                                          //!< std::map of \f$z\f$ distance versus descriptor for disc-like calo regions
-    
+    const CaloCellContainer*    m_cellContainer;                               //!< CaloCell container.
+
+    bool                 m_doExtr;                                             //!< Flag to perform extrapolations using m_extrapolator
+    bool                 m_doHist;                                             //!< Flag to write histograms to track performance
+    bool                 m_debugMode;                                          //!< Flag to run in specialized debug mode
+    bool                 m_showNeighbours;
+    double               m_solenoidRadius;                                     //!< Radius of the solenoid surrounding the ID
+    CaloLayerMap mutable m_barrelLayerMap;                                     //!< std::map of \f$r\f$ distance versus descriptor for cylindrical calo regions
+    CaloLayerMap mutable m_endCapLayerMap;                                     //!< std::map of \f$z\f$ distance versus descriptor for disc-like calo regions
+
+    std::once_flag mutable m_initializeOnce;
 
     // Histograms        
     TH1F* m_hDepositLayer12{};
diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
index ae1dcac120dc916a04d4a8bb1c2fac257b5e3273..cad4b2bb14eb7bfa93c8f3f2d51d0b665bc2e92b 100755
--- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
+++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx
@@ -61,15 +61,6 @@ StatusCode TrackDepositInCaloTool::initialize() {
     return StatusCode::FAILURE;
   } 
   
-  if ( detStore()->retrieve(m_caloDDM).isFailure() ) {
-    ATH_MSG_WARNING("Unable to retrieve CaloDetDescrManager from DetectorStore. Calling the CaloDetDescrManager::instance() method");
-    m_caloDDM = CaloDetDescrManager::instance();
-  }
-  if ( !m_caloDDM ) {
-    ATH_MSG_ERROR("Unfortunately that did not succeed. Sending StatusCode::FAILURE");
-    return StatusCode::FAILURE;
-  }
-  
   if ( detStore()->retrieve(m_tileDDM).isFailure() ) {
     ATH_MSG_ERROR("Could not retrieve TileDetDescrManager from DetectorStore!");
     return StatusCode::FAILURE;
@@ -91,11 +82,6 @@ StatusCode TrackDepositInCaloTool::initialize() {
     }
   }
   
-  if ( initializeDetectorInfo().isFailure() ) {
-    ATH_MSG_ERROR("Could not initialize detector info.");
-    return StatusCode::FAILURE;
-  }
-
   ATH_CHECK(m_extrapolator.retrieve());
   ATH_CHECK(m_caloExtensionTool.retrieve()   );
   ATH_CHECK(m_caloCellAssociationTool.retrieve());
@@ -357,6 +343,12 @@ std::vector<const CaloCell*>* TrackDepositInCaloTool::getCaloCellsForTile(const
   // --- Fill vecHash ---
   CaloCell_ID::CaloSample sample = descr->getSampling();
 
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if ( !m_caloDDM ) {
+    StatusCode sc = detStore()->retrieve( m_caloDDM );
+    if ( !sc.isSuccess() ) return result;
+  }
+
   std::vector<IdentifierHash> vecHash;
   m_caloDDM->cellsInZone(etaMin, etaMax, phiMin, phiMax, sample, vecHash);
   std::vector<IdentifierHash>::iterator it = vecHash.begin();
@@ -859,7 +851,9 @@ double TrackDepositInCaloTool::calcEnergy(const Trk::TrackParameters* par, const
 ///////////////////////////////////////////////////////////////////////////////
 // initializeDetectorInfo()
 ///////////////////////////////////////////////////////////////////////////////
-StatusCode TrackDepositInCaloTool::initializeDetectorInfo() {
+StatusCode TrackDepositInCaloTool::initializeDetectorInfo() const {
+
+  if ( !m_caloDDM ) ATH_CHECK( detStore()->retrieve( m_caloDDM ) );
 
   ATH_MSG_DEBUG("In CaloTrkMuIdDetStore::initialize()");
   // Initialize LAr
@@ -985,6 +979,11 @@ Amg::Vector3D* TrackDepositInCaloTool::extrapolateZ(const Amg::Vector3D& initial
 ///////////////////////////////////////////////////////////////////////////////
 StatusCode TrackDepositInCaloTool::getTraversedLayers(const Trk::TrackParameters* par, std::map<double, const CaloDetDescriptor*>& caloInfo , std::vector<Amg::Vector3D>& extrapolations) const {
 
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  StatusCode sc = StatusCode::SUCCESS;
+  std::call_once( m_initializeOnce, [this, &sc](){ sc = initializeDetectorInfo(); } );
+  if ( !sc.isSuccess() ) return sc;
+
   const Trk::TrackParameters* parAtSolenoid = 0;
   // --- To be replaced by a check, possibly extrapolating to solenoid surface if needed ---
   bool parIsAtSolenoid = true;
@@ -1163,6 +1162,12 @@ that is closest to the track.
 ///////////////////////////////////////////////////////////////////////////////
 const CaloCell* TrackDepositInCaloTool::getClosestCellLAr(const Trk::TrackParameters* par, const CaloDetDescriptor* descr, const CaloCellContainer* caloCellCont) const {
 
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if ( !m_caloDDM ) {
+    StatusCode sc = detStore()->retrieve( m_caloDDM );
+    if ( !sc.isSuccess() ) return 0;
+  }
+
   CaloCell_ID::CaloSample sample = descr->getSampling();
   // ATH_MSG_INFO("Sampling = " << sample);
   const CaloDetDescrElement* cellDescr = m_caloDDM->get_element(sample, par->position().eta(), par->position().phi());
@@ -1196,6 +1201,12 @@ const CaloCell* TrackDepositInCaloTool::getClosestCellTile(const Trk::TrackParam
   // --- Fill vecHash ---
   CaloCell_ID::CaloSample sample = descr->getSampling();
 
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if ( !m_caloDDM ) {
+    StatusCode sc = detStore()->retrieve( m_caloDDM );
+    if ( !sc.isSuccess() ) return result;
+  }
+
   std::vector<IdentifierHash> vecHash;
   m_caloDDM->cellsInZone(etaMin, etaMax, phiMin, phiMax, sample, vecHash);
   std::vector<IdentifierHash>::iterator it = vecHash.begin();
@@ -1398,6 +1409,12 @@ std::vector<DepositInCalo> TrackDepositInCaloTool::deposits( const Trk::Track* t
 
 void TrackDepositInCaloTool::showNeighbours(const CaloCell* cell) const {
 
+  // Cannot do this in initialize: see ATLASRECTS-5012
+  if ( !m_caloDDM ) {
+    StatusCode sc = detStore()->retrieve( m_caloDDM );
+    if ( !sc.isSuccess() ) return;
+  }
+
   // --- Get helper class for finding neighbours ---
   const CaloCell_ID* cellId = m_caloDDM->getCaloCell_ID();
   if (cellId) {
diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMClusterTool.h b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMClusterTool.h
index 9e58569d17f59ab3d8accd4ad5fb338cbab8cf6b..1039574bc4aa3a981a5558662efe446a8a989c40 100644
--- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMClusterTool.h
+++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMClusterTool.h
@@ -25,10 +25,10 @@ class IEMClusterTool : virtual public IAlgTool {
  public:
   /** @brief Virtual destructor*/
   virtual ~IEMClusterTool() {};
-  
+
   /** @brief AlgTool interface methods */
   static const InterfaceID& interfaceID();
-  
+
   /** @brief initialize method*/
   virtual StatusCode initialize() = 0;
   /** @brief execute on containers */
@@ -36,9 +36,7 @@ class IEMClusterTool : virtual public IAlgTool {
                                  const CaloDetDescrManager& cmgr,
                                  xAOD::ElectronContainer* electronContainer,
                                  xAOD::PhotonContainer* photonContainer) const = 0;
-  /** @brief finalize method*/
-  virtual StatusCode finalize() = 0;
-  
+
 };
 
 inline const InterfaceID& IEMClusterTool::interfaceID()
@@ -46,4 +44,4 @@ inline const InterfaceID& IEMClusterTool::interfaceID()
   return IID_IEMClusterTool;
 }
 
-#endif // EGAMMAINTERFACES_IEMCLUSTERTOOL_H 
+#endif // EGAMMAINTERFACES_IEMCLUSTERTOOL_H
diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMConversionBuilder.h b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMConversionBuilder.h
index 1c8929f7cb86a81196c9c3390893941397a21eaa..711fd5da1f16469a85941c67ccc9994950eb8387 100755
--- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMConversionBuilder.h
+++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IEMConversionBuilder.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -34,7 +34,7 @@ class IEMConversionBuilder : virtual public IAlgTool
 
   /** @brief Virtual destructor*/
   virtual ~IEMConversionBuilder() {};
-	
+
   /** @brief AlgTool interface methods */
   static const InterfaceID& interfaceID();
 
@@ -44,9 +44,7 @@ class IEMConversionBuilder : virtual public IAlgTool
   virtual StatusCode executeRec(const EventContext& ctx,egammaRec* egRec) const =  0;
   /** @brief execute method*/
   virtual StatusCode hltExecute(egammaRec* egRec, const xAOD::VertexContainer* conversions) const =0;
-  /** @brief finalize method*/
-  virtual StatusCode finalize() = 0;
-  
+
 };
 
 inline const InterfaceID& IEMConversionBuilder::interfaceID()
diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaSwTool.h b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaSwTool.h
index 675d0fb36af2ec3d324c28e406e7775d62b49917..c42ba6bf9ab86ffab1ce2afc3b177e1716569554 100755
--- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaSwTool.h
+++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaSwTool.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -18,35 +18,37 @@ CREATED : 01/09/2008
 MODIFIED : Bruno Lenzi (02/2014): xAOD migration
 */
 
-// INCLUDE HEADER FILES: 
+// INCLUDE HEADER FILES:
+#include "GaudiKernel/EventContext.h"
 #include "GaudiKernel/IAlgTool.h"
 #include "xAODCaloEvent/CaloClusterFwd.h"
 #include "xAODEgamma/EgammaEnums.h"
-#include "GaudiKernel/EventContext.h"
 
 static const InterfaceID IID_IegammaSwTool("IegammaSwTool", 1, 0);
 
 class IegammaSwTool : virtual public IAlgTool
 {
 
- public:
-
+public:
   /** @brief Virtual destructor*/
-  virtual ~IegammaSwTool() {};
-  
+  virtual ~IegammaSwTool(){};
+
   /** @brief AlgTool interface methods */
   static const InterfaceID& interfaceID();
 
   /** @brief initialize method*/
   virtual StatusCode initialize() = 0;
-  /** @brief finalize method*/
-  virtual StatusCode finalize() = 0;
   /** @brief execute method*/
-  virtual StatusCode execute(const EventContext& ctx, xAOD::CaloCluster* cluster) const = 0;
-  virtual StatusCode execute(const EventContext& ctx, xAOD::CaloCluster* cluster, xAOD::EgammaParameters::EgammaType egType , bool isBarrel) const  = 0;
+  virtual StatusCode execute(const EventContext& ctx,
+                             xAOD::CaloCluster* cluster) const = 0;
+  virtual StatusCode execute(const EventContext& ctx,
+                             xAOD::CaloCluster* cluster,
+                             xAOD::EgammaParameters::EgammaType egType,
+                             bool isBarrel) const = 0;
 };
 
-inline const InterfaceID& IegammaSwTool::interfaceID()
+inline const InterfaceID&
+IegammaSwTool::interfaceID()
 {
   return IID_IegammaSwTool;
 }
diff --git a/Reconstruction/egamma/egammaTools/python/EMPIDBuilderBase.py b/Reconstruction/egamma/egammaTools/python/EMPIDBuilderBase.py
index d5578eed80d1bb336ca6c6bcd7621bb7028b5536..dbcc3123d4df69e72f3148dcacd272abbe83f2e7 100755
--- a/Reconstruction/egamma/egammaTools/python/EMPIDBuilderBase.py
+++ b/Reconstruction/egamma/egammaTools/python/EMPIDBuilderBase.py
@@ -45,11 +45,6 @@ class EMPIDBuilderElectronBase (EMPIDBuilder):
             "TightLHSelector", LikeEnum.Tight)
         TightLHSelector.primaryVertexContainer = "PrimaryVertices"
 
-        # Multi Lepton
-        from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf \
-            import AsgElectronMultiLeptonSelector
-        MultiLeptonSelector = AsgElectronMultiLeptonSelector(
-            "MultiLeptonSelector")
 
         self.electronIsEMselectors = [
             LooseElectronSelector,
@@ -60,8 +55,6 @@ class EMPIDBuilderElectronBase (EMPIDBuilder):
         self.electronLHselectors = [
             LooseLHSelector, MediumLHSelector, TightLHSelector]
         self.electronLHselectorResultNames = ["LHLoose", "LHMedium", "LHTight"]
-        self.genericIsEMselectors = [MultiLeptonSelector]
-        self.genericIsEMselectorResultNames = ["MultiLepton"]
         self.LuminosityTool = None
 
 
diff --git a/Reconstruction/egamma/egammaTools/python/EMPIDBuilderConfig.py b/Reconstruction/egamma/egammaTools/python/EMPIDBuilderConfig.py
index a3b08875e879d2e39303e029418e6f3673e7747b..e69fddcf6ef0f73e98d99b2b15d87929b6f0c051 100755
--- a/Reconstruction/egamma/egammaTools/python/EMPIDBuilderConfig.py
+++ b/Reconstruction/egamma/egammaTools/python/EMPIDBuilderConfig.py
@@ -52,13 +52,6 @@ def EMPIDBuilderElectronCfg(flags, name='EMPIDBuilderElectron', **kwargs):
         acc.merge(MediumLHSelectorAcc)
         acc.merge(TightLHSelectorAcc)
 
-    # Multi Lepton
-    AsgElectronMultiLeptonSelector=CompFactory.AsgElectronMultiLeptonSelector
-    if "genericIsEMselectors" not in kwargs:
-        MultiLeptonSelector = AsgElectronMultiLeptonSelector("MultiLeptonSelector")
-        kwargs["genericIsEMselectors"] = [MultiLeptonSelector]
-        kwargs["genericIsEMselectorResultNames"] = ["MultiLepton"]
-
     tool = EMPIDBuilder(name, **kwargs)
 
     acc.setPrivateTools(tool)
diff --git a/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx b/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx
index c02121ec662422e944133eb2176c972e1ac621af..fcfc574ab50ec7c7eab23133d10fd2b2a003c414 100644
--- a/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx
+++ b/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx
@@ -3,132 +3,147 @@
 */
 
 #include "EMClusterTool.h"
+#include "CaloEvent/CaloClusterCellLink.h"
 #include "GaudiKernel/EventContext.h"
-#include "xAODEgamma/EgammaxAODHelpers.h"
+#include "StoreGate/StoreGateSvc.h"
 #include "xAODCaloEvent/CaloCluster.h"
 #include "xAODCaloEvent/CaloClusterAuxContainer.h"
-#include "StoreGate/StoreGateSvc.h"
-#include "CaloEvent/CaloClusterCellLink.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
 
 #include "xAODEgamma/ElectronContainer.h"
 #include "xAODEgamma/PhotonContainer.h"
 
 #include "CaloDetDescr/CaloDetDescrManager.h"
-#include "CaloUtils/CaloClusterStoreHelper.h"
 #include "CaloUtils/CaloCellDetPos.h"
+#include "CaloUtils/CaloClusterStoreHelper.h"
 #include "StoreGate/WriteHandle.h"
 
-
 // =============================================================
-EMClusterTool::EMClusterTool(const std::string& type, const std::string& name, const IInterface* parent) :
-  AthAlgTool(type, name, parent),
-  m_caloCellDetPos{},
-  m_doTopoSeededContainer(false)
+EMClusterTool::EMClusterTool(const std::string& type,
+                             const std::string& name,
+                             const IInterface* parent)
+  : AthAlgTool(type, name, parent)
+  , m_caloCellDetPos{}
+  , m_doTopoSeededContainer(false)
 {
   declareInterface<IEMClusterTool>(this);
-  
 }
 
-EMClusterTool::~EMClusterTool() {  }
-
-// const InterfaceID& ClusterTool::interfaceID() {
-//   return IID_IClusterTool;
-// }
-
-// =============================================================
-StatusCode EMClusterTool::initialize() {
+StatusCode
+EMClusterTool::initialize()
+{
 
   ATH_MSG_DEBUG("Initializing " << name() << "...");
 
   ATH_CHECK(m_outputClusterContainerKey.initialize());
-  m_outputClusterContainerCellLinkKey = m_outputClusterContainerKey.key() + "_links";
+
+  m_outputClusterContainerCellLinkKey =
+    m_outputClusterContainerKey.key() + "_links";
   ATH_CHECK(m_outputClusterContainerCellLinkKey.initialize());
 
-  m_doTopoSeededContainer = (m_outputTopoSeededClusterContainerKey.key() != m_outputClusterContainerKey.key() && !m_doSuperClusters);
-  ATH_CHECK(m_outputTopoSeededClusterContainerKey.initialize(m_doTopoSeededContainer));
-  m_outputTopoSeededClusterContainerCellLinkKey = m_outputTopoSeededClusterContainerKey.key() + "_links";
-  ATH_CHECK(m_outputTopoSeededClusterContainerCellLinkKey.initialize(m_doTopoSeededContainer));
+  m_doTopoSeededContainer = (m_outputTopoSeededClusterContainerKey.key() !=
+                               m_outputClusterContainerKey.key() &&
+                             !m_doSuperClusters);
+  ATH_CHECK(
+    m_outputTopoSeededClusterContainerKey.initialize(m_doTopoSeededContainer));
+  m_outputTopoSeededClusterContainerCellLinkKey =
+    m_outputTopoSeededClusterContainerKey.key() + "_links";
+
+  ATH_CHECK(m_outputTopoSeededClusterContainerCellLinkKey.initialize(
+    m_doTopoSeededContainer));
 
   // Get the cluster correction tool
-  if(m_clusterCorrectionTool.retrieve().isFailure()) {
+  if (m_clusterCorrectionTool.retrieve().isFailure()) {
     ATH_MSG_ERROR("Failed to retrieve " << m_clusterCorrectionTool);
     return StatusCode::SUCCESS;
-  } 
-  
-    ATH_MSG_DEBUG("Retrieved tool " << m_clusterCorrectionTool);   
-  
+  }
 
+  ATH_MSG_DEBUG("Retrieved tool " << m_clusterCorrectionTool);
 
   // Get the cluster correction tool
-  if(m_MVACalibSvc.retrieve().isFailure()) {
+  if (m_MVACalibSvc.retrieve().isFailure()) {
     ATH_MSG_ERROR("Failed to retrieve " << m_MVACalibSvc);
     return StatusCode::SUCCESS;
-  } 
-  
-    ATH_MSG_DEBUG("Retrieved tool " << m_MVACalibSvc);   
-  
+  }
 
-  ATH_MSG_DEBUG("Initialization successful");
+  ATH_MSG_DEBUG("Retrieved tool " << m_MVACalibSvc);
 
-  return StatusCode::SUCCESS;
-}
+  ATH_MSG_DEBUG("Initialization successful");
 
-// =========================================================================
-StatusCode EMClusterTool::finalize() {
   return StatusCode::SUCCESS;
 }
 
-// =========================================================================
-StatusCode EMClusterTool::contExecute(const EventContext& ctx,
-                                      const CaloDetDescrManager& mgr,
-                                      xAOD::ElectronContainer *electronContainer, 
-                                      xAOD::PhotonContainer *photonContainer) const
+StatusCode
+EMClusterTool::contExecute(const EventContext& ctx,
+                           const CaloDetDescrManager& mgr,
+                           xAOD::ElectronContainer* electronContainer,
+                           xAOD::PhotonContainer* photonContainer) const
 {
+
   // Create output cluster container and register in StoreGate
-  SG::WriteHandle<xAOD::CaloClusterContainer> outputClusterContainer(m_outputClusterContainerKey, ctx);
-  ATH_CHECK(outputClusterContainer.record(std::make_unique<xAOD::CaloClusterContainer>(),
-					  std::make_unique<xAOD::CaloClusterAuxContainer>()));
-  SG::WriteHandle<CaloClusterCellLinkContainer> outputClusterContainerCellLink(m_outputClusterContainerCellLinkKey, ctx);
-  ATH_CHECK(outputClusterContainerCellLink.record(std::make_unique<CaloClusterCellLinkContainer>()));
-
-  // Create output cluster container for topo-seeded clusters and register in StoreGate
-  // Only if they differ from the main output cluster container
-  // and if we do not do supercluster
+  SG::WriteHandle<xAOD::CaloClusterContainer> outputClusterContainer(
+    m_outputClusterContainerKey, ctx);
+
+  ATH_CHECK(outputClusterContainer.record(
+    std::make_unique<xAOD::CaloClusterContainer>(),
+    std::make_unique<xAOD::CaloClusterAuxContainer>()));
+
+  SG::WriteHandle<CaloClusterCellLinkContainer> outputClusterContainerCellLink(
+    m_outputClusterContainerCellLinkKey, ctx);
+
+  ATH_CHECK(outputClusterContainerCellLink.record(
+    std::make_unique<CaloClusterCellLinkContainer>()));
+
+  // Create output cluster container for topo-seeded clusters and register in
+  // StoreGate Only if they differ from the main output cluster container and if
+  // we do not do supercluster
   SG::WriteHandle<xAOD::CaloClusterContainer> outputTopoSeededClusterContainer;
-  SG::WriteHandle<CaloClusterCellLinkContainer> outputTopoSeededClusterContainerCellLink;
+  SG::WriteHandle<CaloClusterCellLinkContainer>
+    outputTopoSeededClusterContainerCellLink;
+
   if (m_doTopoSeededContainer) {
-    outputTopoSeededClusterContainer = SG::WriteHandle<xAOD::CaloClusterContainer>(m_outputTopoSeededClusterContainerKey, ctx);
-    ATH_CHECK(outputTopoSeededClusterContainer.record(std::make_unique<xAOD::CaloClusterContainer>(),
-						      std::make_unique<xAOD::CaloClusterAuxContainer>()));
-    outputTopoSeededClusterContainerCellLink = SG::WriteHandle<CaloClusterCellLinkContainer>(m_outputTopoSeededClusterContainerCellLinkKey, ctx);
-    ATH_CHECK(outputTopoSeededClusterContainerCellLink.record(std::make_unique<CaloClusterCellLinkContainer>()));
+    outputTopoSeededClusterContainer =
+      SG::WriteHandle<xAOD::CaloClusterContainer>(
+        m_outputTopoSeededClusterContainerKey, ctx);
+
+    ATH_CHECK(outputTopoSeededClusterContainer.record(
+      std::make_unique<xAOD::CaloClusterContainer>(),
+      std::make_unique<xAOD::CaloClusterAuxContainer>()));
+
+    outputTopoSeededClusterContainerCellLink =
+      SG::WriteHandle<CaloClusterCellLinkContainer>(
+        m_outputTopoSeededClusterContainerCellLinkKey, ctx);
+
+    ATH_CHECK(outputTopoSeededClusterContainerCellLink.record(
+      std::make_unique<CaloClusterCellLinkContainer>()));
   }
-  
+
   // Loop over electrons and create new clusters
   xAOD::EgammaParameters::EgammaType egType = xAOD::EgammaParameters::electron;
-  if(electronContainer){
-    for (auto electron : *electronContainer){
-      setNewCluster(ctx,mgr, electron, outputClusterContainer.ptr(), egType);
+  if (electronContainer) {
+    for (auto electron : *electronContainer) {
+      setNewCluster(ctx, mgr, electron, outputClusterContainer.ptr(), egType);
     }
   }
-  if(photonContainer){
+
+  if (photonContainer) {
     // Loop over photons and create new clusters
-    for (auto photon : *photonContainer){
-      egType = (xAOD::EgammaHelpers::isConvertedPhoton(photon) ? 
-                xAOD::EgammaParameters::convertedPhoton :
-                xAOD::EgammaParameters::unconvertedPhoton);
-    
-      if (!m_doTopoSeededContainer || !photon->author(xAOD::EgammaParameters::AuthorCaloTopo35) ){
-        setNewCluster(ctx, mgr,photon, outputClusterContainer.ptr(), egType);
-      }
-      else{
-        setNewCluster(ctx, mgr,photon, outputTopoSeededClusterContainer.ptr(), egType);
+    for (auto photon : *photonContainer) {
+      egType = (xAOD::EgammaHelpers::isConvertedPhoton(photon)
+                  ? xAOD::EgammaParameters::convertedPhoton
+                  : xAOD::EgammaParameters::unconvertedPhoton);
+
+      if (!m_doTopoSeededContainer ||
+          !photon->author(xAOD::EgammaParameters::AuthorCaloTopo35)) {
+        setNewCluster(ctx, mgr, photon, outputClusterContainer.ptr(), egType);
+      } else {
+        setNewCluster(
+          ctx, mgr, photon, outputTopoSeededClusterContainer.ptr(), egType);
       }
     }
   }
-  // Now finalize the cluster: based on code in CaloClusterStoreHelper::finalizeClusters
-  // Note: I don't specifically set the IProxyDict, since I also don't set it when I create
-  //    data handles, either. 
+  // Now finalize the cluster: based on code in
+  // CaloClusterStoreHelper::finalizeClusters
   auto sg = outputClusterContainer.storeHandle().get();
   for (xAOD::CaloCluster* cl : *outputClusterContainer) {
     cl->setLink(outputClusterContainerCellLink.ptr(), sg);
@@ -151,34 +166,35 @@ EMClusterTool::setNewCluster(const EventContext& ctx,
                              xAOD::CaloClusterContainer* outputClusterContainer,
                              xAOD::EgammaParameters::EgammaType egType) const
 {
-  if (!eg) {return;}
+  if (!eg) {
+    return;
+  }
 
-  if (!eg->caloCluster()){
+  if (!eg->caloCluster()) {
     ATH_MSG_DEBUG("egamma object does not have a cluster associated");
     return;
   }
   typedef ElementLink<xAOD::CaloClusterContainer> ClusterLink_t;
   xAOD::CaloCluster* cluster = nullptr;
 
-  //Special Case for topo seeded photons. 
+  // Special Case for topo seeded photons.
   if (eg->author(xAOD::EgammaParameters::AuthorCaloTopo35)) {
     cluster = new xAOD::CaloCluster(*(eg->caloCluster()));
-    fillPositionsInCalo(cluster,mgr);
+    fillPositionsInCalo(cluster, mgr);
   } // Doing superClusters
-  else if ( m_doSuperClusters){
-    //copy over for super clusters 
-    cluster = makeNewSuperCluster(*(eg->caloCluster()),eg);
-  }
-  else {
-    cluster = makeNewCluster(ctx,*(eg->caloCluster()), mgr, eg, egType);
+  else if (m_doSuperClusters) {
+    // copy over for super clusters
+    cluster = makeNewSuperCluster(*(eg->caloCluster()), eg);
+  } else {
+    cluster = makeNewCluster(ctx, *(eg->caloCluster()), mgr, eg, egType);
   }
+
   outputClusterContainer->push_back(cluster);
 
   // Set the link to the new cluster
   ClusterLink_t clusterLink(cluster, *outputClusterContainer);
-  const std::vector<ClusterLink_t> clusterLinks{clusterLink};
-  eg->setCaloClusterLinks( clusterLinks );
-  
+  const std::vector<ClusterLink_t> clusterLinks{ clusterLink };
+  eg->setCaloClusterLinks(clusterLinks);
 }
 
 xAOD::CaloCluster*
@@ -188,108 +204,122 @@ EMClusterTool::makeNewCluster(const EventContext& ctx,
                               xAOD::Egamma* eg,
                               xAOD::EgammaParameters::EgammaType egType) const
 {
-  //
   // Create new cluster based on an existing one
   // const CaloCluster* cluster : input cluster
-  //
+
   // protection against cluster not in barrel nor endcap
-  if (!cluster.inBarrel() && !cluster.inEndcap() ){
+  if (!cluster.inBarrel() && !cluster.inEndcap()) {
     ATH_MSG_ERROR("Cluster neither in barrel nor in endcap, Skipping cluster");
     return nullptr;
   }
-  
-  if ((int) egType < 0 || egType >= xAOD::EgammaParameters::NumberOfEgammaTypes){
+
+  if (static_cast<int>(egType) < 0 ||
+      egType >= xAOD::EgammaParameters::NumberOfEgammaTypes) {
     ATH_MSG_WARNING("Invalid egamma type");
     return nullptr;
   }
 
-  bool isBarrel = xAOD::EgammaHelpers::isBarrel(&cluster);  
-  xAOD::CaloCluster::ClusterSize cluSize=xAOD::CaloCluster:: CSize_Unknown;
-  if (egType == xAOD::EgammaParameters::electron){
-    cluSize= (isBarrel ? xAOD::CaloCluster::SW_37ele : xAOD::CaloCluster::SW_55ele);
-  }
-  else if (egType == xAOD::EgammaParameters::convertedPhoton){
-    cluSize= (isBarrel ? xAOD::CaloCluster::SW_37Econv : xAOD::CaloCluster::SW_55Econv);
-  }
-  else  {//(egType == xAOD::EgammaParameters::unconvertedPhoton)
-    cluSize = (isBarrel ? xAOD::CaloCluster::SW_37gam : xAOD::CaloCluster::SW_55gam);
+  bool isBarrel = xAOD::EgammaHelpers::isBarrel(&cluster);
+  xAOD::CaloCluster::ClusterSize cluSize = xAOD::CaloCluster::CSize_Unknown;
+  switch (egType) {
+    case xAOD::EgammaParameters::electron: {
+      cluSize =
+        isBarrel ? xAOD::CaloCluster::SW_37ele : xAOD::CaloCluster::SW_55ele;
+      break;
+    }
+    case xAOD::EgammaParameters::convertedPhoton: {
+      cluSize = isBarrel ? xAOD::CaloCluster::SW_37Econv
+                         : xAOD::CaloCluster::SW_55Econv;
+      break;
+    }
+    default: {
+      cluSize =
+        (isBarrel ? xAOD::CaloCluster::SW_37gam : xAOD::CaloCluster::SW_55gam);
+    }
   }
-  xAOD::CaloCluster *newCluster = makeNewCluster(ctx,cluster, mgr,cluSize);
- 
-  if (newCluster && m_MVACalibSvc->execute(*newCluster,*eg).isFailure()){
+  xAOD::CaloCluster* newCluster = makeNewCluster(ctx, cluster, mgr, cluSize);
+
+  if (newCluster && m_MVACalibSvc->execute(*newCluster, *eg).isFailure()) {
     ATH_MSG_ERROR("Problem executing MVA cluster tool");
   }
   return newCluster;
 }
 
-// ==========================================================================
 xAOD::CaloCluster*
-EMClusterTool::makeNewCluster(const EventContext& ctx,
-                              const xAOD::CaloCluster& cluster,
-                              const CaloDetDescrManager& mgr,
-                              const xAOD::CaloCluster::ClusterSize& cluSize) const
+EMClusterTool::makeNewCluster(
+  const EventContext& ctx,
+  const xAOD::CaloCluster& cluster,
+  const CaloDetDescrManager& mgr,
+  const xAOD::CaloCluster::ClusterSize& cluSize) const
 {
 
-  xAOD::CaloCluster* newClus = CaloClusterStoreHelper::makeCluster(cluster.getCellLinks()->getCellContainer(),
-								   cluster.eta0(),cluster.phi0(),
-								   cluSize);
-  if(newClus){  
-    if (m_clusterCorrectionTool->execute(ctx,newClus).isFailure()){
+  xAOD::CaloCluster* newClus = CaloClusterStoreHelper::makeCluster(
+    cluster.getCellLinks()->getCellContainer(),
+    cluster.eta0(),
+    cluster.phi0(),
+    cluSize);
+  if (newClus) {
+    if (m_clusterCorrectionTool->execute(ctx, newClus).isFailure()) {
       ATH_MSG_ERROR("Problem executing cluster correction tool");
     }
-    fillPositionsInCalo(newClus,mgr);
-    //Fill the raw state using the cluster with correct size  but not MVA
+    fillPositionsInCalo(newClus, mgr);
+    // Fill the raw state using the cluster with correct size  but not MVA
     newClus->setRawE(newClus->calE());
     newClus->setRawEta(newClus->calEta());
     newClus->setRawPhi(newClus->calPhi());
-    //Fill the Alt state using the 3x5 cluster
+    // Fill the Alt state using the 3x5 cluster
     newClus->setAltE(cluster.calE());
     newClus->setAltEta(cluster.calEta());
     newClus->setAltPhi(cluster.calPhi());
-  }
-  else {
+  } else {
     ATH_MSG_ERROR("Null newClus");
   }
 
   return newClus;
 }
+
 xAOD::CaloCluster*
 EMClusterTool::makeNewSuperCluster(const xAOD::CaloCluster& cluster,
                                    xAOD::Egamma* eg) const
 {
   //
   xAOD::CaloCluster* newClus = new xAOD::CaloCluster(cluster);
-  if(m_applySuperClusters){ 
-    if (newClus && m_MVACalibSvc->execute(*newClus,*eg).isFailure()){
+  if (m_applySuperClusters) {
+    if (newClus && m_MVACalibSvc->execute(*newClus, *eg).isFailure()) {
       ATH_MSG_ERROR("Problem executing MVA cluster tool");
     }
   }
- 
-  ATH_MSG_DEBUG("Cluster Energy after final calibration: "<<newClus->e());
 
   return newClus;
 }
 void
-EMClusterTool::fillPositionsInCalo(xAOD::CaloCluster* cluster, const CaloDetDescrManager& mgr) const
+EMClusterTool::fillPositionsInCalo(xAOD::CaloCluster* cluster,
+                                   const CaloDetDescrManager& mgr) const
 {
 
   bool isBarrel = xAOD::EgammaHelpers::isBarrel(cluster);
-  CaloCell_ID::CaloSample sample = isBarrel ? CaloCell_ID::EMB2 : CaloCell_ID::EME2;
+  CaloCell_ID::CaloSample sample =
+    isBarrel ? CaloCell_ID::EMB2 : CaloCell_ID::EME2;
+
   // eta and phi of the cluster in the calorimeter frame
   double eta;
   double phi;
-  m_caloCellDetPos.getDetPosition(mgr,sample,cluster->eta(), cluster->phi(), eta, phi); 
+  m_caloCellDetPos.getDetPosition(
+    mgr, sample, cluster->eta(), cluster->phi(), eta, phi);
 
-  cluster->insertMoment(xAOD::CaloCluster::ETACALOFRAME,eta);
-  cluster->insertMoment(xAOD::CaloCluster::PHICALOFRAME,phi);
+  cluster->insertMoment(xAOD::CaloCluster::ETACALOFRAME, eta);
+  cluster->insertMoment(xAOD::CaloCluster::PHICALOFRAME, phi);
 
   //  eta in the second sampling
-  m_caloCellDetPos.getDetPosition(mgr,sample, cluster->etaBE(2), cluster->phiBE(2), eta, phi);
-  cluster->insertMoment(xAOD::CaloCluster::ETA2CALOFRAME,eta);
-  cluster->insertMoment(xAOD::CaloCluster::PHI2CALOFRAME,phi);
-  //  eta in the first sampling 
+  m_caloCellDetPos.getDetPosition(
+    mgr, sample, cluster->etaBE(2), cluster->phiBE(2), eta, phi);
+  cluster->insertMoment(xAOD::CaloCluster::ETA2CALOFRAME, eta);
+  cluster->insertMoment(xAOD::CaloCluster::PHI2CALOFRAME, phi);
+
+  //  eta in the first sampling
   sample = isBarrel ? CaloCell_ID::EMB1 : CaloCell_ID::EME1;
-  m_caloCellDetPos.getDetPosition(mgr,sample, cluster->etaBE(1), cluster->phiBE(1),eta, phi);
-  cluster->insertMoment(xAOD::CaloCluster::ETA1CALOFRAME,eta);
-  cluster->insertMoment(xAOD::CaloCluster::PHI1CALOFRAME,phi);
+  m_caloCellDetPos.getDetPosition(
+    mgr, sample, cluster->etaBE(1), cluster->phiBE(1), eta, phi);
+  cluster->insertMoment(xAOD::CaloCluster::ETA1CALOFRAME, eta);
+  cluster->insertMoment(xAOD::CaloCluster::PHI1CALOFRAME, phi);
 }
diff --git a/Reconstruction/egamma/egammaTools/src/EMClusterTool.h b/Reconstruction/egamma/egammaTools/src/EMClusterTool.h
index a729802a76a9002f952562eed52bcffd243dbadb..0e67e6dc1941c4ac42fc81946372bc86b7d95d1b 100644
--- a/Reconstruction/egamma/egammaTools/src/EMClusterTool.h
+++ b/Reconstruction/egamma/egammaTools/src/EMClusterTool.h
@@ -6,19 +6,19 @@
 #define EGAMMATOOLS_EMCLUSTERTOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
-#include "egammaInterfaces/IEMClusterTool.h"
+#include "GaudiKernel/ToolHandle.h"
 #include "egammaBaseTool.h"
+#include "egammaInterfaces/IEMClusterTool.h"
 
-#include "egammaInterfaces/IegammaSwTool.h"
 #include "egammaInterfaces/IegammaMVASvc.h"
+#include "egammaInterfaces/IegammaSwTool.h"
 
+#include "StoreGate/WriteHandleKey.h"
 #include "xAODCaloEvent/CaloCluster.h" // cannot use CaloClusterFwd b/c of ClusterSize
 #include "xAODCaloEvent/CaloClusterContainer.h"
-#include "xAODEgamma/EgammaFwd.h"
 #include "xAODEgamma/EgammaEnums.h"
-#include "StoreGate/WriteHandleKey.h"
+#include "xAODEgamma/EgammaFwd.h"
 
 #include "CaloUtils/CaloCellDetPos.h"
 class CaloClusterCellLink;
@@ -26,133 +26,162 @@ class CaloClusterCellLink;
 /**
    @class EMClusterTool
    This tool makes the EM CaloCluster used by egamma objects.
-   It also defines the cluster size 
+   It also defines the cluster size
        - in barrel
          3*7 for electrons
          3*7 for converted photons with Rconv<800mm
          3*5 for converted photons with Rconv>800mm
-         3*5 for unconverted photons 
+         3*5 for unconverted photons
        - in end-caps
          5*5 for electrons
          5*5 for converted photons with Rconv<800mm
          5*5 for converted photons with Rconv>800mm
-         5*5 for unconverted photons 
-    and applies the right cluster corrections depending on classification as electron, unconverted photon or converted photon
-    
+         5*5 for unconverted photons
+    and applies the right cluster corrections depending on classification as
+   electron, unconverted photon or converted photon
+
    @author Thomas Koffas
    @author F. Derue
    @author B. Lenzi
    @author C. Anastopoulos
 */
 
-class EMClusterTool : public AthAlgTool, virtual public IEMClusterTool {
-
- public:
+class EMClusterTool
+  : public AthAlgTool
+  , virtual public IEMClusterTool
+{
 
+public:
   /** @brief constructor */
-  EMClusterTool (const std::string& type,const std::string& name, const IInterface* parent);
+  EMClusterTool(const std::string& type,
+                const std::string& name,
+                const IInterface* parent);
 
   /** @brief destructor */
-  virtual ~EMClusterTool();
+  virtual ~EMClusterTool() = default;
 
   /** @brief initialize method */
-  virtual StatusCode initialize() override;
+  virtual StatusCode initialize() override final;
   /** @brief execute on container */
-  virtual StatusCode contExecute(const EventContext& ctx,
-                                 const CaloDetDescrManager& mgr,
-                                 xAOD::ElectronContainer* electronContainer,
-                                 xAOD::PhotonContainer* photonContainer) const override final;
-  /** @brief finalize method */
-  virtual StatusCode finalize() override;
-
+  virtual StatusCode contExecute(
+    const EventContext& ctx,
+    const CaloDetDescrManager& mgr,
+    xAOD::ElectronContainer* electronContainer,
+    xAOD::PhotonContainer* photonContainer) const override final;
 
 private:
-
   /** @brief Set new cluster to the egamma object, decorate the new cluster
-    * with a link to the old one **/
+   * with a link to the old one **/
   void setNewCluster(const EventContext& ctx,
                      const CaloDetDescrManager& mgr,
-                     xAOD::Egamma *eg,
-                     xAOD::CaloClusterContainer *outputClusterContainer,
+                     xAOD::Egamma* eg,
+                     xAOD::CaloClusterContainer* outputClusterContainer,
                      xAOD::EgammaParameters::EgammaType egType) const;
-  
-  /** @brief creation of new cluster based on existing one 
-    * Return a new cluster using the seed eta0, phi0 from the existing one, 
-    * applying cluster corrections and MVA calibration (requires the egamma object).
-    * The cluster size depends on the given EgammaType
-    */
+
+  /** @brief creation of new cluster based on existing one
+   * Return a new cluster using the seed eta0, phi0 from the existing one,
+   * applying cluster corrections and MVA calibration (requires the egamma
+   * object). The cluster size depends on the given EgammaType
+   */
   xAOD::CaloCluster* makeNewCluster(const EventContext&,
                                     const xAOD::CaloCluster&,
                                     const CaloDetDescrManager& mgr,
                                     xAOD::Egamma* eg,
                                     xAOD::EgammaParameters::EgammaType) const;
 
-  /** @brief creation of new cluster based on existing one 
-    * Return a new cluster with the given size using the seed eta0, phi0 from the
-    * existing cluster and applying cluster corrections. 
-    * If doDecorate is true, copy the cal to the raw signal state
-    * and set the raw one to the cal e,eta,phi from the existing cluster
-    */
-  xAOD::CaloCluster* makeNewCluster(const EventContext& ctx,
-                                    const xAOD::CaloCluster&,
-                                    const CaloDetDescrManager& mgr,
-                                    const xAOD::CaloCluster::ClusterSize&) const;
+  /** @brief creation of new cluster based on existing one
+   * Return a new cluster with the given size using the seed eta0, phi0 from the
+   * existing cluster and applying cluster corrections.
+   * If doDecorate is true, copy the cal to the raw signal state
+   * and set the raw one to the cal e,eta,phi from the existing cluster
+   */
+  xAOD::CaloCluster* makeNewCluster(
+    const EventContext& ctx,
+    const xAOD::CaloCluster&,
+    const CaloDetDescrManager& mgr,
+    const xAOD::CaloCluster::ClusterSize&) const;
 
   /** @brief creation of new super cluster based on existing one */
   xAOD::CaloCluster* makeNewSuperCluster(const xAOD::CaloCluster& cluster,
                                          xAOD::Egamma* eg) const;
 
   /** @brief build extra positions in calo frame*/
-  void fillPositionsInCalo(xAOD::CaloCluster* cluster, const CaloDetDescrManager& mgr) const;
+  void fillPositionsInCalo(xAOD::CaloCluster* cluster,
+                           const CaloDetDescrManager& mgr) const;
 
   /** @brief Key of the output cluster container **/
-  SG::WriteHandleKey<xAOD::CaloClusterContainer> m_outputClusterContainerKey {this,
-      "OutputClusterContainerName", "", 
-      "Name of the output cluster container"};
-
-  /** @brief Key of the output cluster container cell links: 
+  SG::WriteHandleKey<xAOD::CaloClusterContainer> m_outputClusterContainerKey{
+    this,
+    "OutputClusterContainerName",
+    "",
+    "Name of the output cluster container"
+  };
+
+  /** @brief Key of the output cluster container cell links:
       name taken from containter name; only dummy configurable **/
-  SG::WriteHandleKey<CaloClusterCellLinkContainer> m_outputClusterContainerCellLinkKey {this,
-      "DoNotSet_OutputClusterContainerLinks", "",
-      "Key of the output cluster container cell links; Do not set! Name taken from associated container"};      
+  SG::WriteHandleKey<CaloClusterCellLinkContainer>
+    m_outputClusterContainerCellLinkKey{
+      this,
+      "DoNotSet_OutputClusterContainerLinks",
+      "",
+      "Key of the output cluster container cell links; Do not set! Name taken "
+      "from associated container"
+    };
 
   /** @brief Key of the output cluster container for topo-seeded clusters **/
-  SG::WriteHandleKey<xAOD::CaloClusterContainer> m_outputTopoSeededClusterContainerKey {this,
-      "OutputTopoSeededClusterContainerName", ""
-      "Name of the output cluster container for topo-seeded clusters (can be the same as the other clusters)"};
-
-  /** @brief Key of the output cluster container cell links for topo-seeded clusters: 
-    * name taken from containter name; only dummy configurable */
-  SG::WriteHandleKey<CaloClusterCellLinkContainer> m_outputTopoSeededClusterContainerCellLinkKey {this,
-      "DoNotSet_OutputTopoSeededClusterContainerLinks", "",
-      "Key of the output cluster container cell links for topo-seeded clusters; Do not set! Name taken from associated container"};
+  SG::WriteHandleKey<xAOD::CaloClusterContainer>
+    m_outputTopoSeededClusterContainerKey{
+      this,
+      "OutputTopoSeededClusterContainerName",
+      ""
+      "Name of the output cluster container for topo-seeded clusters (can be "
+      "the same as the other clusters)"
+    };
+
+  /** @brief Key of the output cluster container cell links for topo-seeded
+   * clusters: name taken from containter name; only dummy configurable */
+  SG::WriteHandleKey<CaloClusterCellLinkContainer>
+    m_outputTopoSeededClusterContainerCellLinkKey{
+      this,
+      "DoNotSet_OutputTopoSeededClusterContainerLinks",
+      "",
+      "Key of the output cluster container cell links for topo-seeded "
+      "clusters; Do not set! Name taken from associated container"
+    };
 
   /** Handle to the MVA calibration service **/
-  ServiceHandle<IegammaMVASvc> m_MVACalibSvc {this,
-      "MVACalibSvc", "egammaMVASvc", "calibration service"};
+  ServiceHandle<IegammaMVASvc> m_MVACalibSvc{ this,
+                                              "MVACalibSvc",
+                                              "egammaMVASvc",
+                                              "calibration service" };
 
- 
   /** @brief Tool to handle cluster corrections */
-  ToolHandle<IegammaSwTool> m_clusterCorrectionTool{ this,
-                                                     "ClusterCorrectionTool",
-                                                     "egammaSwTool/egammaswtool",
-                                                     "tool that applies cluster corrections" };
+  ToolHandle<IegammaSwTool> m_clusterCorrectionTool{
+    this,
+    "ClusterCorrectionTool",
+    "egammaSwTool/egammaswtool",
+    "tool that applies cluster corrections"
+  };
 
   /** @brief do super clusters **/
-  Gaudi::Property<bool> m_doSuperClusters{ this, "doSuperCluster", true, "Do Super Cluster Reco" };
+  Gaudi::Property<bool> m_doSuperClusters{ this,
+                                           "doSuperCluster",
+                                           true,
+                                           "Do Super Cluster Reco" };
 
   /** @brief flag to protect against applying the MVA to super Clusters **/
-  Gaudi::Property<bool> m_applySuperClusters{ this,
-                                              "applyMVAToSuperCluster",
-                                              true,
-                                              "Protection to not do anything for superClusters" };
-
-  /** @brief Position in Calo frame**/  
+  Gaudi::Property<bool> m_applySuperClusters{
+    this,
+    "applyMVAToSuperCluster",
+    true,
+    "Protection to not do anything for superClusters"
+  };
+
+  /** @brief Position in Calo frame**/
   const CaloCellDetPos m_caloCellDetPos;
 
   // derived variable (not set by JOs)
   bool m_doTopoSeededContainer;
-
 };
 
 #endif // EGAMMATOOLS_EMCLUSTERTOOL_H
diff --git a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx
index 9c62c73bd4bbe81c125f67bbf5000105ee32b860..969e6a2f249e3ac7a3b81b6910715cb973698cb5 100644
--- a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx
@@ -11,63 +11,65 @@ CREATED:  Jul, 2005
 CHANGES:  Mar, 2014 (BL) xAOD migration
 CHANGES:  2020 (CA) Athena MT migration
 
-PURPOSE:  subAlgorithm which creates an EMConversion object. 
+PURPOSE:  subAlgorithm which creates an EMConversion object.
 
 ********************************************************************/
 
 // INCLUDE HEADER FILES:
 
 #include "EMConversionBuilder.h"
-#include "xAODTracking/VertexContainer.h"
-#include "egammaRecEvent/egammaRecContainer.h"
-#include "egammaRecEvent/egammaRec.h"
 #include "FourMomUtils/P4Helpers.h"
-#include "StoreGate/ReadHandle.h"
 #include "GaudiKernel/EventContext.h"
-#include "xAODTracking/Vertex.h"
+#include "StoreGate/ReadHandle.h"
+#include "egammaRecEvent/egammaRec.h"
+#include "egammaRecEvent/egammaRecContainer.h"
 #include "xAODEgamma/EgammaxAODHelpers.h"
+#include "xAODTracking/Vertex.h"
+#include "xAODTracking/VertexContainer.h"
 
 //  END OF HEADER FILES INCLUDE
 
 /////////////////////////////////////////////////////////////////
 
 namespace {
- /** Sort conversion vertices according to the following criteria:
-  - Vertices with more Si tracks have priority
-  - Vertices with more tracks have priority
-  - Vertices with smaller radii have priority
-
-  OLD SCHEME:
-  - Vertices with 2 tracks have priority over the ones with 1 track
-  - Vertices with Si + Si tracks have priority (if m_preferSi > 0)
-  - Vertices with Si + TRT or TRT + TRT depending on m_preferSi
-  - Vertices with smaller radii have priority
-  **/
-  bool ConvVxSorter (const xAOD::Vertex& vx1, const xAOD::Vertex& vx2)
-  {
-    xAOD::EgammaParameters::ConversionType convType1;
-    xAOD::EgammaParameters::ConversionType convType2;
-    convType1 = xAOD::EgammaHelpers::conversionType(&vx1);
-    convType2 = xAOD::EgammaHelpers::conversionType(&vx2);
-
-    if (convType1 != convType2)
-      {
-	// Different conversion type, preference to vertices with Si tracks
-	int nSi1 = xAOD::EgammaHelpers::numberOfSiTracks(convType1);
-	int nSi2 = xAOD::EgammaHelpers::numberOfSiTracks(convType2);
-	if (nSi1 != nSi2) return nSi1 > nSi2;
-
-	// Same number of Si tracks: either 0 or 1 (Si+TRT vs. Si single)
-	// For 1 Si track, preference to Si+TRT
-	if (nSi1 != 0) return convType1 == xAOD::EgammaParameters::doubleSiTRT;
-
-	// No Si track, preference to doubleTRT over single TRT
-	return convType1 == xAOD::EgammaParameters::doubleTRT;
-      }
-
-    // Same conversion type, preference to lower radius
-    return (vx1.position().perp() < vx2.position().perp());
+/** Sort conversion vertices according to the following criteria:
+ - Vertices with more Si tracks have priority
+ - Vertices with more tracks have priority
+ - Vertices with smaller radii have priority
+
+ OLD SCHEME:
+ - Vertices with 2 tracks have priority over the ones with 1 track
+ - Vertices with Si + Si tracks have priority (if m_preferSi > 0)
+ - Vertices with Si + TRT or TRT + TRT depending on m_preferSi
+ - Vertices with smaller radii have priority
+ **/
+bool
+ConvVxSorter(const xAOD::Vertex& vx1, const xAOD::Vertex& vx2)
+{
+  xAOD::EgammaParameters::ConversionType convType1;
+  xAOD::EgammaParameters::ConversionType convType2;
+  convType1 = xAOD::EgammaHelpers::conversionType(&vx1);
+  convType2 = xAOD::EgammaHelpers::conversionType(&vx2);
+
+  if (convType1 != convType2) {
+    // Different conversion type, preference to vertices with Si tracks
+    int nSi1 = xAOD::EgammaHelpers::numberOfSiTracks(convType1);
+    int nSi2 = xAOD::EgammaHelpers::numberOfSiTracks(convType2);
+    if (nSi1 != nSi2)
+      return nSi1 > nSi2;
+
+    // Same number of Si tracks: either 0 or 1 (Si+TRT vs. Si single)
+    // For 1 Si track, preference to Si+TRT
+    if (nSi1 != 0)
+      return convType1 == xAOD::EgammaParameters::doubleSiTRT;
+
+    // No Si track, preference to doubleTRT over single TRT
+    return convType1 == xAOD::EgammaParameters::doubleTRT;
   }
+
+  // Same conversion type, preference to lower radius
+  return (vx1.position().perp() < vx2.position().perp());
+}
 } // end of namespace
 
 using namespace xAOD::EgammaParameters;
@@ -77,16 +79,11 @@ EMConversionBuilder::EMConversionBuilder(const std::string& type,
                                          const IInterface* parent)
   : AthAlgTool(type, name, parent)
 {
-  
+
   // declare interface
   declareInterface<IEMConversionBuilder>(this);
-
 }
 
-// =================================================================
-// DESTRUCTOR:
-EMConversionBuilder::~EMConversionBuilder() {}
-
 StatusCode
 EMConversionBuilder::initialize()
 {
@@ -96,12 +93,11 @@ EMConversionBuilder::initialize()
   ATH_CHECK(m_conversionContainerKey.initialize());
 
   // the extrapolation tool
-  if(m_extrapolationTool.retrieve().isFailure()){
+  if (m_extrapolationTool.retrieve().isFailure()) {
     ATH_MSG_ERROR("Cannot retrieve extrapolationTool " << m_extrapolationTool);
     return StatusCode::FAILURE;
-  } 
-    ATH_MSG_DEBUG("Retrieved extrapolationTool " << m_extrapolationTool);
-  
+  }
+  ATH_MSG_DEBUG("Retrieved extrapolationTool " << m_extrapolationTool);
 
   return StatusCode::SUCCESS;
 }
@@ -110,20 +106,20 @@ StatusCode
 EMConversionBuilder::executeRec(const EventContext& ctx, egammaRec* egRec) const
 {
   // retrieve Conversion Container
-  
-  SG::ReadHandle<xAOD::VertexContainer> conversions(m_conversionContainerKey, ctx); 
+
+  SG::ReadHandle<xAOD::VertexContainer> conversions(m_conversionContainerKey,
+                                                    ctx);
 
   // only for serial running; remove for MT
-  if(!conversions.isValid()){
-    ATH_MSG_ERROR(
-      "Could not retrieve Conversion container with key: "
-      << m_conversionContainerKey.key());
+  if (!conversions.isValid()) {
+    ATH_MSG_ERROR("Could not retrieve Conversion container with key: "
+                  << m_conversionContainerKey.key());
     return StatusCode::FAILURE;
   }
-  //reset the vertices
-  std::vector< ElementLink< xAOD::VertexContainer > >  vertices;
+  // reset the vertices
+  std::vector<ElementLink<xAOD::VertexContainer>> vertices;
   egRec->setVertices(vertices);
-  ATH_CHECK(vertexExecute(ctx,egRec,conversions.cptr()));
+  ATH_CHECK(vertexExecute(ctx, egRec, conversions.cptr()));
   return StatusCode::SUCCESS;
 }
 
@@ -142,8 +138,9 @@ EMConversionBuilder::vertexExecute(
   const xAOD::VertexContainer* conversions) const
 {
 
-  if (!egRec || !conversions){
-    ATH_MSG_WARNING("trackExecute: NULL pointer to egammaRec or VertexContainer");
+  if (!egRec || !conversions) {
+    ATH_MSG_WARNING(
+      "trackExecute: NULL pointer to egammaRec or VertexContainer");
     return StatusCode::SUCCESS;
   }
 
@@ -152,12 +149,12 @@ EMConversionBuilder::vertexExecute(
 
   float etaAtCalo(0);
   float phiAtCalo(0);
-  for (unsigned int iVtx = 0; iVtx < conversions->size(); ++iVtx){
-    
-    const xAOD::Vertex *vertex = conversions->at(iVtx);    
-    // Check if vertex was already decorated with etaAtCalo, phiAtCalo  
-    if ( accetaAtCalo.isAvailable(*vertex) &&
-	 accphiAtCalo.isAvailable(*vertex) ){
+  for (unsigned int iVtx = 0; iVtx < conversions->size(); ++iVtx) {
+
+    const xAOD::Vertex* vertex = conversions->at(iVtx);
+    // Check if vertex was already decorated with etaAtCalo, phiAtCalo
+    if (accetaAtCalo.isAvailable(*vertex) &&
+        accphiAtCalo.isAvailable(*vertex)) {
       etaAtCalo = accetaAtCalo(*vertex);
       phiAtCalo = accphiAtCalo(*vertex);
     }
@@ -166,7 +163,7 @@ EMConversionBuilder::vertexExecute(
                ctx, vertex, &etaAtCalo, &phiAtCalo)) {
       continue;
     }
-    const xAOD::CaloCluster *cluster = egRec->caloCluster();
+    const xAOD::CaloCluster* cluster = egRec->caloCluster();
     if (!passPtAndEoverP(ctx, *vertex, *cluster)) {
       continue;
     }
@@ -174,80 +171,83 @@ EMConversionBuilder::vertexExecute(
           cluster, vertex, etaAtCalo, phiAtCalo)) {
       continue;
     }
-    const ElementLink< xAOD::VertexContainer > vertexLink( *conversions, iVtx );
-    
-    // If this is the best (or the first) vertex, push front and keep deltaEta, deltaPhi
+    const ElementLink<xAOD::VertexContainer> vertexLink(*conversions, iVtx);
+
+    // If this is the best (or the first) vertex, push front and keep deltaEta,
+    // deltaPhi
     if (!egRec->getNumberOfVertices() ||
         ConvVxSorter(*vertex, *egRec->vertex())) {
-      egRec->pushFrontVertex( vertexLink );
-      egRec->setDeltaEtaVtx( cluster->etaBE(2) - etaAtCalo );
-      egRec->setDeltaPhiVtx( P4Helpers::deltaPhi(cluster->phiBE(2), phiAtCalo) );
+      egRec->pushFrontVertex(vertexLink);
+      egRec->setDeltaEtaVtx(cluster->etaBE(2) - etaAtCalo);
+      egRec->setDeltaPhiVtx(P4Helpers::deltaPhi(cluster->phiBE(2), phiAtCalo));
     } else { // Not the best vertex, push back
-      egRec->pushBackVertex( vertexLink );
+      egRec->pushBackVertex(vertexLink);
     }
   }
   return StatusCode::SUCCESS;
 }
 
-StatusCode EMConversionBuilder::finalize(){
-  return StatusCode::SUCCESS;
-}
-
 bool
 EMConversionBuilder::passPtAndEoverP(const EventContext& ctx,
                                      const xAOD::Vertex& vertex,
                                      const xAOD::CaloCluster& cluster) const
 {
-  Amg::Vector3D momentum = m_extrapolationTool->getMomentumAtVertex(ctx,vertex);
+  Amg::Vector3D momentum =
+    m_extrapolationTool->getMomentumAtVertex(ctx, vertex);
   float pt = momentum.perp();
   float EoverP = cluster.e() / momentum.mag();
-  
+
   auto convType = xAOD::EgammaHelpers::conversionType(&vertex);
   bool isSingle = (convType == singleTRT || convType == singleSi);
-  bool isTRT = (convType == singleTRT || convType == xAOD::EgammaParameters::doubleTRT);
-  float EoverPcut = m_maxEoverP_singleTrack*(1+m_maxEoverP_singleTrack_EtSf*cluster.et()*1e-3);
-  
+  bool isTRT =
+    (convType == singleTRT || convType == xAOD::EgammaParameters::doubleTRT);
+  float EoverPcut = m_maxEoverP_singleTrack *
+                    (1 + m_maxEoverP_singleTrack_EtSf * cluster.et() * 1e-3);
+
   // Check TRT tube hit fraction
   float tubeHitFraction = getMaxTRTTubeHitFraction(vertex);
-  if (isTRT && tubeHitFraction > m_maxTRTTubeHitFraction)
-  {
-    ATH_MSG_DEBUG("Conversion failed cut on TRT tube hit fraction: " 
-      << tubeHitFraction << " vs. " << m_maxTRTTubeHitFraction);
+  if (isTRT && tubeHitFraction > m_maxTRTTubeHitFraction) {
+    ATH_MSG_DEBUG("Conversion failed cut on TRT tube hit fraction: "
+                  << tubeHitFraction << " vs. " << m_maxTRTTubeHitFraction);
     return false;
   }
-  
-  bool reject =  (
-		  (isTRT && m_rejectAllTRT) ||
-		  (isSingle && pt < m_minPt_singleTrack) ||
-		  (!isSingle && pt < m_minSumPt_double) ||
-		  (isSingle && EoverP > EoverPcut) ||
-		  (convType == singleTRT && pt < m_minPt_singleTRT) ||
-		  (convType == doubleTRT && pt < m_minSumPt_doubleTRT)
-		  );
-  
-  if (reject) {ATH_MSG_DEBUG("Conversion failed pt or E/p cuts");}
+
+  bool reject =
+    ((isTRT && m_rejectAllTRT) || (isSingle && pt < m_minPt_singleTrack) ||
+     (!isSingle && pt < m_minSumPt_double) ||
+     (isSingle && EoverP > EoverPcut) ||
+     (convType == singleTRT && pt < m_minPt_singleTRT) ||
+     (convType == doubleTRT && pt < m_minSumPt_doubleTRT));
+
+  if (reject) {
+    ATH_MSG_DEBUG("Conversion failed pt or E/p cuts");
+  }
   return !reject;
 }
 
 float
 EMConversionBuilder::getMaxTRTTubeHitFraction(const xAOD::Vertex& vertex) const
 {
-  auto getTRTTubeHitFraction = [](const xAOD::TrackParticle *trk){
+  auto getTRTTubeHitFraction = [](const xAOD::TrackParticle* trk) {
     uint8_t nTRT;
     uint8_t nTRTTube;
-    if (!trk || !trk->summaryValue(nTRT, xAOD::numberOfTRTHits) || !nTRT ) return 0.;
-    return trk->summaryValue(nTRTTube, xAOD::numberOfTRTTubeHits) ? 1.*nTRTTube/nTRT : 0.;
+    if (!trk || !trk->summaryValue(nTRT, xAOD::numberOfTRTHits) || !nTRT)
+      return 0.;
+    return trk->summaryValue(nTRTTube, xAOD::numberOfTRTTubeHits)
+             ? 1. * nTRTTube / nTRT
+             : 0.;
   };
-  
+
   float maxTubeHitFraction = 0.;
-  for (unsigned int i=0; i < vertex.nTrackParticles(); ++i){
-    if ( !vertex.trackParticle(i) ){
+  for (unsigned int i = 0; i < vertex.nTrackParticles(); ++i) {
+    if (!vertex.trackParticle(i)) {
       ATH_MSG_WARNING("NULL pointer to track particle in conversion vertex");
+    } else {
+      float tubeHitFraction = getTRTTubeHitFraction(vertex.trackParticle(i));
+      if (tubeHitFraction > maxTubeHitFraction) {
+        maxTubeHitFraction = tubeHitFraction;
+      }
     }
-    else{
-      float tubeHitFraction = getTRTTubeHitFraction( vertex.trackParticle(i) );
-      if (tubeHitFraction > maxTubeHitFraction) {maxTubeHitFraction = tubeHitFraction;}
-    }
-  }  
+  }
   return maxTubeHitFraction;
 }
diff --git a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.h b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.h
index 92d24d67751bf7529194b4abb134f2262956da16..8cf030913022b84d719c5a605caee8590af4cfc1 100644
--- a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.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 EGAMMATOOLS_EMCONVERSIONBUILDER_H
@@ -49,10 +49,10 @@ public:
                       const IInterface* parent);
 
   /** @brief Destructor*/
-  ~EMConversionBuilder();
+  virtual ~EMConversionBuilder() = default;
 
   /** @brief initialize method*/
-  StatusCode initialize() override;
+  StatusCode initialize() override final;
   /** @brief execute method*/
   virtual StatusCode executeRec(const EventContext& ctx,
                                 egammaRec* egRec) const override final;
@@ -60,16 +60,12 @@ public:
   virtual StatusCode hltExecute(
     egammaRec* egRec,
     const xAOD::VertexContainer* conversions) const override final;
- /** @brief finalize method*/
-  StatusCode finalize() override;
 
 private:
   /** @brief actual  implementation method*/
-  StatusCode vertexExecute(
-    const EventContext& ctx,
-    egammaRec* egRec,
-    const xAOD::VertexContainer* conversions) const;
- 
+  StatusCode vertexExecute(const EventContext& ctx,
+                           egammaRec* egRec,
+                           const xAOD::VertexContainer* conversions) const;
 
   /** @brief Return true if vertex and cluster pass Pt and E/p cuts **/
   bool passPtAndEoverP(const EventContext& ctx,
diff --git a/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.cxx
index 2680e5c1a8658b2cdd2b9e337206ed3efa84e4e2..ca663f033d5fe87205164df0dbf30b8f71499d34 100644
--- a/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.cxx
@@ -13,182 +13,191 @@ PACKAGE:  offline/Reconstruction/egamma/egammaTools
 #include "EMFourMomBuilder.h"
 #include "FourMom/ErrorMatrixEEtaPhiM.h"
 
-//NEW xAOD INCLUDES.
+// NEW xAOD INCLUDES.
 #include "xAODEgamma/EgammaxAODHelpers.h"
 #include "xAODEgamma/Electron.h"
-#include "xAODEgamma/Photon.h"
 #include "xAODEgamma/ElectronContainer.h"
+#include "xAODEgamma/Photon.h"
 #include "xAODEgamma/PhotonContainer.h"
 
-#include "xAODEgamma/EgammaxAODHelpers.h"
 #include "EventPrimitives/EventPrimitives.h"
 #include "FourMom/EigenP5Jacobiand0z0PhiThetaqOverP2d0z0PhiEtaP.h"
-#include "egammaUtils/eg_resolution.h"
 #include "GeoPrimitives/GeoPrimitives.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
 
 //  END OF HEADER FILES INCLUDE
 
 namespace {
-    const float el_mass=0.510998;        
-    const float ph_mass=0.0;        
+const float el_mass = 0.510998;
+const float ph_mass = 0.0;
 
 }
 
 /////////////////////////////////////////////////////////////////
 
 EMFourMomBuilder::EMFourMomBuilder(const std::string& type,
-        const std::string& name,
-        const IInterface* parent)
-: egammaBaseTool(type, name, parent)
+                                   const std::string& name,
+                                   const IInterface* parent)
+  : egammaBaseTool(type, name, parent)
 {
-    // declare interface
-    declareInterface<IEMFourMomBuilder>(this);
-}
-// =============================================================
-// DESTRUCTOR:
-EMFourMomBuilder::~EMFourMomBuilder(){ 
+  // declare interface
+  declareInterface<IEMFourMomBuilder>(this);
 }
 
-StatusCode EMFourMomBuilder::initialize(){
+StatusCode
+EMFourMomBuilder::initialize()
+{
 
-    ATH_MSG_DEBUG(" Initializing EMFourMomBuilder");
-    m_eg_resol=std::make_unique<eg_resolution>(m_ResolutionConfiguration); 
-    m_eg_resol->msg().setLevel(this->msg().level());
-    return StatusCode::SUCCESS;
+  ATH_MSG_DEBUG(" Initializing EMFourMomBuilder");
+  m_eg_resol = std::make_unique<eg_resolution>(m_ResolutionConfiguration);
+  m_eg_resol->msg().setLevel(this->msg().level());
+  return StatusCode::SUCCESS;
 }
 
-StatusCode EMFourMomBuilder::execute(const EventContext& ctx, xAOD::Egamma* eg) const {
-    (void)ctx;
-    if (!eg){
-        ATH_MSG_WARNING("Null pointer to egamma object ");
-        return StatusCode::SUCCESS;
-    }
-    
-    xAOD::Electron *electron = eg->type() == xAOD::Type::Electron ? static_cast<xAOD::Electron*>(eg) : nullptr;
-    xAOD::Photon   *photon   = electron ? nullptr : static_cast<xAOD::Photon*>(eg);
-
-    bool hasTrack(false);
-    if (electron) {
-        const xAOD::TrackParticle *trackParticle = electron->trackParticle();
-        if(trackParticle){
-            hasTrack=true;
-        }
-    }
-
-    /* One method deals with electron with tracks,
-     * Another with double Si Conversion Photons
-     * The last is for no track e.g forward electrons
-     * or the rest of the photons
-     */
-
-    StatusCode sc = StatusCode::SUCCESS;
-    if (electron && hasTrack) {
-        sc = setFromTrkCluster(*electron);
-    }
-    else if (photon &&  
-            xAOD::EgammaHelpers::conversionType(photon) == xAOD::EgammaParameters::doubleSi  ){
-        sc = setFromTrkCluster(*photon);
-    }
-    else{
-        sc = setFromCluster(*eg);
+StatusCode
+EMFourMomBuilder::execute(const EventContext& ctx, xAOD::Egamma* eg) const
+{
+  (void)ctx;
+  if (!eg) {
+    ATH_MSG_WARNING("Null pointer to egamma object ");
+    return StatusCode::SUCCESS;
+  }
+
+  xAOD::Electron* electron = eg->type() == xAOD::Type::Electron
+                               ? static_cast<xAOD::Electron*>(eg)
+                               : nullptr;
+  xAOD::Photon* photon = electron ? nullptr : static_cast<xAOD::Photon*>(eg);
+
+  bool hasTrack(false);
+  if (electron) {
+    const xAOD::TrackParticle* trackParticle = electron->trackParticle();
+    if (trackParticle) {
+      hasTrack = true;
     }
-    return sc;
+  }
+
+  /* One method deals with electron with tracks,
+   * Another with double Si Conversion Photons
+   * The last is for no track e.g forward electrons
+   * or the rest of the photons
+   */
+
+  StatusCode sc = StatusCode::SUCCESS;
+  if (electron && hasTrack) {
+    sc = setFromTrkCluster(*electron);
+  } else if (photon && xAOD::EgammaHelpers::conversionType(photon) ==
+                         xAOD::EgammaParameters::doubleSi) {
+    sc = setFromTrkCluster(*photon);
+  } else {
+    sc = setFromCluster(*eg);
+  }
+  return sc;
 }
 
-StatusCode EMFourMomBuilder::hltExecute(xAOD::Egamma* eg) const{
-    return execute(Gaudi::Hive::currentContext(), eg);
+StatusCode
+EMFourMomBuilder::hltExecute(xAOD::Egamma* eg) const
+{
+  return execute(Gaudi::Hive::currentContext(), eg);
 }
 
-StatusCode EMFourMomBuilder::setFromTrkCluster(xAOD::Electron& el) const {
+StatusCode
+EMFourMomBuilder::setFromTrkCluster(xAOD::Electron& el) const
+{
 
-    const xAOD::CaloCluster *cluster = el.caloCluster();
-    if (!cluster) {
-        ATH_MSG_WARNING("Null pointer to cluster");
-        return StatusCode::SUCCESS;
-    }
-    const xAOD::TrackParticle *trackParticle = el.trackParticle();
-    if (!trackParticle) {
-        ATH_MSG_WARNING("Null pointer to Track Particle");
-        return StatusCode::SUCCESS;
-    }
-    bool goodTrack=(xAOD::EgammaHelpers::numberOfSiHits(trackParticle)>=4); 
-    const float E = cluster->e();
-    const float eta = goodTrack ? trackParticle->eta() : cluster->eta() ;
-    const float phi = goodTrack ? trackParticle->phi() : cluster->phi() ;
-
-    //Set the four momentum.
-    ATH_MSG_DEBUG("Setting P4 using E=" << E << " eta=" << eta 
-            << " phi=" << phi <<" mass" << el_mass);
-    const double pt = E > el_mass ? sqrt(E*E - el_mass*el_mass)/cosh(eta) : 0;
-    el.setP4(pt, eta, phi, el_mass);
-    
-    //Electron with tracks all should  have a covariance matrix set 
-    AmgMatrix(4,4) matrix;
-    matrix.setZero(); 
-    const float sigmaE_over_E= m_eg_resol->getResolution(el);
-    matrix(0,0) = (sigmaE_over_E* E * sigmaE_over_E *E)/(cosh(eta)*cosh(eta)) ;
-    
-    //Direction can be filled only when a good track is there 
-    if(goodTrack){
-        xAOD::ParametersCovMatrix_t covmat=trackParticle->definingParametersCovMatrix();
-        EigenP5Jacobiand0z0PhiThetaqOverP2d0z0PhiEtaP J(trackParticle->phi(),
-                trackParticle->charge(),
-                trackParticle->p4().P()); 
-        AmgMatrix(5,5) m;
-        m.setZero();
-        m = J * (covmat * J.transpose());
-        //Rearrange the elements of the d0, z0, phi, eta, Pt 
-        //representation to make the (Et, eta, phi, M)     
-        matrix(1,1) = m(3,3);
-        matrix(2,2) = m(2,2);     
-        matrix.fillSymmetric(0,1,m(4,3));
-        matrix.fillSymmetric(0,2,m(4,2));
-        matrix.fillSymmetric(1,2,m(3,2)); 
-    }
-    
-    el.setCovMatrix(matrix.cast<float>());
+  const xAOD::CaloCluster* cluster = el.caloCluster();
+  if (!cluster) {
+    ATH_MSG_WARNING("Null pointer to cluster");
+    return StatusCode::SUCCESS;
+  }
+  const xAOD::TrackParticle* trackParticle = el.trackParticle();
+  if (!trackParticle) {
+    ATH_MSG_WARNING("Null pointer to Track Particle");
     return StatusCode::SUCCESS;
+  }
+  bool goodTrack = (xAOD::EgammaHelpers::numberOfSiHits(trackParticle) >= 4);
+  const float E = cluster->e();
+  const float eta = goodTrack ? trackParticle->eta() : cluster->eta();
+  const float phi = goodTrack ? trackParticle->phi() : cluster->phi();
+
+  // Set the four momentum.
+  ATH_MSG_DEBUG("Setting P4 using E=" << E << " eta=" << eta << " phi=" << phi
+                                      << " mass" << el_mass);
+  const double pt =
+    E > el_mass ? sqrt(E * E - el_mass * el_mass) / cosh(eta) : 0;
+  el.setP4(pt, eta, phi, el_mass);
+
+  // Electron with tracks all should  have a covariance matrix set
+  AmgMatrix(4, 4) matrix;
+  matrix.setZero();
+  const float sigmaE_over_E = m_eg_resol->getResolution(el);
+  matrix(0, 0) =
+    (sigmaE_over_E * E * sigmaE_over_E * E) / (cosh(eta) * cosh(eta));
+
+  // Direction can be filled only when a good track is there
+  if (goodTrack) {
+    xAOD::ParametersCovMatrix_t covmat =
+      trackParticle->definingParametersCovMatrix();
+    EigenP5Jacobiand0z0PhiThetaqOverP2d0z0PhiEtaP J(
+      trackParticle->phi(), trackParticle->charge(), trackParticle->p4().P());
+    AmgMatrix(5, 5) m;
+    m.setZero();
+    m = J * (covmat * J.transpose());
+    // Rearrange the elements of the d0, z0, phi, eta, Pt
+    // representation to make the (Et, eta, phi, M)
+    matrix(1, 1) = m(3, 3);
+    matrix(2, 2) = m(2, 2);
+    matrix.fillSymmetric(0, 1, m(4, 3));
+    matrix.fillSymmetric(0, 2, m(4, 2));
+    matrix.fillSymmetric(1, 2, m(3, 2));
+  }
+
+  el.setCovMatrix(matrix.cast<float>());
+  return StatusCode::SUCCESS;
 }
 
-StatusCode EMFourMomBuilder::setFromTrkCluster(xAOD::Photon& ph) const {
-    const xAOD::CaloCluster *cluster = ph.caloCluster();
-    if (!cluster) {
-        ATH_MSG_WARNING("Null pointer to cluster");
-        return StatusCode::SUCCESS;
-    }   
-    float E = cluster->e();
-    float eta = cluster->eta();
-    float phi = cluster->phi() ; 
-    Amg::Vector3D momentumAtVertex = xAOD::EgammaHelpers::momentumAtVertex(&ph);
-    if (momentumAtVertex.mag() > 1e-5) { // protection against p = 0
-        eta = momentumAtVertex.eta();
-        phi = momentumAtVertex.phi();
-    }
-    //Set the four momentum.
-    ATH_MSG_DEBUG("Setting P4 using E=" << E << " eta=" 
-            << eta << " phi=" << phi <<" mass" << ph_mass);
-    ph.setP4( E/cosh(eta), eta, phi, ph_mass);
+StatusCode
+EMFourMomBuilder::setFromTrkCluster(xAOD::Photon& ph) const
+{
+  const xAOD::CaloCluster* cluster = ph.caloCluster();
+  if (!cluster) {
+    ATH_MSG_WARNING("Null pointer to cluster");
     return StatusCode::SUCCESS;
+  }
+  float E = cluster->e();
+  float eta = cluster->eta();
+  float phi = cluster->phi();
+  Amg::Vector3D momentumAtVertex = xAOD::EgammaHelpers::momentumAtVertex(&ph);
+  if (momentumAtVertex.mag() > 1e-5) { // protection against p = 0
+    eta = momentumAtVertex.eta();
+    phi = momentumAtVertex.phi();
+  }
+  // Set the four momentum.
+  ATH_MSG_DEBUG("Setting P4 using E=" << E << " eta=" << eta << " phi=" << phi
+                                      << " mass" << ph_mass);
+  ph.setP4(E / cosh(eta), eta, phi, ph_mass);
+  return StatusCode::SUCCESS;
 }
 
-StatusCode EMFourMomBuilder::setFromCluster(xAOD::Egamma& eg) const {
-
-    const xAOD::CaloCluster *cluster = eg.caloCluster();
-    if (!cluster) {
-        ATH_MSG_WARNING("Null pointer to cluster");
-        return StatusCode::SUCCESS;
-    }
+StatusCode
+EMFourMomBuilder::setFromCluster(xAOD::Egamma& eg) const
+{
 
-    const float eta  = cluster->eta();
-    const float phi = cluster->phi();
-    const float E    = cluster->e();
-    if(eg.type()==xAOD::Type::Electron){
-        const double pt = E > el_mass ? sqrt(E*E - el_mass*el_mass)/cosh(eta) : 0;
-        eg.setP4(pt, eta, phi, el_mass);
-    }
-    else{
-        eg.setP4( E/cosh(eta), eta, phi, ph_mass);
-    }
+  const xAOD::CaloCluster* cluster = eg.caloCluster();
+  if (!cluster) {
+    ATH_MSG_WARNING("Null pointer to cluster");
     return StatusCode::SUCCESS;
+  }
+
+  const float eta = cluster->eta();
+  const float phi = cluster->phi();
+  const float E = cluster->e();
+  if (eg.type() == xAOD::Type::Electron) {
+    const double pt =
+      E > el_mass ? sqrt(E * E - el_mass * el_mass) / cosh(eta) : 0;
+    eg.setP4(pt, eta, phi, el_mass);
+  } else {
+    eg.setP4(E / cosh(eta), eta, phi, ph_mass);
+  }
+  return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h b/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h
index f9a71460649aadb3cb23fa119988a25b10e12e5f..2dd3f86ffc6a827f6ccf6dfffd9def9a33444129 100644
--- a/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/EMFourMomBuilder.h
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
 #ifndef EGAMMATOOLS_EMFOURMOMBUILDER_H
@@ -7,67 +7,72 @@
 
 /**
   @class EMFourMomBuilder
-  sets the fourmomentum : energy is taken from the cluster and angles either from tracking or cluster.
-  In case the egamma object is a conversion :
-  - if it is a single/double track conversion with TRT only tracks 
-  - (i.e no more than 4 hits in pixel+SCT), take the cluster info, not the track info
-  - 
+  sets the fourmomentum : energy is taken from the cluster and angles either
+  from tracking or cluster. In case the egamma object is a conversion :
+  - if it is a single/double track conversion with TRT only tracks
+  - (i.e no more than 4 hits in pixel+SCT), take the cluster info, not the track
+  info
+  -
   @author  Zerwas,Anastopoulos
   */
 
 // XAOD INCLUDES:
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "egammaInterfaces/IegammaBaseTool.h"
+#include "xAODCaloEvent/CaloClusterFwd.h"
 #include "xAODEgamma/EgammaFwd.h"
-#include "xAODEgamma/PhotonFwd.h"
 #include "xAODEgamma/ElectronFwd.h"
-#include "xAODCaloEvent/CaloClusterFwd.h"
+#include "xAODEgamma/PhotonFwd.h"
 
 // INCLUDE HEADER FILES:
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
 
+#include "EventPrimitives/EventPrimitives.h"
 #include "egammaBaseTool.h"
 #include "egammaInterfaces/IEMFourMomBuilder.h"
-#include "EventPrimitives/EventPrimitives.h"
 #include "egammaRecEvent/egammaRec.h"
+#include "egammaUtils/eg_resolution.h"
 
-class eg_resolution;
-class EMFourMomBuilder : public egammaBaseTool, virtual public IEMFourMomBuilder
+class EMFourMomBuilder
+  : public egammaBaseTool
+  , virtual public IEMFourMomBuilder
 {
 
 public:
+  /** @brief Default constructor*/
+  EMFourMomBuilder(const std::string& type,
+                   const std::string& name,
+                   const IInterface* parent);
 
-    /** @brief Default constructor*/
-    EMFourMomBuilder(const std::string& type,
-            const std::string& name,
-            const IInterface* parent);
-
-    /** @brief Destructor*/
-    ~EMFourMomBuilder();
+  /** @brief Destructor*/
+  virtual ~EMFourMomBuilder() = default;
 
-    /** @brief initialize method*/
-    StatusCode initialize() override;
-    /** @brief execute method*/
-    virtual StatusCode execute(const EventContext& ctx, xAOD::Egamma* eg) const override;
-    /** @brief execute method*/
-    virtual StatusCode hltExecute(xAOD::Egamma* eg) const override;
+  /** @brief initialize method*/
+  StatusCode initialize() override final;
+  /** @brief execute method*/
+  virtual StatusCode execute(const EventContext& ctx,
+                             xAOD::Egamma* eg) const override final;
+  /** @brief execute method*/
+  virtual StatusCode hltExecute(xAOD::Egamma* eg) const override final;
 
 private:
+  /** @brief Method to set the 4-mom in case of electron */
+  StatusCode setFromTrkCluster(xAOD::Electron&) const;
+  StatusCode setFromTrkCluster(xAOD::Photon&) const;
+  /** @brief Method to set the 4-mom in case of unconverted photon */
+  StatusCode setFromCluster(xAOD::Egamma&) const;
 
-    /** @brief Method to set the 4-mom in case of electron */
-    StatusCode setFromTrkCluster(xAOD::Electron& ) const ;
-    StatusCode setFromTrkCluster(xAOD::Photon& ) const ;
-    /** @brief Method to set the 4-mom in case of unconverted photon */
-    StatusCode setFromCluster(xAOD::Egamma& ) const;
-
-    /** @brief Resolution configuration*/
-    Gaudi::Property<std::string> m_ResolutionConfiguration {this,
-        "ResolutionConfiguration", "run2_pre",
-        "Resolution Configuration"};
+  /** @brief Resolution configuration*/
+  Gaudi::Property<std::string> m_ResolutionConfiguration{
+    this,
+    "ResolutionConfiguration",
+    "run2_pre",
+    "Resolution Configuration"
+  };
 
-    std::unique_ptr<eg_resolution> m_eg_resol;
+  std::unique_ptr<eg_resolution> m_eg_resol;
 };
 
 #endif
diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx
index f54cf8b8de99cec562b895f7e94a770debd45051..d558b4103bfcb868694fa009d06c020329d9b6c4 100644
--- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx
@@ -2,161 +2,163 @@
    Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
-// INCLUDE HEADER FILES:
-#include "AthenaKernel/errorcheck.h"
 #include "EMPIDBuilder.h"
-#include "xAODEgamma/Egamma.h"
+#include "AthenaKernel/errorcheck.h"
 #include "PATCore/AcceptData.h"
+#include "xAODEgamma/Egamma.h"
 
-
-// ===========================================================================
 EMPIDBuilder::EMPIDBuilder(const std::string& type,
-        const std::string& name,
-        const IInterface* parent)
-: egammaBaseTool(type, name, parent)
+                           const std::string& name,
+                           const IInterface* parent)
+  : egammaBaseTool(type, name, parent)
 {
-    // declare interface
-    declareInterface<IegammaBaseTool>(this);
-
+  // declare interface
+  declareInterface<IegammaBaseTool>(this);
 }
 
-EMPIDBuilder::~EMPIDBuilder()
-{ 
-}
-
-StatusCode EMPIDBuilder::initialize()
+StatusCode
+EMPIDBuilder::initialize()
 {
-    ATH_MSG_DEBUG(" Initializing EMPIDBuilder");
-
-    ATH_CHECK(m_electronIsEMselectors.retrieve());
-
-    if (m_electronIsEMselectors.size() != m_electronIsEMselectorResultNames.size()) {
-        ATH_MSG_ERROR("The number of selectors does not match the number of given electronIsEMselector names");
-        return StatusCode::FAILURE;
+  ATH_MSG_DEBUG(" Initializing EMPIDBuilder");
+
+  ATH_CHECK(m_electronIsEMselectors.retrieve());
+
+  if (m_electronIsEMselectors.size() !=
+      m_electronIsEMselectorResultNames.size()) {
+    ATH_MSG_ERROR("The number of selectors does not match the number of given "
+                  "electronIsEMselector names");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_CHECK(m_electronLHselectors.retrieve());
+
+  if (m_electronLHselectors.size() != m_electronLHselectorResultNames.size()) {
+    ATH_MSG_ERROR("The number of selectors does not match the number of given "
+                  "electron LH selector names");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_CHECK(m_genericIsEMselectors.retrieve());
+
+  if (m_genericIsEMselectors.size() !=
+      m_genericIsEMselectorResultNames.size()) {
+    ATH_MSG_ERROR("The number of selectors does not match the number of given "
+                  "generic selector names");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_CHECK(m_photonIsEMselectors.retrieve());
+
+  if (m_photonIsEMselectors.size() != m_photonIsEMselectorResultNames.size()) {
+    ATH_MSG_ERROR("The number of selectors does not match the number of given "
+                  "photon selector names");
+    return StatusCode::FAILURE;
+  }
+
+  if (m_UselumiBlockMuTool) {
+    ATH_MSG_INFO("enabling lumiBlockMuTool");
+    if (m_lumiBlockMuTool.retrieve().isFailure()) {
+      ATH_MSG_FATAL("Unable to retrieve Luminosity Tool");
+      return StatusCode::FAILURE;
     }
+    ATH_MSG_DEBUG("Successfully retrieved Luminosity Tool");
 
-    ATH_CHECK(m_electronLHselectors.retrieve());
-
-    if (m_electronLHselectors.size() != m_electronLHselectorResultNames.size()) {
-        ATH_MSG_ERROR("The number of selectors does not match the number of given electron LH selector names");
-        return StatusCode::FAILURE;
-    }
-
-    ATH_CHECK(m_genericIsEMselectors.retrieve());
-
-    if (m_genericIsEMselectors.size() != m_genericIsEMselectorResultNames.size()) {
-        ATH_MSG_ERROR("The number of selectors does not match the number of given generic selector names");
-        return StatusCode::FAILURE;
-    }
-
-    ATH_CHECK(m_photonIsEMselectors.retrieve());
-
-    if (m_photonIsEMselectors.size() != m_photonIsEMselectorResultNames.size()) {
-        ATH_MSG_ERROR("The number of selectors does not match the number of given photon selector names");
-        return StatusCode::FAILURE;
-    }
-
-    if (m_UselumiBlockMuTool) {
-       std::cout << "enabling lumiBlockMuTool" <<std::endl; 
-       if (m_lumiBlockMuTool.retrieve().isFailure()) {
-            ATH_MSG_FATAL("Unable to retrieve Luminosity Tool");
-            return StatusCode::FAILURE;
-        } 
-            ATH_MSG_DEBUG("Successfully retrieved Luminosity Tool");
-        
-    } else {
-       std::cout << "disabling lumiBlockMuTool" <<std::endl; 
-        m_lumiBlockMuTool.disable();
-    }
-    return StatusCode::SUCCESS;
+  } else {
+    ATH_MSG_INFO("disabling lumiBlockMuTool");
+    m_lumiBlockMuTool.disable();
+  }
+  return StatusCode::SUCCESS;
 }
 
-StatusCode EMPIDBuilder::finalize()
+StatusCode
+EMPIDBuilder::execute(const EventContext& ctx, xAOD::Egamma* eg) const
 {
-    return StatusCode::SUCCESS;
-}
-
-StatusCode EMPIDBuilder::execute(const EventContext& ctx, xAOD::Egamma* eg) const
-{   
-
-    ATH_MSG_DEBUG("Executing EMPIDBuilder::execute");
-
-    // Protection against bad pointers
-    if (eg==nullptr) {
-        ATH_MSG_WARNING("NULL egamma object given to execute function");
-        return StatusCode::SUCCESS;
-    }
-
-    size_t size = m_electronIsEMselectors.size();
-
-    for (size_t i = 0; i<size;++i) {
-        asg::AcceptData accept = m_electronIsEMselectors[i]->accept(ctx, eg);
-        //save the bool result
-        eg->setPassSelection(static_cast<bool>(accept), m_electronIsEMselectorResultNames[i]);
-        //save the isem
-        unsigned int isEM = (~0);
-        if ( m_electronIsEMselectors[i]->execute(ctx, eg, isEM).isFailure() ) {
-            ATH_MSG_ERROR("problem to get isEM for " << m_electronIsEMselectorResultNames[i]);
-            return StatusCode::FAILURE;
-        }
-        eg->setSelectionisEM(isEM, "isEM"+m_electronIsEMselectorResultNames[i]);
-
-    }
 
-    size_t sizePh = m_photonIsEMselectors.size();
-
-    for (size_t i = 0; i<sizePh;++i) {
-        asg::AcceptData accept = m_photonIsEMselectors[i]->accept(ctx, eg);
-        //save the bool result
-        eg->setPassSelection(static_cast<bool>(accept), m_photonIsEMselectorResultNames[i]);
-        //save the isem
-        unsigned int isEM = ~0;
-        if ( m_photonIsEMselectors[i]->execute(ctx, eg, isEM).isFailure() ) {
-            ATH_MSG_ERROR("problem to get isEM for " << m_photonIsEMselectorResultNames[i]);
-            return StatusCode::FAILURE;
-        }
-        eg->setSelectionisEM(isEM, "isEM"+m_photonIsEMselectorResultNames[i]);
-    }
-
-    size_t sizeLH = m_electronLHselectors.size();
+  ATH_MSG_DEBUG("Executing EMPIDBuilder::execute");
 
-    //negative mu means the default behaviour --> retrieve the one in xAOD 
-    double mu = -99.;
-    double avg_mu = -99.;
-    if(m_UselumiBlockMuTool){ //
-        mu = m_lumiBlockMuTool->actualInteractionsPerCrossing(); // (retrieve mu for the current BCID)
-        avg_mu = m_lumiBlockMuTool->averageInteractionsPerCrossing();
-        ATH_MSG_DEBUG("REGTEST: Retrieved Mu Value : " << mu);
-        ATH_MSG_DEBUG("REGTEST: Average Mu Value   : " << avg_mu);
+  // Protection against bad pointers
+  if (eg == nullptr) {
+    ATH_MSG_WARNING("NULL egamma object given to execute function");
+    return StatusCode::SUCCESS;
+  }
+
+  size_t size = m_electronIsEMselectors.size();
+
+  for (size_t i = 0; i < size; ++i) {
+    asg::AcceptData accept = m_electronIsEMselectors[i]->accept(ctx, eg);
+    // save the bool result
+    eg->setPassSelection(static_cast<bool>(accept),
+                         m_electronIsEMselectorResultNames[i]);
+    // save the isem
+    unsigned int isEM = (~0);
+    if (m_electronIsEMselectors[i]->execute(ctx, eg, isEM).isFailure()) {
+      ATH_MSG_ERROR("problem to get isEM for "
+                    << m_electronIsEMselectorResultNames[i]);
+      return StatusCode::FAILURE;
     }
-
-    for (size_t i = 0; i<sizeLH; ++i) {
-
-        asg::AcceptData accept = m_electronLHselectors[i]->accept(ctx, eg,avg_mu);
-        //save the bool result
-        eg->setPassSelection(static_cast<bool>(accept), m_electronLHselectorResultNames[i]);
-        //save the isem
-        eg->setSelectionisEM(static_cast<unsigned int>(accept.getCutResultInverted()),
-                             "isEM" + m_electronLHselectorResultNames[i]);
-
-        //save the LHValue only once
-        if(i==0){
-          eg->setLikelihoodValue(
-            static_cast<float>(m_electronLHselectors[i]->calculate(ctx, eg, avg_mu)),m_LHValueName);
-        }  
+    eg->setSelectionisEM(isEM, "isEM" + m_electronIsEMselectorResultNames[i]);
+  }
+
+  size_t sizePh = m_photonIsEMselectors.size();
+
+  for (size_t i = 0; i < sizePh; ++i) {
+    asg::AcceptData accept = m_photonIsEMselectors[i]->accept(ctx, eg);
+    // save the bool result
+    eg->setPassSelection(static_cast<bool>(accept),
+                         m_photonIsEMselectorResultNames[i]);
+    // save the isem
+    unsigned int isEM = ~0;
+    if (m_photonIsEMselectors[i]->execute(ctx, eg, isEM).isFailure()) {
+      ATH_MSG_ERROR("problem to get isEM for "
+                    << m_photonIsEMselectorResultNames[i]);
+      return StatusCode::FAILURE;
     }
-
-    size_t sizeGen = m_genericIsEMselectors.size();
-    for (size_t i = 0; i<sizeGen;++i) {
-        asg::AcceptData accept = m_genericIsEMselectors[i]->accept(eg);
-        //save the bool result
-        eg->setPassSelection(static_cast<bool>(accept), m_genericIsEMselectorResultNames[i]);
-        //save the isem
-        eg->setSelectionisEM(static_cast<unsigned int>(accept.getCutResultInverted()),
-                             "isEM" + m_genericIsEMselectorResultNames[i]);
+    eg->setSelectionisEM(isEM, "isEM" + m_photonIsEMselectorResultNames[i]);
+  }
+
+  size_t sizeLH = m_electronLHselectors.size();
+
+  // negative mu means the default behaviour --> retrieve the one in xAOD
+  double mu = -99.;
+  double avg_mu = -99.;
+  if (m_UselumiBlockMuTool) { //
+    mu = m_lumiBlockMuTool->actualInteractionsPerCrossing();
+    avg_mu = m_lumiBlockMuTool->averageInteractionsPerCrossing();
+    ATH_MSG_DEBUG("REGTEST: Retrieved Mu Value : " << mu);
+    ATH_MSG_DEBUG("REGTEST: Average Mu Value   : " << avg_mu);
+  }
+
+  for (size_t i = 0; i < sizeLH; ++i) {
+    asg::AcceptData accept = m_electronLHselectors[i]->accept(ctx, eg, avg_mu);
+    // save the bool result
+    eg->setPassSelection(static_cast<bool>(accept),
+                         m_electronLHselectorResultNames[i]);
+    // save the isem
+    eg->setSelectionisEM(
+      static_cast<unsigned int>(accept.getCutResultInverted()),
+      "isEM" + m_electronLHselectorResultNames[i]);
+
+    // save the LHValue only once
+    if (i == 0) {
+      eg->setLikelihoodValue(
+        static_cast<float>(
+          m_electronLHselectors[i]->calculate(ctx, eg, avg_mu)),
+        m_LHValueName);
     }
-
-
-    return StatusCode::SUCCESS;
+  }
+
+  size_t sizeGen = m_genericIsEMselectors.size();
+  for (size_t i = 0; i < sizeGen; ++i) {
+    asg::AcceptData accept = m_genericIsEMselectors[i]->accept(eg);
+    // save the bool result
+    eg->setPassSelection(static_cast<bool>(accept),
+                         m_genericIsEMselectorResultNames[i]);
+    // save the isem
+    eg->setSelectionisEM(
+      static_cast<unsigned int>(accept.getCutResultInverted()),
+      "isEM" + m_genericIsEMselectorResultNames[i]);
+  }
+
+  return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
index 08521387122724e211d6b04290b06877d40de262..cd7e7798891f7101f34f7e83536967281929667d 100644
--- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h
@@ -1,20 +1,19 @@
 /*
-  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 EGAMMATOOLS_EMPIDBUILDER_H
 #define EGAMMATOOLS_EMPIDBUILDER_H
 /**
   @class EMPIDBuilder
-  egamma tool to add selector outputs to the egamma objects 
+  egamma tool to add selector outputs to the egamma objects
   Note:  Subject to change after the PAT selectors evolve
- 
+
   @author Jovan Mitrevski Jovan.Mitrevski@cern.ch
 
 */
-// INCLUDE HEADER FILES: 
-#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
 #include "egammaBaseTool.h"
 
 #include <string>
@@ -28,70 +27,94 @@
 class EMPIDBuilder : public egammaBaseTool
 {
 public:
-  
   /** @brief Default constructor*/
   EMPIDBuilder(const std::string& type,
-	       const std::string& name,
-	       const IInterface* parent);
-  
+               const std::string& name,
+               const IInterface* parent);
+
   /** @brief Destructor*/
-  ~EMPIDBuilder();
-	
+  virtual ~EMPIDBuilder() = default;
+
   /** @brief initialize method*/
-  virtual StatusCode initialize() override;
+  virtual StatusCode initialize() override final;
   /** @brief standard execute method */
-  virtual StatusCode execute(const EventContext& ctx, xAOD::Egamma*) const override final ;
-  /** @brief finalize method*/
-  virtual StatusCode finalize() override;
+  virtual StatusCode execute(const EventContext& ctx,
+                             xAOD::Egamma*) const override final;
 
-protected:
-  /** Handle to the selectors */
-
-  ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMselectors {this,
-      "electronIsEMselectors", {},
-      "The selectors that we need to apply to the Electron object"};
-  Gaudi::Property<std::vector<std::string> > m_electronIsEMselectorResultNames {this,
-      "electronIsEMselectorResultNames", {}, "The selector result names"};
- 
-  ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHselectors {this,
-      "electronLHselectors", {},
-      "The selectors that we need to apply to the LH electron object"};
-  Gaudi::Property<std::vector<std::string> > m_electronLHselectorResultNames {this,
-      "electronLHselectorResultNames", {}, "The selector result names"};
-  
-  ToolHandleArray<CP::ISelectionTool> m_genericIsEMselectors {this,
-      "genericIsEMselectors", {},
-      "The selectors that we need to apply to the generic object"};
-
-  Gaudi::Property<std::vector<std::string> > m_genericIsEMselectorResultNames {this,
-      "genericIsEMselectorResultNames", {}, "The selector result names"};
-  
-  ToolHandleArray<IAsgPhotonIsEMSelector> m_photonIsEMselectors {this,
-      "photonIsEMselectors", {},
-      "The selectors that we need to apply to the pothon object"};
-  Gaudi::Property<std::vector<std::string> > m_photonIsEMselectorResultNames {this,
-      "photonIsEMselectorResultNames", {}, "The selector result names"};
- 
-  ToolHandle<ILumiBlockMuTool> m_lumiBlockMuTool {this,
-      "LuminosityTool", "LumiBlockMuTool/LumiBlockMuTool", "Luminosity Tool"};
-
-  Gaudi::Property<std::string> m_LHValueName {this, 
-      "LHValueName", "LHValue", "The LH Value name"};
-  
 private:
-  Gaudi::Property<bool> m_UselumiBlockMuTool {this, 
-      "UseLuminosityTool", false, 
-      "Use Luminosity Tool instead of value stored in xAOD"};
-
+  /** Handle to the selectors */
+  ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMselectors{
+    this,
+    "electronIsEMselectors",
+    {},
+    "The selectors that we need to apply to the Electron object"
+  };
+  Gaudi::Property<std::vector<std::string>> m_electronIsEMselectorResultNames{
+    this,
+    "electronIsEMselectorResultNames",
+    {},
+    "The selector result names"
+  };
+
+  ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHselectors{
+    this,
+    "electronLHselectors",
+    {},
+    "The selectors that we need to apply to the LH electron object"
+  };
+  Gaudi::Property<std::vector<std::string>> m_electronLHselectorResultNames{
+    this,
+    "electronLHselectorResultNames",
+    {},
+    "The selector result names"
+  };
+
+  ToolHandleArray<CP::ISelectionTool> m_genericIsEMselectors{
+    this,
+    "genericIsEMselectors",
+    {},
+    "The selectors that we need to apply to the generic object"
+  };
+
+  Gaudi::Property<std::vector<std::string>> m_genericIsEMselectorResultNames{
+    this,
+    "genericIsEMselectorResultNames",
+    {},
+    "The selector result names"
+  };
+
+  ToolHandleArray<IAsgPhotonIsEMSelector> m_photonIsEMselectors{
+    this,
+    "photonIsEMselectors",
+    {},
+    "The selectors that we need to apply to the pothon object"
+  };
+  Gaudi::Property<std::vector<std::string>> m_photonIsEMselectorResultNames{
+    this,
+    "photonIsEMselectorResultNames",
+    {},
+    "The selector result names"
+  };
+
+  ToolHandle<ILumiBlockMuTool> m_lumiBlockMuTool{
+    this,
+    "LuminosityTool",
+    "LumiBlockMuTool/LumiBlockMuTool",
+    "Luminosity Tool"
+  };
+
+  Gaudi::Property<std::string> m_LHValueName{ this,
+                                              "LHValueName",
+                                              "LHValue",
+                                              "The LH Value name" };
+
+  Gaudi::Property<bool> m_UselumiBlockMuTool{
+    this,
+    "UseLuminosityTool",
+    false,
+    "Use Luminosity Tool instead of value stored in xAOD"
+  };
 };
 
 #endif
 
-
-
-
-
-
-
-
-
diff --git a/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.cxx
index d56fd53301af93bdc69ed6b5d32de55f0692e16c..39bbf832e45359bbe6fb2b1e8ab80b8105d90488 100644
--- a/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.cxx
@@ -26,16 +26,18 @@
 EMShowerBuilder::EMShowerBuilder(const std::string& type,
                                  const std::string& name,
                                  const IInterface* parent)
-    : AthAlgTool(type, name, parent) {
+  : AthAlgTool(type, name, parent)
+{
   // declare interface
   declareInterface<IEMShowerBuilder>(this);
 }
 
-EMShowerBuilder::~EMShowerBuilder() {}
 
-StatusCode EMShowerBuilder::initialize() {
+StatusCode
+EMShowerBuilder::initialize()
+{
   ATH_MSG_DEBUG(
-      " Initializing EMShowerBuilder, m_cellKey = " << m_cellsKey.key());
+    " Initializing EMShowerBuilder, m_cellKey = " << m_cellsKey.key());
 
   ATH_CHECK(m_cellsKey.initialize((m_UseShowerShapeTool || m_UseCaloIsoTool) &&
                                   !m_cellsKey.key().empty()));
@@ -43,9 +45,8 @@ StatusCode EMShowerBuilder::initialize() {
   if (m_UseShowerShapeTool) {
     if ((RetrieveShowerShapeTool()).isFailure()) {
       return StatusCode::FAILURE;
-    } 
-      m_ShowerShapeTool.disable();
-    
+    }
+    m_ShowerShapeTool.disable();
   }
   //
   // call calorimeter isolation tool only if needed
@@ -53,16 +54,17 @@ StatusCode EMShowerBuilder::initialize() {
   if (m_UseCaloIsoTool) {
     if ((RetrieveHadronicLeakageTool()).isFailure()) {
       return StatusCode::FAILURE;
-    } 
-      m_HadronicLeakageTool.disable();
-    
+    }
+    m_HadronicLeakageTool.disable();
   }
   // for measuring the timing
 
   return StatusCode::SUCCESS;
 }
 
-StatusCode EMShowerBuilder::RetrieveShowerShapeTool() {
+StatusCode
+EMShowerBuilder::RetrieveShowerShapeTool()
+{
   if (m_ShowerShapeTool.empty()) {
     ATH_MSG_INFO("ShowerShape is empty");
     return StatusCode::SUCCESS;
@@ -71,7 +73,9 @@ StatusCode EMShowerBuilder::RetrieveShowerShapeTool() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode EMShowerBuilder::RetrieveHadronicLeakageTool() {
+StatusCode
+EMShowerBuilder::RetrieveHadronicLeakageTool()
+{
   if (m_HadronicLeakageTool.empty()) {
     ATH_MSG_INFO("HadronicLeakageTool is empty");
     return StatusCode::SUCCESS;
@@ -80,11 +84,17 @@ StatusCode EMShowerBuilder::RetrieveHadronicLeakageTool() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode EMShowerBuilder::finalize() { return StatusCode::SUCCESS; }
+StatusCode
+EMShowerBuilder::finalize()
+{
+  return StatusCode::SUCCESS;
+}
 
-StatusCode EMShowerBuilder::execute(const EventContext& ctx,
-                                    const CaloDetDescrManager& cmgr,
-                                    xAOD::Egamma* eg) const {
+StatusCode
+EMShowerBuilder::execute(const EventContext& ctx,
+                         const CaloDetDescrManager& cmgr,
+                         xAOD::Egamma* eg) const
+{
 
   ATH_MSG_DEBUG("Executing EMShowerBuilder::execute");
   // protection against bad pointers
@@ -103,9 +113,11 @@ StatusCode EMShowerBuilder::execute(const EventContext& ctx,
   return StatusCode::SUCCESS;
 }
 
-StatusCode EMShowerBuilder::executeWithCells(const CaloCellContainer* cellcoll,
-                                             const CaloDetDescrManager& cmgr,
-                                             xAOD::Egamma* eg) const {
+StatusCode
+EMShowerBuilder::executeWithCells(const CaloCellContainer* cellcoll,
+                                  const CaloDetDescrManager& cmgr,
+                                  xAOD::Egamma* eg) const
+{
   ATH_CHECK(CalcShowerShape(eg, cmgr, cellcoll));
   return StatusCode::SUCCESS;
 }
@@ -113,7 +125,8 @@ StatusCode EMShowerBuilder::executeWithCells(const CaloCellContainer* cellcoll,
 StatusCode
 EMShowerBuilder::CalcShowerShape(xAOD::Egamma* eg,
                                  const CaloDetDescrManager& cmgr,
-                                 const CaloCellContainer* cellcoll) const {
+                                 const CaloCellContainer* cellcoll) const
+{
   //
   // Estimate shower shapes and fill the EMShower object associated to eg
   //
@@ -152,7 +165,8 @@ StatusCode
 EMShowerBuilder::CalcHadronicLeakage(xAOD::Egamma* eg,
                                      const CaloDetDescrManager& cmgr,
                                      const xAOD::CaloCluster* clus,
-                                     const CaloCellContainer* cellcoll) const {
+                                     const CaloCellContainer* cellcoll) const
+{
   //
   // Call calorimeter isolation tool
   //
@@ -165,9 +179,9 @@ EMShowerBuilder::CalcHadronicLeakage(xAOD::Egamma* eg,
   if (m_HadronicLeakageTool.empty()) {
     return StatusCode::SUCCESS;
   }
- // calculate information concerning just the hadronic leakage
+  // calculate information concerning just the hadronic leakage
   IegammaIso::Info info;
-  StatusCode sc = m_HadronicLeakageTool->execute(*clus,cmgr,*cellcoll,info);
+  StatusCode sc = m_HadronicLeakageTool->execute(*clus, cmgr, *cellcoll, info);
   if (sc.isFailure()) {
     ATH_MSG_WARNING("call to Iso returns failure for execute");
     return sc;
@@ -190,7 +204,8 @@ EMShowerBuilder::CalcHadronicLeakage(xAOD::Egamma* eg,
 
 StatusCode
 EMShowerBuilder::FillEMShowerShape(xAOD::Egamma* eg,
-                                   const IegammaShowerShape::Info& info) const {
+                                   const IegammaShowerShape::Info& info) const
+{
 
   // protection in case Tool does not exist
   if (m_ShowerShapeTool.empty()) {
@@ -332,8 +347,8 @@ EMShowerBuilder::FillEMShowerShape(xAOD::Egamma* eg,
   value = static_cast<float>(info.emaxs1);
   valueSecond = static_cast<float>(info.esec1);
   eg->setShowerShapeValue(fabs(value + valueSecond) > 0.
-                              ? (value - valueSecond) / (value + valueSecond)
-                              : 0.,
+                            ? (value - valueSecond) / (value + valueSecond)
+                            : 0.,
                           xAOD::EgammaParameters::Eratio);
 
   value = static_cast<float>(info.emins1);
diff --git a/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.h b/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.h
index 1f263603f56c3f1311d8fb9996e0543dc73e6c72..0d4a92ed61bb681bc5e4486da0988d6f3a74ef4c 100644
--- a/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/EMShowerBuilder.h
@@ -6,129 +6,153 @@
 #define EGAMMATOOLS_EMSHOWERBUILDER_H
 /**
    @class EMShowerBuilder
-   EMShower data object builder : 
-   - Get pointing information associated to the cluster from the egammaqpoint tool
+   EMShower data object builder :
+   - Get pointing information associated to the cluster from the egammaqpoint
+   tool
    - Get shower depth associated to the cluster from the egammaqgcld tool
    - Define a Calo Cell list corresponding to EM, HAD, FCAL Calo
-   - egammaIso calculates information concerning isolation behind em clusters 
+   - egammaIso calculates information concerning isolation behind em clusters
    in the hadronic calorimeter and around the em cluster
    for isolation around em clustr use cone of different sizes
    - Calculate shower shapes in all samplings from egammaShowerShape tool
-   - When running on AOD data(defined as samples which do not contain AllCalo 
-   CaloCellContainer) as there is not enough cells, the showers are not 
-   recalculated. On the other hand we try to find the original 
-   electron/photon object which matches the cluster and 
-   keep this information in the new EMShower object 
+   - When running on AOD data(defined as samples which do not contain AllCalo
+   CaloCellContainer) as there is not enough cells, the showers are not
+   recalculated. On the other hand we try to find the original
+   electron/photon object which matches the cluster and
+   keep this information in the new EMShower object
 
-   @author H. Ma 
+   @author H. Ma
    @author F. Derue
 */
 
-// INCLUDE HEADER FILES: 
-#include "GaudiKernel/Algorithm.h"
+// INCLUDE HEADER FILES:
 #include "GaudiKernel/AlgTool.h"
-#include "egammaBaseTool.h"
-#include "GaudiKernel/ToolHandle.h" 
+#include "GaudiKernel/Algorithm.h"
+#include "GaudiKernel/ToolHandle.h"
 #include "StoreGate/ReadHandleKey.h"
+#include "egammaBaseTool.h"
 
 #include "AthenaBaseComps/AthAlgTool.h"
 
 #include "egammaInterfaces/IEMShowerBuilder.h"
-#include "egammaInterfaces/IegammaShowerShape.h"
 #include "egammaInterfaces/IegammaIso.h"
+#include "egammaInterfaces/IegammaShowerShape.h"
 
+#include "xAODCaloEvent/CaloClusterFwd.h"
 #include "xAODEgamma/EgammaEnums.h"
 #include "xAODEgamma/EgammaFwd.h"
-#include "xAODCaloEvent/CaloClusterFwd.h"
-#include "xAODTracking/TrackParticleContainer.h" 
-#include "xAODTracking/VertexContainer.h" 
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/VertexContainer.h"
 
 class StoreGateSvc;
 class CaloCellContainer;
 class IChronoStatSvc;
 class CaloDetDescrManager;
 
-class EMShowerBuilder : public AthAlgTool, virtual public IEMShowerBuilder
+class EMShowerBuilder
+  : public AthAlgTool
+  , virtual public IEMShowerBuilder
 {
 public:
-
-    /** @brief Default constructor*/
-    EMShowerBuilder(const std::string& type,
-                    const std::string& name,
-                    const IInterface* parent);
-
-    /** @brief Destructor*/
-    ~EMShowerBuilder();
-
-    /** @brief initialize method*/
-    virtual StatusCode initialize() override;
-    /** @brief standard execute method */
-    virtual StatusCode execute(const EventContext& ctx,
-                               const CaloDetDescrManager& cmgr,
-                               xAOD::Egamma*) const override final;
-
-    virtual StatusCode executeWithCells(const CaloCellContainer* cellcoll,
-                                        const CaloDetDescrManager& cmgr,
-                                        xAOD::Egamma*) const override final;
-    /** @brief finalize method*/
-    virtual StatusCode finalize() override;
+  /** @brief Default constructor*/
+  EMShowerBuilder(const std::string& type,
+                  const std::string& name,
+                  const IInterface* parent);
+
+  /** @brief Destructor*/
+  ~EMShowerBuilder() = default;
+
+  /** @brief initialize method*/
+  virtual StatusCode initialize() override final;
+  /** @brief standard execute method */
+  virtual StatusCode execute(const EventContext& ctx,
+                             const CaloDetDescrManager& cmgr,
+                             xAOD::Egamma*) const override final;
+
+  virtual StatusCode executeWithCells(const CaloCellContainer* cellcoll,
+                                      const CaloDetDescrManager& cmgr,
+                                      xAOD::Egamma*) const override final;
+  /** @brief finalize method*/
+  virtual StatusCode finalize() override;
 
 private:
-    /** @brief method to retrieve ShowerBuilder tool */
-    StatusCode RetrieveShowerShapeTool();
-    /** @brief method to retrieve hadronic leakage calculation from CaloIso tool */
-    StatusCode RetrieveHadronicLeakageTool(); 
-    /** @brief calculate shower shapes*/
-    StatusCode CalcShowerShape(xAOD::Egamma* eg,
-                               const CaloDetDescrManager& cmgr,
-                               const CaloCellContainer* cellcoll) const;
-    /** @brief calculate Hadronic leakage*/
-    StatusCode CalcHadronicLeakage(xAOD::Egamma* eg,
-                                   const CaloDetDescrManager& cmgr,
-                                   const xAOD::CaloCluster* clus,
-                                   const CaloCellContainer* cellcoll) const ;
-    /** @brief fill shower detail from shower shape calculation*/
-    StatusCode FillEMShowerShape(xAOD::Egamma* eg,const IegammaShowerShape::Info& info) const ;
-
-    /** @brief Cell container*/
-    SG::ReadHandleKey<CaloCellContainer> m_cellsKey {this,
-            "CellsName", "AllCalo", "Names of containers which contain cells"};
-
-    /** @brief Obsolete enum on the layers to use for the HadLeakage variables*/
-    Gaudi::Property<std::vector<int> > m_caloNums {this,
-            "CaloNums", {}, "list of calo to treat"};     
-
-    /** @brief Tool for shower shape calculation*/
-    ToolHandle<IegammaShowerShape> m_ShowerShapeTool {this,
-            "ShowerShapeTool", "egammaShowerShape/egammashowershape", 
-            "Handle of instance of egammaShowerShape Tool to be run"};
-
-    /** @brief Tool for hadronic leakage calculation*/
-    ToolHandle<IegammaIso> m_HadronicLeakageTool {this,
-            "HadronicLeakageTool", "egammaIso", 
-            "Handle of the EMCaloIsolationTool for Hadronic leakage"};
-
-    /** @brief boolean to print results*/
-    Gaudi::Property<bool> m_Print {this,
-            "Print", false, "in case of extra prints"};
-
-    /** @brief Boolean to call shower shape calculation and filling
-        (NB: this could be important when redoing calculation from AODs) */
-    Gaudi::Property<bool> m_UseShowerShapeTool {this,
-            "UseShowerShapeTool", true, 
-            "Boolean to call shower shape calculation and filling"};
-
-    /** @brief Boolean to call calo isolation variables calculation and filling
-        (NB: this could be important when redoing calculation from AODs) */
-    Gaudi::Property<bool> m_UseCaloIsoTool {this,
-            "UseCaloIsoTool", true, 
-            "Boolean to call hadronic leakage calculation and filling"};
-
-    /** @brief boolean to know if we are looking at cosmic data */
-    Gaudi::Property<bool> m_isCosmics {this,
-            "isCosmics", false, "Boolean for use of cosmics"};
-
-    
+  /** @brief method to retrieve ShowerBuilder tool */
+  StatusCode RetrieveShowerShapeTool();
+  /** @brief method to retrieve hadronic leakage calculation from CaloIso tool
+   */
+  StatusCode RetrieveHadronicLeakageTool();
+  /** @brief calculate shower shapes*/
+  StatusCode CalcShowerShape(xAOD::Egamma* eg,
+                             const CaloDetDescrManager& cmgr,
+                             const CaloCellContainer* cellcoll) const;
+  /** @brief calculate Hadronic leakage*/
+  StatusCode CalcHadronicLeakage(xAOD::Egamma* eg,
+                                 const CaloDetDescrManager& cmgr,
+                                 const xAOD::CaloCluster* clus,
+                                 const CaloCellContainer* cellcoll) const;
+  /** @brief fill shower detail from shower shape calculation*/
+  StatusCode FillEMShowerShape(xAOD::Egamma* eg,
+                               const IegammaShowerShape::Info& info) const;
+
+  /** @brief Cell container*/
+  SG::ReadHandleKey<CaloCellContainer> m_cellsKey{
+    this,
+    "CellsName",
+    "AllCalo",
+    "Names of containers which contain cells"
+  };
+
+  /** @brief Obsolete enum on the layers to use for the HadLeakage variables*/
+  Gaudi::Property<std::vector<int>> m_caloNums{ this,
+                                                "CaloNums",
+                                                {},
+                                                "list of calo to treat" };
+
+  /** @brief Tool for shower shape calculation*/
+  ToolHandle<IegammaShowerShape> m_ShowerShapeTool{
+    this,
+    "ShowerShapeTool",
+    "egammaShowerShape/egammashowershape",
+    "Handle of instance of egammaShowerShape Tool to be run"
+  };
+
+  /** @brief Tool for hadronic leakage calculation*/
+  ToolHandle<IegammaIso> m_HadronicLeakageTool{
+    this,
+    "HadronicLeakageTool",
+    "egammaIso",
+    "Handle of the EMCaloIsolationTool for Hadronic leakage"
+  };
+
+  /** @brief boolean to print results*/
+  Gaudi::Property<bool> m_Print{ this,
+                                 "Print",
+                                 false,
+                                 "in case of extra prints" };
+
+  /** @brief Boolean to call shower shape calculation and filling
+      (NB: this could be important when redoing calculation from AODs) */
+  Gaudi::Property<bool> m_UseShowerShapeTool{
+    this,
+    "UseShowerShapeTool",
+    true,
+    "Boolean to call shower shape calculation and filling"
+  };
+
+  /** @brief Boolean to call calo isolation variables calculation and filling
+      (NB: this could be important when redoing calculation from AODs) */
+  Gaudi::Property<bool> m_UseCaloIsoTool{
+    this,
+    "UseCaloIsoTool",
+    true,
+    "Boolean to call hadronic leakage calculation and filling"
+  };
+
+  /** @brief boolean to know if we are looking at cosmic data */
+  Gaudi::Property<bool> m_isCosmics{ this,
+                                     "isCosmics",
+                                     false,
+                                     "Boolean for use of cosmics" };
 };
 
 #endif
diff --git a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx
index 630db579b640ab93e2c2ded5f3ae395db67546fb..22683c98faff29c3f71c1d68ccbfabd7ca6b8518 100644
--- a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx
@@ -9,19 +9,18 @@
 #include "egammaRecEvent/egammaRec.h"
 #include "egammaRecEvent/egammaRecContainer.h"
 
-
 #include "xAODCaloEvent/CaloCluster.h"
-#include "xAODTracking/TrackParticle.h" 
-#include "xAODTracking/TrackParticleContainer.h" 
 #include "xAODEgamma/EgammaxAODHelpers.h"
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/TrackParticleContainer.h"
 
-#include "egammaUtils/CandidateMatchHelpers.h"
 #include "CaloUtils/CaloCellList.h"
 #include "FourMomUtils/P4Helpers.h"
+#include "egammaUtils/CandidateMatchHelpers.h"
 
+#include "GaudiKernel/EventContext.h"
 #include "SGTools/CurrentEventStore.h"
 #include "StoreGate/ReadHandle.h"
-#include "GaudiKernel/EventContext.h"
 
 #include <cmath>
 
@@ -29,119 +28,125 @@
 
 EMTrackMatchBuilder::EMTrackMatchBuilder(const std::string& type,
                                          const std::string& name,
-                                         const IInterface* parent) : 
-  AthAlgTool(type, name, parent)
+                                         const IInterface* parent)
+  : AthAlgTool(type, name, parent)
 {
   // declare interface
   declareInterface<IEMTrackMatchBuilder>(this);
 }
 
-EMTrackMatchBuilder::~EMTrackMatchBuilder() { 
-}
-
-StatusCode EMTrackMatchBuilder::initialize()
+StatusCode
+EMTrackMatchBuilder::initialize()
 {
   ATH_CHECK(m_TrackParticlesKey.initialize());
-  
+
   // the extrapolation tool
   ATH_CHECK(m_extrapolationTool.retrieve());
 
   // set things up for the sorting
   m_sorter = TrackMatchSorter(m_distanceForScore);
-  m_deltaEtaWeight = 1.0/m_deltaEtaResolution;
-  m_deltaPhiWeight = 1.0/m_deltaPhiResolution;
-  m_deltaPhiRescaleWeight = 1.0/m_deltaPhiRescaleResolution;
+  m_deltaEtaWeight = 1.0 / m_deltaEtaResolution;
+  m_deltaPhiWeight = 1.0 / m_deltaPhiResolution;
+  m_deltaPhiRescaleWeight = 1.0 / m_deltaPhiRescaleResolution;
 
   return StatusCode::SUCCESS;
 }
 
-StatusCode EMTrackMatchBuilder::executeRec(const EventContext& ctx, 
-                                           EgammaRecContainer* egammas) const
+StatusCode
+EMTrackMatchBuilder::executeRec(const EventContext& ctx,
+                                EgammaRecContainer* egammas) const
 {
   // protection against bad pointers
-  if (egammas==nullptr ) {
+  if (egammas == nullptr) {
     return StatusCode::SUCCESS;
   }
   // retrieve the trackparticle container
-  SG::ReadHandle<xAOD::TrackParticleContainer> trackPC(m_TrackParticlesKey, ctx);
+  SG::ReadHandle<xAOD::TrackParticleContainer> trackPC(m_TrackParticlesKey,
+                                                       ctx);
 
   // check is only used for serial running; remove when MT scheduler used
-  if( !trackPC.isValid() ) {
-    ATH_MSG_ERROR("Couldn't retrieve TrackParticle container with key: " << m_TrackParticlesKey.key());
+  if (!trackPC.isValid()) {
+    ATH_MSG_ERROR("Couldn't retrieve TrackParticle container with key: "
+                  << m_TrackParticlesKey.key());
     return StatusCode::FAILURE;
   }
-  //Loop over calling the trackExecute method
-  for (egammaRec* eg: *egammas){ 
+  // Loop over calling the trackExecute method
+  for (egammaRec* eg : *egammas) {
     // retrieve the cluster
-    ATH_CHECK(trackExecute(ctx,eg,trackPC.cptr()));
+    ATH_CHECK(trackExecute(ctx, eg, trackPC.cptr()));
   }
   return StatusCode::SUCCESS;
 }
 
-StatusCode EMTrackMatchBuilder::trackExecute(const EventContext& ctx, egammaRec* eg, 
-                                             const xAOD::TrackParticleContainer* trackPC) const
+StatusCode
+EMTrackMatchBuilder::trackExecute(
+  const EventContext& ctx,
+  egammaRec* eg,
+  const xAOD::TrackParticleContainer* trackPC) const
 {
-  if (!eg || !trackPC){
-    ATH_MSG_WARNING("trackExecute: NULL pointer to egammaRec or TrackParticleContainer");
+  if (!eg || !trackPC) {
+    ATH_MSG_WARNING(
+      "trackExecute: NULL pointer to egammaRec or TrackParticleContainer");
     return StatusCode::SUCCESS;
   }
   // retrieve corresponding cluster
   const xAOD::CaloCluster* cluster = eg->caloCluster();
   // check if the cluster is sane
-  if (cluster && cluster->e() ==0.0) {
+  if (cluster && cluster->e() == 0.0) {
     ATH_MSG_WARNING("trackExecute: cluster energy is 0.0! Ignoring cluster.");
     return StatusCode::SUCCESS;
   }
 
   // Loop over tracks and fill TrackMatch vector
-  std::vector<TrackMatch> trkMatches; 
+  std::vector<TrackMatch> trkMatches;
   xAOD::TrackParticleContainer::const_iterator trkIt = trackPC->begin();
-  for (unsigned int trackNumber = 0; trkIt != trackPC->end(); ++trkIt, ++trackNumber) 
-  {
-    //Avoid TRT alone
-    if(xAOD::EgammaHelpers::numberOfSiHits(*trkIt) < 4){
+  for (unsigned int trackNumber = 0; trkIt != trackPC->end();
+       ++trkIt, ++trackNumber) {
+    // Avoid TRT alone
+    if (xAOD::EgammaHelpers::numberOfSiHits(*trkIt) < 4) {
       continue;
     }
-    /* 
-     * Try with normal directions. 
+    /*
+     * Try with normal directions.
      * For cosmics allow a retry with inverted direction.
      */
-    if (isCandidateMatch(cluster, (*trkIt), false)){
-      inBroadWindow(ctx, trkMatches, *cluster, trackNumber, 
-                    (**trkIt), Trk::alongMomentum);
-    }
-    else if (m_isCosmics && isCandidateMatch(cluster, (*trkIt), true)){
-      inBroadWindow(ctx, trkMatches, *cluster,  trackNumber, 
-                    (**trkIt), Trk::oppositeMomentum);
+    if (isCandidateMatch(cluster, (*trkIt), false)) {
+      inBroadWindow(
+        ctx, trkMatches, *cluster, trackNumber, (**trkIt), Trk::alongMomentum);
+    } else if (m_isCosmics && isCandidateMatch(cluster, (*trkIt), true)) {
+      inBroadWindow(ctx,
+                    trkMatches,
+                    *cluster,
+                    trackNumber,
+                    (**trkIt),
+                    Trk::oppositeMomentum);
     }
   }
 
-  if(!trkMatches.empty()){
-    //sort the track matches
+  if (!trkMatches.empty()) {
+    // sort the track matches
     std::sort(trkMatches.begin(), trkMatches.end(), m_sorter);
-    //set the matching values
-    TrackMatch bestTrkMatch=trkMatches.at(0);
-    eg->setDeltaEta (bestTrkMatch.deltaEta); 
-    eg->setDeltaPhi (bestTrkMatch.deltaPhi); 
-    eg->setDeltaPhiRescaled (bestTrkMatch.deltaPhiRescaled); 
+    // set the matching values
+    TrackMatch bestTrkMatch = trkMatches.at(0);
+    eg->setDeltaEta(bestTrkMatch.deltaEta);
+    eg->setDeltaPhi(bestTrkMatch.deltaPhi);
+    eg->setDeltaPhiRescaled(bestTrkMatch.deltaPhiRescaled);
     eg->setDeltaPhiLast(bestTrkMatch.deltaPhiLast);
 
-    //set the element Links
+    // set the element Links
     typedef ElementLink<xAOD::TrackParticleContainer> EL;
     std::vector<EL> trackParticleLinks;
-    trackParticleLinks.reserve (trkMatches.size());
+    trackParticleLinks.reserve(trkMatches.size());
     const std::string key = EL(*trackPC, 0).dataID();
     IProxyDict* sg = SG::CurrentEventStore::store();
     for (const TrackMatch& m : trkMatches) {
-      ATH_MSG_DEBUG("Match  dR: "<< m.dR
-                    <<" second  dR: "<< m.seconddR
-                    <<" hasPix: "<< m.hasPix
-                    <<" hitsScore: " << m.hitsScore); 
-      if (key.empty()){
-        trackParticleLinks.emplace_back (*trackPC, m.trackNumber, sg);
-      }
-      else{
-        trackParticleLinks.emplace_back (key, m.trackNumber, sg);
+      ATH_MSG_DEBUG("Match  dR: " << m.dR << " second  dR: " << m.seconddR
+                                  << " hasPix: " << m.hasPix
+                                  << " hitsScore: " << m.hitsScore);
+      if (key.empty()) {
+        trackParticleLinks.emplace_back(*trackPC, m.trackNumber, sg);
+      } else {
+        trackParticleLinks.emplace_back(key, m.trackNumber, sg);
       }
     }
     eg->setTrackParticles(trackParticleLinks);
@@ -152,72 +157,69 @@ StatusCode EMTrackMatchBuilder::trackExecute(const EventContext& ctx, egammaRec*
 bool
 EMTrackMatchBuilder::inBroadWindow(const EventContext& ctx,
                                    std::vector<TrackMatch>& trackMatches,
-                                   const xAOD::CaloCluster&   cluster, 
-                                   int                        trackNumber,
+                                   const xAOD::CaloCluster& cluster,
+                                   int trackNumber,
                                    const xAOD::TrackParticle& trkPB,
                                    const Trk::PropDirection dir) const
 {
 
-  IEMExtrapolationTools::TrkExtrapDef extrapFrom = IEMExtrapolationTools::fromPerigee;
-
+  IEMExtrapolationTools::TrkExtrapDef extrapFrom =
+    IEMExtrapolationTools::fromPerigee;
 
   // Now get the delta eta/phi and eta correction at the calorimeter
   // final arrays that we will write
   // Save the value of deltaPhiRescale. If we do not use rescaled
   // perigee, we recalculate deltaPhi using rescaled momentum. This
   // will be saved in EMTrackMatch
-  std::array<double,4>  eta = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  phi = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  deltaEta = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  deltaPhi = {-999.0,-999.0,-999.0,-999.0};
- 
+  std::array<double, 4> eta = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> phi = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> deltaEta = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> deltaPhi = { -999.0, -999.0, -999.0, -999.0 };
+
   /*
    * Try both from perigee
    * and from perigee Rescale.
    *
    * We need anyhow both to be there at the end.
    */
-  if (m_extrapolationTool->getMatchAtCalo (ctx,
-                                           cluster, 
-                                           trkPB, 
-                                           dir, 
-                                           eta,
-                                           phi,
-                                           deltaEta, 
-                                           deltaPhi, 
-                                           extrapFrom).isFailure()) 
-  {
+  if (m_extrapolationTool
+        ->getMatchAtCalo(
+          ctx, cluster, trkPB, dir, eta, phi, deltaEta, deltaPhi, extrapFrom)
+        .isFailure()) {
     return false;
   }
 
-  IEMExtrapolationTools::TrkExtrapDef extrapFromRes = IEMExtrapolationTools::fromPerigeeRescaled;
-  std::array<double,4>  etaRes = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  phiRes = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  deltaEtaRes = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  deltaPhiRes = {-999.0,-999.0,-999.0,-999.0};
- 
-  if (m_extrapolationTool->getMatchAtCalo (ctx, 
-                                           cluster, 
-                                           trkPB, 
-                                           dir, 
-                                           etaRes,
-                                           phiRes,
-                                           deltaEtaRes, 
-                                           deltaPhiRes, 
-                                           extrapFromRes).isFailure())
-  {
+  IEMExtrapolationTools::TrkExtrapDef extrapFromRes =
+    IEMExtrapolationTools::fromPerigeeRescaled;
+  std::array<double, 4> etaRes = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> phiRes = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> deltaEtaRes = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> deltaPhiRes = { -999.0, -999.0, -999.0, -999.0 };
+
+  if (m_extrapolationTool
+        ->getMatchAtCalo(ctx,
+                         cluster,
+                         trkPB,
+                         dir,
+                         etaRes,
+                         phiRes,
+                         deltaEtaRes,
+                         deltaPhiRes,
+                         extrapFromRes)
+        .isFailure()) {
     return false;
   }
- 
+
   double deltaPhiRescale = deltaPhiRes[2];
   /*
-   * Sanity check for very far away matches 
-   * The assumption is when we rescale we should be in the 
+   * Sanity check for very far away matches
+   * The assumption is when we rescale we should be in the
    * correct neighborhood for a valid track-cluster pair.
    */
-  if(fabs(deltaPhiRes[2]) > m_MaxDeltaPhiRescale){
-    ATH_MSG_DEBUG("DeltaPhiRescaled above maximum: " << deltaPhiRes[2] << 
-                  " (max: " << m_MaxDeltaPhiRescale << ")" );
+  if (fabs(deltaPhiRes[2]) > m_MaxDeltaPhiRescale) {
+    ATH_MSG_DEBUG("DeltaPhiRescaled above maximum: "
+                  << deltaPhiRes[2] << " (max: " << m_MaxDeltaPhiRescale
+                  << ")");
     return false;
   }
   /*
@@ -225,231 +227,243 @@ EMTrackMatchBuilder::inBroadWindow(const EventContext& ctx,
    * If this fails and the cluster Et is larger than the track Pt
    * it might get matched only under the rescaled assumption that
    * should be less sensitive to radiative losses.
-   */ 
-  if(fabs(deltaEta[2]) < m_narrowDeltaEta &&
-     deltaPhi[2] < m_narrowDeltaPhi && 
-     deltaPhi[2] > -m_narrowDeltaPhiBrem){
-    ATH_MSG_DEBUG("Matched with Perigee") ;
-  }
-  else if(m_SecondPassRescale && 
-          cluster.et() > trkPB.pt() &&
-          fabs(deltaEtaRes[2]) < m_narrowDeltaEta &&
-          deltaPhiRes[2] < m_narrowDeltaPhiRescale && 
-          deltaPhiRes[2] > -m_narrowDeltaPhiRescaleBrem){
-    ATH_MSG_DEBUG("Not Perigee but matched with Rescale") ;
-  }
-  else{
-    ATH_MSG_DEBUG("Normal matched Failed deltaPhi/deltaEta " << deltaPhi[2] <<" / "<< deltaEta[2]);
-    ATH_MSG_DEBUG("Rescaled matched Failed deltaPhi/deltaEta " << deltaPhiRes[2] <<" / "<< deltaEtaRes[2] );
+   */
+  if (fabs(deltaEta[2]) < m_narrowDeltaEta && deltaPhi[2] < m_narrowDeltaPhi &&
+      deltaPhi[2] > -m_narrowDeltaPhiBrem) {
+    ATH_MSG_DEBUG("Matched with Perigee");
+  } else if (m_SecondPassRescale && cluster.et() > trkPB.pt() &&
+             fabs(deltaEtaRes[2]) < m_narrowDeltaEta &&
+             deltaPhiRes[2] < m_narrowDeltaPhiRescale &&
+             deltaPhiRes[2] > -m_narrowDeltaPhiRescaleBrem) {
+    ATH_MSG_DEBUG("Not Perigee but matched with Rescale");
+  } else {
+    ATH_MSG_DEBUG("Normal matched Failed deltaPhi/deltaEta "
+                  << deltaPhi[2] << " / " << deltaEta[2]);
+    ATH_MSG_DEBUG("Rescaled matched Failed deltaPhi/deltaEta "
+                  << deltaPhiRes[2] << " / " << deltaEtaRes[2]);
     return false;
   }
 
-  //Always the deltaPhiLast will be from the last measurement
-  IEMExtrapolationTools::TrkExtrapDef extrapFrom1 = IEMExtrapolationTools::fromLastMeasurement;
-  std::array<double,4>  eta1 = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  phi1 = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  deltaEta1 = {-999.0,-999.0,-999.0,-999.0};
-  std::array<double,4>  deltaPhi1 = {-999.0,-999.0,-999.0,-999.0};
- 
-  if (m_extrapolationTool->getMatchAtCalo (ctx,
-                                           cluster, 
-                                           trkPB, 
-                                           dir, 
-                                           eta1,
-                                           phi1,
-                                           deltaEta1, 
-                                           deltaPhi1, 
-                                           extrapFrom1).isFailure())
-  {
+  // Always the deltaPhiLast will be from the last measurement
+  IEMExtrapolationTools::TrkExtrapDef extrapFrom1 =
+    IEMExtrapolationTools::fromLastMeasurement;
+  std::array<double, 4> eta1 = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> phi1 = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> deltaEta1 = { -999.0, -999.0, -999.0, -999.0 };
+  std::array<double, 4> deltaPhi1 = { -999.0, -999.0, -999.0, -999.0 };
+
+  if (m_extrapolationTool
+        ->getMatchAtCalo(ctx,
+                         cluster,
+                         trkPB,
+                         dir,
+                         eta1,
+                         phi1,
+                         deltaEta1,
+                         deltaPhi1,
+                         extrapFrom1)
+        .isFailure()) {
     ATH_MSG_DEBUG("Extrapolation from last measurement failed");
     return false;
   }
   double deltaPhiLast = deltaPhi1[2];
   ATH_MSG_DEBUG("Rescale dPhi " << deltaPhiRescale);
-  ATH_MSG_DEBUG("dPhi Last measurement " << deltaPhiLast);      
+  ATH_MSG_DEBUG("dPhi Last measurement " << deltaPhiLast);
   /*
    * Done with extrapolation
    * Lets do the matching logic
    */
   TrackMatch trkmatch;
-  //Add the matching variable to the TrackMAtch
-  trkmatch.deltaEta=deltaEta; 
-  trkmatch.deltaPhi=deltaPhi; 
-  trkmatch.deltaPhiRescaled=deltaPhiRes; 
-  trkmatch.deltaPhiLast=deltaPhiLast; 
-
-  //Variables used for the sorting. Note both dPhi's will be used.
-  trkmatch.trackNumber=trackNumber;
-  if(m_useRescaleMetric){
-    trkmatch.dR = sqrt(std::pow(m_deltaEtaWeight*deltaEta[2], 2) +
-                       std::pow(m_deltaPhiRescaleWeight*deltaPhiRescale, 2));
-    trkmatch.seconddR = sqrt(std::pow(m_deltaEtaWeight*deltaEta[2], 2) +
-                             std::pow(m_deltaPhiWeight*deltaPhi[2], 2));
-    }
-  else{
-    trkmatch.dR = sqrt(std::pow(m_deltaEtaWeight*deltaEta[2], 2) +
-                       std::pow(m_deltaPhiWeight*deltaPhi[2], 2));
-    trkmatch.seconddR = sqrt(std::pow(m_deltaEtaWeight*deltaEta[2], 2) +
-                             std::pow(m_deltaPhiRescaleWeight*deltaPhiRescale, 2));
+  // Add the matching variable to the TrackMAtch
+  trkmatch.deltaEta = deltaEta;
+  trkmatch.deltaPhi = deltaPhi;
+  trkmatch.deltaPhiRescaled = deltaPhiRes;
+  trkmatch.deltaPhiLast = deltaPhiLast;
+
+  // Variables used for the sorting. Note both dPhi's will be used.
+  trkmatch.trackNumber = trackNumber;
+  if (m_useRescaleMetric) {
+    trkmatch.dR = sqrt(std::pow(m_deltaEtaWeight * deltaEta[2], 2) +
+                       std::pow(m_deltaPhiRescaleWeight * deltaPhiRescale, 2));
+    trkmatch.seconddR = sqrt(std::pow(m_deltaEtaWeight * deltaEta[2], 2) +
+                             std::pow(m_deltaPhiWeight * deltaPhi[2], 2));
+  } else {
+    trkmatch.dR = sqrt(std::pow(m_deltaEtaWeight * deltaEta[2], 2) +
+                       std::pow(m_deltaPhiWeight * deltaPhi[2], 2));
+    trkmatch.seconddR =
+      sqrt(std::pow(m_deltaEtaWeight * deltaEta[2], 2) +
+           std::pow(m_deltaPhiRescaleWeight * deltaPhiRescale, 2));
   }
-  ATH_MSG_DEBUG(" DR " << trkmatch.dR <<" deltaPhi " 
-                << deltaPhi[2] <<" deltaEta "<< deltaEta[2]);   
+  ATH_MSG_DEBUG(" DR " << trkmatch.dR << " deltaPhi " << deltaPhi[2]
+                       << " deltaEta " << deltaEta[2]);
   /*
-   * The first thing to check in 
-   * finding the best track match
-   * Prefer pixel over SCT only 
+   * The first thing is
+   * Prefer pixel over SCT only
    */
-  int nPixel=0;
-  uint8_t uint8_value=0;
-  //Check number of pixel hits
-  if (trkPB.summaryValue(uint8_value,  xAOD::numberOfPixelDeadSensors)){
-    nPixel+=uint8_value;
+  int nPixel = 0;
+  uint8_t uint8_value = 0;
+  // Check number of pixel hits
+  if (trkPB.summaryValue(uint8_value, xAOD::numberOfPixelDeadSensors)) {
+    nPixel += uint8_value;
   }
-  if (trkPB.summaryValue(uint8_value,  xAOD::numberOfPixelHits)){
-    nPixel+=uint8_value;
+  if (trkPB.summaryValue(uint8_value, xAOD::numberOfPixelHits)) {
+    nPixel += uint8_value;
   }
   trkmatch.hasPix = (nPixel > 0);
+
   /*
-   * Seconday score based on hits to be used 
+   * Seconday hitsScore score based on hits to be used
    * for track that are very close
-   * to each other at the calo, 
+   * to each other at the calo i.e similar dR with cluster,
    * pick the longest possible one
    */
-  trkmatch.hitsScore=0;
-  if(m_useScoring){
-    //Check the 2 innermost layers
-    int nInnerMost =0;
-    if (trkPB.summaryValue(uint8_value,  xAOD::numberOfInnermostPixelLayerHits)){
-      nInnerMost+=uint8_value;
+  trkmatch.hitsScore = 0;
+  if (m_useScoring) {
+    // Check the 2 innermost layers
+    int nInnerMost = 0;
+    if (trkPB.summaryValue(uint8_value,
+                           xAOD::numberOfInnermostPixelLayerHits)) {
+      nInnerMost += uint8_value;
     }
-    int expectInnermostPixelLayerHit = 0; 
-    if (trkPB.summaryValue(uint8_value,  xAOD::expectInnermostPixelLayerHit)){
-      expectInnermostPixelLayerHit+=uint8_value;
+    int expectInnermostPixelLayerHit = 0;
+    if (trkPB.summaryValue(uint8_value, xAOD::expectInnermostPixelLayerHit)) {
+      expectInnermostPixelLayerHit += uint8_value;
     }
-    int nNextToInnerMost =0;
-    if (trkPB.summaryValue(uint8_value,  xAOD::numberOfNextToInnermostPixelLayerHits)){
-      nNextToInnerMost+=uint8_value;
+    int nNextToInnerMost = 0;
+    if (trkPB.summaryValue(uint8_value,
+                           xAOD::numberOfNextToInnermostPixelLayerHits)) {
+      nNextToInnerMost += uint8_value;
     }
-    int expectNextToInnermostPixelLayerHit = 0; 
-    if (trkPB.summaryValue(uint8_value,  xAOD::expectNextToInnermostPixelLayerHit)){
-      expectNextToInnermostPixelLayerHit+=uint8_value;
+    int expectNextToInnermostPixelLayerHit = 0;
+    if (trkPB.summaryValue(uint8_value,
+                           xAOD::expectNextToInnermostPixelLayerHit)) {
+      expectNextToInnermostPixelLayerHit += uint8_value;
     }
-    //Secondary score , find the longest track possible, 
-    //i.e the one with the most inner hists  in the pixel 
-    //npixel*5 
-    trkmatch.hitsScore+=(nPixel*5);
-    //Extra points for NextToInnermost
-    if(!expectNextToInnermostPixelLayerHit ||  nNextToInnerMost>0){
-      trkmatch.hitsScore+=5;
+    // Secondary score , find the longest track possible,
+    // i.e the one with the most inner hists  in the pixel
+    // npixel*5
+    trkmatch.hitsScore += (nPixel * 5);
+    // Extra points for NextToInnermost
+    if (!expectNextToInnermostPixelLayerHit || nNextToInnerMost > 0) {
+      trkmatch.hitsScore += 5;
     }
-    //Extra points for Innermost
-    if(!expectInnermostPixelLayerHit ||  nInnerMost>0){
-      trkmatch.hitsScore+=10;
+    // Extra points for Innermost
+    if (!expectInnermostPixelLayerHit || nInnerMost > 0) {
+      trkmatch.hitsScore += 10;
     }
-  }  
-  ATH_MSG_DEBUG("hasPix : " <<trkmatch.hasPix <<" hitsScore : " <<trkmatch.hitsScore);
+  }
+  ATH_MSG_DEBUG("hasPix : " << trkmatch.hasPix
+                            << " hitsScore : " << trkmatch.hitsScore);
 
   trackMatches.push_back(trkmatch);
   return true;
 }
 
 bool
-EMTrackMatchBuilder::isCandidateMatch(const xAOD::CaloCluster*  cluster,
+EMTrackMatchBuilder::isCandidateMatch(const xAOD::CaloCluster* cluster,
                                       const xAOD::TrackParticle* track,
-                                      bool                      flip) const
+                                      bool flip) const
 {
   // loose cluster-track matching
-  if ( !m_useCandidateMatch ) {
+  if (!m_useCandidateMatch) {
     return true;
   }
- 
-  //Tracking
-  const Trk::Perigee& candidatePerigee =track->perigeeParameters();
-  //Decide whether to try the opposite direction (cosmics)
-  const double trkPhi = (!flip) ? candidatePerigee.parameters()[Trk::phi] : -candidatePerigee.parameters()[Trk::phi];
-  const double trkEta = (!flip) ? candidatePerigee.eta() : -candidatePerigee.eta();
-  const double  z_perigee=candidatePerigee.position().z();
-  const double  r_perigee=candidatePerigee.position().perp();
+
+  // Tracking
+  const Trk::Perigee& candidatePerigee = track->perigeeParameters();
+  // Decide whether to try the opposite direction (cosmics)
+  const double trkPhi = (!flip) ? candidatePerigee.parameters()[Trk::phi]
+                                : -candidatePerigee.parameters()[Trk::phi];
+  const double trkEta =
+    (!flip) ? candidatePerigee.eta() : -candidatePerigee.eta();
+  const double z_perigee = candidatePerigee.position().z();
+  const double r_perigee = candidatePerigee.position().perp();
   const Amg::Vector3D PerigeeXYZPosition(candidatePerigee.position().x(),
                                          candidatePerigee.position().y(),
                                          z_perigee);
-  //Cluster variables
-  const double clusterEta=cluster->eta();
-  const bool isEndCap= !xAOD::EgammaHelpers::isBarrel(cluster);
-  const double Et= cluster->e()/cosh(trkEta);
-  const double clusterPhi=cluster->phi();
-
-  //Avoid clusters with |eta| > 10 or Et less than 10 MeV
-  if(fabs(clusterEta)>10.0 || Et <10){
+  // Cluster variables
+  const double clusterEta = cluster->eta();
+  const bool isEndCap = !xAOD::EgammaHelpers::isBarrel(cluster);
+  const double Et = cluster->e() / cosh(trkEta);
+  const double clusterPhi = cluster->phi();
+
+  // Avoid clusters with |eta| > 10 or Et less than 10 MeV
+  if (fabs(clusterEta) > 10.0 || Et < 10) {
     return false;
   }
-   //Calculate the eta/phi of the cluster as would be seen from the perigee position of the Track
-  const Amg::Vector3D XYZClusterWrtTrackPerigee = CandidateMatchHelpers::approxXYZwrtPoint(*cluster,
-                                                                                           PerigeeXYZPosition,
-                                                                                           isEndCap);
-
-  const double clusterEtaCorrected=XYZClusterWrtTrackPerigee.eta(); 
-  //check eta match . Both metrics need to fail in order to disgard the track
-  if ( (fabs(clusterEta - trkEta) > 2.*m_broadDeltaEta) && 
-       (fabs(clusterEtaCorrected- trkEta) > 2.*m_broadDeltaEta)){
-    ATH_MSG_DEBUG(" Fails broad window eta match (track eta, cluster eta, cluster eta corrected): ( " 
-                  << trkEta << ", " << clusterEta <<", "<<clusterEtaCorrected<<")" );
+  // Calculate the eta/phi of the cluster as would be seen from the perigee
+  // position of the Track
+  const Amg::Vector3D XYZClusterWrtTrackPerigee =
+    CandidateMatchHelpers::approxXYZwrtPoint(
+      *cluster, PerigeeXYZPosition, isEndCap);
+
+  const double clusterEtaCorrected = XYZClusterWrtTrackPerigee.eta();
+  // check eta match . Both metrics need to fail in order to disgard the track
+  if ((fabs(clusterEta - trkEta) > 2. * m_broadDeltaEta) &&
+      (fabs(clusterEtaCorrected - trkEta) > 2. * m_broadDeltaEta)) {
+    ATH_MSG_DEBUG(" Fails broad window eta match (track eta, cluster eta, "
+                  "cluster eta corrected): ( "
+                  << trkEta << ", " << clusterEta << ", " << clusterEtaCorrected
+                  << ")");
     return false;
   }
-  //Calculate the possible rotation of the track 
-  //Once assuming the cluster Et being the better estimate (e.g big brem)
-  const double phiRotRescaled = CandidateMatchHelpers::PhiROT(Et,trkEta, 
-                                                              track->charge(),
-                                                              r_perigee,
-                                                              isEndCap)  ;
-  //And also assuming the track Pt being correct 
-  const double phiRotTrack = CandidateMatchHelpers::PhiROT(track->pt(),
-                                                           trkEta, 
-                                                           track->charge(),
-                                                           r_perigee,
-                                                           isEndCap)  ;
+  // Calculate the possible rotation of the track
+  // Once assuming the cluster Et being the better estimate (e.g big brem)
+  const double phiRotRescaled = CandidateMatchHelpers::PhiROT(
+    Et, trkEta, track->charge(), r_perigee, isEndCap);
+  // And also assuming the track Pt being correct
+  const double phiRotTrack = CandidateMatchHelpers::PhiROT(
+    track->pt(), trkEta, track->charge(), r_perigee, isEndCap);
   //
-  const double clusterPhiCorrected=XYZClusterWrtTrackPerigee.phi();   
-  //deltaPhi between the track and the cluster 
+  const double clusterPhiCorrected = XYZClusterWrtTrackPerigee.phi();
+  // deltaPhi between the track and the cluster
   const double deltaPhiStd = P4Helpers::deltaPhi(clusterPhiCorrected, trkPhi);
-  //deltaPhi between the track and the cluster accounting for rotation assuming cluster Et is a better estimator
-  const double trkPhiRescaled= P4Helpers::deltaPhi(trkPhi, phiRotRescaled);
-  const double deltaPhiRescaled = P4Helpers::deltaPhi(clusterPhiCorrected, trkPhiRescaled);
-  //deltaPhi between the track and the cluster accounting for rotation
+  // deltaPhi between the track and the cluster accounting for rotation assuming
+  // cluster Et is a better estimator
+  const double trkPhiRescaled = P4Helpers::deltaPhi(trkPhi, phiRotRescaled);
+  const double deltaPhiRescaled =
+    P4Helpers::deltaPhi(clusterPhiCorrected, trkPhiRescaled);
+  // deltaPhi between the track and the cluster accounting for rotation
   const double trkPhiCorrTrack = P4Helpers::deltaPhi(trkPhi, phiRotTrack);
-  const double deltaPhiTrack = P4Helpers::deltaPhi(clusterPhiCorrected, trkPhiCorrTrack);
- 
-  //It has to fail all phi metrics in order to be disgarded
-  if ( (fabs(deltaPhiRescaled) > 2.*m_broadDeltaPhi) && 
-       (fabs(deltaPhiTrack) > 2.*m_broadDeltaPhi) && 
-       (fabs(deltaPhiStd) > 2.*m_broadDeltaPhi) ){
-    ATH_MSG_DEBUG("FAILS broad window phi match (track phi, phirotCluster , phiRotTrack , "
-                  <<"cluster phi corrected, cluster phi): ( " 
-                  << trkPhi << ", " << phiRotRescaled<< ", "<<phiRotTrack<< ", " 
-                  <<clusterPhiCorrected<<  ", " <<clusterPhi <<")" );
+  const double deltaPhiTrack =
+    P4Helpers::deltaPhi(clusterPhiCorrected, trkPhiCorrTrack);
+
+  // It has to fail all phi metrics in order to be disgarded
+  if ((fabs(deltaPhiRescaled) > 2. * m_broadDeltaPhi) &&
+      (fabs(deltaPhiTrack) > 2. * m_broadDeltaPhi) &&
+      (fabs(deltaPhiStd) > 2. * m_broadDeltaPhi)) {
+
+    ATH_MSG_DEBUG(
+      "FAILS broad window phi match (track phi, phirotCluster , phiRotTrack , "
+      << "cluster phi corrected, cluster phi): ( " << trkPhi << ", "
+      << phiRotRescaled << ", " << phiRotTrack << ", " << clusterPhiCorrected
+      << ", " << clusterPhi << ")");
+
     return false;
   }
-  //if not false returned we end up here
+  // if not false returned we end up here
   return true;
 }
 
-bool EMTrackMatchBuilder::TrackMatchSorter::operator()(
+bool
+EMTrackMatchBuilder::TrackMatchSorter::operator()(
   const EMTrackMatchBuilder::TrackMatch& match1,
   const EMTrackMatchBuilder::TrackMatch& match2)
 {
-  if(match1.hasPix != match2.hasPix) {// prefer pixels first
+  if (match1.hasPix != match2.hasPix) { // prefer pixels first
     return match1.hasPix;
   }
-  //sqrt(0.025**2)*sqrt(2)/sqrt(12) ~ 0.01
-  if(fabs(match1.dR-match2.dR) < m_distance) {
+  // sqrt(0.025**2)*sqrt(2)/sqrt(12) ~ 0.01
+  if (fabs(match1.dR - match2.dR) < m_distance) {
 
-    if(fabs(match1.seconddR-match2.seconddR) > m_distance ){ //Can the second distance separate them?
-      return match1.seconddR < match2.seconddR	;
+    if (fabs(match1.seconddR - match2.seconddR) >
+        m_distance) { // Can the second distance separate them?
+      return match1.seconddR < match2.seconddR;
     }
-    if((match1.hitsScore!= match2.hitsScore)){ //use the one with more pixel
-      return match1.hitsScore>match2.hitsScore;
+    if ((match1.hitsScore != match2.hitsScore)) { // use the one with more pixel
+      return match1.hitsScore > match2.hitsScore;
     }
   }
-  //closest DR
+  // closest DR
   return match1.dR < match2.dR;
 }
diff --git a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.h b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.h
index bca5cb1f6386170ad0fcd2cb625d2e8bbf0a0d40..548e131593750a67ccfdaadf20f2fb3d926b91d1 100644
--- a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.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 EGAMMATOOLS_EMTRACKMATCHBUILDER_H
@@ -12,49 +12,55 @@
   @author RD schaffer
   @author Thomas Koffas
   @author Christos Anastopoulos
-  The matching of a track to a cluster is driven by the EMTrackMatchBuilder tool located in the Reconstruction/egamma/egammaTools package. 
+  The matching of a track to a cluster is driven by the EMTrackMatchBuilder tool
+  located in the Reconstruction/egamma/egammaTools package.
   */
 
 // INCLUDE HEADER FILES:
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "egammaInterfaces/IEMTrackMatchBuilder.h"
+#include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
 #include "egammaInterfaces/IEMExtrapolationTools.h"
+#include "egammaInterfaces/IEMTrackMatchBuilder.h"
 #include "egammaRecEvent/egammaRecContainer.h"
-#include "GaudiKernel/ToolHandle.h" 
-#include "GaudiKernel/EventContext.h"
 
-#include "xAODCaloEvent/CaloClusterFwd.h"
-#include "xAODTracking/TrackParticleContainerFwd.h" 
-#include "TrkEventPrimitives/PropDirection.h"
 #include "StoreGate/ReadHandleKey.h"
+#include "TrkEventPrimitives/PropDirection.h"
+#include "xAODCaloEvent/CaloClusterFwd.h"
+#include "xAODTracking/TrackParticleContainerFwd.h"
 
-namespace Reco  { class ITrackToVertex; }
+namespace Reco {
+class ITrackToVertex;
+}
 
-class EMTrackMatchBuilder : public AthAlgTool, virtual public IEMTrackMatchBuilder
+class EMTrackMatchBuilder
+  : public AthAlgTool
+  , virtual public IEMTrackMatchBuilder
 {
 
 public:
-
   /** @brief Default constructor*/
   EMTrackMatchBuilder(const std::string& type,
                       const std::string& name,
                       const IInterface* parent);
 
   /** @brief Destructor*/
-  ~EMTrackMatchBuilder();
+  virtual ~EMTrackMatchBuilder() = default;
 
   /** @brief Gaudi algorithm hooks*/
-  StatusCode initialize() override;
+  StatusCode initialize() override final;
   /** @brief execute method*/
-  virtual StatusCode executeRec(const EventContext& ctx, 
-                                EgammaRecContainer* egammas) const override final;
+  virtual StatusCode executeRec(
+    const EventContext& ctx,
+    EgammaRecContainer* egammas) const override final;
+
   /** @brief execute method*/
-  virtual StatusCode trackExecute(const EventContext& ctx, 
-                                  egammaRec* eg,  
-                                  const xAOD::TrackParticleContainer * trackPC) const override final;
+  virtual StatusCode trackExecute(
+    const EventContext& ctx,
+    egammaRec* eg,
+    const xAOD::TrackParticleContainer* trackPC) const override final;
 
 private:
-
   /** @brief A structure for keeping track match information */
   struct TrackMatch
   {
@@ -65,17 +71,19 @@ private:
     double dR;
     double seconddR;
     double deltaPhiLast;
-    std::array<double,4> deltaEta;
-    std::array<double,4> deltaPhi;
-    std::array<double,4> deltaPhiRescaled;
+    std::array<double, 4> deltaEta;
+    std::array<double, 4> deltaPhi;
+    std::array<double, 4> deltaPhiRescaled;
   };
 
   /** @brief function object to sort track matches based on quality */
   class TrackMatchSorter
   {
   public:
-    TrackMatchSorter(double distance = 0.0) : m_distance(distance) {};
+    TrackMatchSorter(double distance = 0.0)
+      : m_distance(distance){};
     bool operator()(const TrackMatch& match1, const TrackMatch& match2);
+
   private:
     double m_distance;
   };
@@ -83,106 +91,156 @@ private:
   /** @brief Compute for tracks passing the loose matching
     the distance between track extrapolated to 2nd sampling and cluster */
   bool inBroadWindow(const EventContext& ctx,
-                     std::vector<TrackMatch>&      trackMatches,
-                     const xAOD::CaloCluster&      cluster, 
-                     int                           trackNumber,
-                     const xAOD::TrackParticle&    trkPB,
-                     const Trk::PropDirection      dir) const;
+                     std::vector<TrackMatch>& trackMatches,
+                     const xAOD::CaloCluster& cluster,
+                     int trackNumber,
+                     const xAOD::TrackParticle& trkPB,
+                     const Trk::PropDirection dir) const;
 
   /** @brief Loose track-cluster matching */
-  bool isCandidateMatch(const xAOD::CaloCluster*  cluster,
+  bool isCandidateMatch(const xAOD::CaloCluster* cluster,
                         const xAOD::TrackParticle* track,
-                        bool                       flip) const;
-
+                        bool flip) const;
 
   // configuration:
   /** @brief name of TrackParticle container in TDS*/
-  SG::ReadHandleKey<xAOD::TrackParticleContainer>  m_TrackParticlesKey { this,
-    "TrackParticlesName", "",
-    "Name of the input track particle container"};
+  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_TrackParticlesKey{
+    this,
+    "TrackParticlesName",
+    "",
+    "Name of the input track particle container"
+  };
 
   /** @brief broad cut on deltaEta*/
-  Gaudi::Property<double> m_broadDeltaEta {this,
-    "broadDeltaEta", 0.1, "Value of broad cut for delta eta"};
+  Gaudi::Property<double> m_broadDeltaEta{ this,
+                                           "broadDeltaEta",
+                                           0.1,
+                                           "Value of broad cut for delta eta" };
 
   /** @brief broad cut on deltaPhi*/
-  Gaudi::Property<double> m_broadDeltaPhi {this,
-    "broadDeltaPhi", 0.1, "Value of broad cut for delta phi"};
+  Gaudi::Property<double> m_broadDeltaPhi{ this,
+                                           "broadDeltaPhi",
+                                           0.1,
+                                           "Value of broad cut for delta phi" };
 
   /** @brief narrow cut on deltaEta*/
-  Gaudi::Property<double> m_narrowDeltaEta {this,
-    "narrowDeltaEta", 0.05,
-    "Value of narrow cut for delta eta"};
+  Gaudi::Property<double> m_narrowDeltaEta{
+    this,
+    "narrowDeltaEta",
+    0.05,
+    "Value of narrow cut for delta eta"
+  };
 
   /** @brief narrow cut on deltaPhiRescale*/
-  Gaudi::Property<double> m_narrowDeltaPhi {this,
-    "narrowDeltaPhi", 0.05,
-    "Value of the narrowd cut for delta phi"};
+  Gaudi::Property<double> m_narrowDeltaPhi{
+    this,
+    "narrowDeltaPhi",
+    0.05,
+    "Value of the narrowd cut for delta phi"
+  };
 
   /** @brief narrow cut on deltaPhi for electrons*/
-  Gaudi::Property<double> m_narrowDeltaPhiBrem {this,
-    "narrowDeltaPhiBrem", 0.1,
-    "Value of the narrow cut for delta phi  Brem"};
+  Gaudi::Property<double> m_narrowDeltaPhiBrem{
+    this,
+    "narrowDeltaPhiBrem",
+    0.1,
+    "Value of the narrow cut for delta phi  Brem"
+  };
 
   /** @brief narrow cut on deltaPhiRescale*/
-  Gaudi::Property<double> m_narrowDeltaPhiRescale {this,
-    "narrowDeltaPhiRescale",  0.05,
-    "Value of the narrow cut for delta phi Rescale"};
+  Gaudi::Property<double> m_narrowDeltaPhiRescale{
+    this,
+    "narrowDeltaPhiRescale",
+    0.05,
+    "Value of the narrow cut for delta phi Rescale"
+  };
 
   /** @brief narrow cut on deltaPhiRescale for electrons*/
-  Gaudi::Property<double> m_narrowDeltaPhiRescaleBrem {this,
-    "narrowDeltaPhiRescaleBrem", 0.1,
-    "Value of the narrow cut for delta phi Rescale Brem"};
+  Gaudi::Property<double> m_narrowDeltaPhiRescaleBrem{
+    this,
+    "narrowDeltaPhiRescaleBrem",
+    0.1,
+    "Value of the narrow cut for delta phi Rescale Brem"
+  };
 
   /** @Maximum deltaPhi (Res) allowed for a match */
-  Gaudi::Property<double> m_MaxDeltaPhiRescale {this,
-    "MaxDeltaPhiRescale", 0.25,
-    "Maximum Value of the deltaPhi rescale"};
+  Gaudi::Property<double> m_MaxDeltaPhiRescale{
+    this,
+    "MaxDeltaPhiRescale",
+    0.25,
+    "Maximum Value of the deltaPhi rescale"
+  };
 
   /** @brief flag to turn on/off use of isCandidateMatch*/
-  Gaudi::Property<bool> m_useCandidateMatch {this,
-    "useCandidateMatch", true,
-    "Boolean to use candidate matching"};
+  Gaudi::Property<bool> m_useCandidateMatch{
+    this,
+    "useCandidateMatch",
+    true,
+    "Boolean to use candidate matching"
+  };
 
   /** @brief Boolean to apply heuristic when tracks have close deltaR */
-  Gaudi::Property<bool> m_useScoring {this,
-    "useScoring", true,
-    "Boolean to apply heuristic when tracks have close deltaR"};
+  Gaudi::Property<bool> m_useScoring{
+    this,
+    "useScoring",
+    true,
+    "Boolean to apply heuristic when tracks have close deltaR"
+  };
 
   /** @brief Boolean to use Rescale in the metric*/
-  Gaudi::Property<bool> m_useRescaleMetric {this,
-    "UseRescaleMetric", true, "Use Rescale Metric"};
+  Gaudi::Property<bool> m_useRescaleMetric{ this,
+                                            "UseRescaleMetric",
+                                            true,
+                                            "Use Rescale Metric" };
 
   /** @brief Boolean to do second pass with Rescale*/
-  Gaudi::Property<bool> m_SecondPassRescale {this,
-    "SecondPassRescale", true, "Do second pass with rescale"};
+  Gaudi::Property<bool> m_SecondPassRescale{ this,
+                                             "SecondPassRescale",
+                                             true,
+                                             "Do second pass with rescale" };
 
   /// The resolutions:  might be good to split in barrel/end-cap in the future
-  Gaudi::Property<float> m_deltaEtaResolution {this,
-      "DeltaEtaResolution", 1.0, "The deltaEta resolution"};
-
-  Gaudi::Property<float> m_deltaPhiResolution {this,
-      "DeltaPhiResolution", 1.0, "The deltaPhi resolution"};
-
-  Gaudi::Property<float> m_deltaPhiRescaleResolution {this,
-      "DeltaPhiRescaleResolution", 1.0,
-      "The deltaPhiRescale resolution"};
+  Gaudi::Property<float> m_deltaEtaResolution{ this,
+                                               "DeltaEtaResolution",
+                                               1.0,
+                                               "The deltaEta resolution" };
+
+  Gaudi::Property<float> m_deltaPhiResolution{ this,
+                                               "DeltaPhiResolution",
+                                               1.0,
+                                               "The deltaPhi resolution" };
+
+  Gaudi::Property<float> m_deltaPhiRescaleResolution{
+    this,
+    "DeltaPhiRescaleResolution",
+    1.0,
+    "The deltaPhiRescale resolution"
+  };
 
-  /** @brief The distance from which one goes from using better deltaR to using score.
-      Note that this distance varies depending on the resolutions entered above.
-      If you don't use resolutions (resolution = 1.0) this becomes deltaR distance.
+  /** @brief The distance from which one goes from using better deltaR to using
+     score. Note that this distance varies depending on the resolutions entered
+     above. If you don't use resolutions (resolution = 1.0) this becomes deltaR
+     distance.
   */
-  Gaudi::Property<float> m_distanceForScore {this,
-      "DistanceForScore", 0.01,
-      "The distance from which one goes from using better deltaR to using score."};
-  
-  ToolHandle<IEMExtrapolationTools> m_extrapolationTool {this,
-    "ExtrapolationTool", "EMExtrapolationTools",
-    "Name of the extrapolation tool"};
+  Gaudi::Property<float> m_distanceForScore{
+    this,
+    "DistanceForScore",
+    0.01,
+    "The distance from which one goes from using better deltaR to using score."
+  };
+
+  ToolHandle<IEMExtrapolationTools> m_extrapolationTool{
+    this,
+    "ExtrapolationTool",
+    "EMExtrapolationTools",
+    "Name of the extrapolation tool"
+  };
 
   /** @brief */
-  Gaudi::Property<bool> m_isCosmics {this, 
-      "isCosmics", false, "Boolean for use of cosmics"};
+  Gaudi::Property<bool> m_isCosmics{ this,
+                                     "isCosmics",
+                                     false,
+                                     "Boolean for use of cosmics" };
 
   // Calculated values based on resolutions
   double m_deltaEtaWeight;
@@ -190,7 +248,6 @@ private:
   double m_deltaPhiRescaleWeight;
 
   TrackMatchSorter m_sorter;
-
 };
 
 #endif
diff --git a/Reconstruction/egamma/egammaTools/src/egammaBaseTool.cxx b/Reconstruction/egamma/egammaTools/src/egammaBaseTool.cxx
index addb54a1a8e0a379e91fa9862ece823f3e8bbe28..2660522af4355cf9bfc073f8f47b39a79ae42f68 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaBaseTool.cxx
+++ b/Reconstruction/egamma/egammaTools/src/egammaBaseTool.cxx
@@ -4,23 +4,23 @@
 
 #include "egammaBaseTool.h"
 
-
 egammaBaseTool::egammaBaseTool(const std::string& type,
-			       const std::string& name,
-			       const IInterface* parent):
-  AthAlgTool(type, name, parent)
-{ 
+                               const std::string& name,
+                               const IInterface* parent)
+  : AthAlgTool(type, name, parent)
+{
   declareInterface<IegammaBaseTool>(this);
 }
 
-egammaBaseTool::~egammaBaseTool() { 
-}
-
-StatusCode egammaBaseTool::initialize() {  
+StatusCode
+egammaBaseTool::initialize()
+{
   return StatusCode::SUCCESS;
 }
 
-StatusCode egammaBaseTool::finalize(){
+StatusCode
+egammaBaseTool::finalize()
+{
   return StatusCode::SUCCESS;
 }
 
diff --git a/Reconstruction/egamma/egammaTools/src/egammaBaseTool.h b/Reconstruction/egamma/egammaTools/src/egammaBaseTool.h
index 7108ec7992698619dd9325553ac25214389fe2b0..450efdb58002e20398ff983cdd6ed06739d77166 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaBaseTool.h
+++ b/Reconstruction/egamma/egammaTools/src/egammaBaseTool.h
@@ -7,13 +7,13 @@
 
 /**
   @class  egammaBaseTool
-          Base Tool for all egamma tool that require 
+          Base Tool for all egamma tool that require
           an egamma object as its input. Hence the specific versions
           will have access to all the framework services in addition
-          of being passed an 'egamma' object.  The derived 
-          tools must implement 
+          of being passed an 'egamma' object.  The derived
+          tools must implement
           execute(const EventContext& ctx, xAOD::Egamma* eg).
-          Used typically for constucting ToolHandleArrays of 
+          Used typically for constucting ToolHandleArrays of
           egammaTools
   @author F. Derue, A. Kaczmarska
 */
@@ -29,16 +29,16 @@ class egammaBaseTool
 
 public:
   /** @brief Default constructor*/
-   egammaBaseTool(const std::string& name,
-                  const std::string& description,
-                  const IInterface* parent);
-   /** @brief destructor*/
-   virtual ~egammaBaseTool();
+  egammaBaseTool(const std::string& name,
+                 const std::string& description,
+                 const IInterface* parent);
+  /** @brief destructor*/
+  virtual ~egammaBaseTool() = default;
 
-   /** @brief initialize method*/
-   StatusCode initialize() override;
-   /** @brief finalize method*/
-   StatusCode finalize() override;
+  /** @brief initialize method*/
+  virtual StatusCode initialize() override;
+  /** @brief finalize method*/
+  virtual StatusCode finalize() override;
 };
 
 #endif // EGAMMATOOLS_EGAMMABASETOOL_H
diff --git a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx
index 83e3e4c75b0dbce76b6b8be2f0a622f1acb48723..19be23762f1c50ebaf3cc8c770527424d5fcd360 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx
+++ b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx
@@ -3,131 +3,132 @@
 */
 
 #include "egammaLargeClusterMaker.h"
-#include "egammaUtils/egammaEnergyPositionAllSamples.h"
 #include "CaloEvent/CaloCellContainer.h"
 #include "CaloEvent/CaloClusterCellLink.h"
+#include "CaloUtils/CaloClusterStoreHelper.h"
+#include "egammaUtils/egammaEnergyPositionAllSamples.h"
 #include "xAODCaloEvent/CaloCluster.h"
 #include "xAODCaloEvent/CaloClusterAuxContainer.h"
-#include "CaloUtils/CaloClusterStoreHelper.h"
 //#include "xAODCaloEvent/CaloClusterKineHelper.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "CaloUtils/CaloLayerCalculator.h"
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
-#include "CaloUtils/CaloLayerCalculator.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
-
 
-// =============================================================
 egammaLargeClusterMaker::egammaLargeClusterMaker(const std::string& type,
-						 const std::string& name,
-						 const IInterface* parent)
+                                                 const std::string& name,
+                                                 const IInterface* parent)
   : AthAlgTool(type, name, parent)
 {
-  
+
   // declare interface
   declareInterface<CaloClusterCollectionProcessor>(this);
-  
 }
 
-// =============================================================
-StatusCode egammaLargeClusterMaker::initialize() {
-
+StatusCode
+egammaLargeClusterMaker::initialize()
+{
   ATH_MSG_DEBUG("Initializing " << name() << "...");
-  
   ATH_CHECK(m_inputClusterCollection.initialize());
   ATH_CHECK(m_cellsKey.initialize());
-
-
   ATH_MSG_DEBUG("Initialization successful");
-
   return StatusCode::SUCCESS;
 }
 
-// =========================================================================
-StatusCode egammaLargeClusterMaker::execute(const EventContext& ctx,
-					    xAOD::CaloClusterContainer* collection) const {
+StatusCode
+egammaLargeClusterMaker::execute(const EventContext& ctx,
+                                 xAOD::CaloClusterContainer* collection) const
+{
 
   if (!collection) {
     ATH_MSG_ERROR("A null collection was passed, which should never happen");
     return StatusCode::FAILURE;
   }
 
-  SG::ReadHandle<xAOD::CaloClusterContainer> inputClusters(m_inputClusterCollection, ctx);
+  SG::ReadHandle<xAOD::CaloClusterContainer> inputClusters(
+    m_inputClusterCollection, ctx);
   // retrieve the cell containers
   SG::ReadHandle<CaloCellContainer> cellcoll(m_cellsKey, ctx);
-  
-  const CaloDetDescrManager* dd_man= nullptr;
-  ATH_CHECK( detStore()->retrieve(dd_man,"CaloMgr") );
-  
+
+  const CaloDetDescrManager* dd_man = nullptr;
+  ATH_CHECK(detStore()->retrieve(dd_man, "CaloMgr"));
+
   // The main loop over clusters
   for (auto cluster : *inputClusters) {
 
-    // find the center of the cluster, copying the logic of egammaMiddleShape.cxx
+    // find the center of the cluster, copying the logic of
+    // egammaMiddleShape.cxx
 
     // check if cluster is in barrel or in the end-cap
-    if(!cluster->inBarrel() && !cluster->inEndcap() ) { 
+    if (!cluster->inBarrel() && !cluster->inEndcap()) {
       ATH_MSG_DEBUG(" Cluster is neither in Barrel nor in Endcap; skipping ");
       continue;
     }
-    
+
     // check if cluster is in barrel or end-cap
-    bool in_barrel = egammaEnergyPositionAllSamples::inBarrel(*cluster,2);
-    CaloSampling::CaloSample sam=CaloSampling::EMB2;
+    bool in_barrel = egammaEnergyPositionAllSamples::inBarrel(*cluster, 2);
+    CaloSampling::CaloSample sam = CaloSampling::EMB2;
     if (in_barrel) {
-      sam=CaloSampling::EMB2; 
+      sam = CaloSampling::EMB2;
     } else {
-      sam=CaloSampling::EME2; 
+      sam = CaloSampling::EME2;
     }
     // granularity in (eta,phi) in the pre sampler
     // CaloCellList needs both enums: subCalo and CaloSample
     auto eta = cluster->etaSample(sam);
-    auto phi= cluster->phiSample(sam);
+    auto phi = cluster->phiSample(sam);
 
-    if ((eta==0. && phi==0.) || fabs(eta)>100) {
-        return StatusCode::SUCCESS;
+    if ((eta == 0. && phi == 0.) || fabs(eta) > 100) {
+      return StatusCode::SUCCESS;
     }
-   
+
     // Should get overritten
-    bool  barrel=false;
-    CaloCell_ID::SUBCALO subcalo=CaloCell_ID::LAREM;
-    int sampling_or_module=0; 
+    bool barrel = false;
+    CaloCell_ID::SUBCALO subcalo = CaloCell_ID::LAREM;
+    int sampling_or_module = 0;
 
-    CaloDetDescrManager::decode_sample(subcalo, barrel, sampling_or_module, 
-            (CaloCell_ID::CaloSample) sam);
+    CaloDetDescrManager::decode_sample(
+      subcalo, barrel, sampling_or_module, (CaloCell_ID::CaloSample)sam);
 
     // Get the corresponding grannularities : needs to know where you are
     //                  the easiest is to look for the CaloDetDescrElement
 
     const CaloDetDescrElement* dde =
-        dd_man->get_element(CaloCell_ID::LAREM, 0,barrel,eta,phi);
+      dd_man->get_element(CaloCell_ID::LAREM, 0, barrel, eta, phi);
 
     // if object does not exist then return
     if (!dde) {
-        return StatusCode::SUCCESS;
+      return StatusCode::SUCCESS;
     }
 
     // local granularity
     auto deta = dde->deta();
     auto dphi = dde->dphi();
- 
+
     // search the hottest cell around the (eta,phi)
     // (eta,phi) are defined as etaSample() and phiSample
     // around this position a hot cell is searched for in a window
     // (m_neta*m_deta,m_nphi*m_dphi), by default (m_neta,m_nphi)=(7,7)
     CaloLayerCalculator calc;
-    StatusCode sc = calc.fill(*dd_man,cellcoll.ptr(),cluster->etaSample(sam),cluster->phiSample(sam),
-            m_neta*deta,m_nphi*dphi, (CaloSampling::CaloSample) sam);
-    if ( sc.isFailure() ) {
-        ATH_MSG_WARNING("CaloLayerCalculator failed  fill ");
+    StatusCode sc = calc.fill(*dd_man,
+                              cellcoll.ptr(),
+                              cluster->etaSample(sam),
+                              cluster->phiSample(sam),
+                              m_neta * deta,
+                              m_nphi * dphi,
+                              (CaloSampling::CaloSample)sam);
+    if (sc.isFailure()) {
+      ATH_MSG_WARNING("CaloLayerCalculator failed  fill ");
     }
     double etamax = calc.etarmax();
     double phimax = calc.phirmax();
-    
+
     // create the new cluster
-    xAOD::CaloCluster *newCluster = 
+    xAOD::CaloCluster* newCluster =
       CaloClusterStoreHelper::makeCluster(collection, cellcoll.ptr());
     newCluster->setEta0(etamax);
     newCluster->setPhi0(phimax);
-    newCluster->setClusterSize(xAOD::CaloCluster::SW_7_11);    
+    newCluster->setClusterSize(xAOD::CaloCluster::SW_7_11);
   }
   return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx
index 449164fb2356e3bf3fd5e4a22cf9f267d9ed4563..9afe98cfe36a0543bc5b81fcaa89615c2bd075fe 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx
+++ b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx
@@ -1,5 +1,5 @@
 /*
-  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 HEADER FILES:
@@ -34,7 +34,7 @@ isbadtilecell(CaloCellList& ccl,
 {
 
   bool isbadtilecell = false;
-  ccl.select(cmgr,clusterEta, clusterPhi, sizeEta, sizePhi, sample);
+  ccl.select(cmgr, clusterEta, clusterPhi, sizeEta, sizePhi, sample);
   CaloCellList::list_iterator cclIter = ccl.begin();
   CaloCellList::list_iterator cclIterEnd = ccl.end();
   for (; cclIter != cclIterEnd; cclIter++) {
@@ -58,7 +58,7 @@ egammaOQFlagsBuilder::egammaOQFlagsBuilder(const std::string& type,
   m_calocellId = nullptr;
 }
 
-egammaOQFlagsBuilder::~egammaOQFlagsBuilder() {}
+egammaOQFlagsBuilder::~egammaOQFlagsBuilder() = default;
 
 StatusCode
 egammaOQFlagsBuilder::initialize()
@@ -70,7 +70,7 @@ egammaOQFlagsBuilder::initialize()
   // Get CaloAffectedTool
   StatusCode sc = m_affectedTool.retrieve();
   if (sc.isFailure()) {
-    ATH_MSG_ERROR( "Could not retrieve CaloAffectedTool " << m_affectedTool);
+    ATH_MSG_ERROR("Could not retrieve CaloAffectedTool " << m_affectedTool);
     return StatusCode::FAILURE;
   }
 
@@ -111,8 +111,9 @@ egammaOQFlagsBuilder::findCentralCell(const xAOD::CaloCluster* cluster,
 
   for (; cellIter != cellIterEnd; cellIter++) {
     const CaloCell* cell = (*cellIter);
-    if (!cell)
+    if (!cell){
       continue;
+    }
     float eta = cell->eta();
     float phi = cell->phi();
     float energy = cell->energy();
@@ -278,68 +279,80 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx,
         }
       } else {
         if ((cell->provenance() & 0x0A00) == 0x0A00) {
+
           if (layer == CaloSampling::PreSamplerB ||
               layer == CaloSampling::PreSamplerE) {
             iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgePS);
-          }
-          if (layer == CaloSampling::EMB1 || layer == CaloSampling::EME1) {
+          } else if (layer == CaloSampling::EMB1 ||
+                     layer == CaloSampling::EME1) {
             iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgeS1);
             if (isStripCoreCell)
               iflag |= (0x1 << xAOD::EgammaParameters::BadS1Core);
-          }
-          if (layer == CaloSampling::EMB2 || layer == CaloSampling::EME2)
+          } else if (layer == CaloSampling::EMB2 ||
+                     layer == CaloSampling::EME2) {
             iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgeS2);
-          if (layer == CaloSampling::EMB3 || layer == CaloSampling::EME3)
+          } else if (layer == CaloSampling::EMB3 ||
+                     layer == CaloSampling::EME3) {
             iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgeS3);
+          }
         }
         if ((cell->provenance() & 0x0A00) == 0x0800) {
+
           if (layer == CaloSampling::PreSamplerB ||
               layer == CaloSampling::PreSamplerE) {
             iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgePS);
-          }
-          if (layer == CaloSampling::EMB1 || layer == CaloSampling::EME1) {
+          } else if (layer == CaloSampling::EMB1 ||
+                     layer == CaloSampling::EME1) {
             iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgeS1);
-            if (isStripCoreCell)
+            if (isStripCoreCell) {
               iflag |= (0x1 << xAOD::EgammaParameters::BadS1Core);
-          }
-          if (layer == CaloSampling::EMB2 || layer == CaloSampling::EME2)
+            }
+          } else if (layer == CaloSampling::EMB2 ||
+                     layer == CaloSampling::EME2) {
             iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgeS2);
-          if (layer == CaloSampling::EMB3 || layer == CaloSampling::EME3)
+          } else if (layer == CaloSampling::EMB3 ||
+                     layer == CaloSampling::EME3) {
             iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgeS3);
+          }
         }
         if (bc.sporadicBurstNoise() && qual < m_QCellSporCut) {
           iflag |= (0x1 << xAOD::EgammaParameters::SporadicNoiseLowQEdge);
         }
+
         if (bc.deadCalib() || bc.lowNoiseHG() || bc.lowNoiseMG() ||
             bc.lowNoiseLG() || bc.distorted() || bc.unstable() ||
             bc.unstableNoiseHG() || bc.unstableNoiseMG() ||
             bc.unstableNoiseLG() || bc.peculiarCalibrationLine() ||
             bc.almostDead() || bc.shortProblem()) {
+
           if (layer == CaloSampling::PreSamplerB ||
               layer == CaloSampling::PreSamplerE) {
             iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgePS);
-          }
-          if (layer == CaloSampling::EMB1 || layer == CaloSampling::EME1)
+          } else if (layer == CaloSampling::EMB1 ||
+                     layer == CaloSampling::EME1) {
             iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgeS1);
-          if (layer == CaloSampling::EMB2 || layer == CaloSampling::EME2)
+          } else if (layer == CaloSampling::EMB2 ||
+                     layer == CaloSampling::EME2) {
             iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgeS2);
-          if (layer == CaloSampling::EMB3 || layer == CaloSampling::EME3)
+          } else if (layer == CaloSampling::EMB3 ||
+                     layer == CaloSampling::EME3) {
             iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgeS3);
+          }
         }
         if (qual >= 4000) {
           iflag |= (0x1 << xAOD::EgammaParameters::HighQEdge);
         }
       }
     } // end loop over LAr cells
-    
-    //Set LArQCleaning bit
+
+    // Set LArQCleaning bit
     double egammaLArQCleaning = 0;
     if (totE != 0)
       egammaLArQCleaning = badE / totE;
     if (egammaLArQCleaning > m_LArQCut) {
       iflag |= (0x1 << xAOD::EgammaParameters::LArQCleaning);
     }
-    //Set HighRcell bit//
+    // Set HighRcell bit//
     double ratioCell = 0;
     if (totE != 0)
       ratioCell = energyCellMax / totE;
@@ -348,7 +361,7 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx,
     }
   } // close if found central cell
 
-  //Check the HV components
+  // Check the HV components
   float deta = 0;
   float dphi = 0;
 
@@ -377,7 +390,7 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx,
                                                       CaloSampling::PreSamplerB,
                                                       CaloSampling::PreSamplerB,
                                                       1));
-  if (isNonNominalHVPS){
+  if (isNonNominalHVPS) {
     iflag |= (0x1 << xAOD::EgammaParameters::NonNominalHVPS);
   }
 
@@ -395,7 +408,7 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx,
                                                 CaloSampling::PreSamplerB,
                                                 CaloSampling::PreSamplerB,
                                                 2));
-  if (isDeadHVPS){
+  if (isDeadHVPS) {
     iflag |= (0x1 << xAOD::EgammaParameters::DeadHVPS);
   }
 
diff --git a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.h b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.h
index 201c9b8b59382b127aca750b4aedbfc3b5811db1..e07e4accf59546b2a87b2d168a1e6d07d04c9fef 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.h
+++ b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.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 EGAMMATOOLS_EGAMMAOQFLAGSBUILDER_H
@@ -20,23 +20,22 @@ the EM calorimeter) and the edge (all the other cells) of the cluster.
   @author Quentin Buat quentin.buat@lpsc.in2p3.fr
 */
 
-// INCLUDE HEADER FILES: 
 #include "egammaInterfaces/IegammaOQFlagsBuilder.h"
+#include "CaloInterface/ICaloAffectedTool.h"
 #include "egammaBaseTool.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/EventContext.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArEM_ID.h"
+#include "CaloUtils/CaloCellList.h"
+#include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ToolHandle.h"
 #include "Identifier/HWIdentifier.h"
-#include "CaloIdentifier/CaloCell_ID.h"
+#include "LArCabling/LArOnOffIdMapping.h"
+#include "LArRecConditions/LArBadChannelCont.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/ReadHandleKey.h"
 #include "CaloConditions/CaloAffectedRegionInfoVec.h"
-#include "CaloInterface/ICaloAffectedTool.h"
-#include "CaloUtils/CaloCellList.h"
-#include "xAODEgamma/EgammaFwd.h"
 #include "xAODCaloEvent/CaloClusterFwd.h"
-#include "StoreGate/ReadHandleKey.h"
-#include "StoreGate/ReadCondHandleKey.h"
-#include "LArRecConditions/LArBadChannelCont.h"
-#include "LArCabling/LArOnOffIdMapping.h"
+#include "xAODEgamma/EgammaFwd.h"
 
 class IToolSvc;
 class CaloCellContainer;
@@ -48,72 +47,71 @@ class egammaOQFlagsBuilder
   : public AthAlgTool
   , virtual public IegammaOQFlagsBuilder
 {
- public:
-
+public:
   /** @brief Default constructor*/
-   egammaOQFlagsBuilder(const std::string& type,
-                        const std::string& name,
-                        const IInterface* parent);
-
-   /** @brief Destructor*/
-   ~egammaOQFlagsBuilder();
-   /** @brief initialize method*/
-   StatusCode initialize();
-   /** @brief standard execute method */
-   virtual StatusCode execute(const EventContext& ctx,
-                              const CaloDetDescrManager& cmgr,
-                              xAOD::Egamma& egamma) const;
-   /** @brief finalize method*/
-   StatusCode finalize();
-
- private:
-   /** Handle to bad-channel CDO */
-   SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey{
-     this,
-     "LArBadChannelKey",
-     "LArBadChannel",
-     "Key of the LArBadChannelCont CDO"
-   };
-
-   SG::ReadCondHandleKey<CaloAffectedRegionInfoVec> m_affKey{
-     this,
-     "LArAffectedRegionKey",
-     "LArAffectedRegionInfo",
-     "SG key for affected regions cond object"
-   };
-
-   ToolHandle<ICaloAffectedTool> m_affectedTool{ this,
-                                                 "affectedTool",
-                                                 "CaloAffectedTool",
-                                                 "CaloAffectedTool" };
-
-   const LArEM_ID* m_emHelper;
-   const CaloCell_ID* m_calocellId;
-
-   SG::ReadHandleKey<CaloCellContainer> m_cellsKey{
-     this,
-     "CellsName",
-     "AllCalo",
-     "Names of container which contain cells"
-   };
-
-   // IToolSvc* m_toolSvc;
-   bool isCore(const Identifier Id,
-               const std::vector<IdentifierHash>& neighbourList) const;
-
-   std::vector<IdentifierHash> findNeighbours(
-     const Identifier cellCentrId) const;
-   
-   bool findCentralCell(const xAOD::CaloCluster* cluster,
-                        Identifier& cellCentrId) const;
-
-   Gaudi::Property<double> m_QCellCut{ this, "QCellCut", 4000. };
-   Gaudi::Property<double> m_QCellHECCut{ this, "QCellHECCut", 60000. };
-   Gaudi::Property<double> m_QCellSporCut{ this, "QCellSporCut", 4000. };
-   Gaudi::Property<double> m_LArQCut{ this, "LArQCut", 0.8 };
-   Gaudi::Property<double> m_TCut{ this, "TCut", 10.0 };
-   Gaudi::Property<double> m_TCutVsE{ this, "TCutVsE", 2.0 };
-   Gaudi::Property<double> m_RcellCut{ this, "RcellCut", 0.8 };
+  egammaOQFlagsBuilder(const std::string& type,
+                       const std::string& name,
+                       const IInterface* parent);
+
+  /** @brief Destructor*/
+  ~egammaOQFlagsBuilder();
+  /** @brief initialize method*/
+  StatusCode initialize();
+  /** @brief standard execute method */
+  virtual StatusCode execute(const EventContext& ctx,
+                             const CaloDetDescrManager& cmgr,
+                             xAOD::Egamma& egamma) const;
+  /** @brief finalize method*/
+  StatusCode finalize();
+
+private:
+  /** Handle to bad-channel CDO */
+  SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey{
+    this,
+    "LArBadChannelKey",
+    "LArBadChannel",
+    "Key of the LArBadChannelCont CDO"
+  };
+
+  SG::ReadCondHandleKey<CaloAffectedRegionInfoVec> m_affKey{
+    this,
+    "LArAffectedRegionKey",
+    "LArAffectedRegionInfo",
+    "SG key for affected regions cond object"
+  };
+
+  ToolHandle<ICaloAffectedTool> m_affectedTool{ this,
+                                                "affectedTool",
+                                                "CaloAffectedTool",
+                                                "CaloAffectedTool" };
+
+  const LArEM_ID* m_emHelper;
+  const CaloCell_ID* m_calocellId;
+
+  SG::ReadHandleKey<CaloCellContainer> m_cellsKey{
+    this,
+    "CellsName",
+    "AllCalo",
+    "Names of container which contain cells"
+  };
+
+  // IToolSvc* m_toolSvc;
+  bool isCore(const Identifier Id,
+              const std::vector<IdentifierHash>& neighbourList) const;
+
+  std::vector<IdentifierHash> findNeighbours(
+    const Identifier cellCentrId) const;
+
+  bool findCentralCell(const xAOD::CaloCluster* cluster,
+                       Identifier& cellCentrId) const;
+
+  Gaudi::Property<double> m_QCellCut{ this, "QCellCut", 4000. };
+  Gaudi::Property<double> m_QCellHECCut{ this, "QCellHECCut", 60000. };
+  Gaudi::Property<double> m_QCellSporCut{ this, "QCellSporCut", 4000. };
+  Gaudi::Property<double> m_LArQCut{ this, "LArQCut", 0.8 };
+  Gaudi::Property<double> m_TCut{ this, "TCut", 10.0 };
+  Gaudi::Property<double> m_TCutVsE{ this, "TCutVsE", 2.0 };
+  Gaudi::Property<double> m_RcellCut{ this, "RcellCut", 0.8 };
 };
 
 #endif
diff --git a/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx b/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx
index 229edeee86e90e0378554b56d985895ab115a91c..c73af23e49179a7c159f0d94601514daf4f546a6 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx
+++ b/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx
@@ -2,17 +2,15 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-
 #include "egammaSwTool.h"
 
-
-#include "xAODCaloEvent/CaloCluster.h"
-#include "CaloUtils/CaloLayerCalculator.h"
 #include "CaloUtils/CaloClusterStoreHelper.h"
+#include "CaloUtils/CaloLayerCalculator.h"
+#include "xAODCaloEvent/CaloCluster.h"
 
 #include "GaudiKernel/ListItem.h"
 
-#include <algorithm> 
+#include <algorithm>
 #include <cmath>
 
 //  END OF HEADER FILES INCLUDE
@@ -22,28 +20,19 @@
 //  CONSTRUCTOR:
 
 egammaSwTool::egammaSwTool(const std::string& type,
-			   const std::string& name,
-			   const IInterface* parent)
+                           const std::string& name,
+                           const IInterface* parent)
   : AthAlgTool(type, name, parent)
 {
 
   // declare interface
   declareInterface<IegammaSwTool>(this);
-
-}
-
-// ===============================================================
-// DESTRUCTOR:
-egammaSwTool::~egammaSwTool()
-{ 
 }
 
-// ===============================================================
-// INITIALIZE METHOD:
-StatusCode egammaSwTool::initialize()
+StatusCode
+egammaSwTool::initialize()
 {
   ATH_MSG_DEBUG(" Initializing egammaSwTool");
-  
 
   ATH_CHECK(m_clusterCorrectionPointersEle35.retrieve());
   ATH_CHECK(m_clusterCorrectionPointersEle37.retrieve());
@@ -56,7 +45,7 @@ StatusCode egammaSwTool::initialize()
   ATH_CHECK(m_clusterCorrectionPointersEconv35.retrieve());
   ATH_CHECK(m_clusterCorrectionPointersEconv37.retrieve());
   ATH_CHECK(m_clusterCorrectionPointersEconv55.retrieve());
-  //SuperCluster
+  // SuperCluster
   ATH_CHECK(m_clusterCorrectionPointersSuperClusterEle35.retrieve());
   ATH_CHECK(m_clusterCorrectionPointersSuperClusterEle37.retrieve());
   ATH_CHECK(m_clusterCorrectionPointersSuperClusterEle55.retrieve());
@@ -71,121 +60,140 @@ StatusCode egammaSwTool::initialize()
   return StatusCode::SUCCESS;
 }
 
-// ==================================================================
-// FINALIZE METHOD:
-StatusCode egammaSwTool::finalize(){
-  return StatusCode::SUCCESS;
-}
-
-// ==============================================================
-// ATHENA EXECUTE METHOD:
-StatusCode egammaSwTool::execute(const EventContext& ctx, xAOD::CaloCluster *cluster) const { 
+StatusCode
+egammaSwTool::execute(const EventContext& ctx, xAOD::CaloCluster* cluster) const
+{
   ATH_MSG_DEBUG("Executing egammaSwTool");
-  
+
   // protection against bad clusters
-  if (cluster==nullptr) return StatusCode::SUCCESS;
+  if (cluster == nullptr)
+    return StatusCode::SUCCESS;
 
   xAOD::CaloCluster::ClusterSize requestedSize = cluster->clusterSize();
   switch (requestedSize) {
-  case xAOD::CaloCluster::SW_55ele:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersEle55,cluster));
-    break;
-  case xAOD::CaloCluster::SW_35ele:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersEle35,cluster));
-    break;
-  case xAOD::CaloCluster::SW_37ele:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersEle37,cluster));
-    break;
-  case xAOD::CaloCluster::SW_35gam:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersGam35,cluster));
-    break;
-  case xAOD::CaloCluster::SW_55gam:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersGam55,cluster));
-    break;
-  case xAOD::CaloCluster::SW_37gam:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersGam37,cluster));
-    break;
-  case xAOD::CaloCluster::SW_55Econv:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersEconv55,cluster));
-    break;
-  case xAOD::CaloCluster::SW_35Econv:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersEconv35,cluster));
-    break;
-  case xAOD::CaloCluster::SW_37Econv:
-    ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersEconv37,cluster));
-    break;
-  default:
-    ATH_MSG_DEBUG("Inexisting cluster type and calibration requested: " << requestedSize);
-    return StatusCode::FAILURE;
-    break;
+    case xAOD::CaloCluster::SW_55ele:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersEle55, cluster));
+      break;
+    case xAOD::CaloCluster::SW_35ele:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersEle35, cluster));
+      break;
+    case xAOD::CaloCluster::SW_37ele:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersEle37, cluster));
+      break;
+    case xAOD::CaloCluster::SW_35gam:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersGam35, cluster));
+      break;
+    case xAOD::CaloCluster::SW_55gam:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersGam55, cluster));
+      break;
+    case xAOD::CaloCluster::SW_37gam:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersGam37, cluster));
+      break;
+    case xAOD::CaloCluster::SW_55Econv:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersEconv55, cluster));
+      break;
+    case xAOD::CaloCluster::SW_35Econv:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersEconv35, cluster));
+      break;
+    case xAOD::CaloCluster::SW_37Econv:
+      ATH_CHECK(processTools(ctx, m_clusterCorrectionPointersEconv37, cluster));
+      break;
+    default:
+      ATH_MSG_DEBUG(
+        "Inexisting cluster type and calibration requested: " << requestedSize);
+      return StatusCode::FAILURE;
+      break;
   }
   return StatusCode::SUCCESS;
 }
 // ==============================================================
 // ATHENA EXECUTE METHOD for superClusters
 
-StatusCode egammaSwTool::execute(const EventContext& ctx, xAOD::CaloCluster* cluster, xAOD::EgammaParameters::EgammaType egType , bool isBarrel) const {
+StatusCode
+egammaSwTool::execute(const EventContext& ctx,
+                      xAOD::CaloCluster* cluster,
+                      xAOD::EgammaParameters::EgammaType egType,
+                      bool isBarrel) const
+{
   ATH_MSG_DEBUG("Executing egammaSwTool");
-  
-  // protection against bad clusters
-  if (cluster==nullptr) return StatusCode::SUCCESS;
 
-  if(isBarrel){
+  // protection against bad clusters
+  if (cluster == nullptr) {
+    return StatusCode::SUCCESS;
+  }
 
+  if (isBarrel) {
     switch (egType) {
-    case xAOD::EgammaParameters::electron:
-      ATH_MSG_DEBUG("correction for barrel electron");
-      ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersSuperClusterEle37,cluster));
-      break;
-    case xAOD::EgammaParameters::unconvertedPhoton:
-      ATH_MSG_DEBUG("correction for barrel unconverted");
-      ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersSuperClusterGam37,cluster));
-      break;
-    case xAOD::EgammaParameters::convertedPhoton:
-      ATH_MSG_DEBUG("correction for barrel converted");
-      ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersSuperClusterEconv37,cluster));
-      break;
-    default:
-      ATH_MSG_DEBUG("Inexisting correction requested for egType: " <<egType << " isBarrel: " << isBarrel);
-      return StatusCode::FAILURE;
-      break;
+      case xAOD::EgammaParameters::electron: {
+        ATH_MSG_DEBUG("correction for barrel electron");
+        ATH_CHECK(processTools(
+          ctx, m_clusterCorrectionPointersSuperClusterEle37, cluster));
+        break;
+      }
+      case xAOD::EgammaParameters::unconvertedPhoton: {
+        ATH_MSG_DEBUG("correction for barrel unconverted");
+        ATH_CHECK(processTools(
+          ctx, m_clusterCorrectionPointersSuperClusterGam37, cluster));
+        break;
+      }
+      case xAOD::EgammaParameters::convertedPhoton: {
+        ATH_MSG_DEBUG("correction for barrel converted");
+        ATH_CHECK(processTools(
+          ctx, m_clusterCorrectionPointersSuperClusterEconv37, cluster));
+        break;
+      }
+      default: {
+        ATH_MSG_DEBUG("Inexisting correction requested for egType: "
+                      << egType << " isBarrel: " << isBarrel);
+        return StatusCode::FAILURE;
+        break;
+      }
     }
-  } else{
+  } else {
     switch (egType) {
-    case xAOD::EgammaParameters::electron:
-      ATH_MSG_DEBUG("correction for endcap electron");
-      ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersSuperClusterEle55,cluster));
-      break;
-    case xAOD::EgammaParameters::unconvertedPhoton:
-      ATH_MSG_DEBUG("correction for endcap unconverted");
-      ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersSuperClusterGam55,cluster));
-      break;
-    case xAOD::EgammaParameters::convertedPhoton:
-      ATH_MSG_DEBUG("correction for endcap converted");
-      ATH_CHECK(processTools(ctx,m_clusterCorrectionPointersSuperClusterEconv55,cluster));
-      break;
-    default:
-      ATH_MSG_DEBUG("Inexisting correction requested for egType: " <<egType << " isBarrel: " << isBarrel);
-      return StatusCode::FAILURE;
-      break;
+      case xAOD::EgammaParameters::electron: {
+        ATH_MSG_DEBUG("correction for endcap electron");
+        ATH_CHECK(processTools(
+          ctx, m_clusterCorrectionPointersSuperClusterEle55, cluster));
+        break;
+      }
+      case xAOD::EgammaParameters::unconvertedPhoton: {
+        ATH_MSG_DEBUG("correction for endcap unconverted");
+        ATH_CHECK(processTools(
+          ctx, m_clusterCorrectionPointersSuperClusterGam55, cluster));
+        break;
+      }
+      case xAOD::EgammaParameters::convertedPhoton: {
+        ATH_MSG_DEBUG("correction for endcap converted");
+        ATH_CHECK(processTools(
+          ctx, m_clusterCorrectionPointersSuperClusterEconv55, cluster));
+        break;
+      }
+      default: {
+        ATH_MSG_DEBUG("Inexisting correction requested for egType: "
+                      << egType << " isBarrel: " << isBarrel);
+        return StatusCode::FAILURE;
+        break;
+      }
     }
   }
   return StatusCode::SUCCESS;
 }
 
-StatusCode egammaSwTool::processTools(const EventContext& ctx, const ToolHandleArray<CaloClusterProcessor>& tools,
-				      xAOD::CaloCluster* cluster) const
+StatusCode
+egammaSwTool::processTools(const EventContext& ctx,
+                           const ToolHandleArray<CaloClusterProcessor>& tools,
+                           xAOD::CaloCluster* cluster) const
 {
-  
   auto firstTool = tools.begin();
-  auto lastTool  = tools.end();
+  auto lastTool = tools.end();
   // loop tools
-  for ( ; firstTool != lastTool; ++firstTool ) {
-   StatusCode processCheck = (*firstTool)->execute(ctx, cluster);
-   ATH_MSG_DEBUG("Tool " << (*firstTool)->name() <<  " executing  ");
-   if ( processCheck.isFailure() ) {
-     ATH_MSG_ERROR("Cluster corrections failed!");
-   }
+  for (; firstTool != lastTool; ++firstTool) {
+    StatusCode processCheck = (*firstTool)->execute(ctx, cluster);
+    ATH_MSG_DEBUG("Tool " << (*firstTool)->name() << " executing  ");
+    if (processCheck.isFailure()) {
+      ATH_MSG_ERROR("Cluster corrections failed!");
+    }
   }
   return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/egamma/egammaTools/src/egammaSwTool.h b/Reconstruction/egamma/egammaTools/src/egammaSwTool.h
index d05840a61b27d155815f3751d0d8f35e3220780d..0211a11a25a8edc3f25a889431cdf70716817523 100644
--- a/Reconstruction/egamma/egammaTools/src/egammaSwTool.h
+++ b/Reconstruction/egamma/egammaTools/src/egammaSwTool.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 EGAMMATOOLS_EGAMMASWTOOL_H
@@ -8,89 +8,156 @@
   @class egammaSwTool
           Tool which applies positions and energy corrections to a CaloCluster
 @author D. Zerwas
-@author B. Lenzi 
-@author C. Anastopoulos 
+@author B. Lenzi
+@author C. Anastopoulos
 
 */
 
 // INCLUDE HEADER FILES:
- 
+
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "egammaInterfaces/IegammaSwTool.h" 
-#include "xAODCaloEvent/CaloClusterFwd.h"
 #include "CaloRec/CaloClusterProcessor.h"
 #include "GaudiKernel/EventContext.h"
+#include "egammaInterfaces/IegammaSwTool.h"
+#include "xAODCaloEvent/CaloClusterFwd.h"
 
-class egammaSwTool : public AthAlgTool, virtual public IegammaSwTool
+class egammaSwTool
+  : public AthAlgTool
+  , virtual public IegammaSwTool
 {
 
- public:
-
+public:
   /** @brief Default constructor*/
   egammaSwTool(const std::string& type,
-	       const std::string& name,
-	       const IInterface* parent);
+               const std::string& name,
+               const IInterface* parent);
 
   /** @brief Destructor*/
-  ~egammaSwTool();
-  
+  virtual ~egammaSwTool() = default;
+
   /** @brief initialize method*/
-  StatusCode initialize();
-  /** @brief finalize method*/
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
   /** @brief execute method*/
-  StatusCode execute(const EventContext& ctx, xAOD::CaloCluster* cluster) const;
-  StatusCode execute(const EventContext& ctx, xAOD::CaloCluster* cluster, xAOD::EgammaParameters::EgammaType egType , bool isBarrel) const ;
-
- private:
-  
-  StatusCode processTools(const EventContext& ctx, const ToolHandleArray<CaloClusterProcessor>& tools, xAOD::CaloCluster* cluster) const;
+  virtual StatusCode execute(const EventContext& ctx,
+                             xAOD::CaloCluster* cluster) const override final;
+  virtual StatusCode execute(const EventContext& ctx,
+                             xAOD::CaloCluster* cluster,
+                             xAOD::EgammaParameters::EgammaType egType,
+                             bool isBarrel) const override final;
+
+private:
+  StatusCode processTools(const EventContext& ctx,
+                          const ToolHandleArray<CaloClusterProcessor>& tools,
+                          xAOD::CaloCluster* cluster) const;
 
   /**
    * @brief a list of names for tools to correct clusters
-   * 
+   *
    * the tools in this list are executed after all maker tools are done
    * and run one after each other on each cluster in the container.  */
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersEle55{this, "ClusterCorrectionToolsEle55", {}}; 
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersEle35{this, "ClusterCorrectionToolsEle35", {}}; 
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersEle37{this, "ClusterCorrectionToolsEle37", {}}; 
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersGam35{this, "ClusterCorrectionToolsGam35", {}}; 
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersGam55{this, "ClusterCorrectionToolsGam55", {}}; 
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersGam37{this, "ClusterCorrectionToolsGam37", {}};
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersEconv55{this, "ClusterCorrectionToolsEconv55", {}}; 
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersEconv35{this, "ClusterCorrectionToolsEconv35", {}}; 
-  ToolHandleArray<CaloClusterProcessor>  m_clusterCorrectionPointersEconv37{this, "ClusterCorrectionToolsEconv37", {}}; 
-  //SuperCluster
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterEle35{this, 
-      "ClusterCorrectionToolsSuperClusterEle35", {}};
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterEconv35{this, 
-      "ClusterCorrectionToolsSuperClusterEconv35", {}};
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterGam35{this, 
-      "ClusterCorrectionToolsSuperClusterGam35", {}};
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersEle55{
+    this,
+    "ClusterCorrectionToolsEle55",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersEle35{
+    this,
+    "ClusterCorrectionToolsEle35",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersEle37{
+    this,
+    "ClusterCorrectionToolsEle37",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersGam35{
+    this,
+    "ClusterCorrectionToolsGam35",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersGam55{
+    this,
+    "ClusterCorrectionToolsGam55",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersGam37{
+    this,
+    "ClusterCorrectionToolsGam37",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersEconv55{
+    this,
+    "ClusterCorrectionToolsEconv55",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersEconv35{
+    this,
+    "ClusterCorrectionToolsEconv35",
+    {}
+  };
+  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersEconv37{
+    this,
+    "ClusterCorrectionToolsEconv37",
+    {}
+  };
+  // SuperCluster
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterEle35{
+      this,
+      "ClusterCorrectionToolsSuperClusterEle35",
+      {}
+    };
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterEconv35{
+      this,
+      "ClusterCorrectionToolsSuperClusterEconv35",
+      {}
+    };
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterGam35{
+      this,
+      "ClusterCorrectionToolsSuperClusterGam35",
+      {}
+    };
   //
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterEle55{this, 
-      "ClusterCorrectionToolsSuperClusterEle55", {}};
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterGam55{this, 
-      "ClusterCorrectionToolsSuperClusterGam55", {}};
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterEconv55{this, 
-      "ClusterCorrectionToolsSuperClusterEconv55", {}};
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterEle55{
+      this,
+      "ClusterCorrectionToolsSuperClusterEle55",
+      {}
+    };
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterGam55{
+      this,
+      "ClusterCorrectionToolsSuperClusterGam55",
+      {}
+    };
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterEconv55{
+      this,
+      "ClusterCorrectionToolsSuperClusterEconv55",
+      {}
+    };
   //
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterEle37{this, 
-      "ClusterCorrectionToolsSuperClusterEle37", {}};
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterGam37{this, 
-      "ClusterCorrectionToolsSuperClusterGam37", {}};
-  ToolHandleArray<CaloClusterProcessor> m_clusterCorrectionPointersSuperClusterEconv37{this, 
-      "ClusterCorrectionToolsSuperClusterEconv37", {}};
-
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterEle37{
+      this,
+      "ClusterCorrectionToolsSuperClusterEle37",
+      {}
+    };
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterGam37{
+      this,
+      "ClusterCorrectionToolsSuperClusterGam37",
+      {}
+    };
+  ToolHandleArray<CaloClusterProcessor>
+    m_clusterCorrectionPointersSuperClusterEconv37{
+      this,
+      "ClusterCorrectionToolsSuperClusterEconv37",
+      {}
+    };
 };
 
 #endif
 
-
-
-
-
-
-
-
-
diff --git a/Simulation/Digitization/python/DigiAlgConfig.py b/Simulation/Digitization/python/DigiAlgConfig.py
index 77ace3912f900b3659b152f6ca777ca44ce80de8..561a10c8fb8f5fcf37ce457c74ab26af66c49ee3 100644
--- a/Simulation/Digitization/python/DigiAlgConfig.py
+++ b/Simulation/Digitization/python/DigiAlgConfig.py
@@ -478,6 +478,7 @@ def getSplitNoMergeFFPileUpToolsList():
 
 def getStandardPileUpToolsAlg(name="StandardPileUpToolsAlg", **kwargs):
     kwargs.setdefault('PileUpTools', getStandardPileUpToolsList() )
+    kwargs.setdefault('ExtraInputs', [('xAOD::EventInfo', 'EventInfo')])
     from Digitization.DigitizationFlags import digitizationFlags
     if digitizationFlags.doXingByXingPileUp():
         return CfgMgr.PileUpToolsAlg(name, **kwargs)
diff --git a/Simulation/Digitization/python/DigitizationConfigFlags.py b/Simulation/Digitization/python/DigitizationConfigFlags.py
index 57f81782e310fcc85d2f50c9613c86c5dba69684..f03f4c0cf4fbdcf35176bd2c8eff8f0e2c8ee2be 100644
--- a/Simulation/Digitization/python/DigitizationConfigFlags.py
+++ b/Simulation/Digitization/python/DigitizationConfigFlags.py
@@ -67,5 +67,7 @@ def createDigitizationCfgFlags():
     flags.addFlag("Digitization.AddCaloDigi", False)
     # Integer offset to random seed initialisation
     flags.addFlag("Digitization.RandomSeedOffset", 0)
+    # Digitization extra input dependencies
+    flags.addFlag("Digitization.ExtraInputs", [("xAOD::EventInfo", "EventInfo")])
     return flags
 
diff --git a/Simulation/Digitization/python/PileUpToolsConfig.py b/Simulation/Digitization/python/PileUpToolsConfig.py
index cbb73ab792c1905f7c371e65c3ae168bf4ac67bb..e8b4af5e4624d99f33f7d2916b1510429d1904e6 100644
--- a/Simulation/Digitization/python/PileUpToolsConfig.py
+++ b/Simulation/Digitization/python/PileUpToolsConfig.py
@@ -20,6 +20,9 @@ def PileUpToolsCfg(flags, name="StandardPileUpToolsAlg", **kwargs):
     if not isinstance(PileUpTools, list):
         kwargs["PileUpTools"] = [PileUpTools]
 
+    # declare common extra inputs
+    kwargs["ExtraInputs"] = flags.Digitization.ExtraInputs
+
     # choose the correct alg
     if flags.Digitization.DoXingByXingPileUp:
         Alg = PileUpToolsAlg
diff --git a/Simulation/Digitization/share/FixDataDependenciesForMT.py b/Simulation/Digitization/share/FixDataDependenciesForMT.py
index 55e5c44ea4ad3447e0094d6bf6f0a53ef685ac32..2ed696a90745365778a82e42c994a6ac5a9bc187 100644
--- a/Simulation/Digitization/share/FixDataDependenciesForMT.py
+++ b/Simulation/Digitization/share/FixDataDependenciesForMT.py
@@ -54,8 +54,8 @@ if DetFlags.digitize.TGC_on():
     StreamRDOExtraInputs += [( 'TgcRdoContainer' , 'StoreGateSvc+TGCRDO' ),
                              ( 'MuonSimDataCollection' , 'StoreGateSvc+TGC_SDO' )]
 
-topSequence.StandardPileUpToolsAlg.ExtraInputs = digiExtraInputs
-topSequence.StandardPileUpToolsAlg.ExtraOutputs = digiExtraOutputs
+topSequence.StandardPileUpToolsAlg.ExtraInputs += digiExtraInputs
+topSequence.StandardPileUpToolsAlg.ExtraOutputs += digiExtraOutputs
 
 from AthenaCommon.AppMgr import theApp
 StreamRDO = theApp.getOutputStream( "StreamRDO" )
diff --git a/Simulation/Digitization/test/DigitizationComparisonNew_test.py b/Simulation/Digitization/test/DigitizationComparisonNew_test.py
index c3141dbe7338a8d69c6927be6507b3fec60842b4..0f0dd4d13dc7aaac691c0816e99ae6ea43a6c673 100755
--- a/Simulation/Digitization/test/DigitizationComparisonNew_test.py
+++ b/Simulation/Digitization/test/DigitizationComparisonNew_test.py
@@ -5,10 +5,9 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 """
 import sys
 from AthenaCommon.Logging import log
-from AthenaCommon.Constants import DEBUG, WARNING
+from AthenaCommon.Constants import DEBUG
 from AthenaCommon.Configurable import Configurable
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
-from AthenaConfiguration.TestDefaults import defaultTestFiles
 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
@@ -25,6 +24,7 @@ from LArDigitization.LArDigitizationConfigNew import LArTriggerDigitizationCfg
 from TileSimAlgs.TileDigitizationConfig import TileDigitizationCfg, TileTriggerDigitizationCfg
 from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg
 from OverlayConfiguration.OverlayTestHelpers import JobOptsDumperCfg
+from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
 
 # Set up logging and new style config
 log.setLevel(DEBUG)
@@ -60,6 +60,12 @@ acc.merge(PoolReadCfg(ConfigFlags))
 acc.merge(PoolWriteCfg(ConfigFlags))
 acc.merge(writeDigitizationMetadata(ConfigFlags))
 
+# Old EventInfo conversion
+if "EventInfo" not in ConfigFlags.Input.Collections:
+    acc.merge(EventInfoCnvAlgCfg(ConfigFlags,
+                                 inputKey="McEventInfo",
+                                 outputKey="EventInfo"))
+
 # Inner Detector
 acc.merge(BCM_DigitizationCfg(ConfigFlags))
 acc.merge(PixelDigitizationCfg(ConfigFlags))
diff --git a/Simulation/Digitization/test/DigitizationConfigNew_test.py b/Simulation/Digitization/test/DigitizationConfigNew_test.py
index bda86c6d9f34b4d50b1b37815c8dd09a1619b525..21bed961c1b818458ad2637be0d41bdc5c8d26d1 100755
--- a/Simulation/Digitization/test/DigitizationConfigNew_test.py
+++ b/Simulation/Digitization/test/DigitizationConfigNew_test.py
@@ -24,6 +24,7 @@ from MuonConfig.CSC_DigitizationConfig import CSC_DigitizationDigitToRDOCfg
 from LArDigitization.LArDigitizationConfigNew import LArTriggerDigitizationCfg
 from TileSimAlgs.TileDigitizationConfig import TileDigitizationCfg, TileTriggerDigitizationCfg
 from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg
+from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
 
 # Set up logging and new style config
 log.setLevel(DEBUG)
@@ -45,6 +46,12 @@ acc.merge(PoolReadCfg(ConfigFlags))
 acc.merge(PoolWriteCfg(ConfigFlags))
 acc.merge(writeDigitizationMetadata(ConfigFlags))
 
+# Old EventInfo conversion
+if "EventInfo" not in ConfigFlags.Input.Collections:
+    acc.merge(EventInfoCnvAlgCfg(ConfigFlags,
+                                 inputKey="McEventInfo",
+                                 outputKey="EventInfo"))
+
 # Inner Detector
 acc.merge(BCM_DigitizationCfg(ConfigFlags))
 acc.merge(PixelDigitizationCfg(ConfigFlags))
diff --git a/Tools/PROCTools/data/master_q221_AOD_digest.ref b/Tools/PROCTools/data/master_q221_AOD_digest.ref
index 875c9e0059df7ff7f6de2b3ce537cd10901472ca..210c184fddb4160df7483fcdef624421d6ea4def 100644
--- a/Tools/PROCTools/data/master_q221_AOD_digest.ref
+++ b/Tools/PROCTools/data/master_q221_AOD_digest.ref
@@ -13,12 +13,12 @@
       284500    87473091          43          49           3           0           2           1           1           5           2           3
       284500    87473096          72          76           3           2           2           0           2           3           2           1
       284500    87473104          61          63           6           0           6           1           5           5           4           1
-      284500    87473114          93          78           7           2          13           1          12           8           5           3
+      284500    87473114          93          80           7           2          13           1          12           8           5           3
       284500    87473121          93         100           6           3          16           4          12           6           5           1
       284500    87473132          81          58           9           1          11           0          11           4           4           0
       284500    87473137          81          71           8           3          15           0          15           6           6           0
       284500    87473144          83          67           7           1           6           0           6           8           5           3
-      284500    87473154          89          89           7           0          10           2           8           8           4           4
+      284500    87473154          89          88           7           0          10           2           8           8           4           4
       284500    87473162          52          52           3           0           7           0           7           3           2           1
       284500    87473167          74          54           6           3          12           2          10          13           8           5
       284500    87473171          82          70           8           3           4           2           2           5           3           2
diff --git a/Tools/PROCTools/data/master_q431_AOD_digest.ref b/Tools/PROCTools/data/master_q431_AOD_digest.ref
index 7601ecfd0c02496387da5da6cd41126fc184c31c..83524e312f5e124fb56c41ca175df124a9e61386 100644
--- a/Tools/PROCTools/data/master_q431_AOD_digest.ref
+++ b/Tools/PROCTools/data/master_q431_AOD_digest.ref
@@ -18,7 +18,7 @@
       330470  1183753006         357         377          11           3
       330470  1183754806         470         406          15           0
       330470  1183769295         342         317           8           1
-      330470  1183769939         348         341          11           3
+      330470  1183769939         348         340          11           3
       330470  1183773832         307         198           7           0
       330470  1183775209          57           0           0           0
       330470  1183787124         431         361          11           2
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc
index c47bd50e8749ec48d92d2b2ba7edf1e49e1519e4..bb0819538c31458e33d8e3251b51e6ca72afaa3b 100644
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc
@@ -2,6 +2,8 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include <stdexcept>
+
 namespace Trk {
 // constructor with parameters
 inline Trk::ResidualPull::ResidualPull(
diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
index 5502b0f6f8b05c12ca66f2e3acaab969624ade12..f8172519a74522820ec1896a28d4e724510c49d7 100644
--- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
+++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
@@ -7192,12 +7192,16 @@ namespace Trk {
   ) const {
     GXFTrackState *firstmeasstate, *lastmeasstate;
     std::tie(firstmeasstate, lastmeasstate) = oldtrajectory.findFirstLastMeasurement();
-    const TrackParameters *per = nullptr;
+    std::unique_ptr<const TrackParameters> per(nullptr);
 
     if (cache.m_acceleration && !m_matupdator.empty()) {
-      const TrackParameters *prevpar = firstmeasstate->trackParameters();
-      const TrackParameters *tmppar = firstmeasstate->trackParameters();
+      std::unique_ptr<const TrackParameters> prevpar(
+        firstmeasstate->trackParameters() != nullptr ?
+        firstmeasstate->trackParameters()->clone() :
+        nullptr
+      );
       std::vector<std::pair<const Layer *, const Layer *>> & upstreamlayers = oldtrajectory.upstreamMaterialLayers();
+      bool first = true;
       
       for (int i = (int)upstreamlayers.size() - 1; i >= 0; i--) {
         if (prevpar == nullptr) {
@@ -7222,23 +7226,25 @@ namespace Trk {
             continue;
           }
           
-          if (distsol.first() * distsol.second() < 0 && prevpar != firstmeasstate->trackParameters()) {
+          if (distsol.first() * distsol.second() < 0 && !first) {
             continue;
           }
         }
         
-        if (prevpar == firstmeasstate->trackParameters() && distance > 0) {
+        if (first && distance > 0) {
           propdir = alongMomentum;
         }
 
-        const TrackParameters *layerpar = m_propagator->propagate(
-          ctx,
-          *prevpar,
-          layer->surfaceRepresentation(), 
-          propdir,
-          true,
-          oldtrajectory.m_fieldprop,
-          nonInteracting
+        std::unique_ptr<const TrackParameters> layerpar(
+          m_propagator->propagate(
+            ctx,
+            *prevpar,
+            layer->surfaceRepresentation(),
+            propdir,
+            true,
+            oldtrajectory.m_fieldprop,
+            nonInteracting
+          )
         );
         
         if (layerpar == nullptr) {
@@ -7246,18 +7252,65 @@ namespace Trk {
         }
         
         if (layer->surfaceRepresentation().bounds().inside(layerpar->localPosition())) {
-          const TrackParameters *updatedpar = m_matupdator->update(layerpar, *layer, oppositeMomentum, matEffects);
-          if ((updatedpar != nullptr) && updatedpar != layerpar) {
-            delete layerpar;
-            layerpar = updatedpar;
+          /*
+           * WARNING: Possible memory aliasing. As far as I can tell, the
+           * update method either returns its argument pointer (thereby not
+           * allocating new memory), or allocates new memory on the heap, or
+           * returns a nullptr.
+           *
+           * In other words, the user of this method cannot be sure whether the
+           * pointer returned is an alias of the argument pointer without
+           * additional checks. It also seems to free the memory pointed at in
+           * some cases.
+           *
+           * This sort of duplicity does not work well with C++ smart pointers,
+           * so it's up to the developer to ensure that the memory is handled
+           * safely.
+           *
+           * Stephen Nicholas Swatman <stephen.nicholas.swatman@cern.ch>
+           * August 11th, 2020
+           */
+          const TrackParameters * updatedpar = m_matupdator->update(layerpar.get(), *layer, oppositeMomentum, matEffects);
+
+          if (updatedpar != nullptr) {
+            if (updatedpar != layerpar.get()) {
+              /*
+               * Updating succeeded, and the result is the not the same pointer
+               * that we used as input for our method. This means that the
+               * update method freed the contents of our smart pointer. We need
+               * to replace the contents of our smart pointer _without_
+               * invoking the automatic freeing mechanism.
+               */
+              layerpar.release();
+              layerpar.reset(updatedpar);
+            }
+            /*
+             * If the returned pointer is the same as the input pointer, then
+             * our smart pointer and the returned raw pointer now alias each
+             * other. That's a less than ideal situation, but we can control
+             * the scope of the returned raw pointer. If we make sure we don't
+             * do anything with this raw pointer, for example create new smart
+             * pointers from it or free it, the aliasing raw pointer will
+             * eventually go out of scope and become harmless.
+             */
+          } else {
+            /*
+             * If the updated parameters are a nullptr, then the update failed.
+             * What this means exactly is hidden in the implementation of the
+             * update method, but god help us because it seems it also frees
+             * the memory pointed to by the argument pointer. Since the pointer
+             * argument comes from a smart pointer, we must release that
+             * pointer without freeing it, to prevent RAII mechanics from
+             * freeing it again. We also have to set it to nullptr, but
+             * luckily the std::unique_ptr::release method does both those
+             * things.
+             */
+            layerpar.release();
           }
         }
-        
-        if (prevpar != firstmeasstate->trackParameters()) {
-          delete prevpar;
-        }
-        
-        prevpar = layerpar;
+
+        prevpar = std::move(layerpar);
+        first = false;
       }
       
       const Layer *startlayer = firstmeasstate->trackParameters()->associatedSurface().associatedLayer();
@@ -7302,21 +7355,19 @@ namespace Trk {
       }
       
       if (prevpar != nullptr) {
-        per = m_propagator->propagate(
-          ctx,
-          *prevpar,
-          PerigeeSurface(Amg::Vector3D(0, 0, 0)),
-          oppositeMomentum, 
-          false,
-          oldtrajectory.m_fieldprop,
-          nonInteracting
+        per.reset(
+            m_propagator->propagate(
+            ctx,
+            *prevpar,
+            PerigeeSurface(Amg::Vector3D(0, 0, 0)),
+            oppositeMomentum,
+            false,
+            oldtrajectory.m_fieldprop,
+            nonInteracting
+          )
         );
       }
       
-      if (prevpar != tmppar) {
-        delete prevpar;
-      }
-      
       if (per == nullptr) {
         ATH_MSG_DEBUG("Failed to extrapolate to perigee, returning 0");
         incrementFitStatus(S_PROPAGATION_FAIL);
@@ -7324,18 +7375,20 @@ namespace Trk {
         return nullptr;
       }
     } else if (cache.m_acceleration && (firstmeasstate->trackParameters() != nullptr)) {
-      per = m_extrapolator->extrapolate(
-        *firstmeasstate->trackParameters(),
-        PerigeeSurface(Amg::Vector3D(0, 0, 0)),
-        oppositeMomentum, 
-        false, 
-        matEffects
+      per.reset(
+        m_extrapolator->extrapolate(
+          *firstmeasstate->trackParameters(),
+          PerigeeSurface(Amg::Vector3D(0, 0, 0)),
+          oppositeMomentum,
+          false,
+          matEffects
+        )
       );
     } else {
-      per = oldtrajectory.referenceParameters(true);
+      per.reset(oldtrajectory.referenceParameters(true)->clone());
     }
 
-    return std::unique_ptr<const TrackParameters>(per);
+    return std::move(per);
   }
 
   std::unique_ptr<const TrackStateOnSurface> GlobalChi2Fitter::makeTrackFindPerigee(
diff --git a/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.cu b/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.cu
index 4ade289028e32ee95869662977583e6ca257322b..1806e133b65e55196bd3bbb991e38305b82ddb98 100644
--- a/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.cu
+++ b/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.cu
@@ -18,21 +18,41 @@
 #include "DoubletMakingKernelCuda.cuh"
 #include "DoubletMatchingKernelCuda.cuh"
 
-SeedMakingWorkCuda::SeedMakingWorkCuda(unsigned int id, const SeedMakingWorkContextCuda& ctx, std::shared_ptr<TrigAccel::OffloadBuffer> data, 
-    tbb::concurrent_queue<SeedMakingDeviceContext*>& CQ, tbb::concurrent_vector<WorkTimeStamp>& TL) : 
+SeedMakingWorkCuda::SeedMakingWorkCuda(unsigned int id, SeedMakingDeviceContext* ctx, std::shared_ptr<TrigAccel::OffloadBuffer> data, 
+  tbb::concurrent_vector<WorkTimeStamp>* TL) : 
   m_workId(id),
-  m_context(0), 
+  m_context(ctx), 
   m_input(data),
-  m_contextQueue(CQ),
   m_timeLine(TL)
  {
   
-  m_context = new SeedMakingWorkContextCuda(ctx);//make a copy 
   m_output = std::make_shared<TrigAccel::OffloadBuffer>(sizeof(TrigAccel::OUTPUT_SEED_STORAGE));//output data
 }
 
 SeedMakingWorkCuda::~SeedMakingWorkCuda() {
-  if(m_context) delete(m_context);//delete the copy
+  
+  SeedMakingDeviceContext* p = m_context;
+
+  int id = p->m_deviceId;
+
+  cudaSetDevice(id);
+
+  cudaStreamDestroy(p->m_stream);
+
+  cudaFree(p->d_settings);
+  cudaFree(p->d_spacepoints);
+  cudaFree(p->d_detmodel);
+  
+  cudaFree(p->d_outputseeds);
+  cudaFree(p->d_doubletstorage);
+  cudaFree(p->d_doubletinfo);
+
+  cudaFreeHost(p->h_settings);
+  cudaFreeHost(p->h_spacepoints);
+  cudaFreeHost(p->h_outputseeds);
+
+  delete p;
+  m_context = 0;
 }
 
 std::shared_ptr<TrigAccel::OffloadBuffer> SeedMakingWorkCuda::getOutput() {
@@ -41,9 +61,9 @@ std::shared_ptr<TrigAccel::OffloadBuffer> SeedMakingWorkCuda::getOutput() {
 
 bool SeedMakingWorkCuda::run() {
 
-  m_timeLine.push_back(WorkTimeStamp(m_workId, 0, tbb::tick_count::now()));
+  m_timeLine->push_back(WorkTimeStamp(m_workId, 0, tbb::tick_count::now()));
 
-  const SeedMakingDeviceContext& p = *(m_context->m_pdc);
+  const SeedMakingDeviceContext& p = *m_context;
   
   int id = p.m_deviceId;  
   
@@ -104,7 +124,7 @@ bool SeedMakingWorkCuda::run() {
   checkError();
 
   doubletMakingKernel<<<gridDimensions, blockDimensions, 0, p.m_stream>>>(dSettings, dSpacepoints, dDetModel, dOutput, 
-							   dInfo, dStorage, nLayers, nSlices);
+    dInfo, dStorage, nLayers, nSlices);
 
   cudaStreamSynchronize(p.m_stream);
 
@@ -115,8 +135,8 @@ bool SeedMakingWorkCuda::run() {
   cudaMemcpy(&nStats[0], p.d_doubletstorage, 3*sizeof(int), cudaMemcpyDeviceToHost);
 
   
-  doubletMatchingKernel<<<p.m_gpuParams.m_nNUM_TRIPLET_BLOCKS, NUM_TRIPLET_THREADS, 0, p.m_stream>>>(dSettings, dSpacepoints, dDetModel, dInfo,
-												     dStorage,  dOutput, nStats[0]);
+  doubletMatchingKernel<<<p.m_gpuParams.m_nNUM_TRIPLET_BLOCKS, NUM_TRIPLET_THREADS, 0, p.m_stream>>>(dSettings, dSpacepoints, dDetModel, dInfo, 
+    dStorage,  dOutput, nStats[0]);
 
   cudaStreamSynchronize(p.m_stream);
 
@@ -141,10 +161,8 @@ bool SeedMakingWorkCuda::run() {
   checkError();
 
   memcpy(pOutput, ps, sizeof(TrigAccel::OUTPUT_SEED_STORAGE));
-
-  m_contextQueue.push(m_context->m_pdc);
-
-  m_timeLine.push_back(WorkTimeStamp(m_workId, 1, tbb::tick_count::now()));
+  
+  m_timeLine->push_back(WorkTimeStamp(m_workId, 1, tbb::tick_count::now()));
 
   return true;
 }
diff --git a/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.h b/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.h
index cc8a5bb2f0d9774e2a7fed17e17858d6e232f4b8..30ad7e258f0f02fbaa77c93df04e17285c540f3a 100644
--- a/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.h
+++ b/Trigger/TrigAccel/TrigInDetCUDA/src/SeedMakingWorkCuda.h
@@ -7,7 +7,6 @@
 
 #include <vector>
 
-#include "tbb/concurrent_queue.h"
 #include "tbb/concurrent_vector.h"
 #include "TrigInDetDataContexts.h"
 #include "TrigAccelEvent/Work.h"
@@ -17,8 +16,8 @@
 class SeedMakingWorkCuda : public TrigAccel::Work{
 
 public:
-  SeedMakingWorkCuda(unsigned int, const SeedMakingWorkContextCuda&, std::shared_ptr<TrigAccel::OffloadBuffer> data, 
-    tbb::concurrent_queue<SeedMakingDeviceContext*>&, tbb::concurrent_vector<WorkTimeStamp>&);
+  SeedMakingWorkCuda(unsigned int, SeedMakingDeviceContext*, std::shared_ptr<TrigAccel::OffloadBuffer>, 
+  tbb::concurrent_vector<WorkTimeStamp>*);
   ~SeedMakingWorkCuda();
   std::shared_ptr<TrigAccel::OffloadBuffer> getOutput();
   bool run();
@@ -37,10 +36,9 @@ private:
   };
   
   unsigned int m_workId;
-  SeedMakingWorkContextCuda* m_context;  
+  SeedMakingDeviceContext* m_context;  
   std::shared_ptr<TrigAccel::OffloadBuffer> m_input, m_output;
-  tbb::concurrent_queue<SeedMakingDeviceContext*>& m_contextQueue;
-  tbb::concurrent_vector<WorkTimeStamp>& m_timeLine;
+  tbb::concurrent_vector<WorkTimeStamp>* m_timeLine;
 
   float m_CovMS, m_ptCoeff, m_minPt2, m_ptCoeff2, m_maxD0; 
 };
diff --git a/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetDataContexts.h b/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetDataContexts.h
index 8ddf837d4802ca9aecc1dfe2118aa9bbc1644f83..9412c7198b6619293ee251b85d6ab51900f344b1 100644
--- a/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetDataContexts.h
+++ b/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetDataContexts.h
@@ -22,12 +22,6 @@ public:
 };
 
 
-class SeedMakingWorkContext {//base class
-public:
-  SeedMakingWorkContext() {};
-  SeedMakingWorkContext(const SeedMakingWorkContext& c) {};
-};
-
 struct SeedMakingDeviceContext {
 public:
   SeedMakingDeviceContext() : m_deviceId(-1), h_spacepoints(0), d_spacepoints(0), d_size(0), h_size(0) {};
@@ -58,25 +52,5 @@ private:
 
 
 
-class SeedMakingWorkContextCuda : public SeedMakingWorkContext {
-public:
-  SeedMakingWorkContextCuda(SeedMakingDeviceContext* pdc, 
-			    bool pinm = true, bool wcm = false, bool link = false) : SeedMakingWorkContext(), 
-										     m_pdc(pdc), 
-										     m_usePinnedMemory(pinm), 
-										     m_useWriteCombinedMemory(wcm),
-										     m_linkOutputToShm(link) {};
-  
-  SeedMakingWorkContextCuda(const SeedMakingWorkContextCuda& c) : SeedMakingWorkContext(), 
-								  m_pdc(c.m_pdc), 
-								  m_usePinnedMemory(c.m_usePinnedMemory),
-								  m_useWriteCombinedMemory(c.m_useWriteCombinedMemory),
-								  m_linkOutputToShm(c.m_linkOutputToShm) {};
-  SeedMakingDeviceContext* m_pdc;
-  bool m_usePinnedMemory; 
-  bool m_useWriteCombinedMemory; 
-  bool m_linkOutputToShm;
-};
-
 
 #endif
diff --git a/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.cu b/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.cu
index f24815a593a6eb0929bb865a9f1ce63bae1c7403..7e99ca70d46b1b2b70922903b66a97a33ac13f1c 100644
--- a/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.cu
+++ b/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.cu
@@ -12,6 +12,8 @@
 
 #include "TrigAccelEvent/TrigInDetAccelCodes.h"
 
+#include <sstream>
+
 extern "C" TrigAccel::WorkFactory* getFactory() {
   return new TrigInDetModuleCuda();
 }
@@ -25,147 +27,89 @@ extern "C" void deleteFactory(TrigAccel::WorkFactory* c){
   delete mod;
 }
 
-TrigInDetModuleCuda::TrigInDetModuleCuda() : m_maxNumberOfContexts(12), m_maxDevice(0), m_usePinnedMemory(true), 
-						  m_useWriteCombinedMemory(false),  m_linkOutputToShm(false), m_dumpTimeLine(false) {
-
-  m_d_detmodels.clear();
+void TrigInDetModuleCuda::getNumberOfGPUs() {
+  pid_t childpid;
+  int fd[2];
+  // create pipe descriptors
+  pipe(fd);
+
+  childpid = fork();
+  if(childpid != 0) {  // parent
+    close(fd[1]);
+    // read the data (blocking operation)
+    read(fd[0], &m_maxDevice, sizeof(m_maxDevice));
+    // close the read-descriptor
+    close(fd[0]);
+  }
+  else {  // child
+    // writing only, no need for read-descriptor
+    close(fd[0]);
+    int maxDevice = 0;
+    cudaGetDeviceCount(&maxDevice);
+    cudaError_t error = cudaGetLastError();
+    if(error != cudaSuccess) {
+      maxDevice = 0;
+    }
+    // send the value on the write-descriptor
+    write(fd[1], &maxDevice, sizeof(maxDevice)); 
+    // close the write descriptor
+    close(fd[1]);
+    exit(0);
+  }
+}
 
-  cudaGetDeviceCount(&m_maxDevice);
+TrigInDetModuleCuda::TrigInDetModuleCuda() : m_maxDevice(0), m_dumpTimeLine(false) {
 
-  cudaError_t error = cudaGetLastError();
+  m_h_detmodel = 0;
 
-  if(error != cudaSuccess) {
-    m_maxDevice = 0;
-  }
+  getNumberOfGPUs();
 
   for(unsigned int i=0;i<getProvidedAlgs().size();i++) {
     m_workItemCounters[i] = 0;
   }
+  
+  m_h_detmodel = (unsigned char*) malloc(sizeof(TrigAccel::DETECTOR_MODEL));
 
   m_timeLine.clear();
 
 }
 
 TrigInDetModuleCuda::~TrigInDetModuleCuda() {
-
-  SeedMakingDeviceContext* ps = 0;
-  
-  std::cout<<"deleting "<<m_seedMakingDcQueue.unsafe_size()<<" device contexts"<<std::endl;
   
-  while(m_seedMakingDcQueue.try_pop(ps)) deleteSeedMakingContext(ps);
-
-  for(auto dm : m_d_detmodels) {
-    cudaSetDevice(dm.first);
-    cudaFree(dm.second);
-
-  }
-  m_d_detmodels.clear();
-
+  free(m_h_detmodel);
+  m_h_detmodel = 0;
   if(m_dumpTimeLine) {
-
-     std::cout<<"time_line has "<<m_timeLine.size()<<" events"<<std::endl;
-     if(m_timeLine.size() > 0) {
-        tbb::tick_count t0 = m_timeLine[0].m_time;
-        std::ofstream tl("timeLine.csv");
-        tl<<"workId,eventType,time"<<std::endl;
-        tl<<m_timeLine[0].m_workId<<","<<m_timeLine[0].m_eventType<<",0"<<std::endl;
-        for(unsigned int tIdx = 1;tIdx < m_timeLine.size();++tIdx) {
-           tbb::tick_count t1 = m_timeLine[tIdx].m_time;
-           auto duration = t1-t0;
-           tl<<m_timeLine[tIdx].m_workId<<","<<m_timeLine[tIdx].m_eventType<<","<<1000*duration.seconds()<<std::endl;
-        }
-        tl.close();
-     }
-  }
+    if(m_timeLine.size() > 0) {
+       tbb::tick_count t0 = m_timeLine[0].m_time;
+       std::ostringstream fileName;
+       fileName <<"timeLine_"<<getpid()<<".csv";
+       std::ofstream tl(fileName.str());
+       tl<<"workId,eventType,time"<<std::endl;
+       tl<<m_timeLine[0].m_workId<<","<<m_timeLine[0].m_eventType<<",0"<<std::endl;
+       for(unsigned int tIdx = 1;tIdx < m_timeLine.size();++tIdx) {
+          tbb::tick_count t1 = m_timeLine[tIdx].m_time;
+          auto duration = t1-t0;
+          tl<<m_timeLine[tIdx].m_workId<<","<<m_timeLine[tIdx].m_eventType<<","<<1000*duration.seconds()<<std::endl;
+       }
+       tl.close();
+      m_timeLine.clear();
+    }
+ }
 }
 
 bool TrigInDetModuleCuda::configure() {
 
-  std::vector<int> allowedGPUs, nDeviceContexts;
-
-  allowedGPUs.resize(1,0);//configured for just 1 device with deviceId = 0
-
-  nDeviceContexts.resize(1,8);//configured for 8 DataContexts
-
   if(m_maxDevice == 0) {
      std::cout<<"No CUDA devices found"<<std::endl;
      return false;
   }
-  
-  if(allowedGPUs.empty() || nDeviceContexts.empty()) return false;
-
-  if(allowedGPUs.size() != nDeviceContexts.size()) return false;
-
-  unsigned int dcIndex=0;
-
-  size_t memTotalSize = 0;
-
-  std::vector< SeedMakingDeviceContext*> vSeedDCs[100];//we do not have that many GPUs
-
-  int nDCTotal=0;
-
-  for(std::vector<int>::iterator devIt = allowedGPUs.begin(); devIt!= allowedGPUs.end();++devIt, dcIndex++) {
-
-    int deviceId = (*devIt);
-
-    if(deviceId<0 || deviceId>=m_maxDevice) continue;
-
-    size_t memTotalSizeOnDevice = 0;
-
-    cudaSetDevice(deviceId);
-
-    checkError();
-        
-    unsigned char* d_detmodel;
-
-    cudaMalloc((void **)&d_detmodel, sizeof(TrigAccel::DETECTOR_MODEL));
-
-    checkError();
-    
-    m_d_detmodels.insert(std::pair<unsigned int, unsigned char*>(deviceId, d_detmodel));
-    
-    int nDC = nDeviceContexts[dcIndex];
-    nDCTotal += nDC;
-
-    memTotalSizeOnDevice += sizeof(TrigAccel::DETECTOR_MODEL);
-
-    for(int dc=0;dc<nDC;dc++) {
-      SeedMakingDeviceContext* p = createSeedMakingContext(deviceId);
-      memTotalSizeOnDevice += p->deviceSize();
-      vSeedDCs[dcIndex].push_back(p);
-    }
-
-    memTotalSize += memTotalSizeOnDevice;
-    
-    std::cout<<"GPU"<<deviceId<<" allocated data context size = "<<1e-6*memTotalSizeOnDevice<<" MBytes"<<std::endl;
-  }
-
-  int nDCLeft = nDCTotal;
-  while(nDCLeft>0) {
-     for(unsigned int iGPU=0;iGPU<allowedGPUs.size();iGPU++) {
-        if(vSeedDCs[iGPU].empty()) continue;
-	m_seedMakingDcQueue.push(vSeedDCs[iGPU].back());
-	vSeedDCs[iGPU].pop_back();
-        --nDCLeft;
-     }
-  }
-  
-  std::cout<<"Data context queue : ";
-  for(tbb::concurrent_queue< SeedMakingDeviceContext*>::const_iterator i(m_seedMakingDcQueue.unsafe_begin()); i!=m_seedMakingDcQueue.unsafe_end(); ++i ) {
-    std::cout<<(*i)->m_deviceId<<" ";
-  }
-  std::cout<<std::endl;
-
-  std::cout<<"Total size of memory allocated on all GPUs = "<<1e-6*memTotalSize<<" MBytes"<<std::endl;
-
   return true;
 }
 
-
-SeedMakingDeviceContext* TrigInDetModuleCuda::createSeedMakingContext(int id) {
+SeedMakingDeviceContext* TrigInDetModuleCuda::createSeedMakingContext(int id) const {
 
   cudaSetDevice(id);
-
+  checkError(11);
   SeedMakingDeviceContext* p = new SeedMakingDeviceContext;
 
   p->m_deviceId = id;
@@ -173,7 +117,7 @@ SeedMakingDeviceContext* TrigInDetModuleCuda::createSeedMakingContext(int id) {
   //set stream
 
   cudaStreamCreate(&p->m_stream);
-
+  checkError(12);
   //check device property
 
   cudaDeviceProp deviceProp;
@@ -194,78 +138,49 @@ SeedMakingDeviceContext* TrigInDetModuleCuda::createSeedMakingContext(int id) {
 
   //Allocate memory
   
-  cudaMalloc((void **)&p->d_settings, sizeof(TrigAccel::SEED_FINDER_SETTINGS));
+  cudaMalloc((void **)&p->d_settings,    sizeof(TrigAccel::SEED_FINDER_SETTINGS));
   cudaMalloc((void **)&p->d_spacepoints, sizeof(TrigAccel::SPACEPOINT_STORAGE));
-
-  auto dmIt = m_d_detmodels.find(p->m_deviceId);
-  if(dmIt!=m_d_detmodels.end()) {
-    p->d_detmodel = (*dmIt).second;
-  }
-  
+  cudaMalloc((void **)&p->d_detmodel,    sizeof(TrigAccel::DETECTOR_MODEL));
+  checkError();
   cudaMalloc((void **)&p->d_outputseeds, sizeof(TrigAccel::OUTPUT_SEED_STORAGE));
   cudaMalloc((void **)&p->d_doubletstorage, sizeof(DOUBLET_STORAGE));
   cudaMalloc((void **)&p->d_doubletinfo, sizeof(DOUBLET_INFO));
-
+  checkError(13);
 
   p->d_size = sizeof(TrigAccel::SEED_FINDER_SETTINGS) +  
-              sizeof(TrigAccel::SPACEPOINT_STORAGE) + sizeof(TrigAccel::OUTPUT_SEED_STORAGE) + sizeof(DOUBLET_STORAGE) + sizeof(DOUBLET_INFO);
-
+              sizeof(TrigAccel::SPACEPOINT_STORAGE) + sizeof(TrigAccel::OUTPUT_SEED_STORAGE) + sizeof(DOUBLET_STORAGE) + sizeof(DOUBLET_INFO) + 
+              sizeof(TrigAccel::DETECTOR_MODEL);
+  
   cudaMallocHost((void **)&p->h_settings, sizeof(TrigAccel::SEED_FINDER_SETTINGS));
   cudaMallocHost((void **)&p->h_spacepoints, sizeof(TrigAccel::SPACEPOINT_STORAGE));
   cudaMallocHost((void **)&p->h_outputseeds, sizeof(TrigAccel::OUTPUT_SEED_STORAGE));
 
   p->h_size = sizeof(TrigAccel::SEED_FINDER_SETTINGS) + sizeof(TrigAccel::SPACEPOINT_STORAGE) + sizeof(TrigAccel::OUTPUT_SEED_STORAGE);
-
-  return p;
-}
-
-void TrigInDetModuleCuda::deleteSeedMakingContext(SeedMakingDeviceContext* p) {
-
-  int id = p->m_deviceId;
-
-  cudaSetDevice(id);
-
-  cudaStreamDestroy(p->m_stream);
-
-  cudaFree(p->d_settings);
-  cudaFree(p->d_spacepoints);
   
-  cudaFree(p->d_outputseeds);
-  cudaFree(p->d_doubletstorage);
-  cudaFree(p->d_doubletinfo);
-
-  cudaFreeHost(p->h_settings);
-  cudaFreeHost(p->h_spacepoints);
-  cudaFreeHost(p->h_outputseeds);
-
-  delete p;
-
+  checkError(14);
+  return p;
 }
 
 
 TrigAccel::Work* TrigInDetModuleCuda::createWork(int workType, std::shared_ptr<TrigAccel::OffloadBuffer> data){
   
   if(workType == TrigAccel::InDetJobControlCode::SIL_LAYERS_EXPORT){
-    
-    for(auto dm : m_d_detmodels) {
 
-       unsigned int deviceId = dm.first;
+    memcpy(m_h_detmodel, (unsigned char*)data->get(), sizeof(TrigAccel::DETECTOR_MODEL));
 
-       cudaSetDevice(deviceId);
-       
-       cudaMemcpy(dm.second, (unsigned char*)data->get(), sizeof(TrigAccel::DETECTOR_MODEL), cudaMemcpyHostToDevice);
-    }
     return 0;
   }
 
   if(workType == TrigAccel::InDetJobControlCode::MAKE_SEEDS){
  
-    SeedMakingDeviceContext* ctx = 0;
-    
-    while(!m_seedMakingDcQueue.try_pop(ctx)) {
-      //      std::cout<<"waiting for free device context..."<<std::endl;
-    };
+    int deviceId = 0;//always using device 0 for the time being
+
+    //TO-DO: to support mult-GPU load balancing get deviceId from a tbb_concurrent_queue
+
+    SeedMakingDeviceContext* ctx = createSeedMakingContext(deviceId);
 
+    cudaMemcpy(ctx->d_detmodel, m_h_detmodel, sizeof(TrigAccel::DETECTOR_MODEL), cudaMemcpyHostToDevice);
+    checkError(21);
     TrigAccel::SEED_MAKING_JOB *pArray = reinterpret_cast<TrigAccel::SEED_MAKING_JOB*>(data->get());
     
     //1. copy settings to the context host array
@@ -282,9 +197,7 @@ TrigAccel::Work* TrigInDetModuleCuda::createWork(int workType, std::shared_ptr<T
     
     unsigned int workId = workNum*100;
     
-    SeedMakingWorkCuda* w = new SeedMakingWorkCuda(workId, SeedMakingWorkContextCuda(ctx, m_usePinnedMemory, 
-									     m_useWriteCombinedMemory, 
-									     m_linkOutputToShm), data, m_seedMakingDcQueue, m_timeLine);
+    SeedMakingWorkCuda* w = new SeedMakingWorkCuda(workId, ctx, data, &m_timeLine);
     
     return w;
   }
diff --git a/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.h b/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.h
index 44559910072535e13ce790ea925c774236f39f67..351bd379addfaec83d833516c8221ff2d5e98be6 100644
--- a/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.h
+++ b/Trigger/TrigAccel/TrigInDetCUDA/src/TrigInDetModuleCuda.h
@@ -25,7 +25,7 @@ class TrigInDetModuleCuda : public TrigAccel::WorkFactory {
   ~TrigInDetModuleCuda();
 
   bool configure();
-  
+
   TrigAccel::Work* createWork(int, std::shared_ptr<TrigAccel::OffloadBuffer>);
 
   const std::vector<int> getProvidedAlgs();
@@ -36,35 +36,28 @@ class TrigInDetModuleCuda : public TrigAccel::WorkFactory {
     
   private:
 
-    inline void checkError() const {
+    inline void checkError(int code = 0) const {
       cudaError_t error = cudaGetLastError();
       if(error != cudaSuccess) {
-	printf("CUDA error: %s\n", cudaGetErrorString(error));
-	exit(-1);
+        printf("%d CUDA error %d: %s\n", getpid(), code, cudaGetErrorString(error));
+        exit(-1);
       }
     };
     
+    void getNumberOfGPUs();
+    
     //data structures
 
     //1. "const" data: managed by the Factory
+
+    unsigned char* m_h_detmodel;
     
-    std::map<unsigned int, unsigned char*> m_d_detmodels;
-    
-    int m_maxNumberOfContexts;//Factory setting
     int m_maxDevice;
 
-    bool m_usePinnedMemory; 
-    bool m_useWriteCombinedMemory; 
-    bool m_linkOutputToShm;
-
-    // host / device pairs for each device
-
-    tbb::concurrent_queue<SeedMakingDeviceContext*> m_seedMakingDcQueue;
-
     // data context allocation / de-allocation
     
-    SeedMakingDeviceContext* createSeedMakingContext(int);
-    void deleteSeedMakingContext(SeedMakingDeviceContext*);
+    SeedMakingDeviceContext* createSeedMakingContext(int) const;
+    void deleteSeedMakingContext(SeedMakingDeviceContext*) const;
 
     bool m_dumpTimeLine;
     
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
index 4634294863a40b1085bcc31b8afe04b02dea42c4..af653dea2a8bd78b78d1fb1f5b97e4984eed9a53 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
@@ -15,14 +15,13 @@ testChains = {
     "HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_IDTrig", 
  
     "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF",
-    "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF:HLT_Roi_TauCore",
     "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauIso_FTF",
-    "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauIso_FTF:HLT_Roi_TauIso",
     "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_FTF",
     "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig",
 
     "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF",
-    "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig"
+    "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig",
 
+    "HLT_IDTrack_FS_FTF",
 
 }; 
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..136668950ef97a470a11e4402ef43b8fc53c6309
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.cxx
@@ -0,0 +1,80 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**************************************************************************
+ **
+ **   File: Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.h
+ **
+ **   Description: - Hypothesis Tool: search for electron pairs with
+ **                invariant mass in some interval; intended for Z->ee
+ **                - Modified from TrigL2DielectronMassHypo by R. Goncalo
+ **                - Modified from TrigEFDielectronMassHypo by
+ **                  Debottam Bakshi Gupta
+ **
+ **   Author: T. Hrynova  <thrynova@mail.cern.ch>
+ **
+ **   Created:   Nov 13 2009
+ **
+ **************************************************************************/
+
+
+#include "TrigEgammaDielectronMassHypoTool.h"
+
+#include <cmath>
+
+using namespace TrigCompositeUtils;
+
+TrigEgammaDielectronMassHypoTool::TrigEgammaDielectronMassHypoTool(const std::string& type, const std::string& name, const IInterface* parent)
+    : ComboHypoToolBase(type, name, parent) {}
+
+
+StatusCode TrigEgammaDielectronMassHypoTool::initialize()
+{
+  ATH_MSG_DEBUG("AcceptAll            = " << m_acceptAll );
+  ATH_MSG_DEBUG("LowerMassCut         = " << m_lowerMassElectronClusterCut );
+  ATH_MSG_DEBUG("UpperMassCut         = " << m_upperMassElectronClusterCut );
+
+  if ( not m_monTool.name().empty() ) {
+        ATH_CHECK( m_monTool.retrieve() );
+        ATH_MSG_DEBUG("m_monTool name: " << m_monTool);
+  }
+
+ ATH_MSG_DEBUG("Initialization completed successfully");
+
+  return StatusCode::SUCCESS;
+}
+
+bool TrigEgammaDielectronMassHypoTool::executeAlg(std::vector<LegDecision> &combination) const {
+
+//retrieve the electrons 
+  std::vector<ElementLink<xAOD::ElectronContainer>> selected_electrons;
+  for (auto el: combination){
+    auto EL= el.second;    
+    auto electronLink = TrigCompositeUtils::findLink<xAOD::ElectronContainer>( *EL, featureString() ).link;
+    selected_electrons.push_back(electronLink);
+  }
+  auto electronLink1=selected_electrons[0];
+  auto electronLink2=selected_electrons[1];
+  TLorentzVector hlv1 = (*electronLink1)->p4();
+  TLorentzVector hlv2 = (*electronLink2)->p4();
+  double mass = (hlv1+hlv2).M();
+  ATH_MSG_DEBUG("Found two Electrons with mass " <<mass);
+
+  // apply the cut
+  bool pass=true;
+  if (mass<m_lowerMassElectronClusterCut || mass>m_upperMassElectronClusterCut){ 
+      ATH_MSG_DEBUG("Combination failed mass cut: " << mass << " not in [" << m_lowerMassElectronClusterCut << "," <<  m_upperMassElectronClusterCut << "]");
+      pass=false;
+  }
+
+  if (pass)
+     ATH_MSG_DEBUG( " Invariant mass " << mass << " is  within [" <<m_lowerMassElectronClusterCut<< "," << m_upperMassElectronClusterCut << "] This seleciton passed! ");
+  
+  return pass;
+
+}
+
+
+
+
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..424dea96b825cbe1773d9ff98540fd1b925d298a
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.h
@@ -0,0 +1,80 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGEGAMMAHYPO_TRIGEGAMMADIELECTRONMASSHYPOTOOL_H
+#define TRIGEGAMMAHYPO_TRIGEGAMMADIELECTRONMASSHYPOTOOL_H
+
+/**************************************************************************
+ **
+ **   File: Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDielectronMassHypoTool.h
+ **
+ **   Description: - Hypothesis Tool: search for electron pairs with 
+ **                invariant mass in some interval; intended for Z->ee
+ **                - Modified from TrigL2DielectronMassHypo by R. Goncalo
+ **                - Modified from TrigEFDielectronMassHypo by
+ **                  Debottam Bakshi Gupta
+ **
+ **   Author: T. Hrynova  <thrynova@mail.cern.ch>
+ **
+ **   Created:   Nov 13 2009
+ **
+ **************************************************************************/ 
+
+#include <string>
+#include <vector>
+
+#include "DecisionHandling/ComboHypoToolBase.h"
+
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTrigEgamma/TrigElectron.h"
+#include "xAODEgamma/ElectronContainer.h"
+
+#include "TrigCompositeUtils/HLTIdentifier.h"
+#include "TrigCompositeUtils/TrigCompositeUtils.h"
+
+#include "AthenaMonitoringKernel/Monitored.h"
+#include "AthenaMonitoringKernel/GenericMonitoringTool.h"
+
+
+/**
+ * \class TrigEgammaDielectronMassHypoTool
+ * \brief TrigEgammaDielectronMassHypoTool is a ComboHypoTool that calculates the inv mass
+ * Apply inv mass cuts (upper and lower cut) to the two electrons and accepts the event if condition is 
+ * satisfied
+ *
+ */
+
+
+class TrigEgammaDielectronMassHypoTool:  public ComboHypoToolBase {
+
+ public:
+  
+  TrigEgammaDielectronMassHypoTool(const std::string& type,
+                    const std::string& name,
+                    const IInterface* parent);
+  
+  virtual ~TrigEgammaDielectronMassHypoTool() {};
+  virtual StatusCode initialize() override;
+
+
+ private:
+  
+  virtual bool executeAlg(std::vector<LegDecision>& thecomb) const override;
+  
+  // flags
+  Gaudi::Property< bool > m_acceptAll {this, "AcceptAll", false, "Ignore selection" };
+  
+  // cuts
+  Gaudi::Property<float> m_lowerMassElectronClusterCut {this,"LowerMassElectronClusterCut", 50000.0, "Lower mass cut for electron-cluster pair"}; //!<  lower inv mass cut (e,cluster)
+  Gaudi::Property<float> m_upperMassElectronClusterCut {this,"UpperMassElectronClusterCut", 130000.0, "Upper mass cut for electron-cluster pair"}; //!<  upper inv mass cut (e,cluster)
+  
+  // monitoring
+  ToolHandle<GenericMonitoringTool> m_monTool { this, "MonTool", "", "Monitoring tool" };
+
+
+}; // TRIGEGAMMAHYPO_TRIGEGAMMADIELECTRONMASSHYPOTOOL_H
+#endif
+
+
+
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx
index da14c5524812d5eec4f86bc5a307c31425c3858d..0c58c9a66ebc930b5d9974c06abfc92085330f59 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx
@@ -30,6 +30,7 @@
 #include "../TrigEgammaPrecisionElectronHypoAlgMT.h"
 #include "../TrigEgammaPrecisionPhotonHypoToolMult.h"
 #include "../TrigEgammaPrecisionElectronHypoToolMult.h"
+#include "../TrigEgammaDielectronMassHypoTool.h"
 
 DECLARE_COMPONENT( TrigL2CaloHypo )
 DECLARE_COMPONENT( TrigL2ElectronFex )
@@ -63,3 +64,5 @@ DECLARE_COMPONENT( TrigEgammaPrecisionPhotonHypoAlgMT )
 DECLARE_COMPONENT( TrigEgammaPrecisionElectronHypoAlgMT )
 DECLARE_COMPONENT( TrigEgammaPrecisionPhotonHypoToolMult )
 DECLARE_COMPONENT( TrigEgammaPrecisionElectronHypoToolMult )
+DECLARE_COMPONENT( TrigEgammaDielectronMassHypoTool )
+
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/TrigBphysMonitoring/HLTXAODBphysMonTool.h b/Trigger/TrigMonitoring/TrigBphysMonitoring/TrigBphysMonitoring/HLTXAODBphysMonTool.h
index c0830ae1f34d545cbbb3693a66aeb3f8562e4353..8f6bdec2115a8e8e13a048c4e8dfb49b077ccb45 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/TrigBphysMonitoring/HLTXAODBphysMonTool.h
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/TrigBphysMonitoring/HLTXAODBphysMonTool.h
@@ -99,11 +99,13 @@ private:
     //typedef std::vector<std::pair<std::string, std::string> > Table_t;
     Table_t m_dedicated_chains;  //! menu-independent labels with matching menu-aware chain names for dedicated monitoring
     Table_t m_dedicatedL1Topo_chains;  //! menu-independent labels with matching menu-aware chain names for dedicated L1Topo monitoring
+    Table_t m_dedicatedIndividual_chains;  //! 
     Table_t m_efficiency_chains; //! menu-independent labels with matching menu-aware chain names for numerator efficiencies
     
     // patterns for the above, if generated on-the-fly from m_primary_chains list
     Table_t m_dedicated_chains_patterns;
     Table_t m_dedicatedL1Topo_chains_patterns;
+    Table_t m_dedicatedIndividual_chains_patterns;
     Table_t m_efficiency_chains_patterns;
 
     std::vector<std::string> m_containerList; //! Container list
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
index 7c879286c968e1348e6ab01cb305205765f6fc71..bcd080533a137767597a0fd49d6f8aa7b7b465d5 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
@@ -3,7 +3,7 @@
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
 monitoring_bphys = [
-                    'HLT_mu11_mu6_bDimu', 
+                    #'HLT_mu11_mu6_bDimu', 
                     'HLT_mu11_mu6_bBmumuxv2', 
                     'HLT_mu6_2mu4_bJpsi',
                     'HLT_mu20_bJpsi_Trkloose', 
@@ -14,7 +14,7 @@ monitoring_bphys = [
                     'HLT_mu11_mu6_bTau', 
                     'HLT_2mu6_bDimu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6', 
                     'HLT_mu11_mu6_bDimu_novtx_noos', 
-                    'HLT_mu11_mu6_bJpsimumu',
+                    #'HLT_mu11_mu6_bJpsimumu',
                     'HLT_mu11_mu6_bBmumu',
                     'HLT_mu6_mu4_bUpsimumu_L1BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
                     'HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
@@ -25,9 +25,27 @@ monitoring_bphys = [
                     'HLT_2mu6_bBmumux_BsmumuPhi_L1BPH-2M9-2MU6_BPH-2DR15-2MU6',
                     'HLT_mu6_bJpsi_Trkloose',
                     'HLT_mu4_mu4_idperf_bJpsimumu_noid',
+                    # For individual chain monitoring folders, to fill DetailedIndividualChains
+                    'HLT_2mu4_bJpsimumu',
+                    'HLT_2mu4_bUpsimumu',
+                    'HLT_2mu4_bDimu',
+                    'HLT_mu6_mu4_bJpsimumu',
+                    'HLT_mu6_mu4_bUpsimumu',
+                    'HLT_mu6_mu4_bDimu',
+                    'HLT_2mu6_bJpsimumu',
+                    'HLT_2mu6_bUpsimumu',
+                    'HLT_2mu6_bDimu',
+                    'HLT_mu11_mu6_bJpsimumu',
+                    'HLT_mu11_mu6_bUpsimumu',
+                    'HLT_mu11_mu6_bDimu',
+                    'HLT_2mu4_bBmumux_BsmumuPhi',
+                    'HLT_mu6_mu4_bBmumux_BsmumuPhi_delayed',
+                    'HLT_2mu4_bBmumux_BpmumuKp',
+                    'HLT_mu6_mu4_bBmumux_BpmumuKp',
                     ]
 
 primary_bphys = [ 
+                 # first should go those for generic folders (BMuMu, MultiMu etc)
                  'HLT_mu11_mu6_bDimu', 
                  'HLT_mu11_mu6_bBmumuxv2', 
                  'HLT_mu6_2mu4_bJpsi',
@@ -37,6 +55,18 @@ primary_bphys = [
                  'HLT_mu11_mu6_bTau', 
                  'HLT_2mu6_bDimu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6', 
                  'HLT_mu11_mu6_bDimu_novtx_noos', 
+                 # then others, for individual chain folders
+                 'HLT_2mu4_bJpsimumu',
+                 'HLT_2mu4_bUpsimumu',
+                 'HLT_mu6_mu4_bJpsimumu',
+                 'HLT_mu6_mu4_bUpsimumu',
+                 'HLT_mu6_mu4_bDimu',
+                 'HLT_2mu6_bJpsimumu',
+                 'HLT_2mu6_bUpsimumu',
+                 'HLT_2mu6_bDimu',
+                 'HLT_mu11_mu6_bJpsimumu',
+                 'HLT_mu11_mu6_bUpsimumu',
+                 'HLT_mu11_mu6_bDimu',
                  ]
 
 if TriggerFlags.EDMDecodingVersion == 3 :
@@ -44,6 +74,19 @@ if TriggerFlags.EDMDecodingVersion == 3 :
                       'HLT_2mu4_bJpsimumu_L12MU4',
                       'HLT_2mu4_bUpsimumu_L12MU4',
                       'HLT_2mu4_bDimu_L12MU4',
+                      'HLT_mu6_mu4_bJpsimumu_L1MU6_2MU4',
+                      'HLT_mu6_mu4_bUpsimumu_L1MU6_2MU4',
+                      'HLT_mu6_mu4_bDimu_L1MU6_2MU4',
+                      'HLT_2mu6_bJpsimumu_L12MU6',
+                      'HLT_2mu6_bUpsimumu_L12MU6',
+                      'HLT_2mu6_bDimu_L12MU6',
+                      'HLT_mu11_mu6_bJpsimumu_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bUpsimumu_L1MU11_2MU6',
+                      'HLT_mu11_mu6_bDimu_L1MU11_2MU6',
+                      'HLT_2mu4_bBmumux_BsmumuPhi_L12MU4',
+                      'HLT_mu6_mu4_bBmumux_BsmumuPhi_L1MU6_2MU4',
+                      'HLT_2mu4_bBmumux_BpmumuKp_L12MU4',
+                      'HLT_mu6_mu4_bBmumux_BpmumuKp_L1MU6_2MU4',
                      ]
   primary_bphys = [
                     'HLT_2mu4_bDimu_L12MU4',
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
index ce32dfcc1df499106aa894e08d564ad128964d49..5d3ce0d7874e4fe7c73aba1f3eb22c2a73c111b1 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
@@ -33,6 +33,25 @@ DetailedL1TopoChains = {
                       "L1BPH-M-DR"        : "HLT_2mu6_bUpsimumu_L1BPH-8M15-2MU6_BPH-0DR22-2MU6",
                       #"L1BPH-M"           : "HLT_2mu6_bDimu_L1BPH-8M15-2MU6"
                        }
+DetailedIndividualChains = { 
+                  # filled not from primary_bphys but from monitored_bphys
+                  "HLT_2mu4_bJpsimumu" : "HLT_2mu4_bJpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_2mu4_bUpsimumu" : "HLT_2mu4_bUpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_2mu4_bDimu"     : "HLT_2mu4_bDimu(_L1(?!BPH).*)?$",
+                  "HLT_mu6_mu4_bJpsimumu" : "HLT_mu6_mu4_bJpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_mu6_mu4_bUpsimumu" : "HLT_mu6_mu4_bUpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_mu6_mu4_bDimu"     : "HLT_mu6_mu4_bDimu(_L1(?!BPH).*)?$",
+                  "HLT_2mu6_bJpsimumu" : "HLT_2mu6_bJpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_2mu6_bUpsimumu" : "HLT_2mu6_bUpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_2mu6_bDimu"     : "HLT_2mu6_bDimu(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bJpsimumu" : "HLT_mu11_mu6_bJpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bUpsimumu" : "HLT_mu11_mu6_bUpsimumu(_L1(?!BPH).*)?$",
+                  "HLT_mu11_mu6_bDimu"     : "HLT_mu11_mu6_bDimu(_L1(?!BPH).*)?$",
+                  "HLT_2mu4_bBmumux_BsmumuPhi"     : "HLT_2mu4_bBmumux_BsmumuPhi(_delayed)?(_L1(?!BPH).*)?$",
+                  "HLT_mu6_mu4_bBmumux_BsmumuPhi"     : "HLT_mu6_mu4_bBmumux_BsmumuPhi(_delayed)?(_L1(?!BPH).*)?$",
+                  "HLT_2mu4_bBmumux_BpmumuKp"     : "HLT_2mu4_bBmumux_BpmumuKp(_delayed)?(_L1(?!BPH).*)?$",
+                  "HLT_mu6_mu4_bBmumux_BpmumuKp"     : "HLT_mu6_mu4_bBmumux_BpmumuKp(_delayed)?(_L1(?!BPH).*)?$",
+                 }
 EfficiencyChains = {
                     "BMuMu"  : "HLT_(2mu[0-9]+|mu[0-9]+_?mu[0-9]+)_(bDimu|bJpsimumu)(_L1[0-9]?MU[0-9]+)?",
                     "BMuMuX" : "HLT_(2mu[0-9]+|mu[0-9]+_?mu[0-9]+)_bBmumuxv[23](_L1[0-9]?MU[0-9]+)?",
@@ -106,6 +125,7 @@ def TrigBphysMonitoringTool():
                                   ContainerList   =containers,
                                   DetailedChains_patterns = DetailedChains,
                                   DetailedL1TopoChains_patterns = DetailedL1TopoChains,
+                                  DetailedIndividualChains_patterns = DetailedIndividualChains,
                                   EfficiencyChains_patterns = EfficiencyChains,
                                   EffTrigDenom_noVtxOS_pattern = EffTrigDenom_noVtxOS,
                                   
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/src/HLTXAODBphysMonTool.cxx b/Trigger/TrigMonitoring/TrigBphysMonitoring/src/HLTXAODBphysMonTool.cxx
index 676d4b8d3a2b218e84985b75d5f4d3687af05b2a..0c069db8bba07d5ffad4d91dbd06864a542e5af5 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/src/HLTXAODBphysMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/src/HLTXAODBphysMonTool.cxx
@@ -115,6 +115,7 @@ m_muonMass(105.66)
 
     declareProperty("DetailedChains"    ,m_dedicated_chains , "table<string,string> of menu-idep/aware labels/chainnames");
     declareProperty("DetailedL1TopoChains"    ,m_dedicatedL1Topo_chains , "table<string,string> of menu-idep/aware labels/chainnames for L1Topo");
+    declareProperty("DetailedIndividualChains"    ,m_dedicatedIndividual_chains , "table<string,string> of individual chains");
     declareProperty("EfficiencyChains"  ,m_efficiency_chains, "table<string,string> of menu-idep/aware labels/eff. names");
     
     // ID Tracking efficiency
@@ -136,6 +137,7 @@ m_muonMass(105.66)
     // patterns for the above, if generated on-the-fly from m_primary_chains list
     declareProperty("DetailedChains_patterns"    ,m_dedicated_chains_patterns , "table<string,string> of menu-idep/aware labels/patterns");
     declareProperty("DetailedL1TopoChains_patterns"    ,m_dedicatedL1Topo_chains_patterns , "table<string,string> of menu-idep/aware labels/patterns for L1Topo");
+    declareProperty("DetailedIndividualChains_patterns"    ,m_dedicatedIndividual_chains_patterns , "table<string,string> of individual chains");
     declareProperty("EfficiencyChains_patterns"  ,m_efficiency_chains_patterns, "table<string,string> of menu-idep/aware labels/eff. patterns");
     
     declareProperty("EffTrigDenom_noVtxOS_pattern" , m_trigchain_denomnoVtxOS_pattern , "Trigger pattern for noVtxOS denominator efficiencies");
@@ -226,6 +228,7 @@ StatusCode HLTXAODBphysMonTool::init()
 StatusCode HLTXAODBphysMonTool::generateChainDicts() {
     m_dedicated_chains.clear();
     m_dedicatedL1Topo_chains.clear();
+    m_dedicatedIndividual_chains.clear();
     m_efficiency_chains.clear();
     m_trigchain_denomnoVtxOS = "";
     
@@ -253,6 +256,18 @@ StatusCode HLTXAODBphysMonTool::generateChainDicts() {
         }
     }
     
+    ATH_MSG_DEBUG ("Forming DetailedIndividualChains... ");
+    for(const auto& patternPair : m_dedicatedIndividual_chains_patterns) {
+        boost::regex pattern(patternPair.second.c_str());
+        for(const auto& chainName : m_monitored_chains) {
+            if( boost::regex_match(chainName,pattern) ) {
+              m_dedicatedIndividual_chains.insert( Pair_t(patternPair.first,chainName) );
+              ATH_MSG_INFO ("Add " << patternPair.first << " : " << chainName << " to DetailedIndividualChains dictionary");
+              break;
+            }
+        }
+    }
+    
     ATH_MSG_INFO ("Forming EfficiencyChains... ");
     for(const auto& patternPair : m_efficiency_chains_patterns) {
         boost::regex pattern(patternPair.second.c_str());
@@ -1535,6 +1550,11 @@ StatusCode HLTXAODBphysMonTool::bookTriggerGroups() {
         // groupName, prefix, pathInRoot, chainName
         bookTrigBphysHists(trigpair.first,  m_prefix, trigpair.first, trigpair.second, false); // book only limited number of histograms
     } // for
+    for (const auto& trigpair : m_dedicatedIndividual_chains) {
+        ATH_MSG_DEBUG("Building Dedicated Individual chain monitoring for: " << trigpair.first<< " " <<trigpair.second );
+        // groupName, prefix, pathInRoot, chainName
+        bookTrigBphysHists(trigpair.first,  m_prefix, trigpair.first, trigpair.second); 
+    } // for
     return StatusCode::SUCCESS;
 } // bookTriggerGroups
 
@@ -1554,6 +1574,13 @@ StatusCode HLTXAODBphysMonTool::fillTriggerGroups() {
             continue;
         }
     } // for
+    for (const auto& trigpair : m_dedicatedIndividual_chains) {
+        ATH_MSG_DEBUG("Filling Dedicated Individual chain monitoring for: " << trigpair.first<< " " <<trigpair.second );
+        if (!fillTriggerGroup(trigpair.first,trigpair.second).isSuccess()) {
+            ATH_MSG_WARNING("Problems filling group/chain: " << trigpair.first<< " " <<trigpair.second);
+            continue;
+        }
+    } // for
 return StatusCode::SUCCESS;
 } // fillTriggerGroups
 
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
index 385550cc37c974db2c1b6f07ea79db373fbad2a1..9e66019343ac9369f06e0720e4e0012123a9da75 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitorAlgorithm.py
@@ -63,7 +63,7 @@ Chain2JetCollDict['Legacy'] = {
   'HLT_3j200'                              : 'HLT_xAOD__JetContainer_a4tcemsubjesISFS',
 }
 
-from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec, EventHistoSpec, SelectSpec, ToolSpec
+from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec, EventHistoSpec, SelectSpec, ToolSpec #VarSpec can be added to define specific/custom variables
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
 def TrigJetMonConfig(inputFlags):
@@ -157,9 +157,13 @@ def basicJetMonAlgSpec(jetcoll,isOnline,athenaMT):
     SelectSpec( 'forward', '3.2<|eta|', path, FillerTools = ["pt","et","m"] ),
     SelectSpec( 'lowmu', 'avgMu<30', path, isEventVariable=True, FillerTools = ["pt","et","m","phi","eta"]),
     SelectSpec( 'highmu', '30<avgMu', path, isEventVariable=True, FillerTools = ["pt","et","m","phi","eta"]),
-    EventHistoSpec('njets', (20,0,20), title='NJets;NJets;Entries' ),
+
     EventHistoSpec('njetsPt20', (20,0,20), title='NJetsPt20;NJetsPt20;Entries' ),
-    EventHistoSpec('njetsEt40Eta1_2', (10,0,10), title='NJetsEt40Eta1_2;NJetsEt40Eta1_2;Entries' ),
+    # Jet multiplicity histograms can be added by using an EventHistoSpec
+    # Their specifications (pT cut, ET cut, eta cuts) must be defined in the knownEventVar dictionary within JetStandardHistoSpecs.py
+    # The following line is an example for a jet multiplicity histogram with ET>40 GeV, 1.0<|eta|<2.0, and binning of (10,0,10):
+    # EventHistoSpec('njetsEt40Eta1_2', (10,0,10), title='NJetsEt40Eta1_2;NJetsEt40Eta1_2;Entries' ),
+
     # TProfile2D : just use 3 variables. For now the sytem will automatically
     #  interpret it as a TProfile2D (the 3rd variable being profiled)
     #"phi;eta;e", # --> Average Energy vs pt and eta
@@ -192,6 +196,7 @@ ExtraOfflineHists = [
   "NumTrkPt1000[0]",
   "TrackWidthPt1000[0]",
   "SumPtTrkPt500[0]",
+  SelectSpec( 'LooseBadFailedJets', 'LooseBad', InverseJetSel=True, FillerTools = ["pt","phi","eta"]),
 ]
 
 # Additional histograms for online jets
diff --git a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
index dd2b5d91ab064eb4abb32e3d6adf47364bc1a94b..cd3a461c851a42aaa9a389121f983f42746664b7 100644
--- a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
+++ b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
@@ -9,6 +9,7 @@ atlas_add_library( DecisionHandlingLib
                    src/DumpDecisions.cxx
                    src/HypoBase.cxx
                    src/InputMakerBase.cxx
+		   src/ITestHypoTool.cxx		   
                    PUBLIC_HEADERS DecisionHandling
                    LINK_LIBRARIES AthenaBaseComps AthenaMonitoringKernelLib GaudiKernel StoreGateLib TrigCompositeUtilsLib TrigCostMonitorMTLib TrigSteeringEvent TrigTimeAlgsLib
                    PRIVATE_LINK_LIBRARIES AthContainers AthViews xAODTrigger )
@@ -21,6 +22,10 @@ atlas_add_component( DecisionHandling
                      src/TriggerSummaryAlg.cxx
                      src/RoRSeqFilter.cxx
                      src/ViewCreator*.cxx
+		     src/TestRecoAlg.cxx
+		     src/TestInputMaker.cxx
+		     src/TestHypoTool.cxx
+		     src/TestHypoAlg.cxx
                      LINK_LIBRARIES DecisionHandlingLib xAODTrigCalo AthViews xAODTracking xAODJet )
 
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py b/Trigger/TrigSteer/DecisionHandling/python/HLTSignatureConfig.py
similarity index 97%
rename from Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py
rename to Trigger/TrigSteer/DecisionHandling/python/HLTSignatureConfig.py
index a9431c6c7f78b3f850110770fcaab109757b8909..0c166ad21f60164785b88ba8ab11ae23a55abee0 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py
+++ b/Trigger/TrigSteer/DecisionHandling/python/HLTSignatureConfig.py
@@ -2,7 +2,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.ComponentFactory import CompFactory
-from TrigUpgradeTest.HLTSignatureHypoTools import MuTestHypoTool, ElTestHypoTool
+from DecisionHandling.HLTSignatureHypoTools import MuTestHypoTool, ElTestHypoTool
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import RecoFragmentsPool, MenuSequence
 from AthenaCommon.CFElements import seqAND
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureHypoTools.py b/Trigger/TrigSteer/DecisionHandling/python/HLTSignatureHypoTools.py
similarity index 95%
rename from Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureHypoTools.py
rename to Trigger/TrigSteer/DecisionHandling/python/HLTSignatureHypoTools.py
index c4aa432e07bafef8434ba09c87a849657b0876c8..d174a82541e9c33cfb154b5e5308058a15e48eb0 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureHypoTools.py
+++ b/Trigger/TrigSteer/DecisionHandling/python/HLTSignatureHypoTools.py
@@ -2,7 +2,7 @@
 # file to simulate the HypoTool configuration of the signatures
 
 def TestHypoTool(name, prop, threshold_value):
-    from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoTool
+    from DecisionHandling.DecisionHandlingConf import HLTTest__TestHypoTool
     value  =  int(threshold_value)*1000
     UseThisLinkName="initialRoI"
     h = HLTTest__TestHypoTool(name, Threshold=value, Property=prop, LinkName=UseThisLinkName)
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py b/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py
similarity index 98%
rename from Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py
rename to Trigger/TrigSteer/DecisionHandling/python/TestUtils.py
index ac41bbdaefb5cd140948f794f4ae86b0a08c1d67..0e39664b7c4196cf5404cdb6c3e61a43a983e210 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py
+++ b/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py
@@ -40,7 +40,7 @@ class L1EmulationTest(L1Decoder):
                                 '-3.2,3.0,2704088841,MU0,MU4,MU6,MU8;3.0,1.6,2972524297,MU0,MU4',
                                 '1.3,1.9,3103727387,MU0,MU10;1.2,2.6,2733969453,MU6;-1.1,2.6,2972524297,MU6; -1.2,2.6,2704088842,MU20']
 
-        from TrigUpgradeTest.TestUtils import writeEmulationFiles
+
         writeEmulationFiles(data)
         ctpUnpacker = CTPUnpackingEmulationTool(OutputLevel = self.getDefaultProperty("OutputLevel"),
                                                 ForceEnableAllChains = True)
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/jetMenuHelper.py b/Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/python/jetMenuHelper.py
rename to Trigger/TrigSteer/DecisionHandling/python/jetMenuHelper.py
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/ITestHypoTool.cxx b/Trigger/TrigSteer/DecisionHandling/src/ITestHypoTool.cxx
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/ITestHypoTool.cxx
rename to Trigger/TrigSteer/DecisionHandling/src/ITestHypoTool.cxx
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/ITestHypoTool.h b/Trigger/TrigSteer/DecisionHandling/src/ITestHypoTool.h
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/ITestHypoTool.h
rename to Trigger/TrigSteer/DecisionHandling/src/ITestHypoTool.h
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.cxx b/Trigger/TrigSteer/DecisionHandling/src/TestHypoAlg.cxx
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.cxx
rename to Trigger/TrigSteer/DecisionHandling/src/TestHypoAlg.cxx
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.h b/Trigger/TrigSteer/DecisionHandling/src/TestHypoAlg.h
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.h
rename to Trigger/TrigSteer/DecisionHandling/src/TestHypoAlg.h
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.cxx b/Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.cxx
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.cxx
rename to Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.cxx
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.h b/Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.h
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoTool.h
rename to Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.h
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.cxx b/Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.cxx
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.cxx
rename to Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.cxx
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.h b/Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.h
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestInputMaker.h
rename to Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.h
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRecoAlg.cxx b/Trigger/TrigSteer/DecisionHandling/src/TestRecoAlg.cxx
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestRecoAlg.cxx
rename to Trigger/TrigSteer/DecisionHandling/src/TestRecoAlg.cxx
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRecoAlg.h b/Trigger/TrigSteer/DecisionHandling/src/TestRecoAlg.h
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/src/TestRecoAlg.h
rename to Trigger/TrigSteer/DecisionHandling/src/TestRecoAlg.h
diff --git a/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx
index 7a1f0d36154b2180b9fdf99c6db8b3f1c610786f..7f12647651da6dbe4a0ace81a4295b0195cc39a6 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/components/DecisionHandling_entries.cxx
@@ -14,6 +14,17 @@
 #include "../ViewCreatorCentredOnIParticleROITool.h"
 #include "../ViewCreatorCentredOnClusterROITool.h"
 #include "../ViewCreatorCentredOnJetWithPVConstraintROITool.h"
+#include "../ITestHypoTool.h"
+#include "../TestHypoAlg.h"
+#include "../TestHypoTool.h"
+#include "../TestRecoAlg.h"
+#include "../TestInputMaker.h"
+
+
+DECLARE_COMPONENT( HLTTest::TestInputMaker )
+DECLARE_COMPONENT( HLTTest::TestHypoAlg )
+DECLARE_COMPONENT( HLTTest::TestHypoTool )
+DECLARE_COMPONENT( HLTTest::TestRecoAlg )
 
 DECLARE_COMPONENT( DumpDecisions )
 DECLARE_COMPONENT( RoRSeqFilter )
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx
index c4a9f0f24ebfa3d9ac3303f78ec23e9ea6a28e4d..8f54c55119779ffa922cb77beed2b9d4eda94a4f 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx
@@ -380,7 +380,7 @@ StatusCode HLTEDMCreator::createOutput(const EventContext& context) const {
       if ( not readHandle.isValid() ) { // collection is missing
 	ATH_MSG_DEBUG( "Creating missing CaloClusterContainerShallowCopy " <<  m_CaloClusterContainerShallowCopy[index].key() );
 	auto writeHandle = SG::makeHandle( m_CaloClusterContainerShallowCopyOut[index], context );
-	ATH_CHECK( writeHandle.record( std::move( std::make_unique<xAOD::CaloClusterContainer>()), std::move(std::make_unique<xAOD::ShallowAuxContainer>()) ));
+	ATH_CHECK( writeHandle.record( std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::ShallowAuxContainer>() ));
       } else {
 	ATH_MSG_DEBUG( "CaloClusterContainerShallowCopy " <<  m_CaloClusterContainerShallowCopyOut[index].key() << " present in the event, done nothing");
       }
diff --git a/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.cxx b/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.cxx
index 4a211ebb3404075e6d543a44adfd13c5c5614c48..2d883b93a885052a2c914f05f0b794d93adce9e2 100644
--- a/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.cxx
+++ b/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.cxx
@@ -36,28 +36,8 @@ namespace LVL1 {
 // Constructors and destructors
 //--------------------------------
 
-EnergyCMX::EnergyCMX
-  ( const std::string& name, ISvcLocator* pSvcLocator )
-    : AthAlgorithm( name, pSvcLocator ), 
-      m_configSvc("TrigConf::LVL1ConfigSvc/LVL1ConfigSvc", name),
-      m_EtTool("LVL1::L1EtTools/L1EtTools"),
-      m_resultsFull(0),
-      m_resultsTrunc(0)
-{
-  m_energyCMXDataLocation   = TrigT1CaloDefs::EnergyCMXDataLocation;
-  m_energyRoILocation       = TrigT1CaloDefs::EnergyROILocation ;
-  m_energyCTPLocation       = TrigT1CaloDefs::EnergyCTPLocation ;
-  m_energyTopoLocation      = TrigT1CaloDefs::EnergyTopoDataLocation ;
-  m_cmxEtsumsLocation       = TrigT1CaloDefs::CMXEtSumsLocation ;
-  m_cmxRoILocation          = TrigT1CaloDefs::CMXRoILocation ;
-  
-  // This is how you declare the paramembers to Gaudi so that
-  // they can be over-written via the job options file
-
-  declareProperty("EnergyRoILocation",       m_energyRoILocation );
-  declareProperty("EnergyCTPLocation",       m_energyCTPLocation );
-  declareProperty("EnergyCMXDataLocation",   m_energyCMXDataLocation );
-}
+EnergyCMX::EnergyCMX (const std::string& name, ISvcLocator* pSvcLocator)
+  : AthReentrantAlgorithm( name, pSvcLocator ) {}
 
 
 //---------------------------------
@@ -68,6 +48,11 @@ StatusCode EnergyCMX::initialize()
 {
   ATH_CHECK( m_configSvc.retrieve() );
   ATH_CHECK( m_EtTool.retrieve() );
+  ATH_CHECK( m_energyCMXDataLocation.initialize() );
+  ATH_CHECK( m_energyCTPLocation.initialize() );
+  ATH_CHECK( m_energyTopoLocation.initialize() );
+  ATH_CHECK( m_cmxEtsumsLocation.initialize() );
+  ATH_CHECK( m_cmxRoILocation.initialize() );
   return StatusCode::SUCCESS ;
 }
 
@@ -90,22 +75,18 @@ StatusCode EnergyCMX::start()
 //
 
 
-StatusCode EnergyCMX::execute( )
+StatusCode EnergyCMX::execute(const EventContext& ctx) const
 {
-  //make a message logging stream
-
   ATH_MSG_DEBUG( "Executing" );
    
   // form module sums
-  EnergyCMXDataCollection* jemContainer = 0;
-  ATH_CHECK(evtStore()->retrieve(jemContainer,m_energyCMXDataLocation));
+  SG::ReadHandle<EnergyCMXDataCollection> jemContainer = SG::makeHandle(m_energyCMXDataLocation, ctx);
       
   // form crate sums (full eta range)
   DataVector<CrateEnergy>* cratesFull  = new DataVector<CrateEnergy>;
-  m_EtTool->crateSums(jemContainer, cratesFull);
+  m_EtTool->crateSums(jemContainer.cptr(), cratesFull);
   // system summation and threshold tests
-  SystemEnergy resultsFull = m_EtTool->systemSums(cratesFull);
-  m_resultsFull = &resultsFull;
+  const SystemEnergy resultsFull = m_EtTool->systemSums(cratesFull);
   
   /** Find restructed eta range.
    *  This will use the min/max values for the first valid threshold in the range 9-16 to define the ranges
@@ -149,19 +130,20 @@ StatusCode EnergyCMX::execute( )
   
   // form crate sums (restricted eta range). Explicitly set restricted eta flag regardless of eta range
   DataVector<CrateEnergy>* cratesTrunc  = new DataVector<CrateEnergy>;
-  m_EtTool->crateSums(jemContainer, cratesTrunc, maskXE, maskTE, true);
+  m_EtTool->crateSums(jemContainer.cptr(), cratesTrunc, maskXE, maskTE, true);
   // system summation and threshold tests
-  SystemEnergy resultsTrunc = m_EtTool->systemSums(cratesTrunc);
-  m_resultsTrunc = &resultsTrunc;
+  const SystemEnergy resultsTrunc = m_EtTool->systemSums(cratesTrunc);
   
   // CTP Data
-  saveCTPObjects();
+  ATH_CHECK(saveCTPObjects(resultsFull, resultsTrunc, ctx));
   
   // RoI output
-  saveRoIs();
+  ATH_CHECK(saveRoIs(resultsFull, resultsTrunc, ctx));
   
   // Module readout simulation
-  DataVector<CMXEtSums>* CMXSums = new DataVector<CMXEtSums>;
+  SG::WriteHandle<CMXEtSumsCollection> CMXSums = SG::makeHandle(m_cmxEtsumsLocation, ctx);
+  ATH_CHECK(CMXSums.record(std::make_unique<CMXEtSumsCollection>()));
+
   std::vector<unsigned int> exVec;
   std::vector<unsigned int> eyVec;
   std::vector<unsigned int> etVec;
@@ -197,11 +179,11 @@ StatusCode EnergyCMX::execute( )
   }
   
   exVec.clear();
-  exVec.push_back(m_resultsFull->exTC());
+  exVec.push_back(resultsFull.exTC());
   eyVec.clear();
-  eyVec.push_back(m_resultsFull->eyTC());
+  eyVec.push_back(resultsFull.eyTC());
   etVec.clear();
-  etVec.push_back(m_resultsFull->et());
+  etVec.push_back(resultsFull.et());
   CMXEtSums* systemEtSumFull = new CMXEtSums(system_crate, LVL1::CMXEtSums::TOTAL_STANDARD,
 					     exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
   CMXSums->push_back(systemEtSumFull); 
@@ -229,51 +211,38 @@ StatusCode EnergyCMX::execute( )
   }
   
   exVec.clear();
-  exVec.push_back(m_resultsTrunc->exTC());
+  exVec.push_back(resultsTrunc.exTC());
   eyVec.clear();
-  eyVec.push_back(m_resultsTrunc->eyTC());
+  eyVec.push_back(resultsTrunc.eyTC());
   etVec.clear();
-  etVec.push_back(m_resultsTrunc->et());
+  etVec.push_back(resultsTrunc.et());
   CMXEtSums* systemEtSumTrunc = new CMXEtSums(system_crate, LVL1::CMXEtSums::TOTAL_RESTRICTED,
 					      exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
 
   CMXSums->push_back(systemEtSumTrunc); 
-  
-  // save Sums in SG
-  StatusCode sc1 = evtStore()->overwrite(CMXSums, m_cmxEtsumsLocation, true);
-  if (!sc1.isSuccess()) ATH_MSG_ERROR ( "Failed to store CMXEtsums" );
-  
+
   // Topo data
-  EnergyTopoData* topoData = new EnergyTopoData();
+  SG::WriteHandle<EnergyTopoData> topoData = SG::makeHandle(m_energyTopoLocation, ctx);
+  ATH_CHECK(topoData.record(std::make_unique<EnergyTopoData>()));
   
-  topoData->addEx(m_resultsFull->exTC(), m_resultsFull->exOverflow(), LVL1::EnergyTopoData::Normal);
-  topoData->addEy(m_resultsFull->eyTC(), m_resultsFull->eyOverflow(), LVL1::EnergyTopoData::Normal);
-  topoData->addEt(m_resultsFull->et(),   m_resultsFull->etOverflow(), LVL1::EnergyTopoData::Normal);
+  topoData->addEx(resultsFull.exTC(), resultsFull.exOverflow(), LVL1::EnergyTopoData::Normal);
+  topoData->addEy(resultsFull.eyTC(), resultsFull.eyOverflow(), LVL1::EnergyTopoData::Normal);
+  topoData->addEt(resultsFull.et(),   resultsFull.etOverflow(), LVL1::EnergyTopoData::Normal);
   
-  topoData->addEx(m_resultsTrunc->exTC(), m_resultsTrunc->exOverflow(), LVL1::EnergyTopoData::Restricted);
-  topoData->addEy(m_resultsTrunc->eyTC(), m_resultsTrunc->eyOverflow(), LVL1::EnergyTopoData::Restricted);
-  topoData->addEt(m_resultsTrunc->et(),   m_resultsTrunc->etOverflow(), LVL1::EnergyTopoData::Restricted);
-
-  StatusCode sc2 = evtStore()->overwrite(topoData, m_energyTopoLocation, true);
-  if (!sc2.isSuccess()) ATH_MSG_ERROR ( "Failed to store EnergyTopoData" );
+  topoData->addEx(resultsTrunc.exTC(), resultsTrunc.exOverflow(), LVL1::EnergyTopoData::Restricted);
+  topoData->addEy(resultsTrunc.eyTC(), resultsTrunc.eyOverflow(), LVL1::EnergyTopoData::Restricted);
+  topoData->addEt(resultsTrunc.et(),   resultsTrunc.etOverflow(), LVL1::EnergyTopoData::Restricted);
 
   // tidy up at end of event
   delete cratesFull;
   delete cratesTrunc;
-  cleanup();
  
   return StatusCode::SUCCESS ;
 }
 
-
 } // end of LVL1 namespace bracket
 
 
-/** delete pointers etc. */
-void LVL1::EnergyCMX::cleanup(){
-
-}
-
 /** retrieves the Calo config put into detectorstore by TrigT1CTP and set up trigger menu */
 void LVL1::EnergyCMX::setupTriggerMenuFromCTP(){
   ATH_MSG_DEBUG("Loading Trigger Menu");
@@ -301,22 +270,25 @@ void LVL1::EnergyCMX::setupTriggerMenuFromCTP(){
 }
 
 /** form CMXRoI & save in SG */
-void LVL1::EnergyCMX::saveRoIs(){
+StatusCode LVL1::EnergyCMX::saveRoIs(const SystemEnergy& resultsFull,
+                                     const SystemEnergy& resultsTrunc,
+                                     const EventContext& ctx) const {
   ATH_MSG_DEBUG("saveRoIs");
 
   // copy values into roi words
-  unsigned int roiWord0 = m_resultsFull->roiWord0();
-  unsigned int roiWord2 = m_resultsFull->roiWord1();
-  unsigned int roiWord4 = m_resultsFull->roiWord2();
+  unsigned int roiWord0 = resultsFull.roiWord0();
+  unsigned int roiWord2 = resultsFull.roiWord1();
+  unsigned int roiWord4 = resultsFull.roiWord2();
   
   // Truncated eta range
-  unsigned int roiWord1 = m_resultsTrunc->roiWord0();
-  unsigned int roiWord3 = m_resultsTrunc->roiWord1();
-  unsigned int roiWord5 = m_resultsTrunc->roiWord2();
+  unsigned int roiWord1 = resultsTrunc.roiWord0();
+  unsigned int roiWord3 = resultsTrunc.roiWord1();
+  unsigned int roiWord5 = resultsTrunc.roiWord2();
  
   // DAQ readout object. 
-  //CMXRoI* daqRoI = new CMXRoI(roiWord0, roiWord1, roiWord2, roiWord3, roiWord4, roiWord5);
-  CMXRoI* daqRoI = new CMXRoI();
+  SG::WriteHandle<CMXRoI> daqRoI = SG::makeHandle(m_cmxRoILocation, ctx);
+  ATH_CHECK(daqRoI.record(std::make_unique<CMXRoI>()));
+
   // Add data to RoI object. The object will perform format checks on inputs
   bool added = daqRoI->setRoiWord(roiWord0);
   if (!added) ATH_MSG_WARNING("Failed to add RoI Word 0: " << MSG::hex << roiWord0 << MSG::dec);
@@ -331,30 +303,30 @@ void LVL1::EnergyCMX::saveRoIs(){
   added = daqRoI->setRoiWord(roiWord5);
   if (!added) ATH_MSG_WARNING( "Failed to add RoI Word 5: " << MSG::hex << roiWord5 << MSG::dec );
 
-  // save RoIs in SG
-  StatusCode sc = evtStore()->overwrite(daqRoI, m_cmxRoILocation, true);
-  if (!sc.isSuccess()) ATH_MSG_ERROR ( "Failed to store CMXRoI object" );
-  
-  return;
+  return StatusCode::SUCCESS;
 }
 
 /** form CTP word from ETmiss and ETsum hits */
-unsigned int LVL1::EnergyCMX::ctpWord(unsigned int metSigPassed, unsigned int etMissPassed, unsigned int etSumPassed){
+unsigned int LVL1::EnergyCMX::ctpWord(unsigned int metSigPassed,
+                                      unsigned int etMissPassed,
+                                      unsigned int etSumPassed) const {
 
   return ( (metSigPassed<<(m_def.max_TE_Threshold_Number()+m_def.max_XE_Threshold_Number())) +
 	   (etMissPassed<<m_def.max_TE_Threshold_Number()) + etSumPassed );
 }
 
 /** form CTP objects and store them in SG. */
-void LVL1::EnergyCMX::saveCTPObjects(){
+StatusCode LVL1::EnergyCMX::saveCTPObjects(const SystemEnergy& resultsFull,
+                                           const SystemEnergy& resultsTrunc,
+                                           const EventContext& ctx) const {
   ATH_MSG_DEBUG("saveCTPObjects");
 
   // get bit words of thresholds passed
-  unsigned int etSumHitsFull   = m_resultsFull->etSumHits();
-  unsigned int etMissHitsFull  = m_resultsFull->etMissHits();
-  unsigned int metSigHitsFull  = m_resultsFull->metSigHits();
-  unsigned int etSumHitsTrunc  = m_resultsTrunc->etSumHits();
-  unsigned int etMissHitsTrunc = m_resultsTrunc->etMissHits();
+  unsigned int etSumHitsFull   = resultsFull.etSumHits();
+  unsigned int etMissHitsFull  = resultsFull.etMissHits();
+  unsigned int metSigHitsFull  = resultsFull.metSigHits();
+  unsigned int etSumHitsTrunc  = resultsTrunc.etSumHits();
+  unsigned int etMissHitsTrunc = resultsTrunc.etMissHits();
 
   // form CTP words
   unsigned int word0 = ctpWord(metSigHitsFull, etMissHitsFull, etSumHitsFull);
@@ -364,18 +336,10 @@ void LVL1::EnergyCMX::saveCTPObjects(){
   //temp += (genParity.odd(temp)<<31);
 
   // form CTP object
-  EnergyCTP* energyCTP = new EnergyCTP( word0, word1 );
-
-  // record in SG
-  StatusCode sc = evtStore()->overwrite(energyCTP, m_energyCTPLocation);
-  if (sc.isSuccess() ){
-    ATH_MSG_DEBUG( "Stored energy CTP object with words "<< std::hex
-       << (energyCTP->cableWord0()) << ", " <<  (energyCTP->cableWord1())<< std::dec);
-  }else{
-    ATH_MSG_ERROR("Failed to store energy CTP object ");
-  }
-  return;  
-}
-
-
+  SG::WriteHandle<EnergyCTP> energyCTP = SG::makeHandle(m_energyCTPLocation, ctx);
+  ATH_CHECK(energyCTP.record(std::make_unique<EnergyCTP>(word0, word1)));
+  ATH_MSG_DEBUG( "Stored energy CTP object with words "<< std::hex
+    << (energyCTP->cableWord0()) << ", " <<  (energyCTP->cableWord1())<< std::dec);
 
+  return StatusCode::SUCCESS;
+}
diff --git a/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.h b/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.h
index 4cb7152697651ccf763f65574b7e169d3308d833..fc390d5ca315e2a1f160665c40c8e1bbb419d46a 100644
--- a/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.h
+++ b/Trigger/TrigT1/TrigT1CaloSim/src/EnergyCMX.h
@@ -18,14 +18,12 @@
  #include <map>
 
  // Athena/Gaudi
- #include "AthenaBaseComps/AthAlgorithm.h"
+ #include "AthenaBaseComps/AthReentrantAlgorithm.h"
  #include "GaudiKernel/ServiceHandle.h"  
  #include "GaudiKernel/ToolHandle.h"
- 
  #include "AthContainers/DataVector.h"
-
- // Athena/Gaudi includes
- #include "GaudiKernel/DataSvc.h"
+ #include "StoreGate/ReadHandleKey.h"
+ #include "StoreGate/WriteHandleKey.h"
  
  // LVL1 Calo Trigger
  #include "TrigT1CaloUtils/CrateEnergy.h"
@@ -50,9 +48,10 @@
  EnergyCMX uses EnergyCrate and JetElement objects in order to closely follow
  the layout of the hardware.
    */
- class EnergyCMX : public AthAlgorithm
+ class EnergyCMX : public AthReentrantAlgorithm
  {
   typedef DataVector<EnergyCMXData> EnergyCMXDataCollection;
+  typedef DataVector<CMXEtSums> CMXEtSumsCollection;
   public:
 
    //-------------------------
@@ -71,43 +70,54 @@
 
    virtual StatusCode initialize() override;
    virtual StatusCode start() override;
-   virtual StatusCode execute() override;
+   virtual StatusCode execute(const EventContext& ctx) const override;
 
 private: // Private attributes
-  ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc;
-  ToolHandle<LVL1::IL1EtTools> m_EtTool;
-
-  /* StoreGate keys */
-  std::string   m_energyCMXDataLocation ;
-  std::string   m_energyRoILocation ;
-  std::string   m_energyCTPLocation ;
-  std::string   m_energyTopoLocation ;
-  std::string   m_cmxEtsumsLocation ;
-  std::string   m_cmxRoILocation ;
-  
-  /** SystemEnergy object returns results of ET trigger algorithms */
-  SystemEnergy* m_resultsFull;
-  SystemEnergy* m_resultsTrunc;
+  /* Service and tool handles */
+  ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc {
+    this, "LVL1ConfigSvc", "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc", "Service providing L1 menu thresholds"};
+  ToolHandle<LVL1::IL1EtTools> m_EtTool {
+    this, "L1EtTools", "LVL1::L1EtTools/L1EtTools", "Tool performing the simulation"};
+
+  /* Input handles */
+  SG::ReadHandleKey<EnergyCMXDataCollection> m_energyCMXDataLocation {
+    this, "EnergyCMXDataLocation", TrigT1CaloDefs::EnergyCMXDataLocation,
+    "Read handle key for EnergyCMXDataCollection"};
+
+  /* Output handles */
+  SG::WriteHandleKey<EnergyCTP> m_energyCTPLocation {
+    this, "EnergyCTPLocation", TrigT1CaloDefs::EnergyCTPLocation,
+    "Write handle key for EnergyCTP"};
+  SG::WriteHandleKey<EnergyTopoData> m_energyTopoLocation {
+    this, "EnergyTopoDataLocation", TrigT1CaloDefs::EnergyTopoDataLocation,
+    "Write handle key for EnergyTopoData"};
+  SG::WriteHandleKey<CMXEtSumsCollection> m_cmxEtsumsLocation {
+    this, "CMXEtSumsLocation", TrigT1CaloDefs::CMXEtSumsLocation,
+    "Write handle key for CMXEtSumsCollection"};
+  SG::WriteHandleKey<CMXRoI> m_cmxRoILocation {
+    this, "CMXRoILocation", TrigT1CaloDefs::CMXRoILocation,
+    "Write handle key for CMXRoI"};
 
   TrigConf::L1DataDef m_def;
       
 private: // Private methods
   
-  /** delete pointers etc. */
-  void cleanup();
-  
   /** find Trigger Menu set by CTP, and set internal TM values from it*/
   void setupTriggerMenuFromCTP();
 
   /** form CTP objects and store them in SG. */
-  void saveCTPObjects();
-  /** put EnergyRoIs into SG */
-  void saveRoIs();
+  StatusCode saveCTPObjects(const SystemEnergy& resultsFull,
+                            const SystemEnergy& resultsTrunc,
+                            const EventContext& ctx) const;
   /** put EnergyRoIs into SG */
-  void saveJEMEtSums();
+  StatusCode saveRoIs(const SystemEnergy& resultsFull,
+                      const SystemEnergy& resultsTrunc,
+                      const EventContext& ctx) const;
   
   /** returns the Energy CTP word */
-  unsigned int ctpWord(unsigned int metSigPassed, unsigned int etMissPassed, unsigned int etSumPassed);
+  unsigned int ctpWord(unsigned int metSigPassed,
+                       unsigned int etMissPassed,
+                       unsigned int etSumPassed) const;
 };
 
 } // end of namespace bracket
diff --git a/Trigger/TrigT1/TrigT1CaloUtils/TrigT1CaloUtils/SystemEnergy.h b/Trigger/TrigT1/TrigT1CaloUtils/TrigT1CaloUtils/SystemEnergy.h
index 53e2eeae6ae125eaa1bea2f99bf4341268f0e4ca..5945cb6478f5b9991c0e5af90bbc9678d10fb364 100755
--- a/Trigger/TrigT1/TrigT1CaloUtils/TrigT1CaloUtils/SystemEnergy.h
+++ b/Trigger/TrigT1/TrigT1CaloUtils/TrigT1CaloUtils/SystemEnergy.h
@@ -41,24 +41,24 @@ public:
 
 public:
   /** return global et, ex, ey sums */
-  int et();
-  int ex();
-  int ey();
+  int et() const;
+  int ex() const;
+  int ey() const;
   /** 15 bit twos-complement format */
-  unsigned int exTC();
-  unsigned int eyTC();
+  unsigned int exTC() const;
+  unsigned int eyTC() const;
   /** Overflow bits */
-  unsigned int exOverflow();
-  unsigned int eyOverflow();
-  unsigned int etOverflow();
+  unsigned int exOverflow() const;
+  unsigned int eyOverflow() const;
+  unsigned int etOverflow() const;
   /** Trigger Results */
-  unsigned int etMissHits();
-  unsigned int etSumHits();
-  unsigned int metSigHits();
+  unsigned int etMissHits() const;
+  unsigned int etSumHits() const;
+  unsigned int metSigHits() const;
   /** RoI words */
-  unsigned int roiWord0();
-  unsigned int roiWord1();
-  unsigned int roiWord2();
+  unsigned int roiWord0() const;
+  unsigned int roiWord1() const;
+  unsigned int roiWord2() const;
   
 private:
   ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc;
@@ -83,8 +83,8 @@ private:
   void etMissTrigger();
   void etSumTrigger();
   void metSigTrigger();
-  unsigned int encodeTC(int input);
-  int decodeTC(unsigned int input);
+  unsigned int encodeTC(int input) const;
+  int decodeTC(unsigned int input) const;
 
 };
 
diff --git a/Trigger/TrigT1/TrigT1CaloUtils/src/SystemEnergy.cxx b/Trigger/TrigT1/TrigT1CaloUtils/src/SystemEnergy.cxx
index b7bb34beb8bc64d9b51eb7a773be83eeaf73f2c2..6566144b9c98f95255a29c91f89220c004774bd1 100755
--- a/Trigger/TrigT1/TrigT1CaloUtils/src/SystemEnergy.cxx
+++ b/Trigger/TrigT1/TrigT1CaloUtils/src/SystemEnergy.cxx
@@ -144,73 +144,73 @@ SystemEnergy::~SystemEnergy()
 }
 
 /** return crate Et */
-int SystemEnergy::et()
+int SystemEnergy::et() const
 {
   return m_systemEt;
 }
 
 /** return crate Ex */
-int SystemEnergy::ex()
+int SystemEnergy::ex() const
 {
   return m_systemEx;
 }
 
 /** return crate Ey */
-int SystemEnergy::ey()
+int SystemEnergy::ey() const
 {
   return m_systemEy;
 }
 
 /** return Et overflow bit */
-unsigned int SystemEnergy::etOverflow()
+unsigned int SystemEnergy::etOverflow() const
 {
   return m_overflowT & 0x1;
 }
 
 /** return Ex overflow bit */
-unsigned int SystemEnergy::exOverflow()
+unsigned int SystemEnergy::exOverflow() const
 {
   return m_overflowX & 0x1;
 }
 
 /** return Ey overflow bit */
-unsigned int SystemEnergy::eyOverflow()
+unsigned int SystemEnergy::eyOverflow() const
 {
   return m_overflowY & 0x1;
 }
 
 /** return crate Ex in 15-bit twos-complement format (hardware format) */
-unsigned int SystemEnergy::exTC()
+unsigned int SystemEnergy::exTC() const
 {
   return encodeTC(m_systemEx);
 }
 
 /** return crate Ey in 15-bit twos-complement format (hardware format) */
-unsigned int SystemEnergy::eyTC()
+unsigned int SystemEnergy::eyTC() const
 {
   return encodeTC(m_systemEy);
 }
 
 /** return EtMiss hits */
-unsigned int SystemEnergy::etMissHits()
+unsigned int SystemEnergy::etMissHits() const
 {
   return m_etMissHits;
 }
 
 /** return EtSum hits */
-unsigned int SystemEnergy::etSumHits()
+unsigned int SystemEnergy::etSumHits() const
 {
   return m_etSumHits;
 }
 
 /** return MEtSig hits */
-unsigned int SystemEnergy::metSigHits()
+unsigned int SystemEnergy::metSigHits() const
 {
   return m_metSigHits;
 }
 
 /** return RoI word 0 (Ex value & overflow) */
-unsigned int SystemEnergy::roiWord0()
+unsigned int SystemEnergy::roiWord0() const
 {
   // Start by setting up header
   unsigned int word = TrigT1CaloDefs::energyRoIType << 30;
@@ -227,7 +227,7 @@ unsigned int SystemEnergy::roiWord0()
 }
 
 /** return RoI word 1 (Ey value & overflow, EtSum hits) */
-unsigned int SystemEnergy::roiWord1()
+unsigned int SystemEnergy::roiWord1() const
 {
   // Start by setting up header
   unsigned int word = TrigT1CaloDefs::energyRoIType << 30;
@@ -244,7 +244,7 @@ unsigned int SystemEnergy::roiWord1()
 }
 
 /** return RoI word 2 (Et value & overflow, EtMiss hits) */
-unsigned int SystemEnergy::roiWord2()
+unsigned int SystemEnergy::roiWord2() const
 {
   // Start by setting up header
   unsigned int word = TrigT1CaloDefs::energyRoIType << 30;
@@ -426,7 +426,7 @@ void SystemEnergy::metSigTrigger()
 }
 
 /** encode int as 15-bit twos-complement format (hardware Ex/Ey format) */
-unsigned int SystemEnergy::encodeTC(int input)
+unsigned int SystemEnergy::encodeTC(int input) const
 {
   unsigned int value;
 
@@ -444,7 +444,7 @@ unsigned int SystemEnergy::encodeTC(int input)
 }
 
 /** decode 15-bit twos-complement format (hardware Ex/Ey format) as int */
-int SystemEnergy::decodeTC(unsigned int input)
+int SystemEnergy::decodeTC(unsigned int input) const
 {
 
   int mask = (1 << m_sumBits) - 1;
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
index 747d1c431140cafa2cdc75255f7bd58dc5d3bb46..c71a10e3d15445198325156f6b3cf1f6d9282a55 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref
@@ -111,6 +111,9 @@ TrigSignatureMoniMT                                 INFO -- #899946230 Features
 TrigSignatureMoniMT                                 INFO HLT_e17_lhvloose_nod0_L1EM15VH #140779220
 TrigSignatureMoniMT                                 INFO -- #140779220 Events          8          8          6          6          6          5          -          -          -          -          -          -          -          -          5
 TrigSignatureMoniMT                                 INFO -- #140779220 Features                              6          78         10         5          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_e20_lhmedium_e15_lhmedium_Zee_L12EM3 #1784800924
+TrigSignatureMoniMT                                 INFO -- #1784800924 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1784800924 Features                             0          0          0          0          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_e26_etcut_L1EM22VHI #1703681121
 TrigSignatureMoniMT                                 INFO -- #1703681121 Events         6          6          6          6          6          -          -          -          -          -          -          -          -          -          6
 TrigSignatureMoniMT                                 INFO -- #1703681121 Features                             7          133        7          -          -          -          -          -          -          -          -          -
@@ -129,12 +132,6 @@ TrigSignatureMoniMT                                 INFO -- #2128128255 Features
 TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_g5_etcut_L12EM3 #1745513164
 TrigSignatureMoniMT                                 INFO -- #1745513164 Events         20         20         17         17         17         -          -          -          -          -          -          -          -          -          17
 TrigSignatureMoniMT                                 INFO -- #1745513164 Features                             55         55         55         -          -          -          -          -          -          -          -          -
-TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_mu26_L1EM8I_MU10 #2209076666
-TrigSignatureMoniMT                                 INFO -- #2209076666 Events         5          5          3          0          0          0          3          1          1          1          -          -          -          -          1
-TrigSignatureMoniMT                                 INFO -- #2209076666 Features                             3          0          0          0          3          1          1          1          -          -          -          -
-TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_mu6fast_L1EM8I_MU10 #2086577378
-TrigSignatureMoniMT                                 INFO -- #2086577378 Events         5          5          3          0          0          0          3          -          -          -          -          -          -          -          3
-TrigSignatureMoniMT                                 INFO -- #2086577378 Features                             3          0          0          0          3          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_e3_etcut_L1EM3 #683953566
 TrigSignatureMoniMT                                 INFO -- #683953566 Events          20         20         20         20         20         -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #683953566 Features                              171        1843       390        -          -          -          -          -          -          -          -          -
@@ -486,12 +483,6 @@ TrigSignatureMoniMT                                 INFO -- #4065285611 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1J100 #1026959128
 TrigSignatureMoniMT                                 INFO -- #1026959128 Events         3          3          -          -          -          -          -          -          -          -          -          -          -          -          3
 TrigSignatureMoniMT                                 INFO -- #1026959128 Features                             -          -          -          -          -          -          -          -          -          -          -          -
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1J12 #2640820608
-TrigSignatureMoniMT                                 INFO -- #2640820608 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20
-TrigSignatureMoniMT                                 INFO -- #2640820608 Features                             -          -          -          -          -          -          -          -          -          -          -          -
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1J120 #2116228652
-TrigSignatureMoniMT                                 INFO -- #2116228652 Events         1          1          -          -          -          -          -          -          -          -          -          -          -          -          1
-TrigSignatureMoniMT                                 INFO -- #2116228652 Features                             -          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1J15 #1976430774
 TrigSignatureMoniMT                                 INFO -- #1976430774 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20
 TrigSignatureMoniMT                                 INFO -- #1976430774 Features                             -          -          -          -          -          -          -          -          -          -          -          -
@@ -534,9 +525,6 @@ TrigSignatureMoniMT                                 INFO -- #4248050338 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU12IM #357557968
 TrigSignatureMoniMT                                 INFO -- #357557968 Events          14         14         -          -          -          -          -          -          -          -          -          -          -          -          14
 TrigSignatureMoniMT                                 INFO -- #357557968 Features                              -          -          -          -          -          -          -          -          -          -          -          -
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU20 #3602376876
-TrigSignatureMoniMT                                 INFO -- #3602376876 Events         14         14         -          -          -          -          -          -          -          -          -          -          -          -          14
-TrigSignatureMoniMT                                 INFO -- #3602376876 Features                             -          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU20IM #1931583332
 TrigSignatureMoniMT                                 INFO -- #1931583332 Events         10         10         -          -          -          -          -          -          -          -          -          -          -          -          10
 TrigSignatureMoniMT                                 INFO -- #1931583332 Features                             -          -          -          -          -          -          -          -          -          -          -          -
@@ -549,9 +537,6 @@ TrigSignatureMoniMT                                 INFO -- #1394621652 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU60 #3332424451
 TrigSignatureMoniMT                                 INFO -- #3332424451 Events         5          5          -          -          -          -          -          -          -          -          -          -          -          -          5
 TrigSignatureMoniMT                                 INFO -- #3332424451 Features                             -          -          -          -          -          -          -          -          -          -          -          -
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU8 #3165115874
-TrigSignatureMoniMT                                 INFO -- #3165115874 Events         19         19         -          -          -          -          -          -          -          -          -          -          -          -          19
-TrigSignatureMoniMT                                 INFO -- #3165115874 Features                             -          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1XE10 #1583053368
 TrigSignatureMoniMT                                 INFO -- #1583053368 Events         19         19         -          -          -          -          -          -          -          -          -          -          -          -          19
 TrigSignatureMoniMT                                 INFO -- #1583053368 Features                             -          -          -          -          -          -          -          -          -          -          -          -
@@ -609,9 +594,6 @@ TrigSignatureMoniMT                                 INFO -- #2991490897 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_cosmiccalo_L1J30_FIRSTEMPTY #2214697960
 TrigSignatureMoniMT                                 INFO -- #2214697960 Events         0          0          -          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #2214697960 Features                             -          -          -          -          -          -          -          -          -          -          -          -
-TrigSignatureMoniMT                                 INFO HLT_noalg_cosmiccalo_L1RD1_BGRP10 #48519027
-TrigSignatureMoniMT                                 INFO -- #48519027 Events           0          0          -          -          -          -          -          -          -          -          -          -          -          -          0
-TrigSignatureMoniMT                                 INFO -- #48519027 Features                               -          -          -          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_noalg_cosmiccalo_L1RD1_EMPTY #3925252528
 TrigSignatureMoniMT                                 INFO -- #3925252528 Events         0          0          -          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #3925252528 Features                             -          -          -          -          -          -          -          -          -          -          -          -
@@ -654,6 +636,12 @@ TrigSignatureMoniMT                                 INFO -- #2725693236 Features
 TrigSignatureMoniMT                                 INFO HLT_tau160_idperf_tracktwo_L1TAU100 #886074432
 TrigSignatureMoniMT                                 INFO -- #886074432 Events          0          0          0          0          0          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #886074432 Features                              0          0          0          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_tau160_medium1_tracktwoEF_L1TAU100 #1720193283
+TrigSignatureMoniMT                                 INFO -- #1720193283 Events         0          0          0          0          0          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1720193283 Features                             0          0          0          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_tau160_medium1_tracktwo_L1TAU100 #4069120574
+TrigSignatureMoniMT                                 INFO -- #4069120574 Events         0          0          0          0          0          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4069120574 Features                             0          0          0          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_tau160_mediumRNN_tracktwoMVA_L1TAU100 #1747754287
 TrigSignatureMoniMT                                 INFO -- #1747754287 Events         0          0          0          0          0          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1747754287 Features                             0          0          0          -          -          -          -          -          -          -          -          -
@@ -663,6 +651,12 @@ TrigSignatureMoniMT                                 INFO -- #2334140248 Features
 TrigSignatureMoniMT                                 INFO HLT_tau160_perf_tracktwo_L1TAU100 #1799096347
 TrigSignatureMoniMT                                 INFO -- #1799096347 Events         0          0          0          0          0          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1799096347 Features                             0          0          0          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_tau200_medium1_tracktwoEF_L1TAU100 #4203471951
+TrigSignatureMoniMT                                 INFO -- #4203471951 Events         0          0          0          0          0          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #4203471951 Features                             0          0          0          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_tau200_mediumRNN_tracktwoMVA_L1TAU100 #1468926272
+TrigSignatureMoniMT                                 INFO -- #1468926272 Events         0          0          0          0          0          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #1468926272 Features                             0          0          0          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_tau25_idperf_track_L1TAU12IM #554271976
 TrigSignatureMoniMT                                 INFO -- #554271976 Events          14         14         14         14         -          -          -          -          -          -          -          -          -          -          14
 TrigSignatureMoniMT                                 INFO -- #554271976 Features                              24         24         -          -          -          -          -          -          -          -          -          -
@@ -714,6 +708,9 @@ TrigSignatureMoniMT                                 INFO -- #1275052132 Features
 TrigSignatureMoniMT                                 INFO HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM #2456480859
 TrigSignatureMoniMT                                 INFO -- #2456480859 Events         14         14         11         10         6          -          -          -          -          -          -          -          -          -          6
 TrigSignatureMoniMT                                 INFO -- #2456480859 Features                             20         14         8          -          -          -          -          -          -          -          -          -
+TrigSignatureMoniMT                                 INFO HLT_tau80_medium1_tracktwo_L1TAU60 #598963338
+TrigSignatureMoniMT                                 INFO -- #598963338 Events          5          5          4          1          0          -          -          -          -          -          -          -          -          -          0
+TrigSignatureMoniMT                                 INFO -- #598963338 Features                              4          1          0          -          -          -          -          -          -          -          -          -
 TrigSignatureMoniMT                                 INFO HLT_tilecalib_laser_TilePEB_L1CALREQ2 #1063154655
 TrigSignatureMoniMT                                 INFO -- #1063154655 Events         0          0          0          -          -          -          -          -          -          -          -          -          -          -          0
 TrigSignatureMoniMT                                 INFO -- #1063154655 Features                             0          -          -          -          -          -          -          -          -          -          -          -
diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 09cb8878ae7243c1db158cc524754be649bea6c9..8f1b961516c58b4a09399505cf62f599773e71ae 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -120,6 +120,9 @@ class TrigInDetdictStep(Step):
         super(TrigInDetdictStep, self).configure(test)
 
 
+
+
+
 class TrigInDetCompStep(RefComparisonStep):
     '''
     Execute TIDAcomparitor for data.root files.
@@ -127,15 +130,63 @@ class TrigInDetCompStep(RefComparisonStep):
     def __init__(self, name='TrigInDetComp'):
         super(TrigInDetCompStep, self).__init__(name)
         self.input_file = 'data-hists.root'
-#        self.ref_file = 'data-hists.root'   #### need to add reference file here 
         self.output_dir = 'HLT-plots'
         self.chains = ' '
         self.args = ''
+        self.test = ' '
         self.auto_report_result = True
         self.required = True
         self.executable = 'TIDAcomparitor'
     
     def configure(self, test):
+        if (self.flag == 'L2muon'):
+            self.chains = 'HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF'
+            self.output_dir = 'HLTL2-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-muon'
+        elif (self.flag == 'EFmuon'):
+            self.chains='HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_IDTrig'
+            self.output_dir = 'HLTEF-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-muon'
+        elif (self.flag == 'L2bjet'):
+            self.chains='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF'
+            self.output_dir = 'HLTL2-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-bjet'
+        elif (self.flag == 'EFbjet'):
+            self.chains='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig'
+            self.output_dir = 'HLTEF-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-bjet'
+        elif (self.flag == 'L2tau'):
+            self.chains = 'HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF'
+            self.output_dir = 'HLTL2-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-tau'
+        elif (self.flag == 'EFtau'):
+            self.chains = 'HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig'
+            self.output_dir = 'HLTEF-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-tau'
+        elif (self.flag == 'L2ele'):
+            self.chains = 'HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_FTF'
+            self.output_dir = 'HLTL2-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-electron'
+        elif (self.flag == 'EFele'):
+            self.chains = 'HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_FTF HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_IDTrig'
+            self.output_dir = 'HLTEF-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-electron'
+        elif (self.flag == 'L2FS'):
+            self.chains = 'HLT_IDTrack_FS_FTF'
+            self.output_dir = 'HLTL2-plots'
+            if (self.test=='ttbar'):
+                self.output_dir = self.output_dir+'-FS'
+        else:
+            print('Unknown flag for comparitor step ', self.flag) 
+
         if (self.reference == None):
             # if no referenc found, use input file as reference
             self.args += self.input_file+' '+self.input_file+' '+self.chains+' -d '+self.output_dir
@@ -144,6 +195,7 @@ class TrigInDetCompStep(RefComparisonStep):
         super(TrigInDetCompStep, self).configure(test)
 
 
+
 class TrigInDetCpuCostStep(RefComparisonStep):
     '''
     Execute TIDAcpucost for expert-monitoring.root files.
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
index e1fc8bfc1ec8d174de2a0648a60e48e2a56158d1..6bdeccf6197c0dba79b08e17b7d4a522bf19317f 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
@@ -150,8 +150,9 @@ if ( True ) :
     ":HLT_IDTrack_FS_FTF",
 
     "HLT_mu.*_idperf.*:HLT_IDTrack_Muon_FTF",
+    "HLT_mu.*_idperf.*:HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon",
     "HLT_mu.*_idperf.*:HLT_IDTrack_Muon_IDTrig",
-
+  
     "HLT_b.*perf.*:HLT_IDTrack_Bjet_FTF",
     "HLT_b.*perf.*:HLT_IDTrack_Bjet_IDTrig",
     "HLT_j.*perf.*:HLT_IDTrack_Bjet_FTF",
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
new file mode 100755
index 0000000000000000000000000000000000000000..69a74405ae6e131896d8cd0c71d27d87cc4270d7
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+
+# art-description: art job for all_ttbar_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input-nfiles: 3
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['muon','electron','tau','bjet']
+rdo2aod.max_events = 2000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+rdo2aod.input = 'ttbar'   # defined in TrigValTools/share/TrigValInputs.json  
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -r Offline -f data-hists.root -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag='L2muon'
+comp.test='ttbar'
+test.check_steps.append(comp)
+ 
+ 
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag='EFmuon'
+comp2.test='ttbar'
+test.check_steps.append(comp2)
+
+
+comp3=TrigInDetCompStep('Comp_L2bjet')
+comp3.flag='L2bjet'
+comp3.test='ttbar'
+test.check_steps.append(comp3)
+
+comp4=TrigInDetCompStep('Comp_EFbjet')
+comp4.flag='EFbjet'
+comp4.test='ttbar'
+test.check_steps.append(comp4)
+
+comp5=TrigInDetCompStep('Comp_L2tau')
+comp5.flag='L2tau'
+comp5.test='ttbar'
+test.check_steps.append(comp5)
+
+comp6=TrigInDetCompStep('Comp_EFtau')
+comp6.flag='EFtau'
+comp6.test='ttbar'
+test.check_steps.append(comp6)
+
+comp7=TrigInDetCompStep('Comp_L2ele')
+comp7.flag='L2ele'
+comp7.test='ttbar'
+test.check_steps.append(comp7)
+
+comp8=TrigInDetCompStep('Comp_EFele')
+comp8.flag='EFele'
+comp8.test='ttbar'
+test.check_steps.append(comp8)
+
+comp9=TrigInDetCompStep('Comp_L2FS')
+comp9.flag='L2FS'
+comp9.test='ttbar'
+test.check_steps.append(comp9)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
index 9ad0519a0374370a348ad9eb75f99484ede60fca..3e245532abfa3e47ad528452aba55054b9c4375d 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
@@ -1,10 +1,11 @@
 #!/usr/bin/env python
 
-# art-description: art job for all_ttbar_pu80_grid
+# art-description: art job for all_ttbar_pu80
 # art-type: grid
 # art-include: master/Athena
 # art-input-nfiles: 3
 # art-athena-mt: 4
+# art-memory: 4096
 # art-output: *.txt
 # art-output: *.log
 # art-output: log.*
@@ -58,7 +59,7 @@ rdo2aod.threads = 1 # TODO: change to 4
 rdo2aod.concurrent_events = 1 # TODO: change to 4
 rdo2aod.perfmon = False
 rdo2aod.timeout = 18*3600
-rdo2aod.input = 'ttbar_pu80'   
+rdo2aod.input = 'ttbar_pu80'   # defined in TrigValTools/share/TrigValInputs.json  
 
 
 test = Test.Test()
@@ -76,33 +77,49 @@ if ((not exclude) or postproc ):
 
  
 # Now the comparitor steps
-comp=TrigInDetCompStep('CompareStep1')
-comp.chains = 'HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF'
-comp.output_dir = 'HLTL2-plots-muon'
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag='L2muon'
+comp.test='ttbar'
 test.check_steps.append(comp)
  
  
-comp2=TrigInDetCompStep('CompareStep2')
-comp2.chains='HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF  HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_IDTrig'
-comp2.output_dir = 'HLTEF-plots-muon'
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag='EFmuon'
+comp2.test='ttbar'
 test.check_steps.append(comp2)
 
-comp3=TrigInDetCompStep('CompareStep3')
-comp3.chains='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig'
-comp3.output_dir = 'HLTEF-plots-bjet'
+
+comp3=TrigInDetCompStep('Comp_L2bjet')
+comp3.flag='L2bjet'
+comp3.test='ttbar'
 test.check_steps.append(comp3)
 
-comp4=TrigInDetCompStep('CompareStep4')
-comp4.chains='HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_FTF HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_IDTrig'
-comp4.output_dir = 'HLTEF-plots-electron'
+comp4=TrigInDetCompStep('Comp_EFbjet')
+comp4.flag='EFbjet'
+comp4.test='ttbar'
 test.check_steps.append(comp4)
 
-comp5=TrigInDetCompStep('CompareStep5')
-comp5.chains='HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig'
-comp5.output_dir = 'HLTEF-plots-tau'
+comp5=TrigInDetCompStep('Comp_L2tau')
+comp5.flag='L2tau'
+comp5.test='ttbar'
 test.check_steps.append(comp5)
 
+comp6=TrigInDetCompStep('Comp_EFtau')
+comp6.flag='EFtau'
+comp6.test='ttbar'
+test.check_steps.append(comp6)
+
+comp7=TrigInDetCompStep('Comp_L2ele')
+comp7.flag='L2ele'
+comp7.test='ttbar'
+test.check_steps.append(comp7)
+
+comp8=TrigInDetCompStep('Comp_EFele')
+comp8.flag='EFele'
+comp8.test='ttbar'
+test.check_steps.append(comp8)
 
+# CPU cost steps
 cpucost=TrigInDetCpuCostStep('CpuCostStep1')
 test.check_steps.append(cpucost)
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
index b67f68f0561fb368cb66a5a8b28569011fa52e0f..1799887d009f9120d180380d7d08e51a877a9278 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
@@ -1,10 +1,11 @@
 #!/usr/bin/env python
 
-# art-description: art job for all_ttbar_pu80_mp_grid
+# art-description: art job for all_ttbar_pu80_mt
 # art-type: grid
 # art-include: master/Athena
 # art-input-nfiles: 3
 # art-athena-mt: 4
+# art-memory: 4096
 # art-output: *.txt
 # art-output: *.log
 # art-output: log.*
@@ -48,12 +49,12 @@ for opt,arg in opts:
 
 rdo2aod = TrigInDetReco()
 rdo2aod.slices = ['muon','electron','tau','bjet']
-rdo2aod.max_events = 1000 # TODO: 2000 events
+rdo2aod.max_events = 2000 
 rdo2aod.threads = 1 # TODO: change to 4
 rdo2aod.concurrent_events = 4 
 rdo2aod.perfmon = False
 rdo2aod.timeout = 18*3600
-rdo2aod.input = 'ttbar_pu80'   
+rdo2aod.input = 'ttbar_pu80'   # defined in TrigValTools/share/TrigValInputs.json  
 
 
 test = Test.Test()
@@ -68,33 +69,50 @@ test.exec_steps.append(TrigInDetAna())
 test.check_steps.append(TrigInDetdictStep())
  
 # Now the comparitor steps
-comp=TrigInDetCompStep('CompareStep1')
-comp.chains = 'HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF'
-comp.output_dir = 'HLTL2-plots-muon'
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag='L2muon'
+comp.test='ttbar'
 test.check_steps.append(comp)
  
  
-comp2=TrigInDetCompStep('CompareStep2')
-comp2.chains='HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF  HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_IDTrig'
-comp2.output_dir = 'HLTEF-plots-muon'
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag='EFmuon'
+comp2.test='ttbar'
 test.check_steps.append(comp2)
 
-comp3=TrigInDetCompStep('CompareStep3')
-comp3.chains='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig'
-comp3.output_dir = 'HLTEF-plots-bjet'
+
+comp3=TrigInDetCompStep('Comp_L2bjet')
+comp3.flag='L2bjet'
+comp3.test='ttbar'
 test.check_steps.append(comp3)
 
-comp4=TrigInDetCompStep('CompareStep4')
-comp4.chains='HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_FTF HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_IDTrig'
-comp4.output_dir = 'HLTEF-plots-electron'
+comp4=TrigInDetCompStep('Comp_EFbjet')
+comp4.flag='EFbjet'
+comp4.test='ttbar'
 test.check_steps.append(comp4)
 
-comp5=TrigInDetCompStep('CompareStep5')
-comp5.chains='HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig'
-comp5.output_dir = 'HLTEF-plots-tau'
+comp5=TrigInDetCompStep('Comp_L2tau')
+comp5.flag='L2tau'
+comp5.test='ttbar'
 test.check_steps.append(comp5)
 
+comp6=TrigInDetCompStep('Comp_EFtau')
+comp6.flag='EFtau'
+comp6.test='ttbar'
+test.check_steps.append(comp6)
+
+comp7=TrigInDetCompStep('Comp_L2ele')
+comp7.flag='L2ele'
+comp7.test='ttbar'
+test.check_steps.append(comp7)
+
+comp8=TrigInDetCompStep('Comp_EFele')
+comp8.flag='EFele'
+comp8.test='ttbar'
+test.check_steps.append(comp8)
+
 
+# CPU cost steps
 cpucost=TrigInDetCpuCostStep('CpuCostStep1')
 test.check_steps.append(cpucost)
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
new file mode 100755
index 0000000000000000000000000000000000000000..298f1d250f0614b8f41f87aae180fa9a6c440ffc
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+
+# art-description: art job for all_ttbar_pu80_mt2
+# art-type: grid
+# art-include: master/Athena
+# art-input-nfiles: 3
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLTEF-plots
+# art-output: HLTL2-plots
+# art-output: times
+# art-output: times-FTF
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"l",["local"])
+except getopt.GetoptError:
+    print("Usage: -l(--local)")
+
+
+local=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+
+
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['muon','electron','tau','bjet']
+rdo2aod.max_events = 2000 
+rdo2aod.threads = 4 
+rdo2aod.concurrent_events = 4 
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+rdo2aod.input = 'ttbar_pu80'   # defined in TrigValTools/share/TrigValInputs.json  
+
+
+test = Test.Test()
+test.art_type = 'grid'
+test.exec_steps = [rdo2aod]
+test.check_steps = CheckSteps.default_check_steps(test)
+
+# Run analysis to produce TrkNtuple
+test.exec_steps.append(TrigInDetAna())
+ 
+# Run Tidardict
+test.check_steps.append(TrigInDetdictStep())
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag='L2muon'
+comp.test='ttbar'
+test.check_steps.append(comp)
+ 
+ 
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag='EFmuon'
+comp2.test='ttbar'
+test.check_steps.append(comp2)
+
+
+comp3=TrigInDetCompStep('Comp_L2bjet')
+comp3.flag='L2bjet'
+comp3.test='ttbar'
+test.check_steps.append(comp3)
+
+comp4=TrigInDetCompStep('Comp_EFbjet')
+comp4.flag='EFbjet'
+comp4.test='ttbar'
+test.check_steps.append(comp4)
+
+comp5=TrigInDetCompStep('Comp_L2tau')
+comp5.flag='L2tau'
+comp5.test='ttbar'
+test.check_steps.append(comp5)
+
+comp6=TrigInDetCompStep('Comp_EFtau')
+comp6.flag='EFtau'
+comp6.test='ttbar'
+test.check_steps.append(comp6)
+
+comp7=TrigInDetCompStep('Comp_L2ele')
+comp7.flag='L2ele'
+comp7.test='ttbar'
+test.check_steps.append(comp7)
+
+comp8=TrigInDetCompStep('Comp_EFele')
+comp8.flag='EFele'
+comp8.test='ttbar'
+test.check_steps.append(comp8)
+
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_olddata_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_olddata_pu40.py
new file mode 100755
index 0000000000000000000000000000000000000000..50cde7bc64f765bd3b3116826f239ae0686882bf
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_olddata_pu40.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+
+# art-description: art job for bjet_olddata_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.RDO.e3698_s2608_s2183_r7193
+# art-input-nfiles: 3
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['bjet']
+rdo2aod.max_events = 2000 
+rdo2aod.threads = 1 
+rdo2aod.concurrent_events = 1 
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'ttbar'    # defined in TrigValTools/share/TrigValInputs.json  
+    print ('WARNING not using same datafile locally as grid test')
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat  -f data-hists.root -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp1=TrigInDetCompStep('Comp_L2bjet')
+comp1.flag = 'L2bjet'
+test.check_steps.append(comp1)
+
+comp2=TrigInDetCompStep('Comp_EFbjet')
+comp2.flag = 'EFbjet'
+test.check_steps.append(comp2)
+
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py
index 242cc7286c548101b74a1fee679b8d4354347c13..6d0063fc402974eb97bf969432a2354b1e753f83 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py
@@ -1,10 +1,11 @@
 #!/usr/bin/env python
 
-# art-description: art job for all_ttbar_pu80_grid
+# art-description: art job for bjet_pu40
 # art-type: grid
 # art-include: master/Athena
 # art-input-nfiles: 3
 # art-athena-mt: 4
+# art-memory: 4096
 # art-output: *.txt
 # art-output: *.log
 # art-output: log.*
@@ -59,7 +60,7 @@ rdo2aod.threads = 1
 rdo2aod.concurrent_events = 1 
 rdo2aod.perfmon = False
 rdo2aod.timeout = 18*3600
-rdo2aod.input = 'ttbar'   
+rdo2aod.input = 'ttbar'    # defined in TrigValTools/share/TrigValInputs.json  
 
 
 test = Test.Test()
@@ -77,13 +78,16 @@ if ((not exclude) or postproc ):
 
  
 # Now the comparitor steps
-comp1=TrigInDetCompStep('CompareStep1')
-comp1.chains='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig'
-comp1.output_dir = 'HLTEF-plots-bjet'
+comp1=TrigInDetCompStep('Comp_L2bjet')
+comp1.flag = 'L2bjet'
 test.check_steps.append(comp1)
 
+comp2=TrigInDetCompStep('Comp_EFbjet')
+comp2.flag = 'EFbjet'
+test.check_steps.append(comp2)
 
 
+# CPU cost steps
 cpucost=TrigInDetCpuCostStep('CpuCostStep1')
 test.check_steps.append(cpucost)
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py
new file mode 100755
index 0000000000000000000000000000000000000000..e93b1d50cc269d4c8749eaf4c76b35a02806978e
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for el_Jpsiee_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.129190.Pythia8_AU2CTEQ6L1_ppToJpsie3e3.recon.RDO.e3802_s2608_s2183_r7042
+# art-input-nfiles: 16
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['electron']
+rdo2aod.max_events = 8000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Jpsiee_pu40'     # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2ele')
+comp.flag = 'L2ele'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFele')
+comp2.flag = 'EFele'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
new file mode 100755
index 0000000000000000000000000000000000000000..6c7fbf7612f2fcf9bcc75cd467fb75a814418158
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for el_singlee_7-80
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.159010.ParticleGenerator_e_Et7to80.recon.RDO.e1948_s2726_r7728
+# art-input-nfiles: 10
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['electron']
+rdo2aod.max_events = 20000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Single_el'     # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2ele')
+comp.flag = 'L2ele'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFele')
+comp2.flag = 'EFele'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
new file mode 100755
index 0000000000000000000000000000000000000000..f776615fc755f515edc35608d815ae246f6b8a0a
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for el_singlee_7-80_larged0
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.159053.ParticleGenerator_e_Et7to80_vertxy20.recon.RDO.e3603_s2726_r7728
+# art-input-nfiles: 10
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['electron']
+rdo2aod.max_events = 20000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Single_el_larged0'    # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2ele')
+comp.flag = 'L2ele'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFele')
+comp2.flag = 'EFele'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py
new file mode 100755
index 0000000000000000000000000000000000000000..8df478225d8b315a673ca2feaa6651d2b03ec152
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for el_singlee_7-80_larged0_pu
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.159053.ParticleGenerator_e_Et7to80_vertxy20.recon.RDO.e3603_s2726_r7772
+# art-input-nfiles: 10
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['electron']
+rdo2aod.max_events = 20000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Single_el_larged0_pu'    # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2ele')
+comp.flag = 'L2ele'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFele')
+comp2.flag = 'EFele'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
new file mode 100755
index 0000000000000000000000000000000000000000..85b8d982d9a33e01dda646459ee4fbc1f70bd677
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for el_singlee_7-80_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.159010.ParticleGenerator_e_Et7to80.recon.RDO.e1948_s2726_r7728
+# art-input-nfiles: 10
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['electron']
+rdo2aod.max_events = 20000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Single_el_pu'    # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2ele')
+comp.flag = 'L2ele'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFele')
+comp2.flag = 'EFele'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
new file mode 100755
index 0000000000000000000000000000000000000000..4ec84558e5762a8fe465eeac7d6b1a6278bc59e1
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for el_zee_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.recon.RDO.e3601_s2665_s2183_r7191
+# art-input-nfiles: 8
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['electron']
+rdo2aod.max_events = 16000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Zee_pu40'      # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 11 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2ele')
+comp.flag = 'L2ele'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFele')
+comp2.flag = 'EFele'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
new file mode 100755
index 0000000000000000000000000000000000000000..a55106254356599a30a670f1033f5caa94840dce
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
@@ -0,0 +1,96 @@
+#!/usr/bin/env python
+
+# art-description: art job for mu_bphys
+# art-type: grid
+# art-include: master/Athena
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['muon']
+rdo2aod.max_events = 6000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+rdo2aod.input = 'Bphys_JpsiPhi'    # defined in TrigValTools/share/TrigValInputs.json  
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag = 'L2muon'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag = 'EFmuon'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
new file mode 100755
index 0000000000000000000000000000000000000000..7300d2abd12e108b9879bfc0a60ec624b1d7d412
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for mu_singlemu_larged0_pu
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.107237.ParticleGenerator_mu_Pt4to100_vertxy20.recon.RDO.e3603_s2726_r7772
+# art-input-nfiles: 10
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['muon']
+rdo2aod.max_events = 20000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Single_mu_larged0_pu'    # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag = 'L2muon'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag = 'EFmuon'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
new file mode 100755
index 0000000000000000000000000000000000000000..ac265c0fa2d42878d875a50aceaf1f6ac52c7d73
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# art-description: art job for mu_singlemu_larged0_pu
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.107237.ParticleGenerator_mu_Pt4to100_vertxy20.recon.RDO.e3603_s2726_r7728
+# art-input-nfiles: 10
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['muon']
+rdo2aod.max_events = 20000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+if local:
+    rdo2aod.input = 'Single_mu_larged0'    # defined in TrigValTools/share/TrigValInputs.json  
+else:
+    rdo2aod.input = ''
+    rdo2aod.args += '--inputRDOFile=$ArtInFile '
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -p 13 -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag = 'L2muon'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag = 'EFmuon'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
index 7edca3a8bc43bd1748f4830df01720e3ac1e7028..60b3b1df5609ca09fa3a62dc153d33eac71bcceb 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
@@ -6,6 +6,7 @@
 # art-input: mc15_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.RDO.e3601_s2576_s2132_r7143
 # art-input-nfiles: 4
 # art-athena-mt: 4
+# art-memory: 4096
 # art-output: *.txt
 # art-output: *.log
 # art-output: log.*
@@ -53,13 +54,13 @@ for opt,arg in opts:
 
 rdo2aod = TrigInDetReco()
 rdo2aod.slices = ['muon']
-rdo2aod.max_events = 2000 # TODO: 2000 events
+rdo2aod.max_events = 2000 
 rdo2aod.threads = 1 # TODO: change to 4
 rdo2aod.concurrent_events = 1 # TODO: change to 4
 rdo2aod.perfmon = False
 rdo2aod.timeout = 18*3600
 if local:
-    rdo2aod.input = 'Zmumu_pu40'
+    rdo2aod.input = 'Zmumu_pu40'    # defined in TrigValTools/share/TrigValInputs.json  
 else:
     rdo2aod.input = ''
     rdo2aod.args += '--inputRDOFile=$ArtInFile '
@@ -81,18 +82,15 @@ if ((not exclude) or postproc ):
 
  
 # Now the comparitor steps
-comp=TrigInDetCompStep('CompareStep1')
-comp.chains = 'HLT_mu24_idperf:HLT_IDTrack_Muon_FTF'
-comp.output_dir = 'HLTL2-plots-muon'
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag = 'L2muon'
 test.check_steps.append(comp)
- 
- 
-comp2=TrigInDetCompStep('CompareStep2')
-comp2.chains='HLT_mu24_idperf:HLT_IDTrack_Muon_FTF HLT_mu24_idperf:HLT_IDTrack_Muon_IDTrig'
-comp2.output_dir = 'HLTEF-plots-muon'
+  
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag = 'EFmuon'
 test.check_steps.append(comp2)
 
-
+# CPU cost steps
 cpucost=TrigInDetCpuCostStep('CpuCostStep1')
 test.check_steps.append(cpucost)
  
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py
index 7b125971874dbaf40fc9daae3d7c4099b8cb9de6..8c0308f2fec2629cf770d3e15e8242b7358a1dce 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py
@@ -32,7 +32,7 @@ rdo2aod.max_events = 2000 # TODO: 2000 events
 rdo2aod.threads = 1 # TODO: change to 4
 rdo2aod.concurrent_events = 1 # TODO: change to 4
 rdo2aod.perfmon = False
-rdo2aod.input = 'Zmumu_pu40'   
+rdo2aod.input = 'Zmumu_pu40'   # defined in TrigValTools/share/TrigValInputs.json  
 
 
 test = Test.Test()
@@ -51,17 +51,15 @@ if ((not exclude) or postproc ):
  
 
 # Now the comparitor steps
-comp=TrigInDetCompStep('CompareStep1')
-comp.chains = 'HLT_mu24_idperf:HLT_IDTrack_Muon_FTF'
-comp.output_dir = 'HLTL2-plots-muon'
+comp=TrigInDetCompStep('Comp_L2muon')
+comp.flag = 'L2muon'
 test.check_steps.append(comp)
- 
- 
-comp2=TrigInDetCompStep('CompareStep2')
-comp2.chains='HLT_mu24_idperf:HLT_IDTrack_Muon_FTF HLT_mu24_idperf:HLT_IDTrack_Muon_IDTrig'
-comp2.output_dir = 'HLTEF-plots-muon'
+  
+comp2=TrigInDetCompStep('Comp_EFmuon')
+comp2.flag = 'EFmuon'
 test.check_steps.append(comp2)
 
+# CPU cost steps
 cpucost=TrigInDetCpuCostStep('CpuCostStep1')
 test.check_steps.append(cpucost)
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
new file mode 100755
index 0000000000000000000000000000000000000000..8191de37cb9d79542f64b880ca2c3efb3184adba
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+
+# art-description: art job for mu_ztautau_pu46
+# art-type: grid
+# art-include: master/Athena
+# art-athena-mt: 4
+# art-memory: 4096
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+
+from TrigValTools.TrigValSteering import Test, CheckSteps
+from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
+
+import sys,getopt
+
+try:
+    opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"])
+except getopt.GetoptError:
+    print("Usage:  ")
+    print("-l(--local)    run locally with input file from art eos grid-input")
+    print("-x             don't run athena or post post-processing, only plotting")
+    print("-p             run post-processing, even if -x is set")
+
+
+local=False
+exclude=False
+postproc=False
+for opt,arg in opts:
+    if opt in ("-l", "--local"):
+        local=True
+    if opt=="-x":
+        exclude=True
+    if opt=="-p":
+        postproc=True
+
+
+rdo2aod = TrigInDetReco()
+rdo2aod.slices = ['muon']
+rdo2aod.max_events = 6000 
+rdo2aod.threads = 1 # TODO: change to 4
+rdo2aod.concurrent_events = 1 # TODO: change to 4
+rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
+rdo2aod.input = 'Ztautau_pu46'    # defined in TrigValTools/share/TrigValInputs.json  
+
+
+test = Test.Test()
+test.art_type = 'grid'
+if (not exclude):
+    test.exec_steps = [rdo2aod]
+    test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple
+    test.check_steps = CheckSteps.default_check_steps(test)
+
+ 
+# Run Tidardict
+if ((not exclude) or postproc ):
+    rdict = TrigInDetdictStep()
+    rdict.args='TIDAdata-run3.dat -f data-hists.root -b Test_bin.dat '
+    test.check_steps.append(rdict)
+
+ 
+# Now the comparitor steps
+comp=TrigInDetCompStep('Comp_L2tau')
+comp.flag = 'L2tau'
+test.check_steps.append(comp)
+  
+comp2=TrigInDetCompStep('Comp_EFtau')
+comp2.flag = 'EFtau'
+test.check_steps.append(comp2)
+
+# CPU cost steps
+cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+test.check_steps.append(cpucost)
+ 
+cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
+cpucost2.args += '  -p FastTrack'
+cpucost2.output_dir = 'times-FTF' 
+test.check_steps.append(cpucost2)
+
+import sys
+sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
index 438e90746aca33f15a7f4974171380f98dca6635..e28fc2941e43de09bfbb781d08370dadb504f557 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
+++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
@@ -3,24 +3,6 @@
 # Declare the package name:
 atlas_subdir( TrigUpgradeTest )
 
-atlas_add_component( TrigUpgradeTest
-                     src/*.cxx
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps TrigSteeringEvent DecisionHandlingLib TrigCompositeUtilsLib
-                     )
-
-foreach(test emu_step_processing emu_step_menu_processing)
-    set( rundir ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_${test} )
-    file( REMOVE_RECURSE ${rundir} )
-    file( MAKE_DIRECTORY ${rundir} )
-    atlas_add_test( ${test}
-		SCRIPT test/test_${test}.sh
-		LOG_SELECT_PATTERN "TrigSignatureMoniMT.*INFO HLT_.*|TrigSignatureMoniMT.*-- #[0-9]+ (Events|Features).*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*|TriggerSummaryStep.*+++ leg.*"
-    PROPERTIES WORKING_DIRECTORY ${rundir}
-		)
-endforeach()
-
-
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
 atlas_install_data( share/*.ref share/*.conf )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py
deleted file mode 100644
index bab2326aa6bed4ef46d78c8801ed61c9dcc38899..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py
+++ /dev/null
@@ -1,366 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.AlgScheduler import AlgScheduler
-from AthenaCommon.CFElements import parOR
-from AthenaCommon.Logging import logging
-from L1Decoder.L1DecoderConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool, L1Decoder
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import EmptyMenuSequence
-log = logging.getLogger('EmuStepProcessingConfig')
-
-###########################################################################    
-def thresholdToChains( chains ):
-    """
-    Produces list "threshod : chain" for all chains passed. Uses the L1Thresholds/vseeds Chain property
-    """
-    ret = []
-    for c in chains:
-        for t in c.vseeds:
-            ret.append(t+ " : " + c.name)
-    return ret
-
-###########################################################################    
-def generateL1DecoderAndChainsManually(topSequence):
-    generateEmuEvents()
-    from AthenaCommon.CFElements import seqOR,parOR
-    hltTop = seqOR("HLTTop")
-    hltBeginSeq = parOR("HLTBeginSeq")
-    hltTop += hltBeginSeq
-    topSequence += hltTop
-    l1Decoder = generateL1Decoder()
-    hltBeginSeq += l1Decoder
-    generateChainsManually()
-    from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
-    from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
-    makeHLTTree( triggerConfigHLT=TriggerConfigHLT )
-
-
-###########################################################################    
-def generateL1DecoderAndChainsByMenu(topSequence):
-    generateEmuEvents()
-    from AthenaCommon.CFElements import seqOR,parOR
-    hltTop = seqOR("HLTTop")
-    hltBeginSeq = parOR("HLTBeginSeq")
-    hltTop += hltBeginSeq
-    topSequence += hltTop
-    l1Decoder = generateL1Decoder()
-    hltBeginSeq += l1Decoder
-    l1Decoder = generateL1Decoder()
-    generateEmuMenu()
-
-
-
-###########################################################################    
-def generateEmuMenu():    
-    from TriggerMenuMT.HLTMenuConfig.Menu import LS2_v1
-    from TriggerMenuMT.HLTMenuConfig.Menu import LS2_emu_v1 
-    from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT import GenerateMenuMT
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    from AthenaCommon.Logging import logging
-    log = logging.getLogger('EmuMenuTest')
-    log.debug("generateEmuMenu")
-
-    # overwrite LS2_v1 menu
-    TriggerFlags.triggerMenuSetup = 'LS2_v1'
-    LS2_v1.setupMenu = LS2_emu_v1.setupMenu
-
-    # switch on only TestSlice
-    def signaturesToGenerate():
-        TriggerFlags.Slices_all_setOff()
-        TriggerFlags.TestSlice.setAll()
-        #TriggerFlags.EgammaSlice.setAll()
-
-    # Generate the menu    
-    menu = GenerateMenuMT()
-    menu.overwriteSignaturesWith(signaturesToGenerate)    
-    menu.generateMT()
-
-
-
-###########################################################################    
-def generateEmuEvents():
-    AlgScheduler.ShowControlFlow( True )
-    AlgScheduler.ShowDataFlow( True )
-
-    # 4 events
-    data = {
-        'noreco': [';', ';', ';',';'],
-        'emclusters': [';', ';', ';',';'],
-        'msmu': [';', ';', ';',';'],
-        'ctp': [';', ';', ';',';'],
-        'l1emroi': [';', ';', ';',';'],
-        'l1muroi': [';', ';', ';',';']
-        }  # in the lists there are the events
-
-    # event 0: empty
-    data['ctp'] [0]      =  'HLT_TestChain5_ev1_L1EM3 \
-                             HLT_TestChain8_ev1_L1EM5 \
-                             HLT_g5_EM7'
-    data['l1emroi'][0]   = ';'
-    data['emclusters'][0]= ';'
-    data['l1muroi'][0]   = ';'
-    data['msmu'][0]      = ';'
-
-
-    #event 1: 3e (1 not passing at L1, 1 not passing at step1) + 2mu (2 not passing) - HLT_e5_e8_L12EM3 HLT_2TestChain6_muv1_L12MU6
-    data['ctp'] [1]      =  'HLT_TestChain5_ev1_L1EM3 \
-                             HLT_TestChain8_ev1_L1EM5 \
-                             HLT_TestChain5_gv1_L1EM7 \
-                             HLT_TestChain5_ev3_L1EM7 \
-                             HLT_2TestChain6_muv1_L12MU6 \
-                             HLT_TestChain10_muv2_L1MU10 \
-                             HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 \
-                             HLT_2TestChain4_muv1_dr_L12MU6'
-    data['l1emroi'][1]   =  '1,1,0,EM3,EM5,EM7,EM20,EM50,EM100; 2.,-1.2,0,EM3,EM5,EM7; 3.,0.2,0,EM3;'
-    data['emclusters'][1]=  'eta:1,phi:1,et:180000; eta:1,phi:-1.2,et:6000; eta:0.5,phi:-1.2,et:3000;'
-    data['l1muroi'][1]   =  '2,0.5,0,MU6; 3,0.5,0,MU6;'
-    data['msmu'][1]      = 'eta:-1.2,phi:0.7,pt:1500,pt2:1500; eta:-1.1,phi:0.6,pt:1500,pt2:1500;'
-
-    # event 2: 2e+ 3mu : HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_EM5_L12MU6, HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5
-    data['ctp'] [2]      =  'HLT_TestChain6_muv1_L1MU6 \
-                             HLT_TestChain8_muv1_L1MU10 \
-                             HLT_TestChain10_muv2_L1MU10 \
-                             HLT_TestChain8_muv1step_L1MU6 \
-                             HLT_TestChain5_ev1_L1EM3 \
-                             HLT_TestChain8_ev1_L1EM5 \
-                             HLT_TestChain6_muEmpty2_L1MU6 \
-                             HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 \
-                             HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 \
-                             HLT_2TestChain6_muv1_L12MU6 \
-                             HLT_2TestChain6_muEmpty1_L12MU6 \
-                             HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 \
-                             HLT_2TestChain4_muv1_dr_L12MU6 HLT_e5_e8_L12EM3 \
-                             HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 \
-                             HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 \
-                             HLT_TestChain10_muv1_TestChain6_muEmpty1_L1MU6 \
-                             HLT_TestChain6_muv1_TestChain5_ev1_dr_L12MU6'
-    data['l1emroi'][2]   =  '2,0.2,0,EM3,EM5,EM7,EM15,EM20,EM50,EM100; 1,-1.1,0,EM3,EM5,EM7,EM15,EM20,EM50;'
-    data['emclusters'][2]=  'eta:0.5,phi:0,et:120000; eta:1,phi:-1.2,et:65000;'
-    data['l1muroi'][2]   =  '2,0.5,0,MU6,MU8; 3,0.5,0,MU6,MU8,MU10;2.2,0.6,0,MU6;'
-    data['msmu'][2]      =  'eta:-1.2,phi:0.7,pt:6500,pt2:8500; eta:-1.1,phi:0.6,pt:10500,pt2:8500;eta:-1.1,phi:0.6,pt:8500,pt2:8500;'
-
-    #event 3: 1e + 1mu; HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 does not pass because of e10
-    data['ctp'] [3]      =  'HLT_TestChain20_muv1_L1MU10 \
-                             HLT_TestChain10_muv1_L1MU10 \
-                             HLT_TestChain8_muv1_L1MU10 \
-                             HLT_TestChain8_muv1step_L1MU6 \
-                             HLT_TestChain8_ev1_L1EM5 \
-                             HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5\
-                             HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5'
-    data['l1emroi'][3]   =  '1,1.5,0,EM3,EM5,EM7;'
-    data['emclusters'][3]=  'eta:-0.6,phi:1.7,et:9000;'
-    data['l1muroi'][3]   =  '2,-0.1,0,MU6,MU8,MU10;'
-    data['msmu'][3]      =  'eta:-1.7,phi:-0.2,pt:29500,pt2:8500;'
-
-    # otehr vectors
-
-    data['tracks'] = ['eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
-                      'eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
-                      'eta:0.5,phi:0,pt:130000; eta:1,phi:-1.2,pt:60000;eta:-1.2,phi:0.7,pt:6700; eta:-1.1,phi:0.6,pt:8600;',
-                      'eta:-0.6,phi:1.7,et:9000;'] # no MU track for MS candidate 'eta:-1.7,phi:-0.2,pt:9500;'
-
-    data['mucomb'] = [';',
-                      ';',
-                      'eta:-1.2,phi:0.7,pt:6600; eta:-1.1,phi:0.6,pt:8600;',
-                      ';']
-
-    data['electrons'] = [';',
-                         'eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
-                         ';',
-                         ';']
-    data['photons'] = [';',
-                       'eta:1,phi:1,pt:130000;',
-                       ';',
-                       ';']
-
-    from TrigUpgradeTest.TestUtils import writeEmulationFiles
-    writeEmulationFiles(data)
-
-
-###########################################################################    
-def generateChainsManually():
-    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep
-    from TrigUpgradeTest.TestUtils import makeChain
-    
-
-    doMuon     = True
-    doElectron = True
-    doCombo    = True
-
-    HLTChains = []
-
-    # muon chains
-    if doMuon:
-        from TrigUpgradeTest.HLTSignatureConfig import  muMenuSequence
-        #step1
-        mu11 = muMenuSequence(step="1",reconame="v1", hyponame="v1")
-        mu12 = muMenuSequence(step="1",reconame="v2", hyponame="v2")
-                    
-        #step2
-        mu21 = muMenuSequence(step="2",reconame="v1", hyponame="v1")
-        mu22 = muMenuSequence(step="2",reconame="v2", hyponame="v2")
-        #step3
-        mu31 = muMenuSequence(step="3",reconame="v1", hyponame="v1")
-        mu32 = muMenuSequence(step="3",reconame="v2", hyponame="v2")
-        #step4
-        mu41 = muMenuSequence(step="4",reconame="v1", hyponame="v1")
-
-        step_mu11  = ChainStep("Step1_mu11", [mu11])
-        step_mu21  = ChainStep("Step2_mu21", [mu21] )
-        step_mu22  = ChainStep("Step2_mu22", [mu22] )
-        step_mu31  = ChainStep("Step3_mu31", [mu31] )
-        step_mu32  = ChainStep("Step3_mu32", [mu32] )
-        step_mu41  = ChainStep("Step4_mu41", [mu41] )
-        
-        step_empy= ChainStep("Step2_mu1empty", multiplicity=[])
-
-        MuChains  = [
-            makeChain(name='HLT_TestChain8_muv1step_L1MU6',  L1Thresholds=["MU6"],  ChainSteps=[step_mu11]),
-            makeChain(name='HLT_TestChain8_muv1_L1MU10',    L1Thresholds=["MU10"],   ChainSteps=[step_mu11 , step_mu21 , step_mu31, step_mu41] ),
-            makeChain(name='HLT_TestChain20_muv1_L1MU10',   L1Thresholds=["MU10"],   ChainSteps=[step_mu11 , step_mu21 , step_mu31, step_mu41] ),
-            makeChain(name='HLT_TestChain10_muv2_L1MU10',   L1Thresholds=["MU10"],   ChainSteps=[step_mu11 , step_mu22 , step_mu31] ),
-            makeChain(name='HLT_TestChain6_muEmpty2_L1MU6',     L1Thresholds=["MU6"],    ChainSteps=[step_mu11 , step_empy , step_mu32, step_mu41] ), 
-            ]
-            
-
-        HLTChains += MuChains
-
-
-    ## #electron chains
-    if doElectron:
-        from TrigUpgradeTest.HLTSignatureConfig import  elMenuSequence, gamMenuSequence
-        el11 = elMenuSequence(step="1",reconame="v1", hyponame="v1")
-        el21 = elMenuSequence(step="2",reconame="v1", hyponame="v1")
-        el22 = elMenuSequence(step="2",reconame="v2", hyponame="v2")
-        el23 = elMenuSequence(step="2",reconame="v2", hyponame="v3")
-        el31 = elMenuSequence(step="3",reconame="v1", hyponame="v1")
-        el41 = elMenuSequence(step="4",reconame="v1", hyponame="v1")
-
-        # gamma
-        gamm11 = gamMenuSequence("1", reconame="v1", hyponame="v1")
-    
-        ElChains  = [
-            makeChain(name='HLT_TestChain5_ev1_L1EM3', L1Thresholds=["EM3"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em21",  [el21]), ChainStep("Step3_em31",  [el31])] ),
-            makeChain(name='HLT_TestChain8_ev1_L1EM5', L1Thresholds=["EM5"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em21",  [el21]), ChainStep("Step3_em31",  [el31]) ] ),
-            makeChain(name='HLT_TestChain5_ev2_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em22",  [el22]) ] ),
-            makeChain(name='HLT_TestChain5_ev3_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ ChainStep("Step1_em11", [el11]), ChainStep("Step2_em23",  [el23]) ] ),
-            makeChain(name='HLT_TestChain5_gv1_L1EM7', L1Thresholds=["EM7"], ChainSteps=[ ChainStep("Step1_gam11", [gamm11]) ] )
-        ]
-
-        HLTChains += ElChains
-        
-
-    # combined chain
-    if doCombo:
-        emptySeq1 = EmptyMenuSequence("step1EmptySeqence")
-        emptySeq2 = EmptyMenuSequence("step2EmptySeqence")
-        
-        if not doElectron:
-            from TrigUpgradeTest.HLTSignatureConfig import elMenuSequence        
-            el11 = elMenuSequence(step="1",reconame="v1", hyponame="v1")    
-            el21 = elMenuSequence(step="2",reconame="v1", hyponame="v1")
-            el41 = elMenuSequence(step="4",reconame="v1", hyponame="v1")
-            
-        if not doMuon:
-            from TrigUpgradeTest.HLTSignatureConfig import muMenuSequence
-            #step1
-            mu11 = muMenuSequence(step="1",reconame="v1", hyponame="v1")
-            mu12 = muMenuSequence(step="1",reconame="v2", hyponame="v2")
-            #step2
-            mu21 = muMenuSequence(step="2",reconame="v1", hyponame="v1")
-            mu22 = muMenuSequence(step="2",reconame="v2", hyponame="v2")
-            #step3
-            mu31 = muMenuSequence(step="3",reconame="v1", hyponame="v1")
-            mu32 = muMenuSequence(step="3",reconame="v2", hyponame="v2")
-            #step4
-            mu41 = muMenuSequence(step="4",reconame="v1", hyponame="v1")
-           
-           
-        from TrigUpgradeTest.HLTSignatureHypoTools import dimuDrComboHypoTool
-                       
-        # multiplicity here indicates the number of objects to be combined:
-        # for the chain dictionary, get the sum of the multiplicity in the multiplicy array
-        # in symmetric chains, multiplicity=2 but only one sequence is used
-     
-        CombChains =[
-            # This is an example of a chain running in "serial"
-            makeChain(name='HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5',  L1Thresholds=["MU6","EM5"], ChainSteps=[
-                ChainStep("Step1_mu_em_serial", [mu11, emptySeq1], multiplicity=[1,1]),
-                ChainStep("Step2_mu_em_serial", [emptySeq2, el21], multiplicity=[1,1]),
-                ChainStep("Step3_mu_em_serial", multiplicity=[]),
-                ChainStep("Step4_mu_em_serial", [mu41, el41],  multiplicity=[1,1])] ),
-
-            makeChain(name='HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5', L1Thresholds=["MU6","EM5"], ChainSteps=[
-                ChainStep("Step1_mu2_em", [mu12, el11], multiplicity=[1,1]),
-                ChainStep("Step2_mu_em", [mu21, el21], multiplicity=[1,1])] ),
-
-            makeChain(name='HLT_TestChain5_ev1_TestChain8_ev1_L12EM3',   L1Thresholds=["EM3","EM3"], ChainSteps=[ #norun
-                ChainStep("Step1_2emAs",   [el11, el11], multiplicity=[1,1]),
-                ChainStep("Step2_2emAs",   [el21, el21], multiplicity=[1,1]) ]),
-                
-            makeChain(name='HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6',   L1Thresholds=["EM3","EM5","MU6"], ChainSteps=[
-                ChainStep("Step1_2em_2mu",   [el11,el11,mu11], multiplicity=[1,1,2]),
-                ChainStep("Step2_2em_2mu",   [el21,el21,mu21], multiplicity=[1,1,2]) ]),
-
-            makeChain(name='HLT_2TestChain6_muv1_L12MU6',       L1Thresholds=["MU6"], ChainSteps=[
-                ChainStep("Step1_2mu",   [mu11], multiplicity=[2]),
-                ChainStep("Step2_2mu",   [mu21], multiplicity=[2]) ]),
-
-            makeChain(name='HLT_TestChain6_muv1_TestChain10_muv1_L12MU6',       L1Thresholds=["MU6", "MU6"], ChainSteps=[
-                ChainStep("Step1_2muAs",   [mu11,mu11], multiplicity=[1,1]),
-                ChainStep("Step2_2muAs",   [mu21,mu21], multiplicity=[1,1]) ]),
-                
-            makeChain(name='HLT_2TestChain6_muEmpty1_L12MU6',   L1Thresholds=["MU6"], ChainSteps=[
-                ChainStep("Step1_2mu_empty",  multiplicity=[]),#[2]
-                ChainStep("Step2_2mu", [mu21], multiplicity=[2]) ]),
-
-            makeChain(name='HLT_TestChain6_muv1_TestChain5_ev1dr_L12MU6',  L1Thresholds=["MU6","EM5"], ChainSteps=[
-                ChainStep("Step1_mu_em", [mu11, el11], multiplicity=[1,1], comboToolConfs=[dimuDrComboHypoTool]),
-                ChainStep("Step2_mu_em", [mu21, el21], multiplicity=[1,1], comboToolConfs=[dimuDrComboHypoTool])] ),
-                                                                                       
-            makeChain(name='HLT_2TestChain4_muv1dr_L12MU6', L1Thresholds=["MU6"], ChainSteps=[
-                ChainStep("Step1_2mu",    [mu11], multiplicity=[2], comboToolConfs=[dimuDrComboHypoTool]),
-                ChainStep("Step2_2mu22",  [mu22], multiplicity=[2]) ] ),
-
-            # FSNOSEED not implemented in emulation
-            #  L1Thresholds=["MU6", "MU6"],
-            makeChain(name='HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6', L1Thresholds=["MU6", "MU6"],  ChainSteps=[
-                ChainStep("Step1_2muAs_empty", multiplicity=[]),
-                ChainStep("Step2_2muAs",   [mu21, mu21], multiplicity=[1,1]) ])
-        
-                                                                              
-            ]
-
-
-        HLTChains += CombChains
-
-
-
-########################## L1 #################################################        
-def generateL1Decoder():
-
-    L1UnpackingSeq = parOR("L1UnpackingSeq")
-
-    l1Decoder = L1Decoder( RoIBResult="", L1TriggerResult="" )
-    l1Decoder.L1DecoderSummaryKey = "L1DecoderSummary"
-    ctpUnpacker = CTPUnpackingEmulationTool( ForceEnableAllChains=False , InputFilename="ctp.dat" )
-    l1Decoder.ctpUnpacker = ctpUnpacker
-
-    ## hack to solve the PS crash:
-    from L1Decoder.L1DecoderConf import PrescalingEmulationTool
-    psEmulation = PrescalingEmulationTool()
-    l1Decoder.prescaler = psEmulation
-
-    from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection, mapThresholdToL1DecisionCollection
-
-    emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", InputFilename="l1emroi.dat", OutputTrigRoIs=mapThresholdToL1RoICollection("EM"), Decisions=mapThresholdToL1DecisionCollection("EM"), ThresholdPrefix="EM" )
-
-    muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", InputFilename="l1muroi.dat",  OutputTrigRoIs=mapThresholdToL1RoICollection("MU"), Decisions=mapThresholdToL1DecisionCollection("MU"), ThresholdPrefix="MU" )
-
-    l1Decoder.roiUnpackers = [emUnpacker, muUnpacker]
-
-    L1UnpackingSeq += l1Decoder
-    log.debug(L1UnpackingSeq)
-
-    return l1Decoder
-
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py
deleted file mode 100644
index 749f814e09d9ede13138d30c9e9e848e650fb238..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.Configurable import Configurable
-Configurable.configurableRun3Behavior=1
-
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
-from AthenaCommon.Constants import INFO, DEBUG, VERBOSE
-from AthenaCommon.Logging import logging
-from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
-from TrigUpgradeTest.TriggerHistSvcConfig import TriggerHistSvcConfig
-from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg, TGCCablingConfigCfg
-from TrigConfigSvc.TrigConfigSvcConfig import TrigConfigSvcCfg
-from TriggerJobOpts.TriggerConfig import triggerSummaryCfg, triggerMonitoringCfg, \
-    setupL1DecoderFromMenu, collectHypos, collectFilters
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import generateDecisionTree
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, createStepView
-from AthenaCommon.CFElements import seqOR
-from RegionSelector.RegSelConfig import regSelCfg
-from TrigInDetConfig.TrigInDetConfig import TrigInDetCondConfig
-from TrigUpgradeTest.EmuStepProcessingConfig import generateL1DecoderAndChains
-
-log = logging.getLogger('EmuNewJOTest')
-
-flags.needFlagsCategory("Trigger")
-flags.Input.isMC = False
-flags.Input.Files= ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"]
-
-flags.Trigger.L1Decoder.forceEnableAllChains = True
-
-flags.lock()
-
-acc = ComponentAccumulator()
-acc.merge(ByteStreamReadCfg(flags))
-acc.merge(TriggerHistSvcConfig(flags))
-
-l1DecoderAlg, OrigHLTChains = generateL1DecoderAndChains()
-
-setupL1DecoderFromMenu( flags, l1DecoderAlg )
-
-l1DecoderAcc = ComponentAccumulator()
-l1DecoderAcc.merge( TGCCablingConfigCfg( flags ) )
-l1DecoderAcc.merge( RPCCablingConfigCfg( flags ) )
-l1DecoderAcc.merge( TrigConfigSvcCfg( flags ) )
-acc.merge(l1DecoderAcc)
-
-
-from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import DictFromChainName
-toChainDictTranslator = DictFromChainName()
-chainDicts = [toChainDictTranslator.getChainDict(chain.name) for chain in OrigHLTChains]
-
-
-## Set ca in all sequences to none
-changed_sequences = {}
-HLTChains = []
-
-# select only chains that work after the changes in defining the chains in the EmuStep:
-# problem arises when two chains share the same step, exclty the same object, as will happen in the final menu
-# since this function will be changed soon, I did not investigate more
-# for now, I just exclude some chains in the test
-excludeChainNames = ['HLT_mu10', 'HLT_mu20', 'HLT_mu6', 'HLT_mu8_1step', 'HLT_e8', 'HLT_e5_v3', 'HLT_mu8_e8']
-for chain in OrigHLTChains:
-    if chain.name not in excludeChainNames:
-        HLTChains.append(chain)
-        log.info("Selected chain %s", chain.name)
-
-
-for chainIndex, chain in enumerate(HLTChains):
-    for stepIndex, step in enumerate(chain.steps):
-        for seqIndex, seq in enumerate(step.sequences):
-            
-
-            hypoAlg = seq.hypo.Alg.__class__(seq.hypo.Alg.name(), **seq.hypo.Alg.getValuedProperties())
-
-            if seq.name in changed_sequences:
-                hypoTool = changed_sequences[seq.name].hypoToolGen(chainDicts[chainIndex])
-                hypoAlg.HypoTools = [hypoTool]
-                continue
-            else:
-                conf = seq.hypoToolConf
-                hypoTool = conf.hypoToolGen(chainDicts[chainIndex])
-                hypoAlg.HypoTools = [hypoTool]
-                changed_sequences[seq.name]=conf
-
- 
-            stepReco, stepView = createStepView(step.name)
-
-            sequenceAcc = ComponentAccumulator()
-            sequenceAcc.addSequence(stepView)
-            sequenceAcc.addSequence(seq.sequence.Alg, parentName=stepReco.getName())
-            sequenceAcc.addEventAlgo(hypoAlg, sequenceName=stepView.getName())
-            seq.ca = sequenceAcc
-            sequenceAcc.wasMerged()
-
-            ms = MenuSequence( Sequence = seq.sequence.Alg,
-                               Maker    = seq.maker.Alg,
-                               Hypo     =  hypoAlg,
-                               HypoToolGen = None,
-                               CA = sequenceAcc)
-
-            step.sequences[seqIndex] = ms
-            
-
-menuAcc = generateDecisionTree(HLTChains)
-
-HLTSteps = menuAcc.getSequence("HLTAllSteps")
-hypos = collectHypos(HLTSteps)
-filters = collectFilters(HLTSteps)
-
-summaryAcc, summaryAlg = triggerSummaryCfg(flags, hypos)
-acc.merge(summaryAcc)
-
-monitoringAcc, monitoringAlg = triggerMonitoringCfg( flags, hypos, filters, l1DecoderAlg )
-acc.merge( monitoringAcc )
-
-topSequenceName = "HLTTop"
-HLTTopSequence = seqOR(topSequenceName, [l1DecoderAlg, HLTSteps, summaryAlg, monitoringAlg])
-acc.addSequence(HLTTopSequence)
-
-acc.merge(menuAcc)
-acc.merge(regSelCfg(flags))
-acc.merge(TrigInDetCondConfig(flags))
-
-acc.printConfig()
-
-fname = "EmuNewJOTest.pkl"
-log.debug("Storing config in the config %s", fname)
-with open(fname, "wb") as p:
-    acc.store( p, nEvents=4, useBootStrapFile=False, threaded=True )
-    p.close()
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
deleted file mode 100644
index 7fdfa90796b57ac6c97171788110e6a745844e4b..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
+++ /dev/null
@@ -1,73 +0,0 @@
-###############################################################
-#
-# Job options file
-#
-# Based on AthExStoreGateExamples
-#
-#==============================================================
-
-#--------------------------------------------------------------
-# ATLAS default Application Configuration options
-#--------------------------------------------------------------
-from __future__ import print_function
-
-# input parameters:
-class opt:
-    doMenu          = False # use either menu or manual chain building
-
-
-
-from AthenaCommon.Logging import logging
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-from TrigUpgradeTest.EmuStepProcessingConfig import generateL1DecoderAndChainsManually, generateL1DecoderAndChainsByMenu
-from AthenaCommon.AlgSequence import AlgSequence
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON
-
-# signatures
-# steps: sequential AND of 1=Filter 2=Processing
-# chainstep=single chain step
-# global step=joint for all chains
-# filters: one SeqFilter per step, per chain
-# inputMakers: one per each first RecoAlg in a step (so one per step), one input per chain that needs that step
-
-log = logging.getLogger('EmuStepProcessingTest.py')
-log.info('Setup options:')
-defaultOptions = [a for a in dir(opt) if not a.startswith('__')]
-for option in defaultOptions:
-    if option in globals():
-        setattr(opt, option, globals()[option])
-        log.info(' %20s = %s' % (option, getattr(opt, option)))
-    else:        
-        log.info(' %20s = (Default) %s' % (option, getattr(opt, option)))
-
-TriggerFlags.generateMenuDiagnostics=True
-
-topSequence = AlgSequence()
-
-if opt.doMenu is True:
-    generateL1DecoderAndChainsByMenu(topSequence)
-else:
-    generateL1DecoderAndChainsManually(topSequence)
-
-generateJSON()
-
-from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc, getL1ConfigSvc
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-svcMgr += getHLTConfigSvc()
-TriggerFlags.triggerMenuSetup = "LS2_v1"
-svcMgr += getL1ConfigSvc()
-
-from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
-from GaudiSvc.GaudiSvcConf import THistSvc
-svcMgr += THistSvc()
-if hasattr(svcMgr.THistSvc, "Output"):
-    from TriggerJobOpts.HLTTriggerGetter import setTHistSvcOutput
-    setTHistSvcOutput(svcMgr.THistSvc.Output)
-
-print ("EmuStepProcessing: dump top Sequence after CF/DF Tree build")
-from AthenaCommon.AlgSequence import dumpSequence
-dumpSequence( topSequence )
-#dumpMasterSequence()
-
-theApp.EvtMax = 4
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/emu_newjo.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/emu_newjo.ref
deleted file mode 100644
index e28a48c19ca7896c7d3c44e42ebaf56cda348906..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/emu_newjo.ref
+++ /dev/null
@@ -1,12 +0,0 @@
-TrigSignatureMo...   INFO HLT_e5_e8                     2         2         0         0         0         0         0         
-TrigSignatureMo...   INFO HLT_e5_e8 decisions                               0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu10                      2         2         0         0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu10 decisions                                0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu20                      1         1         0         0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu20 decisions                                0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu6                       1         1         0         0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu6 decisions                                 0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu8                       2         2         0         0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu8 decisions                                 0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu8_1step                 2         2         0         0         0         0         0         
-TrigSignatureMo...   INFO HLT_mu8_1step decisions                           0         0         0         0         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/emu_step_menu_processing.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/emu_step_menu_processing.ref
deleted file mode 100644
index 1f92fac7f8d3341b799da6ac8520b8510bbe7591..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/emu_step_menu_processing.ref
+++ /dev/null
@@ -1,148 +0,0 @@
-TriggerSummaryStep1                        1   0   DEBUG In summary 4 chains passed:
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_gv1_L1EM7 ID#3893303900
-TriggerSummaryStep2                        1   0   DEBUG In summary 3 chains passed:
-TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
-TriggerSummaryStep3                        1   0   DEBUG In summary 2 chains passed:
-TriggerSummaryStep3                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep3                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                        2   0   DEBUG In summary 19 chains passed:
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#1790520567
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_2TestChain6_muEmpty1_L12MU6 ID#2176116418
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2599553377
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3196402061
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain10_muv2_L1MU10 ID#3482819675
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3844733695
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#4097287954
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep2                        2   0   DEBUG In summary 15 chains passed:
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#1790520567
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_2TestChain6_muEmpty1_L12MU6 ID#2176116418
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2599553377
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2764921170
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#4097287954
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep3                        2   0   DEBUG In summary 10 chains passed:
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep3                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep3                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep3                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep3                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep4                        2   0   DEBUG In summary 5 chains passed:
-TriggerSummaryStep4                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep4                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep4                        2   0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep4                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep4                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep1                        3   0   DEBUG In summary 8 chains passed:
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep1                        3   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep1                        3   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep1                        3   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep2                        3   0   DEBUG In summary 6 chains passed:
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep2                        3   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep2                        3   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep3                        3   0   DEBUG In summary 6 chains passed:
-TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep3                        3   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep3                        3   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep4                        3   0   DEBUG In summary 2 chains passed:
-TriggerSummaryStep4                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep4                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TrigSignatureMoniMT                                 INFO HLT_2TestChain4_muv1dr_L12MU6 #3176095517
-TrigSignatureMoniMT                                 INFO -- #3176095517 Events         0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #3176095517 Features                             0          0          0          0          
-TrigSignatureMoniMT                                 INFO HLT_2TestChain6_muEmpty1_L12MU6 #2176116418
-TrigSignatureMoniMT                                 INFO -- #2176116418 Events         1          1          0          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #2176116418 Features                             0          6          -          -          
-TrigSignatureMoniMT                                 INFO HLT_2TestChain6_muv1_L12MU6 #1408409992
-TrigSignatureMoniMT                                 INFO -- #1408409992 Events         2          2          1          1          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #1408409992 Features                             6          6          6          6          
-TrigSignatureMoniMT                                 INFO HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 #2764921170
-TrigSignatureMoniMT                                 INFO -- #2764921170 Events         1          1          0          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #2764921170 Features                             0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain10_muv2_L1MU10 #3482819675
-TrigSignatureMoniMT                                 INFO -- #3482819675 Events         2          2          1          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3482819675 Features                             1          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain20_muv1_L1MU10 #356594709
-TrigSignatureMoniMT                                 INFO -- #356594709 Events          1          1          1          1          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #356594709 Features                              1          1          1          1          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev1_L1EM3 #1756953305
-TrigSignatureMoniMT                                 INFO -- #1756953305 Events         3          3          2          2          2          -          2          
-TrigSignatureMoniMT                                 INFO -- #1756953305 Features                             4          4          4          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 #2709794009
-TrigSignatureMoniMT                                 INFO -- #2709794009 Events         0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2709794009 Features                             0          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev2_L1EM7 #1760405581
-TrigSignatureMoniMT                                 INFO -- #1760405581 Events         0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1760405581 Features                             0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev3_L1EM7 #2336588294
-TrigSignatureMoniMT                                 INFO -- #2336588294 Events         1          1          1          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #2336588294 Features                             2          2          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_gv1_L1EM7 #3893303900
-TrigSignatureMoniMT                                 INFO -- #3893303900 Events         1          1          1          -          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #3893303900 Features                             2          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muEmpty2_L1MU6 #2511524900
-TrigSignatureMoniMT                                 INFO -- #2511524900 Events         1          1          1          0          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #2511524900 Features                             3          0          3          3          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 #64374772
-TrigSignatureMoniMT                                 INFO -- #64374772 Events           2          2          1          1          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #64374772 Features                               3          3          3          3          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 #3196402061
-TrigSignatureMoniMT                                 INFO -- #3196402061 Events         2          2          1          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #3196402061 Features                             3          0          0          0          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv1_TestChain5_ev1dr_L1MU6_EM5 #1237112870
-TrigSignatureMoniMT                                 INFO -- #1237112870 Events         0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1237112870 Features                             0          0          0          0          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 #3476793373
-TrigSignatureMoniMT                                 INFO -- #3476793373 Events         2          2          2          2          2          -          2          
-TrigSignatureMoniMT                                 INFO -- #3476793373 Features                             4          4          4          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain8_ev1_L1EM5 #1677577445
-TrigSignatureMoniMT                                 INFO -- #1677577445 Events         4          4          3          3          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1677577445 Features                             4          4          4          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain8_muv1_L1MU10 #2288364952
-TrigSignatureMoniMT                                 INFO -- #2288364952 Events         2          2          2          1          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #2288364952 Features                             2          1          1          1          
-TrigSignatureMoniMT                                 INFO HLT_TestChain8_muv1step_L1MU6 #3588359947
-TrigSignatureMoniMT                                 INFO -- #3588359947 Events         2          2          2          -          -          -          2          
-TrigSignatureMoniMT                                 INFO -- #3588359947 Features                             3          -          -          -          
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/emu_step_processing.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/emu_step_processing.ref
deleted file mode 100644
index a81860b7412a01ba01f9c6c032debb3f98c34321..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/emu_step_processing.ref
+++ /dev/null
@@ -1,152 +0,0 @@
-TriggerSummaryStep1                        1   0   DEBUG In summary 4 chains passed:
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
-TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_gv1_L1EM7 ID#3893303900
-TriggerSummaryStep2                        1   0   DEBUG In summary 3 chains passed:
-TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
-TriggerSummaryStep3                        1   0   DEBUG In summary 2 chains passed:
-TriggerSummaryStep3                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep3                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                        2   0   DEBUG In summary 23 chains passed:
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg002_HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#56278684
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#133619581
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#1790520567
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#1820214917
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_2TestChain6_muEmpty1_L12MU6 ID#2176116418
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2599553377
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#3037831603
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3196402061
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain10_muv2_L1MU10 ID#3482819675
-TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3844733695
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#4097287954
-TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep2                        2   0   DEBUG In summary 19 chains passed:
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg002_HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#56278684
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#133619581
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#1790520567
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#1820214917
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_2TestChain6_muEmpty1_L12MU6 ID#2176116418
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2599553377
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2764921170
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 ID#3037831603
-TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#4097287954
-TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep3                        2   0   DEBUG In summary 5 chains passed:
-TriggerSummaryStep3                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep3                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep4                        2   0   DEBUG In summary 4 chains passed:
-TriggerSummaryStep4                        2   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep4                        2   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep4                        2   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep4                        2   0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep1                        3   0   DEBUG In summary 10 chains passed:
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#64374772
-TriggerSummaryStep1                        3   0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#122300819
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep1                        3   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep1                        3   0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 ID#1827802456
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep1                        3   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep2                        3   0   DEBUG In summary 6 chains passed:
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep2                        3   0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#1546253468
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#3476793373
-TriggerSummaryStep2                        3   0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 ID#4283304400
-TriggerSummaryStep3                        3   0   DEBUG In summary 3 chains passed:
-TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM5 ID#1677577445
-TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep4                        3   0   DEBUG In summary 2 chains passed:
-TriggerSummaryStep4                        3   0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep4                        3   0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TrigSignatureMoniMT                                 INFO HLT_2TestChain4_muv1dr_L12MU6 #3176095517
-TrigSignatureMoniMT                                 INFO -- #3176095517 Events         0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3176095517 Features                             0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_2TestChain6_muEmpty1_L12MU6 #2176116418
-TrigSignatureMoniMT                                 INFO -- #2176116418 Events         1          1          0          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #2176116418 Features                             0          6          -          -          
-TrigSignatureMoniMT                                 INFO HLT_2TestChain6_muv1_L12MU6 #1408409992
-TrigSignatureMoniMT                                 INFO -- #1408409992 Events         2          2          1          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #1408409992 Features                             6          6          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 #2764921170
-TrigSignatureMoniMT                                 INFO -- #2764921170 Events         1          1          0          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #2764921170 Features                             0          3          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain10_muv2_L1MU10 #3482819675
-TrigSignatureMoniMT                                 INFO -- #3482819675 Events         2          2          1          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #3482819675 Features                             1          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain20_muv1_L1MU10 #356594709
-TrigSignatureMoniMT                                 INFO -- #356594709 Events          1          1          1          1          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #356594709 Features                              1          1          1          1          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev1_L1EM3 #1756953305
-TrigSignatureMoniMT                                 INFO -- #1756953305 Events         3          3          2          2          2          -          2          
-TrigSignatureMoniMT                                 INFO -- #1756953305 Features                             4          4          4          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev1_TestChain8_ev1_2TestChain6_muv1_L1EM3_L1EM5_L12MU6 #1820214917
-TrigSignatureMoniMT                                 INFO -- #1820214917 Events         1          1          1          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #1820214917 Features                             2          2          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 #2709794009
-TrigSignatureMoniMT                                 INFO -- #2709794009 Events         0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2709794009 Features                             0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev2_L1EM7 #1760405581
-TrigSignatureMoniMT                                 INFO -- #1760405581 Events         0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1760405581 Features                             0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_ev3_L1EM7 #2336588294
-TrigSignatureMoniMT                                 INFO -- #2336588294 Events         1          1          1          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #2336588294 Features                             2          2          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain5_gv1_L1EM7 #3893303900
-TrigSignatureMoniMT                                 INFO -- #3893303900 Events         1          1          1          -          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #3893303900 Features                             2          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muEmpty2_L1MU6 #2511524900
-TrigSignatureMoniMT                                 INFO -- #2511524900 Events         1          1          1          0          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #2511524900 Features                             3          0          3          3          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv1_TestChain10_ev1_L1MU6_EM5 #64374772
-TrigSignatureMoniMT                                 INFO -- #64374772 Events           2          2          2          1          0          1          1          
-TrigSignatureMoniMT                                 INFO -- #64374772 Features                               4          3          0          3          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 #3196402061
-TrigSignatureMoniMT                                 INFO -- #3196402061 Events         2          2          1          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3196402061 Features                             3          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv1_TestChain5_ev1dr_L12MU6 #3205587050
-TrigSignatureMoniMT                                 INFO -- #3205587050 Events         0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3205587050 Features                             0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain6_muv2_TestChain8_ev2_L1MU6_EM5 #3476793373
-TrigSignatureMoniMT                                 INFO -- #3476793373 Events         2          2          2          2          -          -          2          
-TrigSignatureMoniMT                                 INFO -- #3476793373 Features                             4          4          -          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain8_ev1_L1EM5 #1677577445
-TrigSignatureMoniMT                                 INFO -- #1677577445 Events         4          4          3          3          3          -          3          
-TrigSignatureMoniMT                                 INFO -- #1677577445 Features                             4          4          4          -          
-TrigSignatureMoniMT                                 INFO HLT_TestChain8_muv1_L1MU10 #2288364952
-TrigSignatureMoniMT                                 INFO -- #2288364952 Events         2          2          2          1          1          1          1          
-TrigSignatureMoniMT                                 INFO -- #2288364952 Features                             2          1          1          1          
-TrigSignatureMoniMT                                 INFO HLT_TestChain8_muv1step_L1MU6 #3588359947
-TrigSignatureMoniMT                                 INFO -- #3588359947 Events         2          2          2          -          -          -          2          
-TrigSignatureMoniMT                                 INFO -- #3588359947 Features                             3          -          -          -          
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_build.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_build.ref
deleted file mode 100644
index 16c0e9822e25c0ba7c9dd6a6b0a43e1d9d3d64a2..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_build.ref
+++ /dev/null
@@ -1,129 +0,0 @@
-TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e3_etcut1step_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e3_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronFastTrackStep (step ) used at step 2 in chain HLT_e3_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronPrecisionCaloStep (step ) used at step 3 in chain HLT_e3_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e5_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronFastTrackStep (step ) used at step 2 in chain HLT_e5_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronPrecisionCaloStep (step ) used at step 3 in chain HLT_e5_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e7_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronFastTrackStep (step ) used at step 2 in chain HLT_e7_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence ElectronPrecisionCaloStep (step ) used at step 3 in chain HLT_e7_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence PhotonFastCaloStep (step ) used at step 1 in chain HLT_g5_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence precisionCaloPhotonStep (step ) used at step 3 in chain HLT_g5_etcut_L1EM3
-TrigSignatureMoniMT                                 INFO Sequence Step1_2muComb_asym (step Step1) used at step 2 in chain HLT_mu6_mu4_L12MU4
-TrigSignatureMoniMT                                 INFO Sequence Step_FSmuEFSA (step ) used at step 1 in chain HLT_mu6noL1_L1MU6
-TrigSignatureMoniMT                                 INFO Sequence Step_FSmuEFCB (step ) used at step 2 in chain HLT_mu6noL1_L1MU6
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j45_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j85_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j420_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j260_320eta490_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a10_subjes_tc_lcw (step ) used at step 1 in chain HLT_j460_a10_lcw_subjes_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a10r (step ) used at step 1 in chain HLT_j460_a10r_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_3j200_L1J20
-TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_5j70_0eta240_L1J20
-TrigSignatureMoniMT                                 INFO HLT_2mu4_bBmumu_L12MU4 #3163510355
-TrigSignatureMoniMT                                 INFO -- #3163510355 Events         20         20         1          1          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #3163510355 Features                             4          2          0          0          
-TrigSignatureMoniMT                                 INFO HLT_2mu4_bDimu_L12MU4 #1730084172
-TrigSignatureMoniMT                                 INFO -- #1730084172 Events         20         20         1          1          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1730084172 Features                             4          2          0          0          
-TrigSignatureMoniMT                                 INFO HLT_2mu4_bJpsimumu_L12MU4 #4276347155
-TrigSignatureMoniMT                                 INFO -- #4276347155 Events         20         20         1          1          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #4276347155 Features                             4          2          0          0          
-TrigSignatureMoniMT                                 INFO HLT_2mu4_bUpsimumu_L12MU4 #4008168535
-TrigSignatureMoniMT                                 INFO -- #4008168535 Events         20         20         1          1          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #4008168535 Features                             4          2          0          0          
-TrigSignatureMoniMT                                 INFO HLT_2mu6Comb_L12MU6 #2046267508
-TrigSignatureMoniMT                                 INFO -- #2046267508 Events         20         20         0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2046267508 Features                             0          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_2mu6_bJpsimumu_L12MU6 #1924924067
-TrigSignatureMoniMT                                 INFO -- #1924924067 Events         20         20         0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1924924067 Features                             0          0          0          0          
-TrigSignatureMoniMT                                 INFO HLT_3j200_L1J20 #493765146
-TrigSignatureMoniMT                                 INFO -- #493765146 Events          20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L1J20 #4050408395
-TrigSignatureMoniMT                                 INFO -- #4050408395 Events         20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #4050408395 Features                             0          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_L1EM3 #999988353
-TrigSignatureMoniMT                                 INFO -- #999988353 Events          20         20         13         -          -          -          13         
-TrigSignatureMoniMT                                 INFO -- #999988353 Features                              27         -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_e3_etcut_L1EM3 #683953566
-TrigSignatureMoniMT                                 INFO -- #683953566 Events          20         20         15         14         14         -          14         
-TrigSignatureMoniMT                                 INFO -- #683953566 Features                              48         156        87         -          
-TrigSignatureMoniMT                                 INFO HLT_e3_etcut_mu6_L1EM8I_MU10 #3997258299
-TrigSignatureMoniMT                                 INFO -- #3997258299 Events         20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3997258299 Features                             0          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_e5_etcut_L1EM3 #324908483
-TrigSignatureMoniMT                                 INFO -- #324908483 Events          20         20         13         13         13         -          13         
-TrigSignatureMoniMT                                 INFO -- #324908483 Features                              41         141        47         -          
-TrigSignatureMoniMT                                 INFO HLT_e7_etcut_L1EM3 #1959043579
-TrigSignatureMoniMT                                 INFO -- #1959043579 Events         20         20         13         13         11         -          11         
-TrigSignatureMoniMT                                 INFO -- #1959043579 Features                             26         90         20         -          
-TrigSignatureMoniMT                                 INFO HLT_g5_etcut_L1EM3 #471243435
-TrigSignatureMoniMT                                 INFO -- #471243435 Events          20         20         13         13         13         -          13         
-TrigSignatureMoniMT                                 INFO -- #471243435 Features                              41         41         50         -          
-TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
-TrigSignatureMoniMT                                 INFO -- #4034799151 Events         20         20         2          -          -          -          2          
-TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             34         -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
-TrigSignatureMoniMT                                 INFO -- #3084792704 Events         20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
-TrigSignatureMoniMT                                 INFO -- #2205518067 Events         20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_L1J20 #1247336154
-TrigSignatureMoniMT                                 INFO -- #1247336154 Events         20         20         5          -          -          -          5          
-TrigSignatureMoniMT                                 INFO -- #1247336154 Features                             5          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_L1J20 #4088855158
-TrigSignatureMoniMT                                 INFO -- #4088855158 Events         20         20         5          5          -          -          5          
-TrigSignatureMoniMT                                 INFO -- #4088855158 Features                             5          5          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          20         20         5          5          -          -          5          
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              5          5          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         20         20         5          5          -          -          5          
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             5          5          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J20 #215408633
-TrigSignatureMoniMT                                 INFO -- #215408633 Events          20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
-TrigSignatureMoniMT                                 INFO -- #3875082669 Events         20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_j85_L1J20 #510475538
-TrigSignatureMoniMT                                 INFO -- #510475538 Events          20         20         3          -          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #510475538 Features                              3          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 #2083734526
-TrigSignatureMoniMT                                 INFO -- #2083734526 Events         20         20         1          1          1          -          1          
-TrigSignatureMoniMT                                 INFO -- #2083734526 Features                             1          1          1          -          
-TrigSignatureMoniMT                                 INFO HLT_mu6Comb_L1MU6 #996392590
-TrigSignatureMoniMT                                 INFO -- #996392590 Events          20         20         1          1          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #996392590 Features                              1          1          -          -          
-TrigSignatureMoniMT                                 INFO HLT_mu6_L1MU6 #2560542253
-TrigSignatureMoniMT                                 INFO -- #2560542253 Events         20         20         1          1          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #2560542253 Features                             1          1          0          0          
-TrigSignatureMoniMT                                 INFO HLT_mu6_mu4_L12MU4 #1713982776
-TrigSignatureMoniMT                                 INFO -- #1713982776 Events         20         20         1          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1713982776 Features                             2          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_mu6fast_L1MU6 #3518031697
-TrigSignatureMoniMT                                 INFO -- #3518031697 Events         20         20         1          -          -          -          1          
-TrigSignatureMoniMT                                 INFO -- #3518031697 Features                             1          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_mu6msonly_L1MU6 #2316111217
-TrigSignatureMoniMT                                 INFO -- #2316111217 Events         20         20         1          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2316111217 Features                             1          0          0          -          
-TrigSignatureMoniMT                                 INFO HLT_mu6noL1_L1MU6 #1631468602
-TrigSignatureMoniMT                                 INFO -- #1631468602 Events         20         20         1          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1631468602 Features                             1          0          -          -          
-TrigSignatureMoniMT                                 INFO HLT_xe30_L1XE10 #347649004
-TrigSignatureMoniMT                                 INFO -- #347649004 Events          20         20         3          -          -          -          3          
-TrigSignatureMoniMT                                 INFO -- #347649004 Features                              3          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_xe30_cell_xe30_tcpufit_L1XE10 #3768353779
-TrigSignatureMoniMT                                 INFO -- #3768353779 Events         20         20         2          -          -          -          2          
-TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             2          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_xe30_tcpufit_L1XE10 #1583719916
-TrigSignatureMoniMT                                 INFO -- #1583719916 Events         20         20         2          -          -          -          2          
-TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             2          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_xe65_L1XE50 #1283272884
-TrigSignatureMoniMT                                 INFO -- #1283272884 Events         20         20         0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1283272884 Features                             0          -          -          -          
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_configOnly.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_configOnly.ref
deleted file mode 100644
index 6596c67af4d31062c79fa2db644fb510c767aa67..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_configOnly.ref
+++ /dev/null
@@ -1 +0,0 @@
-Py:Athena            INFO configuration complete, now exiting ... 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestComboHypoAlg.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestComboHypoAlg.cxx
deleted file mode 100644
index 4c73f25453729d263b8b9797a785fd25860129b3..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestComboHypoAlg.cxx
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-#include "TrigCompositeUtils/HLTIdentifier.h"
-#include "TestComboHypoAlg.h"
-
-
-
-namespace HLTTest {
-
-  TestComboHypoAlg::TestComboHypoAlg( const std::string& name, 
-				      ISvcLocator* pSvcLocator ) : 
-    ::AthReentrantAlgorithm( name, pSvcLocator )  {
-    declareProperty( "Property1", m_property1 );
-    declareProperty( "Property2", m_property2 );
-    declareProperty( "Threshold1", m_threshold1 = 0);
-    declareProperty( "Threshold2", m_threshold2 = 0);
-    declareProperty( "DecisionLabel", m_decisionLabel );
-  }
-
-  TestComboHypoAlg::~TestComboHypoAlg() {}
-
-  StatusCode TestComboHypoAlg::initialize() {
-    ATH_MSG_INFO ("Initializing " << name() << "...");
-    CHECK( m_recoInput1.initialize() );
-    CHECK( m_recoInput2.initialize() );
-    CHECK( m_output1.initialize() );
-    CHECK( m_output2.initialize() );
-    CHECK( m_previousDecisions1.initialize() );
-    renounce(m_previousDecisions1);
-    CHECK( m_previousDecisions2.initialize() );
-    renounce(m_previousDecisions2);
-
-    CHECK( not m_chainsProperty.empty() );
-  
-    for ( const std::string& el: m_chainsProperty ) 
-      m_chains.insert( HLT::Identifier( el ).numeric() );
-  
-    for ( const HLT::Identifier& id: m_chains )
-      ATH_MSG_DEBUG( "Configured to require chain " << id );
-  
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TestComboHypoAlg::finalize() {
-    ATH_MSG_INFO ("Finalizing " << name() << "...");
-
-    return StatusCode::SUCCESS;
-  }
-
-  bool TestComboHypoAlg::passed( const Decision* d1, const Decision* d2 ) const {
-    {
-      auto featureInfo = TrigCompositeUtils::findLink<xAOD::TrigCompositeContainer>( d1, "feature"  );
-      auto feature1 = featureInfo.link;
-
-      if ( not feature1.isValid() )  {
-	ATH_MSG_ERROR( "Can not find reference to the object from the decision1" );
-	return false; 
-      }
-      if ( (*feature1)->hasDetail<float>(m_property1 ) ){
-	float v = (*feature1)->getDetail<float>( m_property1 );
-	ATH_MSG_DEBUG("Prop1="<<v);
-	if ( v < m_threshold1 )
-	  return false;
-      }
-      else ATH_MSG_ERROR( "Cannot find detail "<<m_property1<<" in feature1");
-    }
-    
-    {
-      auto featureInfo = TrigCompositeUtils::findLink<xAOD::TrigCompositeContainer>( d2, "feature"  );
-      auto feature2 = featureInfo.link;
-
-      if ( not feature2.isValid() )  {
-	ATH_MSG_ERROR( "Can not find reference to the object from the decision2" );
-	return false;//StatusCode::FAILURE;
-      }
-      if ( (*feature2)->hasDetail<float>(m_property2 ) ){
-	float v = (*feature2)->getDetail<float>( m_property2 );
-	ATH_MSG_DEBUG("Prop2="<<v);
-	if ( v < m_threshold2 )
-	  return false;
-      } else ATH_MSG_ERROR( "Cannot find detail "<<m_property2<<" in feature2");
-    }
-    
-    return true;    
-  }
-
-
-
-  StatusCode TestComboHypoAlg::execute( const EventContext& context ) const {  
-
-    ATH_MSG_DEBUG ("Executing " << name() << "...");
-
-    auto previousDecisionsHandle1 = SG::makeHandle( m_previousDecisions1, context );
-    if( not previousDecisionsHandle1.isValid() ) {//implicit
-      ATH_MSG_DEBUG( "No implicit RH for previous decisions1: is this expected?" );
-      return StatusCode::SUCCESS;      
-    }
-    ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle1->size() <<" implicit " <<previousDecisionsHandle1.key()<<" for previous decisions of input 1");
-
-    auto previousDecisionsHandle2 = SG::makeHandle( m_previousDecisions2, context );
-    if( not previousDecisionsHandle2.isValid() ) {//implicit
-      ATH_MSG_DEBUG( "No implicit RH for previous decisions2: is this expected?" );
-      return StatusCode::SUCCESS;      
-    }
-    ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle2->size() <<" implicit "<<previousDecisionsHandle2.key()<<" for previous decisions of input 2");
-    
-    auto recoInput1 = SG::makeHandle(m_recoInput1, context);
-    auto recoInput2 = SG::makeHandle(m_recoInput2, context);
-
-    ATH_MSG_DEBUG( "and with "<< recoInput1->size() <<" reco1 inputs, and "<<recoInput2->size() <<" reco2 inputs");
-    
-    SG::WriteHandle<DecisionContainer> outputHandle1 = createAndStore(m_output1, context ); 
-    auto decisions1 = outputHandle1.ptr();
-    SG::WriteHandle<DecisionContainer> outputHandle2 = createAndStore(m_output1, context ); 
-    auto decisions2 = outputHandle2.ptr();
-
-    // find RoIs from previous decisions
-    std::vector<const FeatureOBJ*> featureFromDecision1;
-    for ( auto previousDecision: *previousDecisionsHandle1 ) {
-      auto featureInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI"  );
-      auto featurelink = featureInfo.link;
-
-      CHECK( featurelink.isValid() );
-      const FeatureOBJ* feature = *featurelink;
-      featureFromDecision1.push_back( feature);
-    }
-    ATH_MSG_DEBUG("Found "<<featureFromDecision1.size()<<" RoIs from decision input1");
-
-   std::vector<const FeatureOBJ*> featureFromDecision2;
-    for ( auto previousDecision: *previousDecisionsHandle2 ) {
-      auto featureInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( previousDecision, "initialRoI"  );
-      auto featurelink = featureInfo.link;
-
-      CHECK( featurelink.isValid() );
-      const FeatureOBJ* feature = *featurelink;
-      featureFromDecision2.push_back( feature);
-    }
-    ATH_MSG_DEBUG("Found "<<featureFromDecision2.size()<<" RoIs from decision input2");
-
-    //map reco object and decision: find in reco obejct the initial RoI and map it to the correct decision
-    size_t counter1 = 0;
-    for (auto recoobj: *recoInput1){
-      auto featureInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( recoobj, "initialRoI"  );
-      auto featurelink = featureInfo.link;
-      CHECK( featurelink.isValid() );      
-      ATH_MSG_DEBUG("Found link from the reco object1 to RoI" );
-      const FeatureOBJ* feature = *featurelink;
-      // find the same roi in the previous decisions
-      bool foundRoIInDecision=false;
-       size_t pos=distance(featureFromDecision1.begin(), find(featureFromDecision1.begin(), featureFromDecision1.end(), feature));
-       if (pos < featureFromDecision1.size()){
-	 foundRoIInDecision=true;	 
-       }
-       
-       if (foundRoIInDecision){
-	 ATH_MSG_DEBUG("Found the same RoI on decision at pos "<<pos);
-	 auto d = newDecisionIn(decisions1);
-	 d->setObjectLink( "feature", ElementLink<xAOD::TrigCompositeContainer>(m_recoInput1.key(), counter1) );// feature used by the Tool
-	 d->setObjectLink( "initialRoI", featurelink );// this is used by the InputMaker
-	 d->setObjectLink( "previousDecisions", ElementLink<DecisionContainer>(m_previousDecisions1.key(), pos) );// link to previous decision object
-       }
-       else{
-	 ATH_MSG_ERROR( " Can not find reference to previous decision from RoI from reco object " << counter1 );
-	 return StatusCode::FAILURE;
-       }
-       counter1++;
-    }
-
-
-    size_t counter2 = 0;
-     for (auto recoobj: *recoInput2){
-       auto featureInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( recoobj, "initialRoI"  );
-       auto featurelink = featureInfo.link;
-
-      CHECK( featurelink.isValid() );      
-      ATH_MSG_DEBUG("Found link from the reco object2 to RoI" );
-      const FeatureOBJ* feature = *featurelink;
-      // find the same roi in the previous decisions
-      bool foundRoIInDecision=false;
-       size_t pos=distance(featureFromDecision2.begin(), find(featureFromDecision2.begin(), featureFromDecision2.end(), feature));
-       if (pos < featureFromDecision2.size()){
-	 foundRoIInDecision=true;	 
-       }
-       
-       if (foundRoIInDecision){
-	 ATH_MSG_DEBUG("Found the same RoI on decision at pos "<<pos);
-	 auto d = newDecisionIn(decisions2);
-	 d->setObjectLink( "feature", ElementLink<xAOD::TrigCompositeContainer>(m_recoInput2.key(), counter2) );// feature used by the Tool
-	 d->setObjectLink( "initialRoI", featurelink );// this is used by the InputMaker
-	 d->setObjectLink( "previousDecisions", ElementLink<DecisionContainer>(m_previousDecisions2.key(), pos) );// link to previous decision object
-       }
-       else{
-	 ATH_MSG_ERROR( " Can not find reference to previous decision from RoI from reco object " << counter2 );
-	 return StatusCode::FAILURE;
-       }
-       counter2++;
-    }
-    
-  
-    ATH_MSG_DEBUG( "Found  "<<counter1<<" rois from input 1 " );       
-    ATH_MSG_DEBUG( "Found  "<<counter2<<" rois from input 2 " );
-
-    // this is the tool
-    if (decisions1->size() ==0 || decisions2->size() == 0)
-      ATH_MSG_DEBUG("No combined hypo found, Do not go to the tool since n.dec1="<<  decisions1->size() << " and n.dec2="<< decisions2->size() <<" ");
-    else
-      ATH_MSG_DEBUG("Go to the tool with n.dec1="<<  decisions1->size() << " and n.dec2="<< decisions2->size() <<" ");
-
-    counter1 = 0;
-    for ( auto obj1Iter = decisions1->begin(); obj1Iter != decisions1->end(); ++obj1Iter, ++counter1 ) {
-      auto previousDecisions1 = (*obj1Iter)->objectLink<DecisionContainer>( "previousDecisions" ); 
-      TrigCompositeUtils::DecisionIDContainer objDecisions1;      
-      TrigCompositeUtils::decisionIDs( *previousDecisions1, objDecisions1 );
-      
-      ATH_MSG_DEBUG("Number of previous decisions for input1: " << objDecisions1.size() );
-      
-      for ( TrigCompositeUtils::DecisionID id : objDecisions1 ) {
-	ATH_MSG_DEBUG( " -- found decision " << HLT::Identifier( id ) );
-      }
-      
-      std::vector<TrigCompositeUtils::DecisionID> intersection1;
-      std::set_intersection( m_chains.begin(), m_chains.end(),
-			     objDecisions1.begin(), objDecisions1.end(),
-			     std::back_inserter( intersection1 ) );
-    
-      if ( not intersection1.empty() ) {
-
-	for ( const HLT::Identifier& did: intersection1 ){
-	  ATH_MSG_DEBUG("Found "<<did<<" to candidate "<< counter1 << " in input1");
-	}
-	counter2 = 0;
-	for ( auto obj2Iter = decisions2->begin(); obj2Iter != decisions2->end(); ++obj2Iter, ++counter2 ) {
-	  auto previousDecisions2 = (*obj2Iter)->objectLink<DecisionContainer>( "previousDecisions" ); 
-	  TrigCompositeUtils::DecisionIDContainer objDecisions2;      
-	  TrigCompositeUtils::decisionIDs( *previousDecisions2, objDecisions2 );
-      
-	  ATH_MSG_DEBUG("Number of previous decisions for input2: " << objDecisions2.size() );
-      
-	  for ( TrigCompositeUtils::DecisionID id : objDecisions2 ) {
-	    ATH_MSG_DEBUG( " -- found decision " << HLT::Identifier( id ) );
-	  }
-
-	  // check that the same chain is in this decisions 
-	  std::vector<TrigCompositeUtils::DecisionID> intersection2;
-	  std::set_intersection( objDecisions1.begin(), objDecisions1.end(),
-				 objDecisions2.begin(), objDecisions2.end(),
-				 std::back_inserter( intersection2 ) );
-    
-	  if ( not intersection2.empty() ) {
-	    for ( const HLT::Identifier& did: intersection2 ){
-	      ATH_MSG_DEBUG("Found "<<did<<" to both candidates for "<< counter2 << " in input2");
-	    }
-	    ATH_MSG_DEBUG("Found good combined candidate");
-	    
-
-	    if (  passed(*obj1Iter, *obj2Iter)  ) {
-	      for ( const HLT::Identifier& did: intersection2 ){
-		//	      auto did = HLT::Identifier( m_decisionLabel ).numeric();
-		ATH_MSG_DEBUG("Adding "<<did<<" to both candaites");
-		addDecisionID( did,  decisions1->at(counter1) );
-		addDecisionID( did,  decisions2->at(counter2) );
-	      }
-	    }
-	    
-	  }
-	}
-      }
-    }
-    
-    return StatusCode::SUCCESS;
-  }
-
-} //> end namespace HLTTest
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestComboHypoAlg.h b/Trigger/TrigValidation/TrigUpgradeTest/src/TestComboHypoAlg.h
deleted file mode 100644
index c398289dc2bab4d4a86ed21bfcb47be9e4114b12..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestComboHypoAlg.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-#ifndef TRIGUPGRADETEST_TESTCOMBOHYPOALG_H
-#define TRIGUPGRADETEST_TESTCOMBOHYPOALG_H 1
-
-
-#include <string>
-#include "xAODTrigger/TrigCompositeContainer.h"
-#include "TrigCompositeUtils/TrigCompositeUtils.h"
-//#include "AthenaBaseComps/AthAlgorithm.h"
-#include "AthenaBaseComps/AthReentrantAlgorithm.h"
-#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
-
-namespace HLTTest {
-
-/**
- * @class $(klass)s
- * @brief 
- **/
-  using namespace TrigCompositeUtils;
-  class TestComboHypoAlg : public ::AthReentrantAlgorithm 
-{ 
- public: 
-  TestComboHypoAlg( const std::string& name, ISvcLocator* pSvcLocator );
-
-  virtual ~TestComboHypoAlg(); 
-
-  //TestComboHypoAlg &operator=(const TestComboHypoAlg &alg); 
-
-  StatusCode  initialize() override;
-  virtual StatusCode  execute( const EventContext& context ) const override;
-  //StatusCode  execute() override;
-  StatusCode  finalize() override;
-  
- private: 
-
-  typedef TrigRoiDescriptor FeatureOBJ;
-  typedef TrigRoiDescriptorCollection FeatureContainer;
-
-  SG::ReadHandleKey<xAOD::TrigCompositeContainer> m_recoInput1  { this, "Input1", "first input", "Key for reco input 1" };
-  SG::ReadHandleKey<xAOD::TrigCompositeContainer> m_recoInput2  { this, "Input2", "second input", "Key for reco input 2" };
-  SG::ReadHandleKey <DecisionContainer> m_previousDecisions1    { this, "previousDecisions1", "previousDecisions1", "Key for decisions per RoI for input 1" };
-  SG::ReadHandleKey <DecisionContainer> m_previousDecisions2    { this, "previousDecisions2", "previousDecisions2", "Key for decisions per RoI for input 2" };
-
-  SG::WriteHandleKey<DecisionContainer> m_output1 { this, "Output1", "decision1", "Key for decision input 1" };
-  SG::WriteHandleKey<DecisionContainer> m_output2 { this, "Output2", "decision2", "Key for decision input 2" };
-
-  Gaudi::Property<std::vector<std::string> > m_chainsProperty{ this, "Chains", {}, "Chains of whihc this Hypo is concerned" };
-    
-  // equivalent to tools:
-  std::string m_decisionLabel; // I am lazy and do not create tools for now, alg is able to make just one decision
-  std::string m_property1;
-  std::string m_property2;
-  float m_threshold1;
-  float m_threshold2;
-
-  std::set<HLT::Identifier> m_chains;
-  bool passed( const Decision* d1, const Decision* d2 ) const;
-}; 
-
-} //> end namespace HLTTest
-#endif //> !TRIGUPGRADETEST_TESTCOMBOHYPOALG_H
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMHypoTool.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestMHypoTool.cxx
deleted file mode 100644
index c8f195e2f649a9760aebe3747ba03ad4b1cb64a5..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMHypoTool.cxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-// TrigUpgradeTest includes
-#include "TestMHypoTool.h"
-
-
-namespace HLTTest {
-
-  TestMHypoTool::TestMHypoTool( const std::string& type, 
-			      const std::string& name, 
-			      const IInterface* parent ) :
-    ITestHypoTool( name ),
-    AthAlgTool( type, name, parent )
-  {
-    declareProperty( "Threshold", m_threshold = 0);
-    declareProperty( "Multiplicity", m_multiplicity = 0 );
-    declareProperty( "Property", m_property );
-  }
-
-  TestMHypoTool::~TestMHypoTool()
-  {}
-
-  StatusCode TestMHypoTool::initialize()
-  {
-    ATH_MSG_INFO( "Initializing " << name() << "..." );
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TestMHypoTool::iterate( DecisionContainer* decisions, std::function<void(Decision*)> f) const {
-      ATH_MSG_DEBUG( "Making decisions " << name() );
-      for ( auto d: *decisions )  {
-	auto feature = d->objectLink<xAOD::TrigCompositeContainer>( "feature" );
-	if ( not feature.isValid() )  {
-	  ATH_MSG_ERROR( " Can not find reference to the object from the decision" );
-	  return StatusCode::FAILURE;
-      }      
-	float v = (*feature)->getDetail<float>( m_property );
-	if ( v > m_threshold ) { // actual cut will be more complex of course
-	  ATH_MSG_DEBUG( "  threshold " << m_threshold << " passed by value: " << v );
-	  f(d); // here we inject the functional code
-	}	
-      }
-      return StatusCode::SUCCESS;
-    
-  }
-
-  
-  StatusCode TestMHypoTool::decide( DecisionContainer* decisions ) const  {
-
-    size_t candidates = 0;
-       
-    CHECK( iterate(decisions,
-		   [&](Decision*){ candidates++; } ) );
-    if ( candidates >=  m_multiplicity ) 
-      CHECK( iterate(decisions,
-		     [&](Decision* d) { addDecisionID( decisionId().numeric(), d ); } ) );
-    return StatusCode::SUCCESS;
-  }
-
-  
-  StatusCode TestMHypoTool::finalize()
-  {
-    ATH_MSG_INFO( "Finalizing " << name() << "..." );
-
-    return StatusCode::SUCCESS;
-  }
-
-} //> end namespace HLTTest
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMHypoTool.h b/Trigger/TrigValidation/TrigUpgradeTest/src/TestMHypoTool.h
deleted file mode 100644
index e1f395ecb81ff42a7ba0982bc2204020e71a151d..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMHypoTool.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-#ifndef TRIGUPGRADETEST_TESTMHYPOTOOL_H
-#define TRIGUPGRADETEST_TESTMHYPOTOOL_H 1
-
-// STL includes
-#include <string>
-
-
-#include "AthenaBaseComps/AthAlgTool.h"
-
-#include "TrigCompositeUtils/HLTIdentifier.h"
-
-#include "./ITestHypoTool.h"
-
-namespace HLTTest {
-
-  /**
-   * @class TestMHypoTool
-   * @brief Tool taking the decision for multiplicity selection (one decision per object)
-   * The implementation is limited to same threshold only (it is a test).
-   **/
-
-  class TestMHypoTool : virtual public ITestHypoTool, public AthAlgTool
-  { 
-  public: 
-    TestMHypoTool( const std::string& type,
-		  const std::string& name, 
-		  const IInterface* parent );
-
-    virtual ~TestMHypoTool(); 
-
-    StatusCode  initialize() override;
-    StatusCode  finalize() override;    
-    StatusCode decide( DecisionContainer* decisions ) const override;
-  
-  private: 
-
-    //    TestMHypoTool();
-    float m_threshold;
-    size_t m_multiplicity;
-    std::string m_property;
-    StatusCode iterate( DecisionContainer* decisions, std::function<void(Decision*)> f) const;
-  }; 
-
-} //> end namespace HLTTest
-#endif //> !TRIGUPGRADETEST_TESTMHYPOTOOL_H
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.cxx
deleted file mode 100644
index 7a0af223d1a2d903634619ddedad3006511346fb..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.cxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-// TrigUpgradeTest includes
-#include "TestMerger.h"
-
-// STL includes
-
-
-
-namespace HLTTest {
-
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
-
-  // Constructors
-  ////////////////
-  TestMerger::TestMerger( const std::string& name, 
-    ISvcLocator* pSvcLocator ) : 
-  ::AthAlgorithm( name, pSvcLocator )
-  {
-    declareProperty( "Inputs", m_inputs );
-    declareProperty( "Output", m_outputKey );
-  }
-
-
-  //  TestMerger::~TestMerger()
-  //  {}
-
-
-  StatusCode TestMerger::initialize()
-  {
-    ATH_MSG_INFO ("Initializing " << name() << "...");
-    CHECK( m_outputKey.initialize() );
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TestMerger::finalize()
-  {
-    ATH_MSG_INFO ("Finalizing " << name() << "...");
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TestMerger::execute()
-  {  
-    ATH_MSG_DEBUG ("Executing " << name() << "...");
-
-    auto output = std::make_unique<DecisionContainer>();
-    auto aux    = std::make_unique<DecisionAuxContainer>();
-    output->setStore( aux.get() );
-
-    for (const auto input: m_inputs ) {
-      auto iHandle = SG::ReadHandle<DecisionContainer>(input);
-      if ( iHandle.isValid() ) {
-        size_t counter = 0;
-        for ( auto iDecisionIter  = iHandle->begin(); iDecisionIter != iHandle->end(); ++iDecisionIter, ++counter ) {
-          auto d = newDecisionIn(output.get());
-          linkToPrevious(d, *iDecisionIter );
-        }
-        ATH_MSG_DEBUG( "Input " << input << " present, linked " << counter << " inputs" );
-      } else {
-        ATH_MSG_DEBUG( "Input " << input << " absent" );
-      }
-    }
-    
-    auto outputHandle = SG::makeHandle(m_outputKey);
-    CHECK( outputHandle.record( std::move(output), std::move(aux) ) );
-    return StatusCode::SUCCESS;
-  }
-
-
-} //> end namespace HLTTest
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.h b/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.h
deleted file mode 100644
index f448b1b8d6b220e6dc058cc093854be32a4634ff..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestMerger.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-#ifndef TRIGUPGRADETEST_TESTMERGER_H
-#define TRIGUPGRADETEST_TESTMERGER_H 1
-
-// STL includes
-#include <string>
-
-// FrameWork includes
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "TrigCompositeUtils/TrigCompositeUtils.h"
-namespace HLTTest {
-  using namespace TrigCompositeUtils;
-  class TestMerger
-    : public ::AthAlgorithm
-  { 
-
-  public: 
-
-    TestMerger( const std::string& name, ISvcLocator* pSvcLocator );
-
-    //    virtual ~TestMerger(){}
-
-
-    StatusCode  initialize() override;
-    StatusCode  execute() override;
-    StatusCode  finalize() override;
-
-  private: 
-
-
-    TestMerger();
-    std::vector<std::string> m_inputs;
-    SG::WriteHandleKey<DecisionContainer> m_outputKey;
-  }; 
-
-} //> end namespace HLTTest
-#endif //> !TRIGUPGRADETEST_TESTMERGER_H
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.cxx
deleted file mode 100644
index f2e9d9e100df7e97242a6ae4a1b3d3e42f75f6ab..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <iterator>
-#include <algorithm>
-
-#include "TrigCompositeUtils/HLTIdentifier.h"
-#include "TestRoRSeqFilter.h"
-
-#include "GaudiKernel/Property.h"
-
-using namespace TrigCompositeUtils;
-
-namespace HLTTest {
-
-  TestRoRSeqFilter::TestRoRSeqFilter( const std::string& name, 
-    ISvcLocator* pSvcLocator ) : 
-  ::AthAlgorithm( name, pSvcLocator )
-  {
-    declareProperty( "Inputs", m_inputs );
-    declareProperty( "Outputs", m_outputs );
-    declareProperty( "Chains", m_chainsProperty, "Chains to filter the object on" );
-    declareProperty( "AlwaysPass", m_alwaysPass, "Override negative decision" );
-  }
-
-  TestRoRSeqFilter::~TestRoRSeqFilter()
-  {}
-
-  StatusCode TestRoRSeqFilter::initialize()
-  {
-    ATH_MSG_INFO ("Initializing " << name() << "...");
-
-    ATH_MSG_DEBUG("Will consume the input data: " << m_inputs << " and produce " << m_outputs );
-    ATH_MSG_DEBUG("This filter has alwaysPass=" << m_alwaysPass);
-    ATH_MSG_DEBUG("Configured chains are:");
-    for ( auto& el: m_chainsProperty ) {
-      ATH_MSG_DEBUG(el);
-    }
-    // if ( m_inputs.size() != m_outputs.size() ) {
-    //   ATH_MSG_ERROR("Inputs and Outputs have different size, the mapping is unclear");
-    //   return StatusCode::FAILURE;
-    // }
-
-    for ( auto& el: m_chainsProperty ) {
-      m_chains.insert( HLT::Identifier(el).numeric() );
-    }
-
-    // minimal validity crosscheck
-    if ( m_chainsProperty.size() == 0 and m_alwaysPass == false ) {
-      ATH_MSG_WARNING("This filter will always reject as it has no chains of interest configured");
-    }
-
-    if ( m_chains.size() != m_chainsProperty.size() ) {
-      ATH_MSG_ERROR("Repeated chain requirements (annoyance) or chain to hash conversion clash (major configuration issue therefore can not run)");
-      return StatusCode::FAILURE;
-    }  
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TestRoRSeqFilter::finalize()
-  {
-    ATH_MSG_INFO ("Finalizing " << name() << "...");
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode TestRoRSeqFilter::execute() 
-  {
-    ATH_MSG_DEBUG ( "Executing " << name() << "..." );
-    bool pass = false;
-
-    for ( size_t inputIndex = 0; inputIndex < m_inputs.size(); ++inputIndex ) {
-      auto input = m_inputs[inputIndex];
-      ATH_MSG_DEBUG( "Processing input " << input );
-      // this will only store links to the inputs that are passing
-      auto decisionOutput = std::make_unique<DecisionContainer>();
-      auto decisionAux    = std::make_unique<DecisionAuxContainer>();
-      decisionOutput->setStore( decisionAux.get() );
-      copyPassing( input, decisionOutput.get() );
-
-      // not bother recording if there is no output
-      if ( not decisionOutput->empty() ) {
-        ATH_MSG_DEBUG( "Saving output " << m_outputs[inputIndex] );
-        pass = true;      
-        SG::WriteHandle<DecisionContainer> outputDH( m_outputs[inputIndex] );
-        CHECK( outputDH.record( std::move( decisionOutput ), std::move( decisionAux ) ) );  
-      } else {
-        ATH_MSG_DEBUG( "None of the decisions in the input " << input << " passed, skipping recording output " );
-      }
-    }
-
-    ATH_MSG_DEBUG( "The overall decision is : " << ( pass or m_alwaysPass ? "positive" : "negative") );
-
-    setFilterPassed( pass or m_alwaysPass );
-    return StatusCode::SUCCESS;
-  }
-
-  void TestRoRSeqFilter::copyPassing( const std::string& inputKey, DecisionContainer* output ) const {
-    SG::ReadHandle<DecisionContainer> inputDH( inputKey );
-    if ( not inputDH.isValid() ) {
-      ATH_MSG_DEBUG( "Void input: " << inputKey );
-      return;
-    }
-
-    ATH_MSG_DEBUG( "Filtering "<<inputDH->size()<<" obejcts with key "<<inputKey);
-
-    size_t counter=0;
-    for ( auto objIter =  inputDH->begin(); objIter != inputDH->end(); ++objIter, ++counter ) {      
-      DecisionIDContainer objDecisions;      
-      decisionIDs( *objIter, objDecisions ); // this should be replaced in production code by method passingIDs but the later is not printing so in tests we want the IDs
-      // here we have to sets of IDs, those we are interested in (via chain property) and those comming from the decision obj
-
-      std::vector<DecisionID> intersection;
-      std::set_intersection( m_chains.begin(), m_chains.end(),
-      objDecisions.begin(), objDecisions.end(),
-      std::back_inserter( intersection ) );
-    
-      ATH_MSG_DEBUG( "Found "<<intersection.size()<<" objects of interest for key "<<inputKey);
-      for ( auto positive: intersection ) {
-        ATH_MSG_DEBUG( "Found positive decision for chain " << HLT::Identifier( positive ) );
-      }
-
-      const bool positiveObjectDecision = not intersection.empty();
-      if ( positiveObjectDecision ) {
-        auto d = newDecisionIn( output );
-        linkToPrevious( d, *objIter );
-      } else {
-        ATH_MSG_DEBUG( "Skipping objects with key " << inputKey <<" as they passed no chain of interest to this filter" );
-      }
-    }
-  }
-  
-} //> end namespace HLTTest
-
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.h b/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.h
deleted file mode 100644
index c3d6a1d58aa967b391b6aa58af7bd4a9743ad461..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/TestRoRSeqFilter.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-#ifndef TRIGUPGRADETEST_TESTRORSEQFILTER_H
-#define TRIGUPGRADETEST_TESTRORSEQFILTER_H 1
-
-
-#include <string>
-#include "TrigCompositeUtils/TrigCompositeUtils.h"
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-namespace HLTTest {
-
-  /**
-   * @class TestRoRSeqFilter for validation of the CF sequencers barrier concept 
-   * @brief This alg will read in implicit data, potentially merge, but above all it will decide to accep/reject 
-   * and thus to continue reco in the sequence
-   **/
-  
-  
-  class TestRoRSeqFilter
-    : public ::AthAlgorithm
-  { 
-  public: 
-    TestRoRSeqFilter( const std::string& name, ISvcLocator* pSvcLocator );
-    
-    virtual ~TestRoRSeqFilter(); 
-    
-    //TestRoRSeqFilter &operator=(const TestRoRSeqFilter &alg); 
-    
-    StatusCode  initialize() override;
-    StatusCode  execute( ) override;
-    StatusCode  finalize() override;
-    
-  private: 
-    TestRoRSeqFilter();
-    std::vector<std::string> m_inputs;
-    std::vector<std::string> m_outputs;
-    
-    std::vector<std::string> m_chainsProperty;
-    TrigCompositeUtils::DecisionIDContainer  m_chains; // this is the set of chains we care about in this filter
-    bool m_alwaysPass = false; // override decision 
-    
-    /*
-      @brief fills the output with decision objects lining back to the succesfully passing objs
-      NB> The positive/negative decision can be red from the output.size()
-    */
-    void copyPassing(const std::string& inputKey,
-                     TrigCompositeUtils::DecisionContainer* output) const;
-  }; 
-  
-} //> end namespace HLTTest
-#endif //> !TRIGUPGRADETEST_TESTRORSEQFILTER_H
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/src/components/TrigUpgradeTest_entries.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/components/TrigUpgradeTest_entries.cxx
deleted file mode 100644
index fd90b375c035b4fe8df0a207317b12901a5a9a0a..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/src/components/TrigUpgradeTest_entries.cxx
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "../ITestHypoTool.h"
-#include "../TestHypoAlg.h"
-#include "../TestHypoTool.h"
-#include "../TestMHypoTool.h"
-#include "../TestRecoAlg.h"
-#include "../TestRoRSeqFilter.h"
-#include "../TestMerger.h"
-#include "../TestComboHypoAlg.h"
-#include "../TestInputMaker.h"
-
-
-DECLARE_COMPONENT( HLTTest::TestInputMaker )
-DECLARE_COMPONENT( HLTTest::TestHypoAlg )
-DECLARE_COMPONENT( HLTTest::TestHypoTool )
-DECLARE_COMPONENT( HLTTest::TestMHypoTool )
-DECLARE_COMPONENT( HLTTest::TestRecoAlg )
-DECLARE_COMPONENT( HLTTest::TestRoRSeqFilter )
-DECLARE_COMPONENT( HLTTest::TestMerger )
-DECLARE_COMPONENT( HLTTest::TestComboHypoAlg )
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_step_menu_processing.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_step_menu_processing.sh
deleted file mode 100755
index 2b42b6743d9ce9b9610c6ec213ae1c75340ae520..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_step_menu_processing.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-# This is not an ART test, but a unit test
-
-# This is a unit test of HLT Control Flow and should be moved to TriggerMenuMT
-
-athena.py -l DEBUG --imf --threads=1 -c "doMenu=True" TrigUpgradeTest/EmuStepProcessingTest.py
-
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_step_processing.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_step_processing.sh
deleted file mode 100755
index c2bd92730f8c6c10fdb79d7438f590a68bef9fbd..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_step_processing.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-# This is not an ART test, but a unit test
-
-# This is a unit test of HLT Control Flow and should be moved to TriggerMenuMT
-
-athena.py -l DEBUG --imf --threads=1 -c "doMenu=False" TrigUpgradeTest/EmuStepProcessingTest.py
-
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_trigUpgr_full_menu_cf_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_trigUpgr_full_menu_cf_build.sh
deleted file mode 100755
index 4a140764cf13520c8582a518c9ee9d35c2d97798..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_trigUpgr_full_menu_cf_build.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-# art-description: athenaMT trigger test using the full menu from TrigUpgradeTest job options
-# art-type: build
-# art-include: master/Athena
-# Skipping art-output which has no effect for build tests.
-# If you create a grid version, check art-output in existing grid tests.
-
-export EVENTS=20
-export THREADS=1
-export SLOTS=1
-export JOBOPTION="TrigUpgradeTest/full_menu_cf.py"
-export REGTESTEXP="TriggerSummaryStep.*HLT_.*|TriggerMonitorFinal.*HLT_.*|TrigSignatureMoniMT.*HLT_.*|TrigSignatureMoniMT.*-- #[0-9]+ (Events|Features).*"
-export EXTRA="doWriteBS=False;doWriteRDOTrigger=True;"
-
-# Find the regtest reference installed with the release
-export REGTESTREF=`find_data.py TrigUpgradeTest/full_menu_cf_build.ref`
-
-source exec_TrigUpgradeTest_art_athenaMT.sh
-source exec_TrigUpgradeTest_art_post.sh
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_trigUpgr_full_menu_cf_configOnly_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_trigUpgr_full_menu_cf_configOnly_build.sh
deleted file mode 100755
index 7a8d73fba8486873a455b1c252b8689a84193ab7..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_trigUpgr_full_menu_cf_configOnly_build.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-# art-description: athenaMT trigger test checking only configuration of the full_menu_cf job options
-# art-type: build
-# art-include: master/Athena
-# Skipping art-output which has no effect for build tests.
-# If you create a grid version, check art-output in existing grid tests.
-
-export EVENTS=20
-export THREADS=1
-export SLOTS=1
-export JOBOPTION="TrigUpgradeTest/full_menu_cf.py"
-export EXTRA="doWriteBS=False;doWriteRDOTrigger=True;"
-export ATHENAOPTS="--config-only=config.pkl"
-
-# This test doesn't produce any output useful for RegTest, so do a dummy reference comparison
-export REGTESTEXP="configuration complete, now exiting|ERROR"
-export REGTESTREF=`find_data.py TrigUpgradeTest/full_menu_cf_configOnly.ref`
-
-# Skip dumping chain counts because this test doesn't produce the histogram including them
-export SKIP_CHAIN_DUMP=1
-
-source exec_TrigUpgradeTest_art_athenaMT.sh
-source exec_TrigUpgradeTest_art_post.sh
diff --git a/Trigger/TrigValidation/TrigValTools/share/TrigValInputs.json b/Trigger/TrigValidation/TrigValTools/share/TrigValInputs.json
index a0c441349b541a04e1d80f7e873df8e2d19bcf54..052c31a0e3690490b53b053a4731ae152d9bd839 100644
--- a/Trigger/TrigValidation/TrigValTools/share/TrigValInputs.json
+++ b/Trigger/TrigValidation/TrigValTools/share/TrigValInputs.json
@@ -131,7 +131,81 @@
         "source": "mc",
         "format": "RDO",
         "paths": [
-            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/mc15_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.RDO.e3601_s2576_s2132_r7143/RDO.06718162._000013.pool.root.1"
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.RDO.e3601_s2576_s2132_r7143/RDO.06718162._000013.pool.root.1"
+        ]
+    },
+    "Single_mu_larged0": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.107237.ParticleGenerator_mu_Pt4to100_vertxy20.recon.RDO.e3603_s2726_r7728/RDO.10240174._000001.pool.root.1"
+        ]
+    },
+    "Single_mu_larged0_pu": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.107237.ParticleGenerator_mu_Pt4to100_vertxy20.recon.RDO.e3603_s2726_r7772/RDO.09945423._000001.pool.root.1"
+        ]
+    },
+    "Bphys_JpsiPhi": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.300401.Pythia8BPhotospp_A14_CTEQ6L1_Bs_Jpsimu3p5mu3p5_phi.recon.RDO.e4397_s2608_r6869/RDO.06461186._000001.pool.root.1",            	    
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.300401.Pythia8BPhotospp_A14_CTEQ6L1_Bs_Jpsimu3p5mu3p5_phi.recon.RDO.e4397_s2608_r6869/RDO.06461186._000002.pool.root.1",            	    
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.300401.Pythia8BPhotospp_A14_CTEQ6L1_Bs_Jpsimu3p5mu3p5_phi.recon.RDO.e4397_s2608_r6869/RDO.06461186._000003.pool.root.1"
+	]	
+    },
+    "Zee_pu40": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.recon.RDO.e3601_s2665_s2183_r7191/RDO.06753544._000001.pool.root.1"
+        ]
+    },
+    "Jpsiee_pu40": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.129190.Pythia8_AU2CTEQ6L1_ppToJpsie3e3.recon.RDO.e3802_s2608_s2183_r7042/RDO.06758877._000006.pool.root.1"
+        ]
+    },
+    "Single_el": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.159010.ParticleGenerator_e_Et7to80.recon.RDO.e1948_s2726_r7728/RDO.10240159._000001.pool.root.1"
+        ]
+    },
+    "Single_el_pu40": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.159010.ParticleGenerator_e_Et7to80.recon.RDO.e1948_s2726_r7772/RDO.09929877._000001.pool.root.1"
+        ]
+    },
+    "Single_el_larged0": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.159053.ParticleGenerator_e_Et7to80_vertxy20.recon.RDO.e3603_s2726_r7728/RDO.10240167._000001.pool.root.1"
+        ]
+    },
+    "Single_el_larged0_pu40": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc15_13TeV.159053.ParticleGenerator_e_Et7to80_vertxy20.recon.RDO.e3603_s2726_r7772/RDO.09945414._000001.pool.root.1"
+        ]
+    },
+    "Ztautau_pu46": {
+        "source": "mc",
+        "format": "RDO",
+        "paths": [
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc16_13TeV.361108.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Ztautau.recon.RDO.e3601_s3126_r9546/RDO.11373415._000001.pool.root.1",
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc16_13TeV.361108.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Ztautau.recon.RDO.e3601_s3126_r9546/RDO.11373415._000002.pool.root.1",
+            "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigInDetValidation/samples/mc16_13TeV.361108.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Ztautau.recon.RDO.e3601_s3126_r9546/RDO.11373415._000003.pool.root.1"
         ]
     }
 }
diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
index 127d6bc21d33f5b464c754d0adb7d5c742607376..1cb25c9784238dc9591384791e8534bb8c5c77b8 100644
--- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref
@@ -111,6 +111,9 @@ TrigSignatureMoniMT                                 INFO -- #899946230 Features
 TrigSignatureMoniMT                                 INFO HLT_e17_lhvloose_nod0_L1EM15VH #140779220
 TrigSignatureMoniMT                                 INFO -- #140779220 Events          20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #140779220 Features                              0          0          0          0          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_e20_lhmedium_e15_lhmedium_Zee_L12EM3 #1784800924
+TrigSignatureMoniMT                                 INFO -- #1784800924 Events         20         20         0          0          0          0          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1784800924 Features                             0          0          0          0          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e26_etcut_L1EM22VHI #1703681121
 TrigSignatureMoniMT                                 INFO -- #1703681121 Events         20         20         1          1          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1703681121 Features                             1          2          0          -          -          -          -          -          -          -          -          -          
@@ -129,12 +132,6 @@ TrigSignatureMoniMT                                 INFO -- #2128128255 Features
 TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_g5_etcut_L12EM3 #1745513164
 TrigSignatureMoniMT                                 INFO -- #1745513164 Events         20         20         10         10         10         -          -          -          -          -          -          -          -          -          10         
 TrigSignatureMoniMT                                 INFO -- #1745513164 Features                             23         23         23         -          -          -          -          -          -          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_mu26_L1EM8I_MU10 #2209076666
-TrigSignatureMoniMT                                 INFO -- #2209076666 Events         20         20         0          0          0          0          0          0          0          0          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2209076666 Features                             0          0          0          0          0          0          0          0          -          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_mu6fast_L1EM8I_MU10 #2086577378
-TrigSignatureMoniMT                                 INFO -- #2086577378 Events         20         20         0          0          0          0          0          -          -          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2086577378 Features                             0          0          0          0          0          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e3_etcut_L1EM3 #683953566
 TrigSignatureMoniMT                                 INFO -- #683953566 Events          20         20         15         14         14         -          -          -          -          -          -          -          -          -          14         
 TrigSignatureMoniMT                                 INFO -- #683953566 Features                              48         163        90         -          -          -          -          -          -          -          -          -          
@@ -486,12 +483,6 @@ TrigSignatureMoniMT                                 INFO -- #4065285611 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1J100 #1026959128
 TrigSignatureMoniMT                                 INFO -- #1026959128 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #1026959128 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1J12 #2640820608
-TrigSignatureMoniMT                                 INFO -- #2640820608 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
-TrigSignatureMoniMT                                 INFO -- #2640820608 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1J120 #2116228652
-TrigSignatureMoniMT                                 INFO -- #2116228652 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
-TrigSignatureMoniMT                                 INFO -- #2116228652 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1J15 #1976430774
 TrigSignatureMoniMT                                 INFO -- #1976430774 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #1976430774 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
@@ -534,9 +525,6 @@ TrigSignatureMoniMT                                 INFO -- #4248050338 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU12IM #357557968
 TrigSignatureMoniMT                                 INFO -- #357557968 Events          20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #357557968 Features                              -          -          -          -          -          -          -          -          -          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU20 #3602376876
-TrigSignatureMoniMT                                 INFO -- #3602376876 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
-TrigSignatureMoniMT                                 INFO -- #3602376876 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU20IM #1931583332
 TrigSignatureMoniMT                                 INFO -- #1931583332 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #1931583332 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
@@ -549,9 +537,6 @@ TrigSignatureMoniMT                                 INFO -- #1394621652 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU60 #3332424451
 TrigSignatureMoniMT                                 INFO -- #3332424451 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #3332424451 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_noalg_L1TAU8 #3165115874
-TrigSignatureMoniMT                                 INFO -- #3165115874 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
-TrigSignatureMoniMT                                 INFO -- #3165115874 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_noalg_L1XE10 #1583053368
 TrigSignatureMoniMT                                 INFO -- #1583053368 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #1583053368 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
@@ -609,9 +594,6 @@ TrigSignatureMoniMT                                 INFO -- #2991490897 Features
 TrigSignatureMoniMT                                 INFO HLT_noalg_cosmiccalo_L1J30_FIRSTEMPTY #2214697960
 TrigSignatureMoniMT                                 INFO -- #2214697960 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          4          
 TrigSignatureMoniMT                                 INFO -- #2214697960 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
-TrigSignatureMoniMT                                 INFO HLT_noalg_cosmiccalo_L1RD1_BGRP10 #48519027
-TrigSignatureMoniMT                                 INFO -- #48519027 Events           20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
-TrigSignatureMoniMT                                 INFO -- #48519027 Features                               -          -          -          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_noalg_cosmiccalo_L1RD1_EMPTY #3925252528
 TrigSignatureMoniMT                                 INFO -- #3925252528 Events         20         20         -          -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #3925252528 Features                             -          -          -          -          -          -          -          -          -          -          -          -          
@@ -654,6 +636,12 @@ TrigSignatureMoniMT                                 INFO -- #2725693236 Features
 TrigSignatureMoniMT                                 INFO HLT_tau160_idperf_tracktwo_L1TAU100 #886074432
 TrigSignatureMoniMT                                 INFO -- #886074432 Events          20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #886074432 Features                              0          0          0          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_tau160_medium1_tracktwoEF_L1TAU100 #1720193283
+TrigSignatureMoniMT                                 INFO -- #1720193283 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1720193283 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_tau160_medium1_tracktwo_L1TAU100 #4069120574
+TrigSignatureMoniMT                                 INFO -- #4069120574 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #4069120574 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_tau160_mediumRNN_tracktwoMVA_L1TAU100 #1747754287
 TrigSignatureMoniMT                                 INFO -- #1747754287 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1747754287 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
@@ -663,6 +651,12 @@ TrigSignatureMoniMT                                 INFO -- #2334140248 Features
 TrigSignatureMoniMT                                 INFO HLT_tau160_perf_tracktwo_L1TAU100 #1799096347
 TrigSignatureMoniMT                                 INFO -- #1799096347 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
 TrigSignatureMoniMT                                 INFO -- #1799096347 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_tau200_medium1_tracktwoEF_L1TAU100 #4203471951
+TrigSignatureMoniMT                                 INFO -- #4203471951 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #4203471951 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_tau200_mediumRNN_tracktwoMVA_L1TAU100 #1468926272
+TrigSignatureMoniMT                                 INFO -- #1468926272 Events         20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1468926272 Features                             0          0          0          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_tau25_idperf_track_L1TAU12IM #554271976
 TrigSignatureMoniMT                                 INFO -- #554271976 Events          20         20         3          3          -          -          -          -          -          -          -          -          -          -          3          
 TrigSignatureMoniMT                                 INFO -- #554271976 Features                              4          4          -          -          -          -          -          -          -          -          -          -          
@@ -714,6 +708,9 @@ TrigSignatureMoniMT                                 INFO -- #1275052132 Features
 TrigSignatureMoniMT                                 INFO HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM #2456480859
 TrigSignatureMoniMT                                 INFO -- #2456480859 Events         20         20         3          3          3          -          -          -          -          -          -          -          -          -          3          
 TrigSignatureMoniMT                                 INFO -- #2456480859 Features                             4          4          4          -          -          -          -          -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO HLT_tau80_medium1_tracktwo_L1TAU60 #598963338
+TrigSignatureMoniMT                                 INFO -- #598963338 Events          20         20         0          0          0          -          -          -          -          -          -          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #598963338 Features                              0          0          0          -          -          -          -          -          -          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_tilecalib_laser_TilePEB_L1CALREQ2 #1063154655
 TrigSignatureMoniMT                                 INFO -- #1063154655 Events         20         20         20         -          -          -          -          -          -          -          -          -          -          -          20         
 TrigSignatureMoniMT                                 INFO -- #1063154655 Features                             20         -          -          -          -          -          -          -          -          -          -          -          
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
index 7e1fadfdff17145a92721b86275866248a2c4d7f..7d0f92762e85bf7ee13f04f0140867600885abd5 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
@@ -250,8 +250,9 @@ class TriggerConfigGetter(Configured):
             else: # Does not have xAODMeta
                 # Run-3 Trigger Configuration Services
                 from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc, getHLTConfigSvc
-                svcMgr += getL1ConfigSvc()
-                svcMgr += getHLTConfigSvc()
+                from AthenaConfiguration.AllConfigFlags import ConfigFlags
+                svcMgr += getL1ConfigSvc(ConfigFlags)
+                svcMgr += getHLTConfigSvc(ConfigFlags)
 
                 # Needed for TrigConf::xAODMenuWriterMT
                 from TrigConfigSvc.TrigConfigSvcConfig import TrigConfigSvc
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 3ed34972062c6abf612d15e3e35965683891c856..932be7ba4eb49903fe0ef2675986a15a3baf86a4 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -459,7 +459,7 @@ if opt.doL1Unpacking:
         from L1Decoder.L1DecoderConfig import L1DecoderCfg
         CAtoGlobalWrapper(L1DecoderCfg, ConfigFlags, seqName="HLTBeginSeq")
     else:
-        from TrigUpgradeTest.TestUtils import L1EmulationTest
+        from DecisionHandling.TestUtils import L1EmulationTest
         hltBeginSeq += L1EmulationTest()
 
 # ---------------------------------------------------------------
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
index 37fe3d314a380332fc038fc87b41c3739345aef5..b8cbae98c2c1bf8cdcfceae2615d53a9ff6a79ab 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
@@ -1,14 +1,8 @@
-################################################################################
-# Package: TriggerMenuMT
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TriggerMenuMT )
 
-# Declare the package's dependencies: 
-atlas_depends_on_subdirs( PRIVATE
-                          Trigger/TriggerCommon/TriggerJobOpts)
-
 # External dependencies:
 find_package( six )
 
@@ -108,40 +102,45 @@ atlas_install_python_modules( python/*.py
                               python/LVL1MenuConfig
                               python/L1
                               python/HLTMenuConfig
-			      POST_BUILD_CMD ${ATLAS_FLAKE8})
-atlas_install_joboptions( share/*.py )
-
-atlas_install_scripts( scripts/generateMenuMT.py )
-atlas_install_scripts( scripts/generateL1MenuMT.sh )
-atlas_install_scripts( scripts/generateLVL1MenuMT.py )
-atlas_install_scripts( scripts/generateL1TopoMenuMT.py )
-atlas_install_scripts( scripts/test_HLTmenu.sh )
-atlas_install_scripts( scripts/generateL1MenuRun3.py )
-atlas_install_scripts( scripts/trigCompareOldandNewL1Menus.py )
-atlas_install_scripts( scripts/verify_menu_config.py )
+			                  POST_BUILD_CMD ${ATLAS_FLAKE8})
+
+atlas_install_scripts( scripts/generateMenuMT.py
+                       scripts/generateL1MenuMT.sh
+                       scripts/generateLVL1MenuMT.py
+                       scripts/generateL1TopoMenuMT.py
+                       scripts/test_HLTmenu.sh
+                       scripts/generateL1MenuRun3.py
+                       scripts/trigCompareOldandNewL1Menus.py
+                       scripts/verify_menu_config.py
+                       scripts/test_full_menu_cf.py )
 
+atlas_install_joboptions( share/*.py )
 atlas_install_xmls( data/*.dtd data/*.xml )
 
-atlas_add_test( generateMenuMT_newJO SCRIPT python -m TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1_newJO
-                PROPERTIES TIMEOUT 500 
-              )
-
-atlas_add_test( ViewCFTest     SCRIPT python -m unittest -v TriggerMenuMT.HLTMenuConfig.Test.ViewCFTest POST_EXEC_SCRIPT nopost.sh )
-
-atlas_add_test( generateMenuMT SCRIPT bash test_HLTmenu.sh
-                PROPERTIES TIMEOUT 4000 
-              )
-
-# prparing to move the emulation tests from TUT
-#atlas_add_test( emu_step_processing
-#		SCRIPT scripts/test_emu_step_processing.sh
-#		LOG_SELECT_PATTERN "TrigSignatureMoniMT.*INFO HLT_.*|TrigSignatureMoniMT.*-- #[0-9]+ (Events|Features).*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*|TriggerSummaryStep.*+++ leg.*"
-#		)
-
-#atlas_add_test( emu_step_menu_processing
-#		SCRIPT scripts/test_emu_step_menu_processing.sh
-#		LOG_SELECT_PATTERN "TrigSignatureMoniMT.*INFO HLT_.*|TrigSignatureMoniMT.*-- #[0-9]+ (Events|Features).*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*|TriggerSummaryStep.*+++ leg.*"
-#		) 
+#----------------------------------
+# Tests:
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_generateMenuMT_newJO )
+atlas_add_test( generateMenuMT_newJO
+                SCRIPT python -m TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1_newJO
+                PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_generateMenuMT_newJO
+                PROPERTIES TIMEOUT 500 )
+
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_ViewCFTest )
+atlas_add_test( ViewCFTest
+		        SCRIPT python -m unittest -v TriggerMenuMT.HLTMenuConfig.Test.ViewCFTest
+                PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_ViewCFTest
+		        POST_EXEC_SCRIPT nopost.sh )
+
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_generateMenuMT )
+atlas_add_test( generateMenuMT
+		        SCRIPT bash test_HLTmenu.sh
+                PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_generateMenuMT
+                PROPERTIES TIMEOUT 4000 )
+
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_full_menu_cf )
+atlas_add_test( full_menu_cf
+		        SCRIPT scripts/test_full_menu_cf.sh
+                PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_full_menu_cf )
 
 
 #----------------------------------
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
index b0f1d7e2a281316d128e4dc3916ef91583e6a9df..b76f533dc6654e2b47ede7196d75e4a53569433b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.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__)
@@ -33,6 +33,15 @@ def precisionCaloSequenceCfg( flags ):
 def precisionElectronSequenceCfg( flags ):
     return precisionElectronMenuSequence()
 
+# this must be moved to the HypoTool file:
+def diElectronMassComboHypoToolFromDict(chainDict):
+    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaDielectronMassHypoTool
+    name = chainDict['chainName']
+    tool= TrigEgammaDielectronMassHypoTool(name)
+    tool.LowerMassElectronClusterCut = 50000
+    tool.UpperMassElectronClusterCut = 130000
+    return tool
+
 #----------------------------------------------------------------
 # Class to configure chain
 #----------------------------------------------------------------
@@ -68,7 +77,7 @@ class ElectronChainConfiguration(ChainConfigurationBase):
 
         log.debug('electron chain part = ' + str(self.chainPart))
         key = self.chainPart['extra'] + self.chainPart['IDinfo'] + self.chainPart['L2IDAlg'] + self.chainPart['isoInfo']
-        
+
         for addInfo in self.chainPart['addInfo']:
             key+=addInfo
 
@@ -110,6 +119,10 @@ class ElectronChainConfiguration(ChainConfigurationBase):
         return self.getStep(3,stepName,[ precisionCaloSequenceCfg])
 
     def getPrecisionElectron(self):
-        stepName = "precision_electron"
-        return self.getStep(4,stepName,[ precisionElectronSequenceCfg])
+        if "Zee" in self.chainName:
+            stepName = "precision_topoelectron"
+            return self.getStep(4,stepName,sequenceCfgArray=[precisionElectronSequenceCfg], comboTools=[diElectronMassComboHypoToolFromDict])
+        else:
+            stepName = "precision_electron"
+            return self.getStep(4,stepName,[ precisionElectronSequenceCfg])
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CFValidation.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CFValidation.py
index ded5ba448285c2075dbe9b458d99ce99ee71327d..e280093f5ea84d2333d268072542c4f7ef656adc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CFValidation.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CFValidation.py
@@ -20,6 +20,11 @@ def findViewAlgs( inputNodes, viewNodes ):
         # If node is a sequence, explore further
         if isSequence( node ):
 
+            # Empty nodes can cause Gaudi scheduler bug https://gitlab.cern.ch/gaudi/Gaudi/-/issues/135
+            if len( node.getChildren() ) == 0 and node.ModeOR:
+
+              raise RuntimeError( "Empty CF sequence in OR mode can cause Gaudi scheduler bug. Please remove " + node.getName() )
+
             # Identify view CF nodes
             if node.getName() in viewNodes.keys():
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index fdf1c37ced4d44ed9f74d7be88cd8622366bf2de..7890aa65eb196f3381298c7b1e07ecc8d2bbb479 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -111,6 +111,7 @@ def setupMenu():
         ChainProp(name='HLT_e5_lhmedium_noringer_L1EM3', groups=SingleElectronGroup),
         ChainProp(name='HLT_e5_lhtight_noringer_L1EM3', groups=SingleElectronGroup),
         ChainProp(name='HLT_e5_lhtight_noringer_nod0_L1EM3', groups=SingleElectronGroup),
+        ChainProp(name='HLT_e20_lhmedium_e15_lhmedium_Zee_L12EM3', groups=MultiPhotonGroup),        
 
         # Primary
         ChainProp(name='HLT_e26_lhtight_L1EM22VHI', groups=SingleElectronGroup),
@@ -231,10 +232,17 @@ def setupMenu():
         ChainProp(name="HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM", groups=SingleTauGroup),
         ChainProp(name="HLT_tau160_idperf_track_L1TAU100",groups=SingleTauGroup),
         ChainProp(name="HLT_tau0_perf_ptonly_L1TAU100",groups=SingleTauGroup),
+        ChainProp(name="HLT_tau80_medium1_tracktwo_L1TAU60",groups=SingleTauGroup),
         ChainProp(name="HLT_tau160_idperf_tracktwo_L1TAU100",groups=SingleTauGroup),
         ChainProp(name="HLT_tau160_perf_tracktwo_L1TAU100",groups=SingleTauGroup),
         ChainProp(name="HLT_tau160_idperf_tracktwoMVA_L1TAU100",groups=SingleTauGroup),
         ChainProp(name="HLT_tau160_perf_tracktwoMVA_L1TAU100",groups=SingleTauGroup),
+        ChainProp(name="HLT_tau160_medium1_tracktwo_L1TAU100",groups=SingleTauGroup),
+        ChainProp(name="HLT_tau160_medium1_tracktwoEF_L1TAU100",groups=SingleTauGroup),
+        ChainProp(name="HLT_tau200_medium1_tracktwoEF_L1TAU100",groups=SingleTauGroup),
+        ChainProp(name="HLT_tau200_mediumRNN_tracktwoMVA_L1TAU100",groups=SingleTauGroup),
+        
+        
     ]
 
     TriggerFlags.BphysicsSlice.signatures = TriggerFlags.BphysicsSlice.signatures() + [
@@ -247,9 +255,6 @@ def setupMenu():
 
     TriggerFlags.CombinedSlice.signatures = TriggerFlags.CombinedSlice.signatures() + [
         # groups need to be properly assigned here later
-
-        # Test chain that was using parallel merging with different number of steps, now serial merged with new menu
-        ChainProp(name='HLT_e3_etcut1step_mu26_L1EM8I_MU10', l1SeedThresholds=['EM8I', 'MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
         # Primary e-mu chains
         ChainProp(name='HLT_e17_lhloose_mu14_L1EM15VH_MU10', l1SeedThresholds=['EM15VH','MU10'], mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
         ChainProp(name='HLT_e7_lhmedium_mu24_L1MU20',l1SeedThresholds=['EM3','MU20'],  mergingStrategy='serial', stream=[PhysicsStream], groups=MultiElectronGroup),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
index a099c413c9bc11717cc1a0ea624716803469dd66..711aabf5baa7f1314c4ab393f202a87c99c8229e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
@@ -81,16 +81,16 @@ def addP1Signatures():
         ChainProp(name='HLT_noalg_L1EM20VH',     l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=EgammaStreamersGroup),
         ChainProp(name='HLT_noalg_L1EM22VHI',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=EgammaStreamersGroup),
 
-        ChainProp(name='HLT_noalg_L1TAU8',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
+#        ChainProp(name='HLT_noalg_L1TAU8',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
         ChainProp(name='HLT_noalg_L1TAU12',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
-        ChainProp(name='HLT_noalg_L1TAU20',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
+#        ChainProp(name='HLT_noalg_L1TAU20',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
         ChainProp(name='HLT_noalg_L1TAU30',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
         ChainProp(name='HLT_noalg_L1TAU40',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
         ChainProp(name='HLT_noalg_L1TAU60',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),
         ChainProp(name='HLT_noalg_L1TAU12IM',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),        
         ChainProp(name='HLT_noalg_L1TAU20IM',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=TauStreamersGroup),        
 
-        ChainProp(name='HLT_noalg_L1J12',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
+#        ChainProp(name='HLT_noalg_L1J12',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J15',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J20',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J25',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
@@ -100,7 +100,7 @@ def addP1Signatures():
         ChainProp(name='HLT_noalg_L1J75',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J85',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J100',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
-        ChainProp(name='HLT_noalg_L1J120',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
+#        ChainProp(name='HLT_noalg_L1J120',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J400',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         
         ChainProp(name='HLT_noalg_L1XE10',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METStreamersGroup),
@@ -124,7 +124,7 @@ def addP1Signatures():
         ChainProp(name='HLT_noalg_cosmiccalo_L1J30_EMPTY', stream=['CosmicCalo','express'],groups=['RATE:Cosmic_Calo','BW:Jet']),
         ChainProp(name='HLT_noalg_cosmiccalo_L1J12_FIRSTEMPTY', stream=['CosmicCalo','express'],groups=['RATE:Cosmic_Calo','BW:Jet']),
         ChainProp(name='HLT_noalg_cosmiccalo_L1J30_FIRSTEMPTY', stream=['CosmicCalo','express'],groups=['RATE:Cosmic_Calo','BW:Jet']),
-        ChainProp(name='HLT_noalg_cosmiccalo_L1RD1_BGRP10', l1SeedThresholds=['FSNOSEED'], stream=['CosmicCalo','express'],groups=['RATE:Calibration','BW:Detector']),
+#        ChainProp(name='HLT_noalg_cosmiccalo_L1RD1_BGRP10', l1SeedThresholds=['FSNOSEED'], stream=['CosmicCalo','express'],groups=['RATE:Calibration','BW:Detector']),
     ]
     TriggerFlags.MonitorSlice.signatures   = TriggerFlags.MonitorSlice.signatures() + [
           ChainProp(name='HLT_costmonitor_CostMonDS_L1All',        l1SeedThresholds=['FSNOSEED'], stream=['CostMonitoring'], groups=['RATE:Monitoring','BW:Other']),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
index 3dd90169e0a8ca4a0e7b39439e02d18430a2b6c5..b4a3b134d2ccb5d4759c6d999a4439553768d1be 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
@@ -128,7 +128,7 @@ def setupMenu():
         ChainProp(name='HLT_mu11_mu6_bUpsimumu_L1MU11_2MU6', groups=BphysicsGroup),
     ]
     TriggerFlags.CombinedSlice.signatures = [
-        ChainProp(name='HLT_e3_etcut1step_mu6fast_L1EM8I_MU10', l1SeedThresholds=['EM8I', 'MU10'], mergingStrategy='serial',stream=[PhysicsStream], groups=MultiElectronGroup),    #L1 item thresholds in wrong order (EM first, then MU)
+#        ChainProp(name='HLT_e3_etcut1step_mu6fast_L1EM8I_MU10', l1SeedThresholds=['EM8I', 'MU10'], mergingStrategy='serial',stream=[PhysicsStream], groups=MultiElectronGroup),    #L1 item thresholds in wrong order (EM first, then MU)
    ]
     TriggerFlags.HeavyIonSlice.signatures  = []
     TriggerFlags.BeamspotSlice.signatures  = []
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 1018c922d09bd6492c744a620d2da9ebb5ebb65c..eb42124b4c2a12dd84790d0cdc3b881171dff538 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -840,3 +840,4 @@ def getBasePattern():
 
 
 
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index a6b7e1f092c43a86047d92246079953c4d52d746..18459b37953b4e59b1bb901fd87187f213fd2d27 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -775,6 +775,7 @@ def muEFInsideOutRecoSequence(RoIs, name):
   from MuonRecExample.MuonStandalone import MooSegmentFinderAlg
   from MuonCombinedRecExample.MuonCombinedAlgs import MuonCombinedInDetCandidateAlg, MuonInsideOutRecoAlg, MuGirlStauAlg, MuonCreatorAlg, StauCreatorAlg
   from MuonCombinedAlgs.MuonCombinedAlgsMonitoring import MuonCreatorAlgMonitoring
+  from MuonRecExample.MuonRecFlags import muonRecFlags
 
   efAlgs = []
 
@@ -789,6 +790,7 @@ def muEFInsideOutRecoSequence(RoIs, name):
     #need MdtCondDbAlg for the MuonStationIntersectSvc (required by segment and track finding)
     from AthenaCommon.AlgSequence import AthSequencer
     from MuonCondAlg.MuonTopCondAlgConfigRUN2 import MdtCondDbAlg
+    import AthenaCommon.CfgGetter as CfgGetter
     if not athenaCommonFlags.isOnline:
       condSequence = AthSequencer("AthCondSeq")
       if not hasattr(condSequence,"MdtCondDbAlg"):
@@ -796,8 +798,34 @@ def muEFInsideOutRecoSequence(RoIs, name):
       # Sets up and configures the muon alignment:
       from MuonRecExample import MuonAlignConfig # noqa: F401
 
-    theSegmentFinderAlg = MooSegmentFinderAlg("TrigLateMuonSegmentMaker_"+name)
-    efAlgs.append(theSegmentFinderAlg)
+      if (MuonGeometryFlags.hasSTGC() and MuonGeometryFlags.hasMM()):
+        theMuonLayerHough = CfgMgr.MuonLayerHoughAlg( "MuonLayerHoughAlg")
+        efAlgs.append(theMuonLayerHough)
+        SegmentFinder = CfgGetter.getPublicTool("MuonClusterSegmentFinderTool")
+        Cleaner = CfgGetter.getPublicToolClone("MuonTrackCleaner_seg","MuonTrackCleaner")
+        Cleaner.Extrapolator = CfgGetter.getPublicTool("MuonStraightLineExtrapolator")
+        Cleaner.Fitter = CfgGetter.getPublicTool("MCTBSLFitterMaterialFromTrack")
+        Cleaner.PullCut = 3
+        Cleaner.PullCutPhi = 3
+        SegmentFinder.TrackCleaner = Cleaner
+      
+        theSegmentFinderAlg = CfgMgr.MuonSegmentFinderAlg( "TrigMuonSegmentMaker_"+name,SegmentCollectionName="MuonSegments",
+                                                           MuonPatternCalibration = CfgGetter.getPublicTool("MuonPatternCalibration"), 
+                                                           MuonPatternSegmentMaker = CfgGetter.getPublicTool("MuonPatternSegmentMaker"), 
+                                                           MuonTruthSummaryTool = None)
+        # we check whether the layout contains any CSC chamber and if yes, we check that the user also wants to use the CSCs in reconstruction
+        if MuonGeometryFlags.hasCSC() and muonRecFlags.doCSCs():
+          CfgGetter.getPublicTool("CscSegmentUtilTool")
+          CfgGetter.getPublicTool("Csc2dSegmentMaker")
+          CfgGetter.getPublicTool("Csc4dSegmentMaker")
+        else:
+          theSegmentFinderAlg.Csc2dSegmentMaker = ""
+          theSegmentFinderAlg.Csc4dSegmentMaker = ""
+
+      else:
+        theSegmentFinderAlg = MooSegmentFinderAlg("TrigLateMuonSegmentMaker_"+name)
+
+      efAlgs.append(theSegmentFinderAlg)
 
     # need to run precisions tracking for late muons, since we don't run it anywhere else
     TrackCollection="TrigFastTrackFinder_Tracks_MuonLate" 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
index a6328ace435f7038a9ee21011b43c8f71436432e..f1aa4c6eb47b6cca1620c3035fbd48e164440bf7 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
@@ -7,8 +7,8 @@ log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Test.TestDef")
 
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
 
-from TrigUpgradeTest.HLTSignatureConfig import  muMenuSequence, elMenuSequence, gamMenuSequence
-from TrigUpgradeTest.HLTSignatureHypoTools import dimuDrComboHypoTool
+from DecisionHandling.HLTSignatureConfig import  muMenuSequence, elMenuSequence, gamMenuSequence
+from DecisionHandling.HLTSignatureHypoTools import dimuDrComboHypoTool
 
 #--------------------------------------------------------
 # fragments generating config will be functions in new JO
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py
index 5b5dbf7b3b5459f22189690bd6631d3c5160435a..4721965a9c2ce6cb8b8d716c346223636a997ca7 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/ViewCFTest.py
@@ -20,8 +20,12 @@ class ViewCFTest( unittest.TestCase ):
         vdv1 = CfgMgr.AthViews__ViewDataVerifier("vdv1")
         vdv2 = CfgMgr.AthViews__ViewDataVerifier("vdv2")
 
-        # Add an algorithm to a sequence
+        # Test error for empty sequence
         topSequence += seqOR( "makeViewSequence" )
+        with self.assertRaisesRegex( RuntimeError, "Please remove makeViewSequence" ):
+            findViewAlgs( topSequence.getChildren(), {} )
+
+        # Add an algorithm to the sequence
         topSequence.makeViewSequence += evca1
         #topSequence.makeViewSequence += evca2
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py
index 02f114a943dcc3220ef7fa7e0659792fe1ba3210..94f697d7e9804a9ef35c349d9cfeb03a74e65305 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 def defineMenu():
     """
@@ -8,199 +8,80 @@ def defineMenu():
 
     """
     
+ 
     from ..L1Topo.L1TopoFlags import L1TopoFlags
     from ..L1Topo.TopoOutput import TopoOutput
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-    # if this flag is True for mc v7: produce xml with full v7 menu
-    # if this flag is False for physics v7: produce xml with v7 new items removed, so to match with FW 
-    mcv7_flag = True
-
-    if 'Physics_pp_v7' in TriggerFlags.triggerMenuSetup() or 'Physics_pp_v6' in TriggerFlags.triggerMenuSetup() or 'HI' in TriggerFlags.triggerMenuSetup():
-        mcv7_flag = False
-
-    newalgos_onlyinv6 = [
-#          TopoOutput( algoname='15MINDPHI-EM12s6-XE0',                        module=0, fpga=0, clock=1, firstbit=14 ),#v6n        
-#          TopoOutput( algoname='15MINDPHI-EM15s6-XE0',                        module=0, fpga=0, clock=1, firstbit=15 ),#v6n
-#          TopoOutput( algoname='35MT-EM12s6-XE0',                             module=0, fpga=0, clock=1, firstbit=13 ),#v6n
-#          TopoOutput( algoname='DISAMB-0DR28-EM15his2-TAU12abi',              module=0, fpga=1, clock=0, firstbit=15 ),#v6n
-#          TopoOutput( algoname='LATE-MU10s1',                                  module=1, fpga=0, clock=1, firstbit=10 ),#v6n
-#          TopoOutput( algoname='SC111-CJ15ab.ETA26',                          module=1, fpga=1, clock=0, firstbit=11 ),#v6n
-#          TopoOutput( algoname='SC85-CJ15ab.ETA26',                           module=1, fpga=1, clock=0, firstbit=12 ),#v6n
-#          TopoOutput( algoname='10MINDPHI-AJ20s2-XE50',                       module=1, fpga=0, clock=1, firstbit=9 ),#v6n
-
-#          TopoOutput( algoname='0DR22-2MU6ab',                                module=1, fpga=0, clock=0, firstbit=10 ),#v6diff
-#          TopoOutput( algoname='7INVM15-2MU4ab',                              module=0, fpga=1, clock=0, firstbit=5 ),#v6diff 
-#          TopoOutput( algoname='0DR22-MU6ab-MU4ab',                           module=1, fpga=1, clock=1, firstbit=10 ), #v6diff
- #         TopoOutput( algoname='0DR15-2MU4ab',                                module=1, fpga=0, clock=1, firstbit=0 ), #v6diff
-  #        TopoOutput( algoname='0DR24-2MU4ab',                                module=1, fpga=0, clock=1, firstbit=2 ),#v6diff
-#          TopoOutput( algoname='INVM_EMs6',                                   module=0, fpga=0, clock=0, firstbit=11 ), # 3bits
-#          TopoOutput( algoname='100RATIO-0MATCH-TAU30si2-EMall',              module=0, fpga=0, clock=1, firstbit=7 ),
 
-#          TopoOutput( algoname='2INVM9-2MU4ab',                               module=0, fpga=1, clock=1, firstbit=2 ),  #v6 new
-#          TopoOutput( algoname='2INVM9-MU6ab-MU4ab',                          module=0, fpga=1, clock=1, firstbit=3 ),  #v6 new
-#          TopoOutput( algoname='0DR25-TAU20abi-TAU12abi',                     module=0, fpga=1, clock=0, firstbit=14 ), #v6 new
-#          TopoOutput( algoname='1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',       module=1, fpga=0, clock=1, firstbit=8 ), #v6 new 
-#          TopoOutput( algoname='0DR15-2MU6ab',                                module=1, fpga=0, clock=1, firstbit=11 ), #v6 new
-#          TopoOutput( algoname='10MINDPHI-J20s2-XE30',                        module=1, fpga=0, clock=1, firstbit=12 ),  #v6 new
-#          TopoOutput( algoname='DISAMB-30INVM-EM20his2-TAU12ab',              module=0, fpga=1, clock=1, firstbit=0 ),  #v6 new
-#          TopoOutput( algoname='400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',     module=0, fpga=1, clock=1, firstbit=1 ),  #v6 new
-        ]
-
-    newalgos_onlyinv5 = [
-#        TopoOutput( algoname='2DR15-CMU6ab-CMU4ab',                         module=1, fpga=0, clock=0, firstbit=10 ),#v6diff
-#        TopoOutput( algoname='4INVM8-ONEBARREL-MU6ab-MU4ab',                module=0, fpga=1, clock=0, firstbit=5 ),#v6diff 
-#        TopoOutput( algoname='2DR15-ONEBARREL-MU6ab-MU4ab',                 module=1, fpga=1, clock=1, firstbit=10 ), #v6diff
-#        TopoOutput( algoname='2INVM999-CMU6ab-CMU4ab',                      module=1, fpga=0, clock=1, firstbit=0 ), #v6diff
-#        TopoOutput( algoname='4INVM8-CMU6ab-CMU4ab',                        module=1, fpga=0, clock=1, firstbit=2 ),#v6diff
-#        TopoOutput( algoname='INVM_EMall',                                  module=0, fpga=0, clock=0, firstbit=11 ), # 3bits
-#        TopoOutput( algoname='210RATIO-0MATCH-TAU30si2-EMall',              module=0, fpga=0, clock=1, firstbit=7 ),
-    ]
     
     L1TopoFlags.algos = [
+    
         
         # module: 0, FPGA: 0
-        TopoOutput( algoname='INVM_AJ_HighMass',                            module=0, fpga=0, clock=0, firstbit=0 ), # need 4bits 
-        TopoOutput( algoname='INVM_AJ_LowMass',                             module=0, fpga=0, clock=0, firstbit=4 ), # 4 bits 
-        TopoOutput( algoname='HT150-J20s5.ETA31',                           module=0, fpga=0, clock=0, firstbit=9 ),
-        TopoOutput( algoname='HT190-J15s5.ETA21',                           module=0, fpga=0, clock=0, firstbit=10 ),
-        TopoOutput( algoname='05MINDPHI-EM12s6-XE0',                        module=0, fpga=0, clock=0, firstbit=14 ),#v6
-#        TopoOutput( algoname='10MINDPHI-EM12s6-XE0',                        module=0, fpga=0, clock=0, firstbit=15 ),#v6
-        TopoOutput( algoname='05MINDPHI-EM15s6-XE0',                        module=0, fpga=0, clock=1, firstbit=0 ),
-        TopoOutput( algoname='25MT-EM12s6-XE0',                             module=0, fpga=0, clock=1, firstbit=1 ),#v6
-#        TopoOutput( algoname='30MT-EM12s6-XE0',                             module=0, fpga=0, clock=1, firstbit=2 ),#v6
-        TopoOutput( algoname='35MT-EM15s6-XE0',                             module=0, fpga=0, clock=1, firstbit=3 ),
-#        TopoOutput( algoname='0DETA10-Js1-Js2',                             module=0, fpga=0, clock=1, firstbit=4 ),
-#        TopoOutput( algoname='10MINDPHI-Js2-XE50',                          module=0, fpga=0, clock=1, firstbit=5 ),
-        TopoOutput( algoname='10MINDPHI-J20s2-XE50',                        module=0, fpga=0, clock=1, firstbit=6 ),
-        TopoOutput( algoname='100RATIO-0MATCH-TAU30si2-EMall',              module=0, fpga=0, clock=1, firstbit=7 ),
-        TopoOutput( algoname='NOT-0MATCH-TAU30si2-EMall',                   module=0, fpga=0, clock=1, firstbit=8 ), 
-        TopoOutput( algoname='LAR-EM50s1',                                  module=0, fpga=0, clock=1, firstbit=9 ), 
-        TopoOutput( algoname='LAR-J100s1',                                  module=0, fpga=0, clock=1, firstbit=10 ), 
-        TopoOutput( algoname='NOT-02MATCH-EM10s1-AJj15all.ETA49',           module=0, fpga=0, clock=1, firstbit=11 ), 
-#        TopoOutput( algoname='05RATIO-XE0-SUM0-EM10s1-HT0-AJj15all.ETA49',  module=0, fpga=0, clock=1, firstbit=12 ), 
-        TopoOutput( algoname='15MINDPHI-EM12s6-XE0',                        module=0, fpga=0, clock=1, firstbit=14 ),#v6n        
-        TopoOutput( algoname='15MINDPHI-EM15s6-XE0',                        module=0, fpga=0, clock=1, firstbit=15 ),#v6n
-        TopoOutput( algoname='35MT-EM12s6-XE0',                             module=0, fpga=0, clock=1, firstbit=13 ),#v6n
-        
-        # module: 0, FPGA: 1
-#        TopoOutput( algoname='1DISAMB-TAU20ab-J20ab',                       module=0, fpga=1, clock=0, firstbit=0 ), 
-#        TopoOutput( algoname='DISAMB-EM15abhi-TAU12abi',                    module=0, fpga=1, clock=0, firstbit=1 ),
-        TopoOutput( algoname='1DISAMB-EM15his2-TAU12abi-J25ab',             module=0, fpga=1, clock=0, firstbit=2 ), 
-        TopoOutput( algoname='1DISAMB-J25ab-0DR28-EM15his2-TAU12abi',       module=0, fpga=1, clock=0, firstbit=3 ),
-#        TopoOutput( algoname='4INVM8-2MU6ab',                               module=0, fpga=1, clock=0, firstbit=4 ), 
-        TopoOutput( algoname='2INVM9-2MU6ab',                               module=0, fpga=1, clock=0, firstbit=4 ),#v6
-#        TopoOutput( algoname='2INVM999-ONEBARREL-MU6ab-MU4ab',              module=0, fpga=1, clock=0, firstbit=5 ), 
-#        TopoOutput( algoname='4INVM8-ONEBARREL-MU6ab-MU4ab',                module=0, fpga=1, clock=0, firstbit=6 ),
-        TopoOutput( algoname='2INVM8-ONEBARREL-MU6ab-MU4ab',                module=0, fpga=1, clock=0, firstbit=6 ),#v6
-#        TopoOutput( algoname='5DETA99-5DPHI99-2MU4ab',                      module=0, fpga=1, clock=0, firstbit=7 ), 
-        TopoOutput( algoname='5DETA99-5DPHI99-MU6ab-MU4ab',                 module=0, fpga=1, clock=0, firstbit=8 ), 
-        TopoOutput( algoname='5DETA99-5DPHI99-2MU6ab',                      module=0, fpga=1, clock=0, firstbit=9 ), 
-        TopoOutput( algoname='1DISAMB-TAU20abi-TAU12abi-J25ab',             module=0, fpga=1, clock=0, firstbit=10 ),
-        TopoOutput( algoname='0DR28-MU10ab-TAU12abi',                       module=0, fpga=1, clock=0, firstbit=11 ),
-        TopoOutput( algoname='0DETA20-0DPHI20-TAU20abi-TAU12abi',           module=0, fpga=1, clock=0, firstbit=12 ),
-#        TopoOutput( algoname='DISAMB-EM15abhi-TAU40ab',                     module=0, fpga=1, clock=0, firstbit=13 ), 
-        TopoOutput( algoname='DISAMB-0DR28-EM15his2-TAU12abi',              module=0, fpga=1, clock=0, firstbit=15 ),#v6n
+        TopoOutput( algoname='0DR25-TAU20abi-TAU12abi',                     module=0, fpga=0, clock=0, firstbit=0 ),
+        TopoOutput( algoname='0DR28-TAU20abi-TAU12abi',                     module=0, fpga=0, clock=0, firstbit=1 ),
+        TopoOutput( algoname='2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',       module=0, fpga=0, clock=0, firstbit=2 ),
+        TopoOutput( algoname='2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',       module=0, fpga=0, clock=0, firstbit=3 ),
+        TopoOutput( algoname='INVM_DPHI_NFF',                               module=0, fpga=0, clock=0, firstbit=4 ), # 4 bits
+        TopoOutput( algoname='0INVM10-3MU4ab',                              module=0, fpga=0, clock=0, firstbit=8 ),
 
-        TopoOutput( algoname='DISAMB-30INVM-EM20his2-TAU12ab',              module=0, fpga=1, clock=1, firstbit=0 ),  #v6 new
-        TopoOutput( algoname='400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',     module=0, fpga=0, clock=0, firstbit=15 ),  #v6 new
 
-        TopoOutput( algoname='0DR22-2MU6ab',                                module=0, fpga=1, clock=1, firstbit=4 ),#v6
-        TopoOutput( algoname='7INVM15-2MU4ab',                              module=0, fpga=1, clock=1, firstbit=5 ),#v6
-        TopoOutput( algoname='0DR22-MU6ab-MU4ab',                           module=0, fpga=1, clock=1, firstbit=6 ),#v6
-        TopoOutput( algoname='0DR15-2MU4ab',                                module=0, fpga=1, clock=1, firstbit=7 ),#v6
-        TopoOutput( algoname='0DR24-2MU4ab',                                module=0, fpga=1, clock=1, firstbit=8 ),#v6
-        TopoOutput( algoname='0DR15-2MU6ab',                                module=0, fpga=1, clock=1, firstbit=9 ), #v6 new
-        TopoOutput( algoname='2INVM9-2MU4ab',                               module=0, fpga=1, clock=1, firstbit=10 ),  #v6 new
-        TopoOutput( algoname='2INVM9-MU6ab-MU4ab',                          module=0, fpga=1, clock=1, firstbit=11 ),  #v6 new       
-        TopoOutput( algoname='INVM_EMs6',                                   module=0, fpga=0, clock=0, firstbit=11 ), # 3bits
- 
-        # module: 1, FPGA: 0        
-        TopoOutput( algoname='05MINDPHI-AJj10s6-XE0',                       module=1, fpga=0, clock=0, firstbit=0 ),#v6
-        TopoOutput( algoname='10MINDPHI-AJj10s6-XE0',                       module=1, fpga=0, clock=0, firstbit=1 ),#v6
-        TopoOutput( algoname='15MINDPHI-AJj10s6-XE0',                       module=1, fpga=0, clock=0, firstbit=2 ),#v6
-        TopoOutput( algoname='0DR04-MU4ab-CJ15ab',                          module=1, fpga=0, clock=0, firstbit=3 ), 
-        TopoOutput( algoname='0DR04-MU4ab-CJ20ab',                          module=1, fpga=0, clock=0, firstbit=4 ),
-        TopoOutput( algoname='0DR04-MU4ab-CJ30ab',                          module=1, fpga=0, clock=0, firstbit=5 ),
-        TopoOutput( algoname='0DR04-MU6ab-CJ20ab',                          module=1, fpga=0, clock=0, firstbit=6 ),
-        TopoOutput( algoname='0DR04-MU6ab-CJ25ab',                          module=1, fpga=0, clock=0, firstbit=7 ),
-        TopoOutput( algoname='10MINDPHI-CJ20ab-XE50',                       module=1, fpga=0, clock=0, firstbit=8 ),
-#        TopoOutput( algoname='2DR15-2CMU4ab',                               module=1, fpga=0, clock=0, firstbit=9 ),
-        TopoOutput( algoname='0DR24-2CMU4ab',                               module=1, fpga=0, clock=0, firstbit=9 ),#v6
-#        TopoOutput( algoname='2DR15-CMU6ab-CMU4ab',                         module=1, fpga=0, clock=0, firstbit=10 ),
-        TopoOutput( algoname='MULT-CMU4ab',                                 module=1, fpga=0, clock=0, firstbit=11 ), # 2bits
-        TopoOutput( algoname='MULT-CMU6ab',                                 module=1, fpga=0, clock=0, firstbit=13 ), # 2bits
-#        TopoOutput( algoname='2INVM999-2CMU4ab',                            module=1, fpga=0, clock=0, firstbit=15 ), 
-#        TopoOutput( algoname='1INVM19-2CMU4ab',                             module=1, fpga=0, clock=0, firstbit=15 ),#v6
-#        TopoOutput( algoname='2INVM999-CMU6ab-CMU4ab',                      module=1, fpga=0, clock=1, firstbit=0 ), 
-#        TopoOutput( algoname='4INVM8-2CMU4ab',                              module=1, fpga=0, clock=1, firstbit=1 ),
-#        TopoOutput( algoname='2INVM8-2CMU4ab',                              module=1, fpga=0, clock=1, firstbit=1 ),#v6
-#        TopoOutput( algoname='4INVM8-CMU6ab-CMU4ab',                        module=1, fpga=0, clock=1, firstbit=2 ),
-#        TopoOutput( algoname='0DETA04-0DPHI03-EM8abi-MU10ab',               module=1, fpga=0, clock=1, firstbit=3 ),
-         TopoOutput( algoname='0DETA04-EM8abi-MU10ab',                       module=1, fpga=0, clock=1, firstbit=3 ), #ATR-14282
-         TopoOutput( algoname='0DPHI03-EM8abi-MU10ab',                       module=1, fpga=0, clock=1, firstbit=6 ),
-
-#        TopoOutput( algoname='0DETA04-0DPHI03-EM15abi-MUab',                module=1, fpga=0, clock=1, firstbit=4 ),
-         TopoOutput( algoname='0DETA04-EM15abi-MUab',                       module=1, fpga=0, clock=1, firstbit=4 ), #ATR-14282
-         TopoOutput( algoname='0DPHI03-EM15abi-MUab',                       module=1, fpga=0, clock=1, firstbit=8 ),
-
-#        TopoOutput( algoname='2DR15-CMU4ab-MU4ab',                          module=1, fpga=0, clock=1, firstbit=5 ),
-        TopoOutput( algoname='0DR24-CMU4ab-MU4ab',                          module=1, fpga=0, clock=1, firstbit=5 ),#v6
-#        TopoOutput( algoname='2INVM999-CMU4ab-MU4ab',                       module=1, fpga=0, clock=1, firstbit=6 ), 
-#        TopoOutput( algoname='1INVM19-CMU4ab-MU4ab',                        module=1, fpga=0, clock=1, firstbit=6 ),#v6
-#        TopoOutput( algoname='4INVM8-CMU4ab-MU4ab',                         module=1, fpga=0, clock=1, firstbit=7 ),         
-        TopoOutput( algoname='2INVM8-CMU4ab-MU4ab',                         module=1, fpga=0, clock=1, firstbit=7 ),#v6
-
-        TopoOutput( algoname='0DR25-TAU20abi-TAU12abi',                     module=1, fpga=1, clock=1, firstbit=10 ), #v6 new
-        TopoOutput( algoname='10MINDPHI-AJ20s2-XE50',                       module=1, fpga=0, clock=1, firstbit=9 ),#v6n
-        TopoOutput( algoname='LATE-MU10s1',                                  module=1, fpga=0, clock=1, firstbit=10 ),#v6n
-        TopoOutput( algoname='1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',       module=1, fpga=1, clock=1, firstbit=11 ), #v6 new 
-#          TopoOutput( algoname='0DR15-2MU6ab',                                module=1, fpga=0, clock=1, firstbit=11 ), #v6 new
-        TopoOutput( algoname='10MINDPHI-J20s2-XE30',                        module=0, fpga=0, clock=1, firstbit=5 ),  #v6 new
-
-
-        # module: 1, FPGA: 1        
-        TopoOutput( algoname='KF-XE-AJall',                                 module=1, fpga=1, clock=0, firstbit=0 ), # 6 bits        
-        TopoOutput( algoname='0MATCH-4AJ20.ETA31-4AJj15.ETA31',             module=1, fpga=1, clock=0, firstbit=6 ),
-        TopoOutput( algoname='HT190-AJ15all.ETA21',                         module=1, fpga=1, clock=0, firstbit=7 ),
-        TopoOutput( algoname='HT150-AJ20all.ETA31',                         module=1, fpga=1, clock=0, firstbit=8 ),
-        TopoOutput( algoname='HT150-AJj15all.ETA49',                        module=1, fpga=1, clock=0, firstbit=9 ),
-        TopoOutput( algoname='HT20-AJj15all.ETA49',                         module=1, fpga=1, clock=0, firstbit=10 ),
-        TopoOutput( algoname='SC111-CJ15ab.ETA26',                          module=1, fpga=0, clock=1, firstbit=11 ),#v6n
-        TopoOutput( algoname='SC85-CJ15ab.ETA26',                           module=1, fpga=0, clock=1, firstbit=12 ),#v6n
-        TopoOutput( algoname='05RATIO-XE0-HT0-AJj15all.ETA49',              module=1, fpga=1, clock=0, firstbit=13 ), 
-#        TopoOutput( algoname='08RATIO-XE0-HT0-AJj15all.ETA49',              module=1, fpga=1, clock=0, firstbit=14 ), 
-        TopoOutput( algoname='90RATIO2-XE0-HT0-AJj15all.ETA49',             module=1, fpga=1, clock=0, firstbit=15 ),
-        TopoOutput( algoname='250RATIO2-XE0-HT0-AJj15all.ETA49',            module=1, fpga=1, clock=1, firstbit=0 ),
-        TopoOutput( algoname='10MINDPHI-J20ab-XE50',                        module=1, fpga=1, clock=1, firstbit=1 ), 
-        TopoOutput( algoname='0DR28-TAU20abi-TAU12abi',                     module=1, fpga=1, clock=1, firstbit=2 ),
-        TopoOutput( algoname='1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',       module=1, fpga=1, clock=1, firstbit=3 ), 
-        TopoOutput( algoname='1DISAMB-TAU12abi-J25ab',                      module=1, fpga=1, clock=1, firstbit=4 ), 
-        TopoOutput( algoname='0DR10-MU10ab-MU6ab',                          module=1, fpga=1, clock=1, firstbit=5 ),  
-        TopoOutput( algoname='2DR99-2MU4ab',                                module=1, fpga=1, clock=1, firstbit=6 ), 
-#        TopoOutput( algoname='2DR15-2MU4ab',                                module=1, fpga=1, clock=1, firstbit=7 ),
-        TopoOutput( algoname='0DR34-2MU4ab',                                module=1, fpga=1, clock=1, firstbit=7 ), #v6
-        TopoOutput( algoname='2DR15-2MU6ab',                                module=1, fpga=1, clock=1, firstbit=8 ), 
-#        TopoOutput( algoname='2DR15-MU6ab-MU4ab',                           module=1, fpga=1, clock=1, firstbit=9 ), 
-        TopoOutput( algoname='0DR15-MU6ab-MU4ab',                           module=1, fpga=1, clock=1, firstbit=9 ), #v6
-#        TopoOutput( algoname='2DR15-ONEBARREL-MU6ab-MU4ab',                 module=1, fpga=1, clock=1, firstbit=10 ),
-#        TopoOutput( algoname='2INVM999-2MU4ab',                             module=1, fpga=1, clock=1, firstbit=11 ),
-#        TopoOutput( algoname='1INVM19-2MU4ab',                              module=1, fpga=1, clock=1, firstbit=11 ), #v6
-#        TopoOutput( algoname='2INVM999-MU6ab-MU4ab',                        module=1, fpga=1, clock=1, firstbit=12 ),
-        TopoOutput( algoname='8INVM15-MU6ab-MU4ab',                         module=1, fpga=1, clock=1, firstbit=12 ), #v6
-#        TopoOutput( algoname='2INVM999-2MU6ab',                             module=1, fpga=1, clock=1, firstbit=13 ),
-        TopoOutput( algoname='8INVM15-2MU6ab',                              module=1, fpga=1, clock=1, firstbit=13 ), #v6
-#        TopoOutput( algoname='4INVM8-2MU4ab',                               module=1, fpga=1, clock=1, firstbit=14 ), 
-        TopoOutput( algoname='2INVM8-2MU4ab',                               module=1, fpga=1, clock=1, firstbit=14 ), #v6
-# ATR-15197        TopoOutput( algoname='2INVM9-2MU4ab',                               module=1, fpga=1, clock=1, firstbit=14 ), #v6
-#        TopoOutput( algoname='4INVM8-MU6ab-MU4ab',                          module=1, fpga=1, clock=1, firstbit=15 ), 
-        TopoOutput( algoname='2INVM8-MU6ab-MU4ab',                          module=1, fpga=1, clock=1, firstbit=15 ), #v6
-# ATR-15197        TopoOutput( algoname='2INVM9-MU6ab-MU4ab',                          module=1, fpga=1, clock=1, firstbit=15 ), #v6
-        ]
+    
 
 
-    if mcv7_flag:
-        L1TopoFlags.algos +=  newalgos_onlyinv6
-    else:
-        L1TopoFlags.algos +=  newalgos_onlyinv5 
+        # module: 0, FPGA: 1
+        TopoOutput( algoname='KF-XE-AJall',                                 module=0, fpga=1, clock=0, firstbit=0 ), # 6 bits
+        TopoOutput( algoname='ZAFB_DPHI',                                   module=0, fpga=1, clock=0, firstbit=6 ), # 2 bits
+        TopoOutput( algoname='CEP_CJ',                                      module=0, fpga=1, clock=0, firstbit=8 ), # 2 bits
+        TopoOutput( algoname='INVM_EMs6',                                   module=0, fpga=1, clock=0, firstbit=10 ), # 3bits to 2 bits
+        TopoOutput( algoname='27DPHI32-EMs1-EMs6',                          module=0, fpga=1, clock=0, firstbit=12 ),
+
+
+        # module: 1, FPGA: 0
+        TopoOutput( algoname='HT190-J15s5.ETA21',                           module=1, fpga=0, clock=0, firstbit=0 ),
+        TopoOutput( algoname='0DR03-EM7ab-CJ15ab',                          module=1, fpga=0, clock=0, firstbit=1 ),
+        TopoOutput( algoname='INVM_NFF',                                    module=1, fpga=0, clock=0, firstbit=2 ), # 4 bits to 1 bit
+        TopoOutput( algoname='INVM_AJ_HighMass',                            module=1, fpga=0, clock=0, firstbit=3 ), # 4bits to 1 bit
+        TopoOutput( algoname='INVM_AJ_LowMass',                             module=1, fpga=0, clock=0, firstbit=4 ), # 4 bits to 1 bit
+        TopoOutput( algoname='HT150-J20s5.ETA31',                           module=1, fpga=0, clock=0, firstbit=5 ),
+        TopoOutput( algoname='400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',     module=1, fpga=0, clock=0, firstbit=6 ),
+        TopoOutput( algoname='10MINDPHI-J20s2-XE30',                        module=1, fpga=0, clock=0, firstbit=7 ),
+        TopoOutput( algoname='10MINDPHI-J20s2-XE50',                        module=1, fpga=0, clock=0, firstbit=8 ),
+        TopoOutput( algoname='SC111-CJ15ab.ETA26',                          module=1, fpga=0, clock=0, firstbit=9 ),
+        TopoOutput( algoname='0DETA20-J50s1-Js2',                           module=1, fpga=0, clock=0, firstbit=10 ),
+        TopoOutput( algoname='2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',       module=1, fpga=0, clock=0, firstbit=11 ),
+        TopoOutput( algoname='0INVM9-EM7ab-EMab',                           module=1, fpga=0, clock=0, firstbit=12 ),
+        TopoOutput( algoname='2DISAMB-TAU12abi-J25ab',                      module=1, fpga=0, clock=0, firstbit=13 ),
+        TopoOutput( algoname='0DR04-MU4ab-CJ15ab',                          module=1, fpga=0, clock=0, firstbit=14 ),
+        TopoOutput( algoname='0DR04-MU6ab-CJ20ab',                          module=1, fpga=0, clock=0, firstbit=15 ),
+
+        # module: 1, FPGA: 1
+
+        TopoOutput( algoname='DISAMB-30INVM-EM20his2-TAU12ab',              module=1, fpga=1, clock=0, firstbit=0 ),
+        TopoOutput( algoname='100RATIO-0MATCH-TAU30si2-EMall',              module=1, fpga=1, clock=0, firstbit=1 ),
+        TopoOutput( algoname='NOT-0MATCH-TAU30si1-EMall',                   module=1, fpga=1, clock=0, firstbit=2 ),
+        TopoOutput( algoname='LATE-MU10s1',                                 module=1, fpga=1, clock=0, firstbit=3 ),
+        TopoOutput( algoname='MULT-CMU4ab',                                 module=1, fpga=1, clock=0, firstbit=4 ),#2bits
+        TopoOutput( algoname='MULT-CMU6ab',                                 module=1, fpga=1, clock=0, firstbit=6 ),#2bits        
+        TopoOutput( algoname='0DR15-2MU6ab',                                module=1, fpga=1, clock=0, firstbit=8 ),
+#        TopoOutput( algoname='8INVM15-0DR22-2MU6ab',                        module=1, fpga=1, clock=0, firstbit=9 ),
+
+#        TopoOutput( algoname='8INVM15-0DR22-MU6ab-MU4ab',                   module=1, fpga=1, clock=1, firstbit=0 ),
+#        TopoOutput( algoname='2INVM9-0DR15-MU6ab-MU4ab',                    module=1, fpga=1, clock=1, firstbit=1 ),
+#        TopoOutput( algoname='2INVM9-0DR15-2MU4ab',                         module=1, fpga=1, clock=1, firstbit=2 ),
+#        TopoOutput( algoname='2INVM9-2DR15-2MU6ab',                         module=1, fpga=1, clock=1, firstbit=3 ),
+        TopoOutput( algoname='5DETA99-5DPHI99-2MU4ab',                      module=1, fpga=1, clock=1, firstbit=0 ),
+        TopoOutput( algoname='5DETA99-5DPHI99-MU6ab-MU4ab',                 module=1, fpga=1, clock=1, firstbit=1 ), 
+        TopoOutput( algoname='5DETA99-5DPHI99-2MU6ab',                      module=1, fpga=1, clock=1, firstbit=2 ),
+        TopoOutput( algoname='0DETA04-EM8abi-MU10ab',                       module=1, fpga=1, clock=1, firstbit=3 ),
+        TopoOutput( algoname='0DPHI03-EM8abi-MU10ab',                       module=1, fpga=1, clock=1, firstbit=4 ),
+        TopoOutput( algoname='0DETA04-EM15abi-MUab',                        module=1, fpga=1, clock=1, firstbit=5 ),
+        TopoOutput( algoname='0DPHI03-EM15abi-MUab',                        module=1, fpga=1, clock=1, firstbit=6 ),
+        TopoOutput( algoname='0INVM70-27DPHI32-EM10his1-EM10his6',          module=1, fpga=1, clock=1, firstbit=7 ),
+        TopoOutput( algoname='0INVM70-27DPHI32-EM12his1-EM12his6',          module=1, fpga=1, clock=1, firstbit=8 ),
+#        TopoOutput( algoname='0INVM10-0DR15-EM8abi-MU10ab',                 module=1, fpga=1, clock=1, firstbit=13 ),
+#        TopoOutput( algoname='0INVM10-0DR15-EM12abi-MU6ab',                 module=1, fpga=1, clock=1, firstbit=14 ),
+        TopoOutput( algoname='8INVM15-2CMU4ab',                             module=1, fpga=1, clock=1, firstbit=9 ),
+
+    ]      
+        
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
index c2643edc0f117c7b8b3d20d8abe7014c00c6f641..1c7e9516df6d6cf9545417f8b22c6dbf95688b0c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
@@ -15,31 +15,26 @@ import L1TopoHardware.L1TopoHardware as HW
 
 
 class TopoAlgoDef(object):
-
+    
     @staticmethod
     def registerTopoAlgos(tm):
         currentAlgoId = 0
-
+        
         _etamax = 49
         _minet = 0
-        usev7 = False
-
-        if '_v7' in TriggerFlags.triggerMenuSetup():
-            usev7 = True
-        if 'LS2_v' in TriggerFlags.triggerMenuSetup() or 'run3_v1' in TriggerFlags.triggerMenuSetup():
-            usev7 = True
-        
+ 
         _emscale_for_decision = 2 # global scale for EM, TAU        
         if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
             if TriggerFlags.useRun1CaloEnergyScale :
                 _emscale_for_decision=1     
-                log.info("Changed mscale_for_decision %s for Run1CaloEnergyScale", _emscale_for_decision)
+                log.info("Changed mscale_for_decision %s for Run1CaloEnergyScale" % _emscale_for_decision)
 
         alg = AlgConf.ClusterNoSort( name = 'EMall', inputs = 'ClusterTobArray', outputs = 'EMall', algoId = currentAlgoId) ; currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthEM)
         alg.addgeneric('OutputWidth', HW.InputWidthEM)
         alg.addvariable('IsoMask', 0)
         tm.registerAlgo(alg)  
+
                                 
         alg = AlgConf.ClusterSelect( name = 'TAUabi', inputs = 'ClusterTobArray', outputs = 'TAUabi', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth',  HW.InputWidthTAU)
@@ -52,6 +47,7 @@ class TopoAlgoDef(object):
         alg.addgeneric('DoIsoCut', 1)
         tm.registerAlgo(alg) 
 
+
         alg = AlgConf.ClusterSelect( name = 'EMabi', inputs = 'ClusterTobArray', outputs = 'EMabi', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth',  HW.InputWidthEM)
         alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) 
@@ -63,6 +59,7 @@ class TopoAlgoDef(object):
         alg.addgeneric('DoIsoCut', 1)
         tm.registerAlgo(alg) 
 
+
         alg = AlgConf.ClusterSelect( name = 'EMabhi', inputs = 'ClusterTobArray', outputs = 'EMabhi', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth',  HW.InputWidthEM)
         alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) 
@@ -73,6 +70,7 @@ class TopoAlgoDef(object):
         alg.addvariable('MaxEta', _etamax)
         alg.addgeneric('DoIsoCut', 1)
         tm.registerAlgo(alg) 
+
         
         alg = AlgConf.ClusterSelect( name = 'TAUab', inputs = 'ClusterTobArray', outputs = 'TAUab', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth',  HW.InputWidthTAU)
@@ -85,6 +83,7 @@ class TopoAlgoDef(object):
         alg.addgeneric('DoIsoCut', 0)
         tm.registerAlgo(alg) 
 
+
         alg = AlgConf.ClusterSort( name = 'EMs', inputs = 'ClusterTobArray', outputs = 'EMs', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthEM)
         alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortEM)
@@ -95,6 +94,7 @@ class TopoAlgoDef(object):
         alg.addgeneric('DoIsoCut', '0')
         #alg.addgeneric('DoEtaCut', '1')
         tm.registerAlgo(alg) 
+
         
         alg = AlgConf.ClusterSort( name = 'EMshi', inputs = 'ClusterTobArray', outputs = 'EMshi', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthEM)
@@ -106,7 +106,8 @@ class TopoAlgoDef(object):
         alg.addgeneric('DoIsoCut', '1')
         #alg.addgeneric('DoEtaCut', '1')
         tm.registerAlgo(alg)
-                
+
+
         alg = AlgConf.ClusterSort( name = 'TAUsi', inputs = 'ClusterTobArray', outputs = 'TAUsi', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthTAU)
         alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortTAU)
@@ -117,6 +118,7 @@ class TopoAlgoDef(object):
         alg.addgeneric('DoIsoCut', '1')
         #alg.addgeneric('DoEtaCut', '1')
         tm.registerAlgo(alg)
+
         
         alg = AlgConf.JetNoSort( name = 'AJall', inputs = 'JetTobArray', outputs = 'AJall', algoId = currentAlgoId ) ; currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthJET)
@@ -124,13 +126,16 @@ class TopoAlgoDef(object):
         alg.addgeneric('JetSize', HW.DefaultJetSize)
         tm.registerAlgo(alg)
 
+
         alg = AlgConf.JetNoSort( name = 'AJjall', inputs = 'JetTobArray', outputs = 'AJjall', algoId = currentAlgoId ) ; currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthJET)
         alg.addgeneric('OutputWidth', HW.InputWidthJET)
         alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2)
         tm.registerAlgo(alg)
 
+
         # for 0MATCH-4AJ20-4AJj15
+
         alg = AlgConf.JetNoSortMatch( name = 'AJMatchall', inputs = 'JetTobArray', outputs = 'AJMatchall', algoId = currentAlgoId ) ; currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthJET)
         alg.addgeneric('OutputWidth', HW.InputWidthJET)
@@ -139,18 +144,21 @@ class TopoAlgoDef(object):
         alg.addvariable('MinET2', 20) # 8x8
         tm.registerAlgo(alg)        
 
-
         # ab J lists:
-        for jet_type in ['J', 'CJ']:
+        for jet_type in ['J', 'CJ', 'FJ']:
             jetabseta = _etamax
             _minet = 25
+            _mineta=0
             if jet_type=='J':
                 jetabseta = 31
                 _minet = 20
             elif jet_type=='CJ':
                 jetabseta = 26 
                 _minet = 15
-            
+            elif jet_type=='FJ':
+                _mineta = 31
+                _minet = 15
+
             alg = AlgConf.JetSelect( name = jet_type+'ab', inputs = 'JetTobArray', outputs = jet_type+'ab', algoId = currentAlgoId ); currentAlgoId += 1
 
             alg.addgeneric('InputWidth', HW.InputWidthJET)
@@ -158,7 +166,7 @@ class TopoAlgoDef(object):
             alg.addgeneric('OutputWidth', HW.OutputWidthSelectJET)
             alg.addgeneric('JetSize', HW.DefaultJetSize.value)
             alg.addvariable('MinET', _minet)  
-            alg.addvariable('MinEta', 0)
+            alg.addvariable('MinEta', _mineta)
             alg.addvariable('MaxEta', jetabseta)
             alg.addgeneric('DoEtaCut', 1)
             tm.registerAlgo(alg) 
@@ -173,17 +181,44 @@ class TopoAlgoDef(object):
         alg.addvariable('MaxEta', _etamax)
         alg.addgeneric('DoEtaCut', 0)
         tm.registerAlgo(alg) 
+
+
+        #input list needed for ATR-18824
+        alg = AlgConf.JetSort( name = 'FJjs23ETA49', inputs = 'JetTobArray', outputs = 'FJjs23ETA49', algoId = currentAlgoId); currentAlgoId += 1
+
+        alg.addgeneric('InputWidth',  HW.InputWidthJET)
+        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
+        alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
+        alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2)
+        alg.addvariable('MinEta', 23)
+        alg.addvariable('MaxEta', _etamax)
+        alg.addgeneric('DoEtaCut', 1)
+        tm.registerAlgo(alg)
+            
         
+        alg = AlgConf.JetSort( name = 'CJsETA21', inputs = 'JetTobArray', outputs = 'CJsETA21', algoId = currentAlgoId); currentAlgoId += 1
+        alg.addgeneric('InputWidth',  HW.InputWidthJET)
+        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
+        alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
+        alg.addgeneric('JetSize', HW.DefaultJetSize.value)
+        alg.addvariable('MinEta', 0)
+        alg.addvariable('MaxEta', 21)
+        tm.registerAlgo(alg)
+
         # Sorted J lists:
-        for jet_type in ['AJ']:
+        for jet_type in ['AJ', 'FJ']:
             jetabseta = _etamax
             _minet = 25
+            _mineta = 0
             if jet_type=='J':
                 jetabseta = 31
                 _minet = 20
             elif jet_type=='CJ':
                 jetabseta = 26 
                 _minet = 15
+            elif jet_type=='FJ':
+                _mineta = 31
+                _minet = 15
                 
             alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s', algoId = currentAlgoId ); currentAlgoId += 1
 
@@ -191,12 +226,15 @@ class TopoAlgoDef(object):
             alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
             alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
             alg.addgeneric('JetSize', HW.DefaultJetSize.value) 
-            alg.addvariable('MinEta', 0)
+            alg.addvariable('MinEta', _mineta)
             alg.addvariable('MaxEta', jetabseta)
-            alg.addgeneric('DoEtaCut', 0)
+            if jet_type=='FJ':
+                alg.addgeneric('DoEtaCut', 1)
+            else:
+                alg.addgeneric('DoEtaCut', 0)
             tm.registerAlgo(alg) 
 
-        for jet_type in ['J']:
+        for jet_type in ['J','CJ']:
             jetabseta = _etamax
             _minet = 25
             if jet_type=='J':
@@ -217,18 +255,21 @@ class TopoAlgoDef(object):
             alg.addgeneric('DoEtaCut', 1)
             tm.registerAlgo(alg)
 
+
         alg = AlgConf.METNoSort( name = 'XENoSort', inputs = 'MetTobArray', outputs = 'XENoSort', algoId = currentAlgoId ); currentAlgoId += 1
 
         alg.addgeneric('InputWidth', HW.InputWidthMET)
         alg.addgeneric('OutputWidth', HW.OutputWidthMET)
         tm.registerAlgo(alg)
+
                 
         alg = AlgConf.MetSort( name = 'XE', inputs = 'MetTobArray', outputs = 'XE', algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.InputWidthMET)
         alg.addgeneric('OutputWidth', HW.OutputWidthMET)
         tm.registerAlgo(alg)
+
         
-        alg = AlgConf.MuonSelect( name = 'MUab', inputs = 'MuonTobArray', outputs = 'MUab', algoId = currentAlgoId ); currentAlgoId += 1                                      
+        alg = AlgConf.MuonSelect( name = 'MUab', inputs = 'MuonTobArray', outputs = 'MUab', algoId = currentAlgoId ); currentAlgoId += 1
 
         alg.addgeneric('InputWidth', HW.InputWidthMU)
         alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectMU )
@@ -238,6 +279,18 @@ class TopoAlgoDef(object):
         alg.addvariable('MaxEta', 25)
         tm.registerAlgo(alg)            
 
+
+        alg = AlgConf.MuonSort( name = 'MUs', inputs = 'MuonTobArray', outputs = 'MUs', algoId = currentAlgoId ); currentAlgoId += 1
+
+        alg.addgeneric('InputWidth', HW.InputWidthMU)
+        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortMU )
+        alg.addgeneric('OutputWidth', HW.OutputWidthSortMU)
+#        alg.addvariable('MinET', 4)
+        alg.addvariable('MinEta', 0)
+        alg.addvariable('MaxEta', 25)
+        tm.registerAlgo(alg)
+
+
         alg = AlgConf.MuonSelect( name = 'CMUab', inputs = 'MuonTobArray', outputs = 'CMUab', algoId = currentAlgoId ); currentAlgoId += 1                                     
 
         alg.addgeneric('InputWidth', HW.InputWidthMU)
@@ -248,6 +301,7 @@ class TopoAlgoDef(object):
         alg.addvariable('MaxEta', 10)
         tm.registerAlgo(alg)
 
+
         alg = AlgConf.MuonSort_1BC( name = 'LMUs', inputs = 'LateMuonTobArray', outputs = 'LMUs', algoId = currentAlgoId ); currentAlgoId += 1
         #alg = AlgConf.MuonSort_1BC( name = 'LMUs', inputs = 'MuonTobArray', outputs = 'LMUs', algoId = currentAlgoId ); currentAlgoId += 1
 
@@ -258,6 +312,7 @@ class TopoAlgoDef(object):
         alg.addvariable('MinEta', 0)
         alg.addvariable('MaxEta', 25)
         tm.registerAlgo(alg)
+
         
         # Abbreviated lists:
         alg = AlgConf.ClusterSelect( name = 'EMab', inputs = 'ClusterTobArray', outputs = 'EMab', algoId = currentAlgoId ); currentAlgoId += 1
@@ -265,13 +320,14 @@ class TopoAlgoDef(object):
         alg.addgeneric('InputWidth',  HW.InputWidthEM)
         alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) 
         alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM)
-        alg.addvariable('MinET', 8)
+        alg.addvariable('MinET', 5)
         alg.addvariable('IsoMask', 0)                
         alg.addvariable('MinEta', 0)
         alg.addvariable('MaxEta', _etamax)
-        #alg.addgeneric('DoIsoCut', 1)
+        alg.addgeneric('DoIsoCut', 0)
         tm.registerAlgo(alg) 
         
+
         # All lists:
 
         alg = AlgConf.ClusterNoSort( name = 'TAUall', inputs = 'ClusterTobArray', outputs = 'TAUall', algoId = currentAlgoId) ; currentAlgoId += 1                                         
@@ -281,23 +337,22 @@ class TopoAlgoDef(object):
         alg.addvariable('IsoMask', 0)
         tm.registerAlgo(alg)
 
+
         alg = AlgConf.MuonNoSort( name = 'MUall', inputs = 'MuonTobArray', outputs = 'MUall',algoId = currentAlgoId) ; currentAlgoId += 1                                      
 
         alg.addgeneric('InputWidth', HW.InputWidthMU)
         alg.addgeneric('OutputWidth', HW.InputWidthMU)
         tm.registerAlgo(alg)
+
                 
         # Decision algorithms
         currentAlgoId = 0
         
-
-
-
-        # VBF items    
+        # VBF items
         for x in [
-            {"algoname": 'INVM_AJ_HighMass', "Threlist": [ 900, 800, 700, 500 ], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6},
-            {"algoname": 'INVM_AJ_LowMass',  "Threlist": [ 400, 300, 200, 100 ], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6},
-            ]:
+                {"algoname": 'INVM_AJ_HighMass', "Threlist": [ 700], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6},
+                {"algoname": 'INVM_AJ_LowMass',  "Threlist": [ 300], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6}
+        ]:
 
             class d : pass
             for k in x:
@@ -305,111 +360,54 @@ class TopoAlgoDef(object):
 
             inputList = d.otype + d.olist
             toponames=[]
+            
 
-            for minInvm in d.Threlist:
+            for minInvm in d.Threlist:  
                 toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s"  % (minInvm, d.maxInvm,
-                                                            d.otype, str(d.ocut1) , d.olist, str(d.nleading1) if d.olist=="s" else "",
-                                                            d.otype, str(d.ocut2) , d.olist, str(d.nleading2) if d.olist=="s" else "")   
+                                                            d.otype, str(d.ocut1) , d.olist, str(d.nleading1) if d.olist=="s" else "",     
+                                                            d.otype, str(d.ocut2) , d.olist, str(d.nleading2) if d.olist=="s" else "")     
                 toponames.append(toponame)
-                
-            alg = AlgConf.InvariantMassInclusive1( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1
 
-            alg.addgeneric('InputWidth', d.inputwidth1)
-            alg.addgeneric('MaxTob', d.nleading1)
+            alg = AlgConf.InvariantMassInclusive1( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1  
+
+            alg.addgeneric('InputWidth', d.inputwidth1)      
+            alg.addgeneric('MaxTob', d.nleading1)            
             alg.addgeneric('NumResultBits', len(toponames))
 
-            for bitid, minInvm in enumerate(d.Threlist): 
-                alg.addvariable('MinET1', d.ocut1, bitid)
-                alg.addvariable('MinET2', d.ocut2, bitid)
-                alg.addvariable('MinMSqr', minInvm * minInvm, bitid)
-                alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm, bitid)
+            for bitid, minInvm in enumerate(d.Threlist):     
+                alg.addvariable('MinET1', d.ocut1, bitid)    
+                alg.addvariable('MinET2', d.ocut2, bitid)    
+                alg.addvariable('MinMSqr', minInvm * minInvm, bitid)  
+                alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm, bitid)  
 
             tm.registerAlgo(alg)
 
 
-        # dimu INVM items
-
-        listofalgos=[
-
-            #{"minInvm": 1, "maxInvm": 19, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist" : "ab", "otype2" : "",  "ocut2" : 0, "onebarrel": 0},#1INVM19-2MU4ab 
-            {"minInvm": 2, "maxInvm": 8, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist" : "ab", "otype2" : "",  "ocut2" : 0, "onebarrel": 0}, #2INVM8-2MU4ab 
-            {"minInvm": 2, "maxInvm": 9, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist" : "ab", "otype2" : "",  "ocut2" : 0, "onebarrel": 0}, #2INVM9-2MU4ab 
-            {"minInvm": 8, "maxInvm": 15, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 0}, #8INVM15-MU6ab-MU4ab
-            {"minInvm": 2, "maxInvm": 8, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 0}, #2INVM8-MU6ab-MU4ab
-            {"minInvm": 2, "maxInvm": 9, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 0}, #2INVM9-MU6ab-MU4ab
-            {"minInvm": 8, "maxInvm": 15, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "",  "ocut2" : 0, "onebarrel": 0}, #8INVM15-2MU6ab
-            {"minInvm": 2, "maxInvm": 9, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "",  "ocut2" : 0, "onebarrel": 0},  #2INVM9-2MU6ab 
-            {"minInvm": 7, "maxInvm": 15, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist" : "ab", "otype2" : "",  "ocut2" : 0, "onebarrel": 0}, #7INVM15-2MU4ab 
-
-            ]
-
-        for x in listofalgos:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
-            toponame = "%iINVM%i-%s%s%s"  % (d.minInvm, d.maxInvm, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
-
-            log.debug("Define %s", toponame)
-
-
-            inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
-            algoname = AlgConf.InvariantMassInclusive1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.InvariantMassInclusive2
-            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-
-            if (d.mult>1 or d.otype1==d.otype2):
-                alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) 
-                alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', d.onebarrel)
-            else:
-                alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
-                alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
-                alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
-                alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
-
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1)
-            alg.addvariable('MinET2', d.ocut2 if d.ocut2>0 else d.ocut1)
-            alg.addvariable('MinMSqr', d.minInvm * d.minInvm)
-            alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm)
-            tm.registerAlgo(alg)
-
 
         # dimu DR items
-        listofalgos=[  
-            {"minDr": 2, "maxDr": 99, "mult": 2, "otype1" : "MU" ,"ocut1": 4,  "olist" : "ab", "otype2" : "",   "ocut2": 4, "onebarrel": 0}, # SM Y  x
-            {"minDr": 0, "maxDr": 10, "mult": 1, "otype1" : "MU" ,"ocut1": 10, "olist" : "ab", "otype2" : "MU", "ocut2": 6, "onebarrel": 0}, # Exotic LFV x 
-            {"minDr": 2, "maxDr": 15, "mult": 2, "otype1" : "MU" ,"ocut1": 6,  "olist" : "ab", "otype2" : "",   "ocut2": 6, "onebarrel": 0},   #x
-            {"minDr": 0, "maxDr": 15, "mult": 2, "otype1" : "MU" ,"ocut1": 4,  "olist" : "ab", "otype2" : "",   "ocut2": 4, "onebarrel": 0}, #0DR15-2MU4ab
-            {"minDr": 0, "maxDr": 15, "mult": 1, "otype1" : "MU", "ocut1": 6,  "olist" : "ab", "otype2" : "MU", "ocut2": 4, "onebarrel": 0}, #0DR15-MU6ab-MU4ab
-            {"minDr": 0, "maxDr": 34, "mult": 2, "otype1" : "MU" ,"ocut1": 4,  "olist" : "ab", "otype2" : "",   "ocut2": 4, "onebarrel": 0}, #0DR34-2MU4ab 
-            {"minDr": 0, "maxDr": 24, "mult": 2, "otype1" : "MU" ,"ocut1": 4,  "olist" : "ab", "otype2" : "",   "ocut2": 4, "onebarrel": 0}, #0DR24-2MU4ab 
-            {"minDr": 0, "maxDr": 22, "mult": 2, "otype1" : "MU" ,"ocut1": 6,  "olist" : "ab", "otype2" : "",   "ocut2": 6, "onebarrel": 0}, #0DR22-2MU6ab
-            {"minDr": 0, "maxDr": 22, "mult": 1, "otype1" : "MU", "ocut1": 6,  "olist" : "ab", "otype2" : "MU", "ocut2": 4, "onebarrel": 0}, #0DR22-MU6ab-MU4ab
-            {"minDr": 0, "maxDr": 15, "mult": 2, "otype1" : "MU", "ocut1": 6,  "olist" : "ab", "otype2" : "",   "ocut2": 6, "onebarrel": 0}, #0DR15-2MU6ab  
-            ]
+        listofalgos=[
+            {"minDr": 0, "maxDr": 15, "mult": 2, "otype1" : "MU", "ocut1": 6,  "olist" : "ab", "otype2" : "",   "ocut2": 6, "onebarrel": 0}, #0DR15-2MU6ab        
+        ]
 
         for x in listofalgos:
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
+                
+            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)    
+            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)                                    
+            toponame = "%iDR%i-%s%s%s"  % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)  # noqa: F821
 
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
-            toponame = "%iDR%i-%s%s%s"  % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
-
-            log.debug("Define %s", toponame)
+            log.info("Define %s" % toponame)
 
-            inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
-            algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2
+            inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]    
+            algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2         
             alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-
-            if (d.mult>1 or d.otype1==d.otype2):
+ 
+            if (d.mult>1 or d.otype1==d.otype2):  
                 alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
                 alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', d.onebarrel)
+                alg.addgeneric('RequireOneBarrel', d.onebarrel)  
             else:
                 alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
                 alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
@@ -418,639 +416,344 @@ class TopoAlgoDef(object):
 
 
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1)
-            alg.addvariable('MinET2', d.ocut2)
-            alg.addvariable('DeltaRMin', d.minDr*d.minDr)
-            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)
+            alg.addvariable('MinET1', d.ocut1)            
+            alg.addvariable('MinET2', d.ocut2)            
+            alg.addvariable('DeltaRMin', d.minDr*d.minDr)   
+            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)   
             tm.registerAlgo(alg)
-        
 
             
         # deta-dphi with ab+ab
-        for x in [     
-            #{"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 4, "olist2": "", "nleading2": HW.OutputWidthSelectMU},
-            {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "MU", "ocut2": 4, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU},
-            {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 6, "olist2": "", "nleading2": HW.OutputWidthSelectMU},
+        for x in [
+            {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "MU", "ocut2": 4, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-MU6ab-MU4ab
+        {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 6, "olist2": "", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-2MU6ab
+        {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 4, "olist2": "", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-2MU4ab
             ]:
-            
+
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist1)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
-            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2)
+            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist1)  
+            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)  
+            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2)  
             
-            log.debug("Define %s", toponame)
+            log.info("Define %s" % toponame)
             
-            inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2]
-            algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2            
+            inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2]    
+            algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2        
             alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
             alg.addgeneric('NumResultBits', 1)                        
 
             
-            if (d.mult>1 or d.otype1==d.otype2):
-                alg.addgeneric('InputWidth', d.nleading1)
-                alg.addgeneric('MaxTob', d.nleading1)
-                alg.addvariable('MinET1', d.ocut1)
-                alg.addvariable('MinET2', d.ocut2)
-                alg.addvariable('MinDeltaEta', d.minDeta)
-                alg.addvariable('MaxDeltaEta', d.maxDeta)
-                alg.addvariable('MinDeltaPhi', d.minDphi)
-                alg.addvariable('MaxDeltaPhi', d.maxDphi)
+            if (d.mult>1 or d.otype1==d.otype2):  # noqa: F821
+                alg.addgeneric('InputWidth', d.nleading1)  # noqa: F821
+                alg.addgeneric('MaxTob', d.nleading1)      # noqa: F821
+                alg.addvariable('MinET1', d.ocut1)         # noqa: F821
+                alg.addvariable('MinET2', d.ocut2)         # noqa: F821
+                alg.addvariable('MinDeltaEta', d.minDeta)  # noqa: F821
+                alg.addvariable('MaxDeltaEta', d.maxDeta)  # noqa: F821
+                alg.addvariable('MinDeltaPhi', d.minDphi)  # noqa: F821
+                alg.addvariable('MaxDeltaPhi', d.maxDphi)  # noqa: F821
             else:
-                alg.addgeneric('InputWidth1', d.nleading1)
-                alg.addgeneric('InputWidth2', d.nleading2)
-                alg.addgeneric('MaxTob1', d.nleading1)
-                alg.addgeneric('MaxTob2', d.nleading2)
-                alg.addvariable('DeltaEtaMin', d.minDeta)
-                alg.addvariable('DeltaEtaMax', d.maxDeta)
-                alg.addvariable('DeltaPhiMin', d.minDphi)
-                alg.addvariable('DeltaPhiMax', d.maxDphi)
-                alg.addvariable('MinET1', d.ocut1)
-                alg.addvariable('MinET2', d.ocut2)
+                alg.addgeneric('InputWidth1', d.nleading1) # noqa: F821
+                alg.addgeneric('InputWidth2', d.nleading2) # noqa: F821
+                alg.addgeneric('MaxTob1', d.nleading1)     # noqa: F821
+                alg.addgeneric('MaxTob2', d.nleading2)     # noqa: F821
+                alg.addvariable('DeltaEtaMin', d.minDeta)  # noqa: F821
+                alg.addvariable('DeltaEtaMax', d.maxDeta)  # noqa: F821
+                alg.addvariable('DeltaPhiMin', d.minDphi)  # noqa: F821
+                alg.addvariable('DeltaPhiMax', d.maxDphi)  # noqa: F821
+                alg.addvariable('MinET1', d.ocut1)         # noqa: F821
+                alg.addvariable('MinET2', d.ocut2)         # noqa: F821
             
             tm.registerAlgo(alg)
 
 
-
         algolist=[
-               {"minDr": 0, "maxDr": 28, "otype1" : "MU" ,"ocut1": 10, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU, "otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU},   # 0DR28-MU10ab-TAU12abi
-               {"minDr": 0, "maxDr": 28, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-TAU20abi-TAU12abi
-               {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, #	0DR25-TAU20abi-TAU12abi
-            ] 
+            {"minDr": 0, "maxDr": 28, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-TAU20abi-TAU12abi
+            {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, #        0DR25-TAU20abi-TAU12abi
+        ]
 
 
         for x in algolist:
-
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)
-            toponame = "%iDR%i-%s%s"  % (d.minDr, d.maxDr, obj1, obj2)
 
-            log.debug("Define %s", toponame)
+            obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1)       
+            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)      
+            toponame = "%iDR%i-%s%s"  % (d.minDr, d.maxDr, obj1, obj2) 
+
+            log.info("Define %s" % toponame)
             
-            inputList = [d.otype1 + d.olist1] if d.otype1==d.otype2 else [d.otype1 + d.olist1, d.otype2 + d.olist2]
-            algoname = AlgConf.DeltaRSqrIncl1 if d.otype1==d.otype2 else AlgConf.DeltaRSqrIncl2
+            inputList = [d.otype1 + d.olist1] if d.otype1==d.otype2 else [d.otype1 + d.olist1, d.otype2 + d.olist2] 
+            algoname = AlgConf.DeltaRSqrIncl1 if d.otype1==d.otype2 else AlgConf.DeltaRSqrIncl2         
             alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
 
                             
-            if d.otype1==d.otype2:
-                alg.addgeneric('InputWidth', d.inputwidth1)
-                alg.addgeneric('MaxTob', d.nleading1)
+            if d.otype1==d.otype2: 
+                alg.addgeneric('InputWidth', d.inputwidth1)   
+                alg.addgeneric('MaxTob', d.nleading1)         
             else:
-                alg.addgeneric('InputWidth1', d.inputwidth1)
-                alg.addgeneric('InputWidth2', d.inputwidth2) 
-                alg.addgeneric('MaxTob1', d.nleading1)
-                alg.addgeneric('MaxTob2', d.nleading2)
+                alg.addgeneric('InputWidth1', d.inputwidth1)  
+                alg.addgeneric('InputWidth2', d.inputwidth2)  
+                alg.addgeneric('MaxTob1', d.nleading1)        
+                alg.addgeneric('MaxTob2', d.nleading2)        
+
             alg.addgeneric('NumResultBits', 1)
 
-            if d.otype1==d.otype2:
-                alg.addvariable('MinET1', d.ocut1)
-                alg.addvariable('MinET2', d.ocut2)
-                alg.addvariable('DeltaRMin', d.minDr*d.minDr)
-                alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)
+            if d.otype1==d.otype2:  
+                alg.addvariable('MinET1', d.ocut1) 
+                alg.addvariable('MinET2', d.ocut2) 
+                alg.addvariable('DeltaRMin', d.minDr*d.minDr) 
+                alg.addvariable('DeltaRMax', d.maxDr*d.maxDr) 
             else:
-                alg.addvariable('MinET1', d.ocut1, 0)
-                alg.addvariable('MinET2', d.ocut2, 0)
-                alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0)
-                alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0)
+                alg.addvariable('MinET1', d.ocut1, 0) 
+                alg.addvariable('MinET2', d.ocut2, 0) 
+                alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) 
+                alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) 
                 
             tm.registerAlgo(alg)        
-
             
         # (ATR-8194) L1Topo HT Trigger
-        for x in [            
-            {"minHT": 150, "otype" : "J", "ocut" : 20, "olist" : "s",   "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 31},
-            {"minHT": 190, "otype" : "J", "ocut" : 15, "olist" : "s",   "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 21},
-            {"minHT": 190, "otype" : "AJ", "ocut" : 15, "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 21},
-            {"minHT": 150, "otype" : "AJ", "ocut" : 20, "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 31},
-            {"minHT": 150, "otype" : "AJj","ocut" : 15, "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 49},
-            {"minHT": 20,  "otype" : "AJj","ocut" : 15,  "olist" : "all", "nleading" : HW.InputWidthJET, "inputwidth": HW.InputWidthJET, "oeta" : 49},
-            ]:
-            
+        algoList = [
+            {"minHT": 150, "otype" : "J", "ocut" : 20, "olist" : "s",   "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 31}, #HT150-J20s5.ETA31
+            {"minHT": 190, "otype" : "J", "ocut" : 15, "olist" : "s",   "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 21}, #HT190-J15s5.ETA21
+            ]
+        for x in algoList:
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
+             
                 
-            toponame = "HT%d-%s%s%s%s.ETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta))
+            toponame = "HT%d-%s%s%s%s.ETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta)) 
             
-            log.debug("Define %s", toponame)
+            log.info("Define %s" % toponame)
             
-            inputList = d.otype + d.olist
+            inputList = d.otype + d.olist 
 
             alg = AlgConf.JetHT( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1
 
 
-            alg.addgeneric('InputWidth', d.inputwidth)
-            alg.addgeneric('MaxTob', d.nleading)        
-            alg.addgeneric('NumRegisters', 2 if d.olist=="all" else 0)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET', d.ocut)                        
+            alg.addgeneric('InputWidth', d.inputwidth)   # noqa: F821
+            alg.addgeneric('MaxTob', d.nleading)         # noqa: F821
+            alg.addgeneric('NumRegisters', 2 if d.olist=="all" else 0) # noqa: F821
+            alg.addgeneric('NumResultBits', 1) # noqa: F821
+            alg.addvariable('MinET', d.ocut)     # noqa: F821                    
             alg.addvariable('MinEta', 0)
-            alg.addvariable('MaxEta', d.oeta)            
-            alg.addvariable('MinHt', d.minHT) 
-            tm.registerAlgo(alg)  
+            alg.addvariable('MaxEta', d.oeta)    # noqa: F821
+            alg.addvariable('MinHt', d.minHT)    # noqa: F821
+            tm.registerAlgo(alg)
+
+            
+        # INVM_EM for Jpsi
+        invm_map = {"algoname": 'INVM_EMs6' , "ocutlist": [ 7, 12 ], "minInvm": 1, "maxInvm": 5, "otype" : "EM", "olist" : "s", "nleading" : 1, "inputwidth": HW.OutputWidthSortEM}
 
-        # INVM_EM for Jpsi    
-        invm_map = {"algoname": 'INVM_EMs6' , "ocutlist": [ 0, 7, 12 ], "minInvm": 1, "maxInvm": 5, "otype" : "EM", "olist" : "s", "nleading" : 1, "inputwidth": HW.OutputWidthSortEM}
         for x in [ invm_map,
             ]:
-            
+
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            inputList = d.otype + d.olist
+
+            inputList = d.otype + d.olist  # noqa: F821
             toponames=[]
 
-            for ocut in d.ocutlist:
-                toponame = "%iINVM%i-%s%s%s%s-EMs6"   % (d.minInvm, d.maxInvm, d.otype, str(ocut) if ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
+            for ocut in d.ocutlist:      # noqa: F821
+                toponame = "%iINVM%i-%s%s%s%s-EMs6"   % (d.minInvm, d.maxInvm, d.otype, str(ocut) if ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")          # noqa: F821
                 toponames.append(toponame)
 
-            alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = [inputList, 'EMs'], outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1    
+            alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = [inputList, 'EMs'], outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
 
 
-            alg.addgeneric('InputWidth1', d.inputwidth)
+            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
             #alg.addgeneric('InputWidth2', HW.InputWidthEM)
             alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
-            alg.addgeneric('MaxTob1', d.nleading)
+            alg.addgeneric('MaxTob1', d.nleading)       # noqa: F821
             #alg.addgeneric('MaxTob2', HW.InputWidthEM)
             alg.addgeneric('MaxTob2', HW.OutputWidthSortEM)
             alg.addgeneric('NumResultBits', len(toponames))
 
-            for bitid, ocut in enumerate(d.ocutlist):
+            for bitid, ocut in enumerate(d.ocutlist): # noqa: F821
                 alg.addvariable('MinET1', ocut, bitid)
                 alg.addvariable('MinET2', 0, bitid)
-                alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision), bitid)                
-                alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision), bitid)
-                
-            tm.registerAlgo(alg)
-
-        # W T&P: MINDPHI(J, XE0), (EM, XE0)
+                alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision), bitid)        # noqa: F821
+                alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision), bitid)        # noqa: F821
 
-
-        alglist = [
-            {"minDPhi":  5, "otype" : "AJj", "ocut" : 10, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortJET},
-            {"minDPhi": 10, "otype" : "AJj", "ocut" : 10, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortJET},
-            {"minDPhi": 15, "otype" : "AJj", "ocut" : 10, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortJET},
-            {"minDPhi":  5, "otype" : "EM",  "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},#new
-            #{"minDPhi": 10, "otype" : "EM",  "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},#new
-            {"minDPhi":  5, "otype" : "EM",  "ocut" : 15, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},#same
-            ]
-
-        for x in alglist:
-            
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-                
-            toponame = "%02dMINDPHI-%s%s%s%s-XE0"  % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
-            log.debug("Define %s", toponame)
-
-            inputList = d.otype + d.olist
-
-            alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-
-
-            alg.addgeneric('InputWidth1', d.inputwidth)
-            alg.addgeneric('InputWidth2', 1) 
-            alg.addgeneric('MaxTob1', d.nleading)
-            alg.addgeneric('MaxTob2', 1)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut)
-            alg.addvariable('MinET2', 0)
-            alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
             tm.registerAlgo(alg)
-
-        # W T&P MT
-
-        alglistmt = [
-            {"minMT": 25, "otype" : "EM", "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
-            #{"minMT": 30, "otype" : "EM", "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
-            {"minMT": 35, "otype" : "EM", "ocut" : 15, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
-            ]
-        for x in alglistmt:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-            toponame = "%iMT-%s%s%s%s-XE0"  % (d.minMT, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
-            log.debug("Define %s", toponame)
-
-            inputList = d.otype + d.olist
             
-            alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-
-
-
-            alg.addgeneric('InputWidth', HW.OutputWidthSortEM)
-            alg.addgeneric('MaxTob', str(d.nleading))
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', str(d.ocut))
-            alg.addvariable('MinET2', 0)
-            alg.addvariable('MinMTSqr', d.minMT*d.minMT)                        
-            tm.registerAlgo(alg)
-
             
-        # VBF deta     
-        for x in [
-            #{"minDeta": 0,  "maxDeta": 10, "otype" : "J",  "ocut1" : 0,  "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 0, "nleading2": 2},
-            ]:
+        # VBF deta    
 
+        algoList = [
+            {"minDeta": 0,  "maxDeta": 20, "otype" : "J",  "ocut1" : 50,  "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 0, "nleading2": 2}, #0DETA20-J50s1-Js2
+        ]
+  
+
+        for x in algoList:
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
-
-            toponame = "%iDETA%i-%s%s%s%s-%s%s%s%s"  % (d.minDeta, d.maxDeta,
-                                                        d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "",
-                                                        d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "")
             
-            log.debug("Define %s", toponame)
-            inputList = d.otype + d.olist
+  
+            toponame = "%iDETA%i-%s%s%s%s-%s%s%s%s"  % (d.minDeta, d.maxDeta,  # noqa: F821
+                                                        d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "", # noqa: F821
+                                                        d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "") # noqa: F821
+            
+            log.info("Define %s" % toponame)
+            inputList = d.otype + d.olist # noqa: F821
             
             alg = AlgConf.DeltaEtaIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
 
+            log.info("Current algo ID %i" % currentAlgoId )
+
 
 
-            alg.addgeneric('InputWidth', d.inputwidth1)
-            alg.addgeneric('MaxTob', d.nleading2)
+            alg.addgeneric('InputWidth', d.inputwidth1)  # noqa: F821
+            alg.addgeneric('MaxTob', d.nleading2)        # noqa: F821
             alg.addgeneric('NumResultBits', 1)                        
-            alg.addvariable('MinET1', str(d.ocut1), 0)            
-            alg.addvariable('MinET2', str(d.ocut2), 0)
-            alg.addvariable('MinDeltaEta', d.minDeta, 0)
-            alg.addvariable('MaxDeltaEta', d.maxDeta, 0)
+            alg.addvariable('MinET1', str(d.ocut1), 0)   # noqa: F821
+            alg.addvariable('MinET2', str(d.ocut2), 0)   # noqa: F821
+            alg.addvariable('MinDeltaEta', d.minDeta, 0) # noqa: F821
+            alg.addvariable('MaxDeltaEta', d.maxDeta, 0) # noqa: F821
             tm.registerAlgo(alg)
             
         # ZH Trigger
-
         supportedalgolist = [
-               #{"minDPhi": 10, "otype" : "J", "ocut" : 0,  "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 50 },
-               {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 50 },
-               {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "ocut2": 50},
-               {"minDPhi": 10, "otype" : "CJ","ocut" : 20, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "ocut2": 50},
-               {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 30 }, # NEW
-            ]
+            {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 30 }, #10MINDPHI-J20s2-XE30
+            {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 50 }, #10MINDPHI-J20s2-XE50
+        ] 
+
 
         for x in supportedalgolist:
-            
+
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
-                
-            toponame = "%iMINDPHI-%s%s%s%s-XE%i"  % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "",d.ocut2)
-            log.debug("Define %s", toponame)
             
-            inputList = d.otype + d.olist
+                 
+            toponame = "%iMINDPHI-%s%s%s%s-XE%i"  % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "",d.ocut2) # noqa: F821
+            log.info("Define %s" % toponame)
+            
+            inputList = d.otype + d.olist # noqa: F821
 
             alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
-            alg.addgeneric('InputWidth1', d.inputwidth)
+            log.info("Current algo ID %i" % currentAlgoId )
+
+            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
             alg.addgeneric('InputWidth2', 1)  
-            alg.addgeneric('MaxTob1', d.nleading)
+            alg.addgeneric('MaxTob1', d.nleading)       # noqa: F821
             alg.addgeneric('MaxTob2', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut)
-            alg.addvariable('MinET2', d.ocut2)
-            alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
+            alg.addvariable('MinET1', d.ocut)           # noqa: F821
+            alg.addvariable('MinET2', d.ocut2)          # noqa: F821
+            alg.addvariable('DeltaPhiMin', d.minDPhi, 0)# noqa: F821
             tm.registerAlgo(alg)
-
             
+
         # added for muon-jet:
-        for x in [  
-            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"},
-            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 30, "olist2" : "ab"},
-            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"},
-            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 25, "olist2" : "ab"},
-            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"} 
-            ]:
+        algoList = [
+            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"}, #0DR04-MU4ab-CJ15ab
+            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU6ab-CJ20ab
+        ]
+
 
+        for x in algoList:
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            toponame = "%iDR%02d-%s%s%s-%s%s%s"  % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2)
-            log.debug("Define %s", toponame)
-            
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
+
+            toponame = "%iDR%02d-%s%s%s-%s%s%s"  % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2) # noqa: F821
+            log.info("Define %s" % toponame)
+
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
 
             alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
 
+            log.info("Current algo ID %i" % currentAlgoId )
+
             alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
             alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET)
             alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
             alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET)
-            alg.addgeneric('NumResultBits', 1)                        
-            alg.addvariable('MinET1', d.ocut1, 0)
-            alg.addvariable('MinET2', d.ocut2, 0)
-            alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0)
-            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0)
-            tm.registerAlgo(alg)
-            
-        # dimu INVM items
-
-        algolist=[
-                #            {"minInvm": 2, "maxInvm": 999, "mult": 2, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" :"", "ocut2" : 0, "onebarrel": 0},
-                #            {"minInvm": 2, "maxInvm": 999, "mult": 1, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" :"MU", "ocut2" : 4, "onebarrel": 0},
-                #            {"minInvm": 2, "maxInvm": 999, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" :"MU", "ocut2" : 4, "onebarrel": 1},
-                #            {"minInvm": 2, "maxInvm": 999, "mult": 1, "otype1" : "CMU","ocut1": 6, "olist" : "ab", "otype2" :"CMU","ocut2" : 4, "onebarrel": 0},
-
-
-                #            {"minInvm": 4, "maxInvm": 8, "mult": 2, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" : "",  "ocut2" : 0, "onebarrel": 0},
-                #            {"minInvm": 4, "maxInvm": 8, "mult": 1, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 0},
-                #            {"minInvm": 4, "maxInvm": 8, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 1},
-                #            {"minInvm": 4, "maxInvm": 8, "mult": 1, "otype1" : "CMU","ocut1": 6, "olist" : "ab", "otype2" : "CMU","ocut2": 4, "onebarrel": 0},
-                #SX
-                #{"minInvm": 1, "maxInvm": 19, "mult": 1, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" :"MU", "ocut2" : 4, "onebarrel": 0}, #1INVM19-CMU4ab-MU4ab
-                {"minInvm": 2, "maxInvm": 8, "mult": 1, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" :"MU", "ocut2" : 4, "onebarrel": 0}, #2INVM8-CMU4ab-MU4ab
-                #{"minInvm": 1, "maxInvm": 19, "mult": 2, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" :"", "ocut2" : 0, "onebarrel": 0}, #1INVM19-2CMU4ab
-                #{"minInvm": 2, "maxInvm": 8, "mult": 2, "otype1" : "CMU","ocut1": 4, "olist" : "ab", "otype2" :"", "ocut2" : 0, "onebarrel": 0}, #2INVM8-2CMU4ab
-                {"minInvm": 2, "maxInvm": 8, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist" : "ab", "otype2" : "MU","ocut2" : 4, "onebarrel": 1}, #2INVM8-ONEBARREL-MU6ab-MU4ab
-            ]
-
-        for x in algolist:
-
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
-            toponame = "%iINVM%i-%s%s%s"  % (d.minInvm, d.maxInvm, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
-
-            log.debug("Define %s", toponame)
-
-
-            inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
-            algoname = AlgConf.InvariantMassInclusive1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.InvariantMassInclusive2
-            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            if (d.mult>1 or d.otype1==d.otype2):
-                alg.addgeneric('InputWidth', HW.OutputWidthSelectMU) 
-                alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', d.onebarrel)
-            else:
-                alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
-                alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
-                alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
-                alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
-
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1)
-            alg.addvariable('MinET2', d.ocut2 if d.ocut2>0 else d.ocut1)
-            alg.addvariable('MinMSqr', d.minInvm * d.minInvm)
-            alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm)
-            tm.registerAlgo(alg)
-
-        # dimu DR items
-        algolist=[#            {"minDr": 2, "maxDr": 15, "mult": 1, "otype1" : "CMU","ocut1": 4,  "olist" : "ab", "otype2" : "MU", "ocut2": 4, "onebarrel": 0},
-                #            {"minDr": 2, "maxDr": 15, "mult": 2, "otype1" : "CMU","ocut1": 4,  "olist" : "ab", "otype2" : "",   "ocut2": 4, "onebarrel": 0},
-                #            {"minDr": 2, "maxDr": 15, "mult": 1, "otype1" : "MU", "ocut1": 6,  "olist" : "ab", "otype2" : "MU","ocut2": 4, "onebarrel": 1},            
-                #            {"minDr": 2, "maxDr": 15, "mult": 1, "otype1" : "CMU","ocut1": 6,  "olist" : "ab", "otype2" : "CMU","ocut2": 4, "onebarrel": 0},
-
-                #SX
-                {"minDr": 0, "maxDr": 24, "mult": 2, "otype1" : "CMU","ocut1": 4,  "olist" : "ab", "otype2" : "",   "ocut2": 4, "onebarrel": 0}, #0DR24-2CMU4ab
-                {"minDr": 0, "maxDr": 24, "mult": 1, "otype1" : "CMU","ocut1": 4,  "olist" : "ab", "otype2" : "MU","ocut2": 4, "onebarrel": 0}, #0DR24-CMU4ab-MU4ab  
-            ]
-
-        for x in algolist : 
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
-            toponame = "%iDR%i-%s%s%s"  % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
-
-            log.debug("Define %s", toponame)
-
-            inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
-            algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2
-            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            if (d.mult>1 or d.otype1==d.otype2):
-                alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-                alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', d.onebarrel)
-            else:
-                alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
-                alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
-                alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
-                alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
-
-
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1)
-            alg.addvariable('MinET2', d.ocut2)
-            alg.addvariable('DeltaRMin', d.minDr*d.minDr)
-            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)
+            alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821
+            alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821
+            alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) # noqa: F821
+            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) # noqa: F821
             tm.registerAlgo(alg)
-
-
-        # deta-dphi with ab+ab
-        if usev7:
-            algoList = [
-               {"minDeta": 0, "maxDeta": 20, "minDphi": 0, "maxDphi": 20, "mult": 1, "otype1" : "TAU", "ocut1": 20, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU},
-            ]
-        else:
-            algoList = [
-               {"minDeta": 0, "maxDeta": "04", "minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU},
-               {"minDeta": 0, "maxDeta": "04", "minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU},
-               {"minDeta": 0, "maxDeta": 20, "minDphi": 0, "maxDphi": 20, "mult": 1, "otype1" : "TAU", "ocut1": 20, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU},
-            ]
-
-        for x in algoList:                 
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist1)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
-            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2)
-            
-            log.debug("Define %s", toponame)
-            
-            inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2]
-            algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2
-            
-            alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('NumResultBits', 1)                        
-            
-            if (d.mult>1 or d.otype1==d.otype2):
-                alg.addgeneric('InputWidth', d.nleading1)
-                alg.addgeneric('MaxTob', d.nleading1)
-                alg.addvariable('MinET1', d.ocut1, 0)
-                alg.addvariable('MinET2', d.ocut2, 0)
-                alg.addvariable('MinDeltaEta', d.minDeta, 0)
-                alg.addvariable('MaxDeltaEta', d.maxDeta, 0)
-                alg.addvariable('MinDeltaPhi', d.minDphi, 0)
-                alg.addvariable('MaxDeltaPhi', d.maxDphi, 0)
-            else:
-                alg.addgeneric('InputWidth1', d.nleading1)
-                alg.addgeneric('InputWidth2', d.nleading2)
-                alg.addgeneric('MaxTob1', d.nleading1)
-                alg.addgeneric('MaxTob2', d.nleading2)
-                alg.addvariable('MinET1', d.ocut1, 0)
-                alg.addvariable('MinET2', d.ocut2, 0)
-                alg.addvariable('DeltaEtaMin', d.minDeta, 0)
-                alg.addvariable('DeltaEtaMax', d.maxDeta, 0)
-                alg.addvariable('DeltaPhiMin', d.minDphi, 0)
-                alg.addvariable('DeltaPhiMax', d.maxDphi, 0)
-
             
-            tm.registerAlgo(alg)
 
-        # LFV DETA ATR-14282
-        if usev7:
-            algoList = [
-                {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU},
-                {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU},
-                ]
-        else:
-            algoList = []
+        # LFV DETA ATR-14282 
+        algoList = [
+            {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM8abi-MU10ab
+            {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM15abi-MUab
+        ]
 
         for x in algoList:
-
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            toponame = "%sDETA%s-%s%s%s-%s%s%s"  % (d.minDeta, d.maxDeta, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
  
-            log.debug("Define %s", toponame)
+            toponame = "%sDETA%s-%s%s%s-%s%s%s"  % (d.minDeta, d.maxDeta, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2) # noqa: F821
+ 
+            log.info("Define %s" % toponame)
 
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
             alg = AlgConf.DeltaEtaIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
             alg.addgeneric('NumResultBits', 1)
 
-            alg.addgeneric('InputWidth1', d.nleading1)
-            alg.addgeneric('InputWidth2', d.nleading2)
-            alg.addgeneric('MaxTob1', d.nleading1)
-            alg.addgeneric('MaxTob2', d.nleading2)
-            alg.addvariable('MinET1', d.ocut1, 0)
-            alg.addvariable('MinET2', d.ocut2, 0)
-            alg.addvariable('MinDeltaEta', d.minDeta, 0)
-            alg.addvariable('MaxDeltaEta', d.maxDeta, 0)
+            alg.addgeneric('InputWidth1', d.nleading1)   # noqa: F821
+            alg.addgeneric('InputWidth2', d.nleading2)   # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2)       # noqa: F821
+            alg.addvariable('MinET1', d.ocut1, 0)        # noqa: F821
+            alg.addvariable('MinET2', d.ocut2, 0)        # noqa: F821
+            alg.addvariable('MinDeltaEta', d.minDeta, 0) # noqa: F821
+            alg.addvariable('MaxDeltaEta', d.maxDeta, 0) # noqa: F821
 
             tm.registerAlgo(alg)
 
-        if usev7:
-            algoList = [
-                {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU},
-                {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU},
-                ]
-        else:
-            algoList = []
+  
+        #EMU dphi
+        algoList = [
+            {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM8abi-MU10ab
+            {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM15abi-MUab
+        ]
+ 
 
         for x in algoList:
-
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
+
             
-            toponame = "%sDPHI%s-%s%s%s-%s%s%s"  % (d.minDphi, d.maxDphi, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)
+            toponame = "%sDPHI%s-%s%s%s-%s%s%s"  % (d.minDphi, d.maxDphi, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2) # noqa: F821
  
-            log.debug("Define %s", toponame)
+            log.info("Define %s" % toponame)
 
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
             alg = AlgConf.DeltaPhiIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
             alg.addgeneric('NumResultBits', 1)
             
-            alg.addgeneric('InputWidth1', d.nleading1)
-            alg.addgeneric('InputWidth2', d.nleading2)
-            alg.addgeneric('MaxTob1', d.nleading1)
-            alg.addgeneric('MaxTob2', d.nleading2)
-            alg.addvariable('MinET1', d.ocut1, 0)
-            alg.addvariable('MinET2', d.ocut2, 0)
-            alg.addvariable('MinDeltaPhi', d.minDphi, 0)
-            alg.addvariable('MaxDeltaPhi', d.maxDphi, 0)
+            alg.addgeneric('InputWidth1', d.nleading1)   # noqa: F821
+            alg.addgeneric('InputWidth2', d.nleading2)   # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2)       # noqa: F821
+            alg.addvariable('MinET1', d.ocut1, 0)        # noqa: F821
+            alg.addvariable('MinET2', d.ocut2, 0)        # noqa: F821
+            alg.addvariable('MinDeltaPhi', d.minDphi, 0) # noqa: F821
+            alg.addvariable('MaxDeltaPhi', d.maxDphi, 0) # noqa: F821
 
             tm.registerAlgo(alg)
-
             
-        # JetMatch
-        toponame = "0MATCH-4AJ20.ETA31-4AJj15.ETA31"
-        alg = AlgConf.MultiplicityCustom( name = toponame, inputs = [ 'AJMatchall' ], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthJET)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinET', 0)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', 31)
-        alg.addvariable('MinMultiplicity', 4)
-        tm.registerAlgo(alg)
-        
-        # NoMatch for W T&P
-        toponame = "NOT-02MATCH-EM10s1-AJj15all.ETA49"
-        alg = AlgConf.NotMatch( name = toponame, inputs = [ 'EMs', 'AJjall'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth1', HW.OutputWidthSortEM)
-        alg.addgeneric('InputWidth2', HW.InputWidthJET)
-        alg.addgeneric('MaxTob1', 1)
-        alg.addgeneric('MaxTob2', HW.InputWidthJET)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinET1', 10)
-        alg.addvariable('MinET2', 15)
-        alg.addvariable('EtaMin1', 0)
-        alg.addvariable('EtaMax1', 49)
-        alg.addvariable('EtaMin2', 0)
-        alg.addvariable('EtaMax2', 49)
-        alg.addvariable('DRCut', 4)
-        tm.registerAlgo(alg)
-
-        # RATIO SUM for W T&P 
-        #toponame = "05RATIO-XE0-SUM0-EM10s1-HT0-AJj15all.ETA49"
-        #alg = AlgConf.RatioSum( name = toponame, inputs = ['XE', 'AJjall', 'EMs'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-        #alg.addgeneric('InputWidth1', 1)
-        #alg.addgeneric('InputWidth2', HW.InputWidthJET) 
-        #alg.addgeneric('InputWidth3', HW.OutputWidthSortEM) 
-        #alg.addgeneric('MaxTob1', 1)
-        #alg.addgeneric('MaxTob2', HW.InputWidthJET)
-        #alg.addgeneric('MaxTob3', 1)
-        #alg.addgeneric('NumResultBits', 1)
-        #alg.addgeneric('UseCluster05Granularity', 1)
-        #alg.addvariable('MinET2', 15)
-        #alg.addvariable('EtaMin2', 0)
-        #alg.addvariable('EtaMax2', 49)
-        #alg.addvariable('MinET3', 10)
-        #alg.addvariable('EtaMin3', 0)
-        #alg.addvariable('EtaMax3', 49)
-        #alg.addvariable('MinMET', 0)
-        #alg.addvariable('HT', 0)
-        #alg.addvariable('SUM', 0)
-        #alg.addvariable('Ratio', 5, 0)
-        #tm.registerAlgo(alg)
-
-        # RATIO for W T&P
-        for x in [
-            {"minRatio": 5, "ocut" : 15, "Ratio": "RATIO"},
-            #{"minRatio": 8, "ocut" : 15, "Ratio": "RATIO"},
-            {"minRatio": 90, "ocut" : 15, "Ratio": "RATIO2"},
-            {"minRatio": 250, "ocut" : 15, "Ratio": "RATIO2"},
-            ]:
-            
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-                
-            toponame = "%02d%s-XE0-HT0-AJj%sall.ETA49"  % (d.minRatio, d.Ratio, str(d.ocut))
-            log.debug("Define %s", toponame)
-            
-            alg = AlgConf.Ratio( name = toponame, inputs = ['XE', 'AJjall'], outputs = [ toponame ], algoId = currentAlgoId ) 
-            currentAlgoId += 1
-            alg.addgeneric('InputWidth1', 1) 
-            alg.addgeneric('InputWidth2', HW.InputWidthJET) 
-            alg.addgeneric('MaxTob1', 1)
-            alg.addgeneric('MaxTob2', HW.InputWidthJET)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('isXE2', 1 if d.Ratio=="RATIO2" else 0)
-            alg.addvariable('MinET2', str(d.ocut))
-            alg.addvariable('EtaMin', 0)
-            alg.addvariable('EtaMax', 49)
-            alg.addvariable('MinET1', 0)                        
-            alg.addvariable('HT', 0)
-            alg.addvariable('Ratio', str(d.minRatio))
-            tm.registerAlgo(alg)
-
+  
             
         # RATIO MATCH dedicated to Exotic 
         toponame = '100RATIO-0MATCH-TAU30si2-EMall'
@@ -1065,13 +768,12 @@ class TopoAlgoDef(object):
         alg.addvariable('Ratio', 100, 0)
         tm.registerAlgo(alg)        
 
-
         # NOT MATCH dedicated to Exotic
-        toponame = 'NOT-0MATCH-TAU30si2-EMall'
+        toponame = 'NOT-0MATCH-TAU30si1-EMall'
         alg = AlgConf.NotMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth1', HW.OutputWidthSortTAU)
         alg.addgeneric('InputWidth2', HW.InputWidthEM)
-        alg.addgeneric('MaxTob1', 2)
+        alg.addgeneric('MaxTob1', 1)
         alg.addgeneric('MaxTob2', HW.InputWidthEM)
         alg.addgeneric('NumResultBits', 1)
         alg.addvariable('MinET1', 30)
@@ -1085,98 +787,70 @@ class TopoAlgoDef(object):
 
         # MULT-BIT
         for x in [
-            {"otype1" : "CMU" ,"ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU},
-            {"otype1" : "CMU" ,"ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU},
+            {"otype1" : "CMU" ,"ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU}, #MULT-CMU4ab
+            {"otype1" : "CMU" ,"ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU}, #MULT-CMU6ab
             ]:
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
-                
-            toponame = "MULT-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1)
+
+            
+                  
+            toponame = "MULT-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1) # noqa: F821
             toponames = [toponame+"[0]", toponame+"[1]"]
-            log.debug("Define %s", toponames)
+            log.info("Define %s" % toponames)
             
-            inputList = [d.otype1 + d.olist1] 
+            inputList = [d.otype1 + d.olist1]  # noqa: F821
             alg = AlgConf.Multiplicity( name = toponame,  inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1
             
-            alg.addgeneric('InputWidth', d.inputwidth1)
+            alg.addgeneric('InputWidth', d.inputwidth1) # noqa: F821
             alg.addgeneric('NumResultBits', 2)
-            alg.addvariable('MinET', d.ocut1-1) # for MU threshold -1 
+            alg.addvariable('MinET', d.ocut1-1) # for MU threshold -1   # noqa: F821
             tm.registerAlgo(alg)        
-            
-        
+
+
         # DISAMB 2 lists
-        for x in [     
-            {"disamb": 1, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET},
-            #{"disamb": 0, "otype1" : "EM",  "ocut1": 15, "olist1" : "abhi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "TAU", "ocut2": 40, "olist2": "ab", "nleading2": HW.OutputWidthSelectTAU},
-            #{"disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1" : "ab", "nleading1": HW.OutputWidthSelectTAU,  "otype2" : "J", "ocut2": 20, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET},
-            #{"disamb": 0, "otype1" : "EM",  "ocut1": 15, "olist1" : "abhi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU},
-            ]:
+        algolist=[
+            {"disamb": 2, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, #2DISAMB-TAU12abi-J25ab
+        ]
             
+        for x in algolist :
+
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            obj1 = "%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1)
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)
-            toponame = "%sDISAMB-%s%s"  % ( d.disamb if d.disamb>0 else "", obj1, obj2)
+     
+ 
+            obj1 = "%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1) # noqa: F821
+            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2) # noqa: F821
+            toponame = "%sDISAMB-%s%s"  % ( d.disamb if d.disamb>0 else "", obj1, obj2) # noqa: F821
             
-            log.debug("Define %s", toponame)
+            log.info("Define %s" % toponame)
             
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
             alg = AlgConf.DisambiguationIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', d.nleading1 if d.olist1.find("ab")>=0 else -1000)
-            alg.addgeneric('InputWidth2', d.nleading2 if d.olist2.find("ab")>=0 else -1000) 
-            alg.addgeneric('MaxTob1', d.nleading1)
-            alg.addgeneric('MaxTob2', d.nleading2)
+            alg.addgeneric('InputWidth1', d.nleading1 if d.olist1.find("ab")>=0 else -1000) # noqa: F821
+            alg.addgeneric('InputWidth2', d.nleading2 if d.olist2.find("ab")>=0 else -1000)  # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('ClusterOnly', 1 if (d.otype1=="EM" and d.otype2=="TAU") or (d.otype1=="TAU" and d.otype2=="EM") else 0 )
+            alg.addgeneric('ClusterOnly', 1 if (d.otype1=="EM" and d.otype2=="TAU") or (d.otype1=="TAU" and d.otype2=="EM") else 0 ) # noqa: F821
             alg.addgeneric('ApplyDR', 0)
-            alg.addvariable('MinET1', d.ocut1)
-            alg.addvariable('MinET2', d.ocut2)
-            alg.addvariable('DisambDRSqrMin', d.disamb*d.disamb)
+            alg.addvariable('MinET1', d.ocut1) # noqa: F821
+            alg.addvariable('MinET2', d.ocut2) # noqa: F821
+            alg.addvariable('DisambDRSqrMin', d.disamb*d.disamb) # noqa: F821
             tm.registerAlgo(alg)
         
-        # DISAMB 3 lists
-        for x in [     
-            {"disamb": 1, "otype1" : "EM",  "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET},
-            {"disamb": 1, "otype1" : "TAU", "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectTAU, "inputwidth3": HW.OutputWidthSelectJET}, 
-            ]:
-            
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-            obj1 = "%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else ""))
-            obj3 = "-%s%s%s" % (d.otype3, str(d.ocut3), d.olist3)
-            toponame = "%sDISAMB-%s%s%s"  % ( d.disamb if d.disamb>0 else "", obj1, obj2, obj3)
-            
-            log.debug("Define %s", toponame)
-            
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3]
-            alg = AlgConf.DisambiguationIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', d.inputwidth1)
-            alg.addgeneric('InputWidth2', d.inputwidth2)
-            alg.addgeneric('InputWidth3', d.inputwidth3)
-            alg.addgeneric('MaxTob1', d.nleading1)
-            alg.addgeneric('MaxTob2', d.nleading2)
-            alg.addgeneric('MaxTob3', d.nleading3)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('ApplyDR', 0)
-            alg.addvariable('MinET1', d.ocut1, 0)
-            alg.addvariable('MinET2', d.ocut2, 0)
-            alg.addvariable('MinET3', d.ocut3, 0)
-            alg.addvariable('DisambDRSqr', d.disamb*d.disamb, 0) # DisambDR
-            tm.registerAlgo(alg)         
-
         # DISAMB 3 lists with DR cut to 2nd and 3rd lists
 
         algolist=[
-               {"disamb": 1, "otype1" : "EM",  "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, 
-               {"disamb": 1, "otype1" : "TAU",  "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi
-               {"disamb": 1, "otype1" : "TAU",  "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25}, # 1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi
-            ]
+            {"disamb": 2, "otype1" : "TAU",  "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25}, # 2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi
+            {"disamb": 2, "otype1" : "EM",  "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #2DISAMB-J25ab-0DR28-EM15his2-TAU12abi
+            {"disamb": 2, "otype1" : "TAU",  "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi
+
+        ]
+       
 
         for x in algolist:
 
@@ -1184,318 +858,642 @@ class TopoAlgoDef(object):
             for k in x:
                 setattr (d, k, x[k])
 
-            obj1 = "-%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else ""))
-            obj3 = "%s%s%s" % (d.otype3, str(d.ocut3), d.olist3)
-            toponame = "%sDISAMB-%s-%dDR%d%s%s"  % ( str(d.disamb) if d.disamb>0 else "", obj3, d.drcutmin, d.drcutmax, obj1, obj2)
+ 
+            obj1 = "-%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))  # noqa: F821
+            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else "")) # noqa: F821
+            obj3 = "%s%s%s" % (d.otype3, str(d.ocut3), d.olist3) # noqa: F821
+            toponame = "%sDISAMB-%s-%dDR%d%s%s"  % ( str(d.disamb) if d.disamb>0 else "", obj3, d.drcutmin, d.drcutmax, obj1, obj2)  # noqa: F821
 
-            log.debug("Define %s", toponame)
+            log.info("Define %s" % toponame)
             
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3]
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3]  # noqa: F821
             alg = AlgConf.DisambiguationDRIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', d.inputwidth1)
-            alg.addgeneric('InputWidth2', d.inputwidth2)
-            alg.addgeneric('InputWidth3', d.inputwidth3)
-            alg.addgeneric('MaxTob1', d.nleading1)
-            alg.addgeneric('MaxTob2', d.nleading2)
-            alg.addgeneric('MaxTob3', d.nleading3)
+            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
+            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
+            alg.addgeneric('InputWidth3', d.inputwidth3) # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
+            alg.addgeneric('MaxTob3', d.nleading3) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1, 0)
-            alg.addvariable('MinET2', d.ocut2, 0)
-            alg.addvariable('MinET3', d.ocut3, 0)
-            alg.addvariable('DisambDRSqrMin', d.drcutmin*d.drcutmin, 0)
-            alg.addvariable('DisambDRSqrMax', d.drcutmax*d.drcutmax, 0)
-            alg.addvariable('DisambDRSqr', d.disamb*d.disamb, 0)
+            alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821
+            alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821
+            alg.addvariable('MinET3', d.ocut3, 0) # noqa: F821
+            alg.addvariable('DisambDRSqrMin', d.drcutmin*d.drcutmin, 0) # noqa: F821
+            alg.addvariable('DisambDRSqrMax', d.drcutmax*d.drcutmax, 0) # noqa: F821
+            alg.addvariable('DisambDRSqr', d.disamb*d.disamb, 0) # noqa: F821
             tm.registerAlgo(alg)            
 
 
-        # LAR  0<eta<1.4 and 9/16pi<phi<11/16pi for FE crate IO6 
-        for x in [     
-            {"minEta": 0, "maxEta": 15, "minPhi": 16, "maxPhi": 23, "otype" : "EM", "ocut" : 20, "inputwidth": HW.OutputWidthSortEM},
-            {"minEta": 0, "maxEta": 14, "minPhi": 16, "maxPhi": 23, "otype" : "J", "ocut" : 100, "inputwidth": HW.OutputWidthSortJET}, 
-            ]:
+
+        #
+        xemap = [{"etcut": 0, "Threlist": [ 40, 50, 55, 60, 65, 75 ]}]
+        for x in xemap:
 
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            toponame = "LAR-%s%ss1"  % ( d.otype, str(d.ocut) if not d.otype=="EM" else "50" )
-            
-            log.debug("Define %s", toponame)
-            
-            inputList = d.otype + 's'
-            
-            alg = AlgConf.LAr( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', d.inputwidth) 
-            alg.addgeneric('MaxTob', 1)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET', str(d.ocut))
-            alg.addvariable('EtaMin', d.minEta)
-            alg.addvariable('EtaMax', d.maxEta)
-            alg.addvariable('PhiMin', d.minPhi)
-            alg.addvariable('PhiMax', d.maxPhi)
-            tm.registerAlgo(alg)
-
-
-
-
-        xemap = {"etcut": 0, "Threlist": [ 40, 50, 55, 60, 65, 75 ]}
-        for x in [ 
-            xemap,
-            ]:
                 
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            
-            log.debug("Define %s", toponame)
+            log.info("Define %s" % toponame)
             
             inputList = ['XENoSort', 'AJall']
             toponames=[]
 
-            for minxe in d.Threlist:
+            for minxe in d.Threlist:  # noqa: F821
                 toponames.append("KF-XE%s-AJall"  % (minxe))
             
             alg = AlgConf.KalmanMETCorrection( name = "KF-XE-AJall", inputs = inputList, outputs = toponames, algoId = currentAlgoId ); currentAlgoId += 1
             alg.addgeneric('InputWidth', HW.InputWidthJET)
             alg.addgeneric('NumResultBits', len(toponames))
             alg.addvariable('MinET', 0)
-            for bitid,minxe in enumerate(d.Threlist):
+            for bitid,minxe in enumerate(d.Threlist):  # noqa: F821
                 alg.addvariable('KFXE', str(minxe), bitid)
             
             tm.registerAlgo(alg)
 
-        # W T&P: MINDPHI(J, XE0), (EM, XE0)
-
-        alglist = [
-            {"minDPhi": 15, "otype" : "EM",  "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
-            {"minDPhi": 15, "otype" : "EM",  "ocut" : 15, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
-            ]
+             
+        # LATE MUON : LATE-MU10s1
+        for x in [     
+             {"otype" : "LATE-MU", "ocut" : 10, "inputwidth": HW.NumberOfDelayedMuons},
+            ]:
 
-        for x in alglist:
-            
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
-                
-            toponame = "%02dMINDPHI-%s%s%s%s-XE0"  % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
-            log.debug("Define %s", toponame)
 
-            inputList = d.otype + d.olist
 
-            alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
+    
+            toponame = "%s%ss1"  % ( d.otype, str(d.ocut) ) # noqa: F821
 
+            log.info("Define %s" % toponame)
 
-            alg.addgeneric('InputWidth1', d.inputwidth)
-            alg.addgeneric('InputWidth2', 1) 
-            alg.addgeneric('MaxTob1', d.nleading)
-            alg.addgeneric('MaxTob2', 1)
+            inputList = 'LMUs'
+
+            alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+            alg.addgeneric('InputWidth', d.inputwidth)  # noqa: F821
+            alg.addgeneric('MaxTob', 1)
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut)
-            alg.addvariable('MinET2', 0)
-            alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
+            alg.addvariable('MinET', str(d.ocut)) # noqa: F821
             tm.registerAlgo(alg)
-
             
-        # W T&P MT
 
-        alglistmt = [
-            {"minMT": 35, "otype" : "EM", "ocut" : 12, "olist" : "s", "nleading" : 6, "inputwidth": HW.OutputWidthSortEM},
-            ]
-        for x in alglistmt:
+        # (ATR-12748) fat jet trigger with Simple Cone algo
+        algoList = [
+            {"minHT": 111, "otype" : "CJ", "ocut" : 15, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "oeta" : 26}, #SC111-CJ15ab.ETA26
+        ]
+        for x in algoList:
+
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            toponame = "%iMT-%s%s%s%s-XE0"  % (d.minMT, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
-            log.debug("Define %s", toponame)
 
-            inputList = d.otype + d.olist
-            
-            alg = AlgConf.TransverseMassInclusive1( name = toponame, inputs = [ inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
+            toponame = "SC%d-%s%s%s%s.ETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta)) # noqa: F821
+
+            log.info("Define %s" % toponame)
+
+            inputList = d.otype + d.olist # noqa: F821
+
+            alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1
 
 
+            alg.addgeneric('InputWidth', d.inputwidth) # noqa: F821
+            alg.addvariable('MinET', d.ocut)           # noqa: F821       
+            alg.addvariable('MinSumET', d.minHT)       # noqa: F821
+            alg.addvariable('MaxRSqr', 10*10)                        
+            tm.registerAlgo(alg)  
+
+        # DISAMB-INVM
+        for x in [
+                {"disamb": 0, "minInvm": 30, "maxInvm": 9999,"otype1" : "EM",  "ocut1": 20, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "ab", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # DISAMB-30INVM-EM20his2-TAU12ab
+        ]:
+            class d : pass
+            for k in x:
+                setattr (d, k, x[k])
 
-            alg.addgeneric('InputWidth', HW.OutputWidthSortEM)
-            alg.addgeneric('MaxTob', str(d.nleading))
+            
+            obj1 = "%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else "")) # noqa: F821
+            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2) # noqa: F821
+            toponame = "%sDISAMB-%iINVM%s-%s%s"  % ( d.disamb if d.disamb>0 else "", d.minInvm, str(d.maxInvm) if d.maxInvm<9999 else "", obj1, obj2)       # noqa: F821    
+            
+            log.info("Define %s" % toponame)
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]      # noqa: F821         
+            #alg = AlgConf.DisambiguationInvariantMass2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
+            alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
+            
+            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
+            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', str(d.ocut))
-            alg.addvariable('MinET2', 0)
-            alg.addvariable('MinMTSqr', d.minMT*d.minMT)                        
+            
+            alg.addvariable('MinET1', d.ocut1) # noqa: F821
+            alg.addvariable('MinET2', d.ocut2) # noqa: F821
+            alg.addvariable('MinMSqr', d.minInvm * d.minInvm) # noqa: F821
+            alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm) # noqa: F821
+        
             tm.registerAlgo(alg)
+
+        #
+        for x in [
+            {  "minInvm": 400, "maxInvm": 9999, "otype1" : "AJ", "ocut1": 30, "olist1" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2": 20, "olist2" : "s", "nleading2" : 6, "inputwidth2": HW.OutputWidthSortJET, "applyEtaCut":1, "minEta1": 0 ,"maxEta1": 31 , "minEta2": 31 ,"maxEta2": 49 , }, #400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49
+        ]:
+            class d : pass
+            for k in x:
+                setattr (d, k, x[k])
+
+
+            obj1 = "%s%s%s.%sETA%i"  % (d.otype1, str(d.ocut1), d.olist1 + (str(d.nleading1) if d.olist1.find('s')>=0 else ""),str(d.minEta1) if d.minEta1>0 else "", d.maxEta1) # noqa: F821
+            obj2 = "-%s%s%s.%sETA%i"  % (d.otype2, str(d.ocut2), d.olist2 + (str(d.nleading2) if d.olist2.find('s')>=0 else ""),str(d.minEta2) if d.minEta2>0 else "", d.maxEta2) # noqa: F821
+            
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
+        
+            toponame = "%iINVM%i-%s%s"   % (d.minInvm, d.maxInvm, obj1, obj2) # noqa: F821
+            alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1    
+        
+        
+            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
+            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
+            alg.addgeneric('NumResultBits', 1)
+            if (d.applyEtaCut>0): # noqa: F821
+                alg.addgeneric('ApplyEtaCut', d.applyEtaCut) # noqa: F821
             
-        # DISAMB 2 lists with DR cut between objects in two lists
+            alg.addvariable('MinET1', d.ocut1) # noqa: F821
+            alg.addvariable('MinET2', d.ocut2) # noqa: F821
+            alg.addvariable('MinMSqr', d.minInvm * d.minInvm ) # noqa: F821
+            alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm ) # noqa: F821
+            if (d.applyEtaCut>0): # noqa: F821
+                alg.addvariable('MinEta1', d.minEta1) # noqa: F821
+                alg.addvariable('MaxEta1', d.maxEta1) # noqa: F821
+                alg.addvariable('MinEta2', d.minEta2) # noqa: F821
+                alg.addvariable('MaxEta2', d.maxEta2) # noqa: F821
+            
+            tm.registerAlgo(alg)
 
-        for x in [     
-            {"disamb": 0, "otype1" : "EM",  "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "drcutmin": 0, "drcutmax": 28},
+
+        #  0INVM9-EM7ab-EMab 
+        for x in [
+            {"minInvm" : 0, "maxInvm": 9, "otype" : "EM", "ocut1" : 7, "olist" : "ab", "inputwidth": HW.OutputWidthSelectEM, "ocut2" : 0},
             ]:
 
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            obj1 = "-%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else ""))
-            toponame = "%sDISAMB-%dDR%d%s%s"  % ( str(d.disamb) if d.disamb>0 else "", d.drcutmin, d.drcutmax, obj1, obj2)
-
-            log.debug("Define %s", toponame)
+ 		
+            inputList = d.otype + d.olist # noqa: F821
+            toponame = "%iINVM%i-%s%s%s-%s%s"  % (d.minInvm, d.maxInvm,                                                    # noqa: F821
+                                                  d.otype, str(d.ocut1) , d.olist,     # noqa: F821
+                                                  d.otype, d.olist)     # noqa: F821 
 
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
-            alg = AlgConf.DisambiguationDRIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', d.inputwidth1)
-            alg.addgeneric('InputWidth2', d.inputwidth2)
-            alg.addgeneric('MaxTob1', d.nleading1)
-            alg.addgeneric('MaxTob2', d.nleading2)
+            alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1  # noqa: F821
+            alg.addgeneric('InputWidth', d.inputwidth)      # noqa: F821
+            alg.addgeneric('MaxTob', HW.OutputWidthSelectEM)            # noqa: F821
             alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1, 0)
-            alg.addvariable('MinET2', d.ocut2, 0)
-            alg.addvariable('DisambDRSqrMin', d.drcutmin*d.drcutmin, 0)
-            alg.addvariable('DisambDRSqrMax', d.drcutmax*d.drcutmax, 0)
-            tm.registerAlgo(alg)   
 
-        # ZH Trigger
+            alg.addvariable('MinET1', d.ocut1)    # noqa: F821
+            alg.addvariable('MinET2', d.ocut2)    # noqa: F821
+            alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision))        # noqa: F821
+            alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision))        # noqa: F821
+
+            tm.registerAlgo(alg)
+
+
+
+        # added for b-phys, 0DR03-EM7ab-CJ15ab
+        for x in [  
+            {"minDr": 0, "maxDr": 3, "otype1" : "EM" ,"ocut1": 7,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"} 
+            ]:
 
-        supportedalgolist = [
-            {"minDPhi": 10, "otype" : "AJ", "ocut" : 20,  "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET},
-        ]            
-        for x in supportedalgolist:
-            
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
-                
-            toponame = "%iMINDPHI-%s%s%s%s-XE50"  % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")
-            log.debug("Define %s", toponame)
-            
-            inputList = d.otype + d.olist
 
-            alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
 
-            alg.addgeneric('InputWidth1', d.inputwidth)
-            alg.addgeneric('InputWidth2', 1)  
-            alg.addgeneric('MaxTob1', d.nleading)
-            alg.addgeneric('MaxTob2', 1)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut)
-            alg.addvariable('MinET2', 50)
-            alg.addvariable('DeltaPhiMin', d.minDPhi, 0)
+            toponame = "%iDR%02d-%s%s%s-%s%s%s"  % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2) # noqa: F821
+            log.info("Define %s" % toponame)
+
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
+
+            alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
+
+            alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM)
+            alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET)
+            alg.addgeneric('MaxTob1', HW.OutputWidthSelectEM)
+            alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET)
+            alg.addgeneric('NumResultBits', 1)                        
+            alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821
+            alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821
+            alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) # noqa: F821
+            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) # noqa: F821
             tm.registerAlgo(alg)
-                
-        # LATE MUON
-        for x in [     
-            #{"otype" : "LATE-MU", "ocut" : 10, "inputwidth": HW.OutputWidthSortMU},
-            {"otype" : "LATE-MU", "ocut" : 10, "inputwidth": HW.NumberOfDelayedMuons},
+
+
+        # VBF items INVM_NFF
+        invm_nff_map = {"algoname": 'INVM_NFF', "Threlist": [ 500 ], "maxInvm": 9999, "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET,  "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }
+
+
+
+        for x in [ invm_nff_map,
             ]:
 
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            toponame = "%s%ss1"  % ( d.otype, str(d.ocut) )
+            
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1]      # noqa: F821       
+            toponames=[]
 
-            log.debug("Define %s", toponame)
 
-            inputList = 'LMUs'
+            for minInvm in d.Threlist:  # noqa: F821
+                toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s"  % (minInvm, d.maxInvm,                          
+                                                            d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "",
+                                                            d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else "") 
+                toponames.append(toponame)
 
-            alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', d.inputwidth) 
-            alg.addgeneric('MaxTob', 1)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET', str(d.ocut))
+                
+            alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
+
+
+            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
+            alg.addgeneric('InputWidth2', d.inputwidth) # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2)# noqa: F821
+            alg.addgeneric('NumResultBits', len(toponames))
+
+            for bitid, minInvm in enumerate(d.Threlist): # noqa: F821
+                alg.addvariable('MinET1', d.ocut1, bitid)# noqa: F821
+                alg.addvariable('MinET2', d.ocut2, bitid)# noqa: F821
+                alg.addvariable('MinMSqr', minInvm*minInvm , bitid)        # noqa: F821         
+                alg.addvariable('MaxMSqr', d.maxInvm *d.maxInvm , bitid)        # noqa: F821
+                
             tm.registerAlgo(alg)
+
+
+        # Axion 2EM DPHI  
+        #27DPHI32-EMs1-EMs6
+        algoList = [
+            {"minDphi": 27,  "maxDphi": 32, "otype" : "EM",  "ocut1" : 0,  "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortEM, "ocut2" : 0, "nleading2": 6},
+        ]
+
+        for x in algoList:
+            class d : pass
+            for k in x:
+                setattr (d, k, x[k])
+
             
+            toponame = "%iDPHI%i-%s%s%s%s-%s%s%s%s"  % (d.minDphi, d.maxDphi,  # noqa: F821
+                                                        d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "", # noqa: F821
+                                                        d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "") # noqa: F821
+            
+            log.info("Define %s" % toponame)
+            inputList = d.otype + d.olist # noqa: F821
+            
+            alg = AlgConf.DeltaPhiIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
 
-        # (ATR-12748) fat jet trigger with Simple Cone algo
-        for x in [            
-            {"minHT": 111, "otype" : "CJ", "ocut" : 15, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "oeta" : 26},
-            {"minHT": 85, "otype" : "CJ", "ocut" : 15, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "oeta" : 26},                
-            ]:
+            alg.addgeneric('InputWidth', d.inputwidth1) # noqa: F821
+            alg.addgeneric('MaxTob', d.nleading2)       # noqa: F821 
+            alg.addgeneric('NumResultBits', 1)                        
+            alg.addvariable('MinET1', d.ocut1 if d.ocut1 > 0 else 3, 0) # noqa: F821   
+            alg.addvariable('MinET2', d.ocut2 if d.ocut2 > 0 else 3, 0) # noqa: F821  
+            alg.addvariable('MinDeltaPhi', d.minDphi, 0) # noqa: F821
+            alg.addvariable('MaxDeltaPhi', d.maxDphi, 0) # noqa: F821
+            tm.registerAlgo(alg)
+
+
+        # VBF items INVM_NFF + DPHI
+        NFFDphimap = [{"minInvm": 400 , "maxInvm": 9999, "minDphi": 0, "maxDphiList": [26, 24, 22, 20], "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET,  "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }]
+
+
+        for x in NFFDphimap:
 
             class d : pass
             for k in x:
                 setattr (d, k, x[k])
 
-            toponame = "SC%d-%s%s%s%s.ETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta))
 
-            log.debug("Define %s", toponame)
+            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1]      # noqa: F821       
+            toponames=[]
 
-            inputList = d.otype + d.olist
+            for maxDphi in d.maxDphiList:  # noqa: F821
+                toponames.append ("%iINVM%i-%iDPHI%i-%s%s%s%s-%s%s%s%s"  % (d.minInvm, d.maxInvm, d.minDphi, maxDphi,
+                                                                 d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", 
+                                                                 d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else ""))
 
-            alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1
+            alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'INVM_DPHI_NFF', inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
 
 
-            alg.addgeneric('InputWidth', d.inputwidth)
-            alg.addvariable('MinET', d.ocut)                        
-            alg.addvariable('MinSumET', d.minHT)
-            alg.addvariable('MaxRSqr', 10*10)                        
-            tm.registerAlgo(alg)  
+            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
+            alg.addgeneric('InputWidth2', d.inputwidth) # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2)# noqa: F821
+            alg.addgeneric('NumResultBits',  len(toponames))
+            for bitid,maxDphi in enumerate(d.maxDphiList):  # noqa: F821
+                alg.addvariable('MinET1', d.ocut1, bitid)# noqa: F821
+                alg.addvariable('MinET2', d.ocut2, bitid)# noqa: F821
+                alg.addvariable('MinMSqr', d.minInvm*d.minInvm , bitid)        # noqa: F821         
+                alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm , bitid)        # noqa: F821
+                alg.addvariable('MinDeltaPhi', d.minDphi, bitid) # noqa: F821
+                alg.addvariable('MaxDeltaPhi', maxDphi, bitid) # noqa: F821
 
-        # DISAMB-INVM
+            tm.registerAlgo(alg)
 
-        for x in [
-                {"disamb": 0, "minInvm": 30, "maxInvm": 9999,"otype1" : "EM",  "ocut1": 20, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "ab", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # DISAMB-30INVM-EM20his2-TAU12ab
-                ]:
+
+        #ATR-19355  
+        toponame = "0INVM10-3MU4ab"      # noqa: F821
+        log.info("Define %s" % toponame)
+    
+        inputList = 'MUab'
+        
+        alg = AlgConf.InvariantMassThreeTOBsIncl( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+        alg.addgeneric('NumResultBits', 1)
+        alg.addvariable('MinMSqr', 0)
+        alg.addvariable('MaxMSqr', 10*10)
+        alg.addvariable('MinET1', 4)
+        tm.registerAlgo(alg)
+        
+
+
+        #ATR-18815
+ #       toponame = "0INVM10-0DR15-EM8abi-MU10ab"
+ #       log.info("Define %s" % toponame)
+        
+#        inputList = ['EMabi','MUab']
+        
+#        alg = AlgConf.InvariantMassInclusive2DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+#        alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM)
+#        alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
+#        alg.addgeneric('MaxTob1', HW.OutputWidthSortEM)
+#        alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
+#        alg.addgeneric('NumResultBits', 1)
+#        alg.addvariable('MinMSqr', 0)
+#        alg.addvariable('MaxMSqr', 10*10*_emscale_for_decision) # Fix to add emscale
+#        alg.addvariable('MinET1', 8)
+#        alg.addvariable('MinET2', 10)
+#        alg.addgeneric('ApplyEtaCut', 0)
+#        alg.addvariable('MinEta1', 0)
+#        alg.addvariable('MinEta2', 0)
+#        alg.addvariable('MaxEta1', 9999)
+#        alg.addvariable('MaxEta2', 9999)
+#        alg.addvariable('DeltaRMin', 0)
+#        alg.addvariable('DeltaRMax', 15*15)
+#        tm.registerAlgo(alg)
+#        
+#        #ATR-18815
+#        toponame = "0INVM10-0DR15-EM12abi-MU6ab"
+#        log.info("Define %s" % toponame)
+#        
+#        inputList = ['EMabi','MUab']
+#        
+#        alg = AlgConf.InvariantMassInclusive2DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+#        alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM)
+#        alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
+#        alg.addgeneric('MaxTob1', HW.OutputWidthSortEM)
+#        alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
+#        alg.addgeneric('NumResultBits', 1)
+#        alg.addvariable('MinMSqr', 0)
+#        alg.addvariable('MaxMSqr', 10*10*_emscale_for_decision) # Fix to add emscale
+#        alg.addvariable('MinET1', 12)
+#        alg.addvariable('MinET2', 6)
+#        alg.addgeneric('ApplyEtaCut', 0)
+#        alg.addvariable('MinEta1', 0)
+#        alg.addvariable('MinEta2', 0)
+#        alg.addvariable('MaxEta1', 9999)
+#        alg.addvariable('MaxEta2', 9999)
+#        alg.addvariable('DeltaRMin', 0)
+#        alg.addvariable('DeltaRMax', 15*15)
+#        tm.registerAlgo(alg)
+#        
+
+
+        #ATR-18824 ZAFB-DPHI
+        
+        ZAFBDphimap = [
+            {"minInvm": 60 ,"maxInvm": 9999, "minDphiList": [4, 25], "maxDphi": 32, "minEta2": 23, "maxEta2": 49, "inputwidth1": HW.OutputWidthSortEM, "otype1" : "EM", "ocut1" : 15, "olist1" : "abhi", "nleading1" : HW.OutputWidthSortEM, "inputwidth2": HW.OutputWidthSortJET,  "ocut2" : 15,"nleading2" : 6}
+        ]
+
+        for x in ZAFBDphimap:
+            class d : pass
+            for k in x:
+                setattr (d, k, x[k])
+
+
+            inputList = [d.otype1 + d.olist1, 'FJjs23ETA49']      # noqa: F821       
+            toponames=[]
             
-                class d : pass
-                for k in x:
-                    setattr (d, k, x[k])
-
-                obj1 = "%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))
-                obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)
-                toponame = "%sDISAMB-%iINVM%s-%s%s"  % ( d.disamb if d.disamb>0 else "", d.minInvm, str(d.maxInvm) if d.maxInvm<9999 else "", obj1, obj2)          
-
-                log.debug("Define %s", toponame)
-                inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]               
-                #alg = AlgConf.DisambiguationInvariantMass2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
-                alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
-
-                alg.addgeneric('InputWidth1', d.inputwidth1)
-                alg.addgeneric('InputWidth2', d.inputwidth2)
-                alg.addgeneric('MaxTob1', d.nleading1)
-                alg.addgeneric('MaxTob2', d.nleading2)
-                alg.addgeneric('NumResultBits', 1)
+            for minDphi in d.minDphiList:  # noqa: F821
+                toponames.append ("%iINVM%i-%02dDPHI%i-%s%s%s%s-FJj%ss%s%iETA%i"  % (d.minInvm, d.maxInvm, minDphi, d.maxDphi, d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "",  str(d.ocut2) , str(d.nleading2) , d.minEta2, d.maxEta2))  
             
-                alg.addvariable('MinET1', d.ocut1)
-                alg.addvariable('MinET2', d.ocut2)
-                alg.addvariable('MinMSqr', d.minInvm * d.minInvm)
-                alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm)
-                
-                tm.registerAlgo(alg)
 
+            alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'ZAFB_DPHI', inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
+
+
+            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
+            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
+            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
+            alg.addgeneric('MaxTob2', d.nleading2)# noqa: F821
+            alg.addgeneric('NumResultBits',  len(toponames))
+            alg.addgeneric('ApplyEtaCut', 1)
+            alg.addvariable('MinEta1', 0)
+            alg.addvariable('MaxEta1', 9999)
+            alg.addvariable('MinEta2', 23)
+            alg.addvariable('MaxEta2', 49)
+            for bitid,minDphi in enumerate(d.minDphiList):  # noqa: F821
+                alg.addvariable('MinET1', d.ocut1, bitid)# noqa: F821
+                alg.addvariable('MinET2', d.ocut2, bitid)# noqa: F821
+                alg.addvariable('MinMSqr', d.minInvm*d.minInvm*_emscale_for_decision , bitid)        # noqa: F821 #ATR-18824 only one factor is needed as there is one EM object         
+                alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm*_emscale_for_decision , bitid)        # noqa: F821 #ATR-18824 only one factor is needed as there is one EM object
+                alg.addvariable('MinDeltaPhi', minDphi, bitid) # noqa: F821
+                alg.addvariable('MaxDeltaPhi', d.maxDphi, bitid) # noqa: F821
+
+            tm.registerAlgo(alg)
+
+        #ATR-19302: not included for now
+        toponame = "0INVM70-27DPHI32-EM10his1-EM10his6"
+        log.info("Define %s" % toponame)
+        inputList = ['EMshi','EMshi']
+        alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+        alg.addgeneric('InputWidth1', HW.OutputWidthSortEM)
+        alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
+        alg.addgeneric('MaxTob1', 1)
+        alg.addgeneric('MaxTob2', 6)
+        alg.addgeneric('NumResultBits', 1)
+        alg.addvariable('MinMSqr', 0)
+        alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision))
+        alg.addvariable('MinET1', 10)
+        alg.addvariable('MinET2', 10)
+        alg.addgeneric('ApplyEtaCut', 1)
+        alg.addvariable('MinEta1', 0)
+        alg.addvariable('MaxEta1', 9999)
+        alg.addvariable('MinEta2', 0)
+        alg.addvariable('MaxEta2', 9999)
+        alg.addvariable('MinDeltaPhi', 27)
+        alg.addvariable('MaxDeltaPhi', 32)
+        tm.registerAlgo(alg)
+
+        
+        toponame = "0INVM70-27DPHI32-EM12his1-EM12his6"
+        log.info("Define %s" % toponame)
+        inputList = ['EMshi','EMshi']
+        alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+        alg.addgeneric('InputWidth1', HW.OutputWidthSortEM)
+        alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
+        alg.addgeneric('MaxTob1', 1)
+        alg.addgeneric('MaxTob2', 6)
+        alg.addgeneric('NumResultBits', 1)
+        alg.addvariable('MinMSqr', 0)
+        alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision))
+        alg.addvariable('MinET1', 10)
+        alg.addvariable('MinET2', 12)
+        alg.addgeneric('ApplyEtaCut', 1)
+        alg.addvariable('MinEta1', 0)
+        alg.addvariable('MaxEta1', 9999)
+        alg.addvariable('MinEta2', 0)
+        alg.addvariable('MaxEta2', 9999)
+        alg.addvariable('MinDeltaPhi', 27)
+        alg.addvariable('MaxDeltaPhi', 32)
+        tm.registerAlgo(alg)
+
+
+        #ATR-19720, L1_BPH-8M15-0DR22-2MU6
+#        toponame = "8INVM15-0DR22-2MU6ab"
+#        log.info("Define %s" % toponame)
+#        
+#        inputList = ['MUab']
+#        
+#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+#        alg.addgeneric('NumResultBits', 1)
+#        alg.addvariable('MinMSqr', 8*8)
+#        alg.addvariable('MaxMSqr', 15*15)
+#        alg.addvariable('MinET1', 6)
+#        alg.addvariable('MinET2', 6)
+#        alg.addvariable('DeltaRMin', 0)
+#        alg.addvariable('DeltaRMax', 22*22)
+#        tm.registerAlgo(alg)
+#        
+#        #ATR-19720, L1_BPH-2M9-2DR15-2MU6
+#        toponame = "2INVM9-2DR15-2MU6ab"
+#        log.info("Define %s" % toponame)
+#    
+#        inputList = ['MUab']
+#    
+#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+#        alg.addgeneric('NumResultBits', 1)
+#        alg.addvariable('MinMSqr', 2*2)
+#        alg.addvariable('MaxMSqr', 9*9)
+#        alg.addvariable('MinET1', 6)
+#        alg.addvariable('MinET2', 6)
+#        alg.addvariable('DeltaRMin', 2*2)
+#        alg.addvariable('DeltaRMax', 15*15)
+#        tm.registerAlgo(alg)
+#
+#        #ATR-19720, L1_BPH-2M9-0DR15-MU6MU4
+#        toponame = "2INVM9-0DR15-MU6ab-MU4ab"
+#        log.info("Define %s" % toponame)
+#        
+#        inputList = ['MUab']
+#        
+#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+#        alg.addgeneric('NumResultBits', 1)
+#        alg.addvariable('MinMSqr', 2*2)
+#        alg.addvariable('MaxMSqr', 9*9)
+#        alg.addvariable('MinET1', 6)
+#        alg.addvariable('MinET2', 4)
+#        alg.addvariable('DeltaRMin', 0)
+#        alg.addvariable('DeltaRMax', 15*15)
+#        tm.registerAlgo(alg)
+#        
+#        #ATR-19720, L1_BPH-8M15-0DR22-MU6MU4-BO
+#        toponame = "8INVM15-0DR22-MU6ab-MU4ab"
+#        log.info("Define %s" % toponame)
+#        
+#        inputList = ['MUab']
+#        
+#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+#        alg.addgeneric('NumResultBits', 1)
+#        alg.addvariable('MinMSqr', 8*8)
+#        alg.addvariable('MaxMSqr', 15*15)
+#        alg.addvariable('MinET1', 6)
+#        alg.addvariable('MinET2', 4)
+#        alg.addvariable('DeltaRMin', 0)
+#        alg.addvariable('DeltaRMax', 22*22)
+#        tm.registerAlgo(alg)
+#
+#        #ATR-19720, L1_BPH-2M9-0DR15-2MU4
+#        
+#        toponame = "2INVM9-0DR15-2MU4ab"
+#        log.info("Define %s" % toponame)
+#   
+#        inputList = ['MUab']
+#
+#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+#        alg.addgeneric('NumResultBits', 1)
+#        alg.addvariable('MinMSqr', 2*2)
+#        alg.addvariable('MaxMSqr', 9*9)
+#        alg.addvariable('MinET1', 4)
+#        alg.addvariable('MinET2', 4)
+#        alg.addvariable('DeltaRMin', 0)
+#        alg.addvariable('DeltaRMax', 15*15)
+#        tm.registerAlgo(alg)
+#
+        #ATR-20174, L1BPH-8M15-2MU4-BO
+        
+        toponame = "8INVM15-2CMU4ab"
+        log.info("Define %s" % toponame)
+        
+        inputList = ['CMUab']
+        
+        alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+        alg.addgeneric('NumResultBits', 1)
+        alg.addvariable('MinMSqr', 8*8)
+        alg.addvariable('MaxMSqr', 15*15)
+        alg.addvariable('MinET1', 4)
+        alg.addvariable('MinET2', 4)
+        
+        tm.registerAlgo(alg)
+        
+
+        #CEP algorithms    
+        CEPmap = [{"algoname": 'CEP_CJ', "minETlist": [50, 60]}]
 
-        for x in [
-                {  "minInvm": 400, "maxInvm": 9999, "otype1" : "AJ", "ocut1": 30, "olist1" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2": 20, "olist2" : "s", "nleading2" : 6, "inputwidth2": HW.OutputWidthSortJET, "applyEtaCut":1, "minEta1": 0 ,"maxEta1": 31 , "minEta2": 31 ,"maxEta2": 49 , }, #400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49
-                ]:
-            
-                class d : pass
-                for k in x:
-                    setattr (d, k, x[k])
 
-                obj1 = "%s%s%s.%sETA%i"  % (d.otype1, str(d.ocut1), d.olist1 + (str(d.nleading1) if d.olist1.find('s')>=0 else ""),str(d.minEta1) if d.minEta1>0 else "", d.maxEta1)
-                obj2 = "-%s%s%s.%sETA%i"  % (d.otype2, str(d.ocut2), d.olist2 + (str(d.nleading2) if d.olist2.find('s')>=0 else ""),str(d.minEta2) if d.minEta2>0 else "", d.maxEta2)
+        for x in CEPmap:
+            class d : pass
+            for k in x:
+                setattr (d, k, x[k])
+
+  
+            inputList = ['CJs']
+            toponames=[]            
+
+            for minET in d.minETlist:  # noqa: F821
+                toponames.append ("CEP-CJ%is6" % (minET))     # noqa: F821 
             
-                inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]
-                        
-                toponame = "%iINVM%i-%s%s"   % (d.minInvm, d.maxInvm, obj1, obj2)
-                alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1    
-
-
-                alg.addgeneric('InputWidth1', d.inputwidth1)
-                alg.addgeneric('InputWidth2', d.inputwidth2)
-                alg.addgeneric('MaxTob1', d.nleading1)
-                alg.addgeneric('MaxTob2', d.nleading2)
-                alg.addgeneric('NumResultBits', 1)
-                if (d.applyEtaCut>0):
-                    alg.addgeneric('ApplyEtaCut', d.applyEtaCut)
-
-                alg.addvariable('MinET1', d.ocut1)
-                alg.addvariable('MinET2', d.ocut2)
-                alg.addvariable('MinMSqr', d.minInvm * d.minInvm )
-                alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm )
-                if (d.applyEtaCut>0):
-                    alg.addvariable('MinEta1', d.minEta1)
-                    alg.addvariable('MaxEta1', d.maxEta1)
-                    alg.addvariable('MinEta2', d.minEta2)
-                    alg.addvariable('MaxEta2', d.maxEta2)
-
-                tm.registerAlgo(alg)
+            alg = AlgConf.ExclusiveJets( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1 # noqa: F821
+            alg.addgeneric('InputWidth', HW.InputWidthJET) # noqa: F821
+            alg.addgeneric('MaxTob', HW.InputWidthJET)       # noqa: F821
+            alg.addgeneric('NumResultBits',  len(toponames)) # noqa: F821
+            for bitid,minET in enumerate(d.minETlist):  # noqa: F821
+                alg.addvariable('MinET1', minET, bitid)# noqa: F821
+            alg.addvariable('MinXi', 13000.0*0.02, bitid) # noqa: F821
+            alg.addvariable('MaxXi', 13000.0*0.05, bitid) # noqa: F821
+            tm.registerAlgo(alg)
+
+        
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
index edb3890b65ab7700ed5ecc37478e69931a71ebbd..e39990685260604f8e15ba506b3f14ec6fe7b26e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
@@ -1,13 +1,10 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-#
-# Disable flake8 checking due to the use of 'exec':
-# flake8: noqa
-#
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from .Limits import Limits
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger("Cabling")
+log.setLevel(logging.INFO)
 
 """
 Thilo's proposal in the CTP meeting Oct 13
@@ -78,7 +75,7 @@ def getLutInput(connector):
 
 
 
-class Cabling(object):
+class Cabling:
     @staticmethod
     def getInputCable(threshold):
         return InputCable( threshold )
@@ -90,6 +87,16 @@ class Cabling(object):
 
         from .Lvl1Flags import Lvl1Flags
         run1 = Lvl1Flags.CTPVersion()<=3
+
+
+        if thrtype == 'EM' and mapping >= 16:
+            mapping = 15
+        elif thrtype == 'TAU' and mapping >= 16:
+            mapping = 15
+        elif thrtype == 'JET' and mapping >= 25:
+            mapping = 24
+        elif thrtype == 'XE' and mapping >=16:
+            mapping = 15
         
         if run1:
             type2cablename  = { 'MUON'   : [(0,6,'MUCTPI')],
@@ -115,13 +122,13 @@ class Cabling(object):
                                 }
         else:
             type2cablename  = { 'MUON'   : [(0,6,'MUCTPI')],
-                                'EM'     : [(0,8,'EM1'), (8,16,'EM2')],
-                                'TAU'    : [(0,8,'TAU1'), (8,16,'TAU2')],
-                                'JET'    : [(0,10,'JET1'), (10,25,'JET2')],
+                                'EM'     : [(0,8,'EM1'), (8,16,'EM2'), (16, 20, 'EM1'), (20, 26, 'EM2')],
+                                'TAU'    : [(0,8,'TAU1'), (8,16,'TAU2'), (16, 19, 'TAU1'), (19, 24, 'TAU2')],
+                                'JET'    : [(0,10,'JET1'), (10,25,'JET2'), (25, 33, 'JET1'), (33, 42, 'JET2')],
                                 'TE'     : [(0,8,'EN1'),(8,16,'EN2')],
-                                'XE'     : [(0,8,'EN1'),(8,16,'EN2')],
+                                'XE'     : [(0,8,'EN1'),(8,16,'EN2'), (16, 24, 'EN1')],
                                 'XS'     : [(0,8,'EN1')],
-                                'MBTSSI' : [(0,12,'NIM1'),(12,24,'NIM2')],
+                                'MBTSSI' : [(0,16,'NIM1'),(16,32,'NIM2')],
                                 'MBTS'   : [(0,1,'NIM1'), (1,2,'NIM2')],
                                 'LUCID'  : [(0,6,'CTPCAL')],
                                 'ZDC'    : [(0,3,'CTPCAL')],
@@ -150,11 +157,12 @@ class Cabling(object):
     @staticmethod
     def calcBitnum(thrtype):
         # get the widths for the threshold types is defined in L1Common
-        return getattr (Limits, '%s_bitnum' % thrtype)
+        nbits = getattr(Limits,'%s_bitnum' % thrtype)
+        return nbits
 
 
 
-class InputCable(object):
+class InputCable:
         
     def __fillTopoInputs(self, threshold):
         # CTPCORE
@@ -166,11 +174,12 @@ class InputCable(object):
         self.clock       = threshold.clock
         self.range_begin = threshold.bitOnCable
         self.range_end   = threshold.bitOnCable+self.bitnum-1
-        
+
         log.debug( 'Threshold type %s (mapping=%i) comes in on CTPCore on cable %s, bit %s, clock %i',
                    self.thrtype, self.mapping, self.connector,
                    ("%i" % self.range_begin) if self.bitnum==1 else ("%i-%i" % (self.range_begin, self.range_end)), self.clock )
 
+
     def __fillAlfaInputs(self, threshold):
         # CTPCORE
         self.isDirectIn = True
@@ -180,11 +189,13 @@ class InputCable(object):
         self.clock = self.mapping / 32
         self.range_begin = self.mapping % 32
         self.range_end   = self.range_begin
-           
+
         log.debug( 'Threshold type %s (mapping=%i) comes in on CTPCore on cable %s, bit %s, clock %i',
                    self.thrtype, self.mapping, self.connector,
                    ("%i" % self.range_begin) if self.bitnum==1 else ("%i-%i" % (self.range_begin, self.range_end)), self.clock )
 
+ 
+
     def __fillCTPIn(self):
         self.name = Cabling.getCableName(self.thrtype,self.mapping)
 
@@ -194,6 +205,7 @@ class InputCable(object):
                    ("%i" % self.range_begin) if self.bitnum==1 else ("%i-%i" % (self.range_begin, self.range_end)) )
 
 
+
     def __init__(self, threshold ):
 
         if threshold.ttype == 'ZB':
@@ -201,6 +213,17 @@ class InputCable(object):
         else:
             self.thrtype = threshold.ttype
         self.mapping = int(threshold.mapping)
+        thrtype = self.thrtype
+        mapping = self.mapping
+        if thrtype == 'EM' and mapping >= 16:
+            mapping = 15
+        elif thrtype == 'TAU' and mapping >= 16:
+            mapping = 15
+        elif thrtype == 'JET' and mapping >= 25:
+            mapping = 24
+        elif thrtype == 'XE' and mapping >=16:
+            mapping = 15
+        self.mapping = mapping
 
         self.isDirectIn  = False # True for TOPO and ALFA which go into CTPCore
         self.slot        = None  # input cable slot, possible values 7..9
@@ -236,6 +259,21 @@ class InputCable(object):
             cableAssign += self.getCTPINCableAssignment("TAU")
 
         offset = self.mapping
+        name = Cabling.getCableName(self.thrtype,self.mapping)
+        if name == 'EM1' and self.mapping >= 16: 
+            offset -= 16
+        elif name == 'EM2' and self.mapping >= 20:
+            offset -= 12
+        elif name == 'TAU1' and self.mapping >= 16:
+            offset -= 16
+        elif name == 'TAU2' and self.mapping >= 19:
+            offset -= 11
+        elif name == 'JET1' and self.mapping >= 25:
+            offset -= 25
+        elif name == 'JET2' and self.mapping >= 33:
+            offset -= 23
+        elif self.thrtype == 'XE' and name == 'EN1' and self.mapping >= 16:
+            offset -= 16
         for (slot, connector, start, stop, bitnum) in cableAssign:
 
             self.bitnum = bitnum
@@ -243,6 +281,7 @@ class InputCable(object):
             delta = (stop - start + 1) / self.bitnum
             log.debug( 'Cable SLOT%i / CON%i has room for %i thresholds of type %s', slot, connector, delta, self.thrtype )
 
+
             if offset >= delta: # does not fit on this connector (only 0 to offset-1 will fit)
                 offset -= delta # move to the next cable for checking
                 continue
@@ -252,7 +291,6 @@ class InputCable(object):
             self.range_begin = start + offset * self.bitnum
             self.range_end   = self.range_begin + self.bitnum-1
             break
-
         if not self.connector:
             log.error("Cable mapping ERROR %s", cableAssign)
             raise RuntimeError("No cable has been assigned to threshold type '%s' with mapping %i" % (self.thrtype,self.mapping))
@@ -266,8 +304,7 @@ class InputCable(object):
         """
         Gets the cable assignment from L1Common
         """
-        cable = getattr (Limits, "%s_cable" % thrtype)
-        
+        cable = getattr(Limits,'%s_cable' % thrtype)
         # we change the format for run 2, the tuple now contains also the bit multiplicity, as it is not constant per type
         infosize = (len(cable)-1)/cable[0]
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
index dd7b54512963f72d2fc5dbc2a16e6332e16b8369..a1c06071100e05964d84b4f61ea2478018ca40a4 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
@@ -83,31 +83,35 @@ class ItemDef(object):
         LVL1MenuItem('L1_EM10'      ).setLogic( d.EM10       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM24VHI'   ).setLogic( d.EM24VHI    & physcond).setTriggerType( TT.calo)
         LVL1MenuItem('L1_EM8'       ).setLogic( d.EM8        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM8I'      ).setLogic( d.EM8I       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM12'      ).setLogic( d.EM12       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM14'      ).setLogic( d.EM14       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15'      ).setLogic( d.EM15       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15_BGRP7').setLogic( d.EM15       & bgrp7cond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15I'     ).setLogic( d.EM15 & d.EM8I      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI'    ).setLogic( d.EM15HI      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM26VHI'   ).setLogic( d.EM26VHI    & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VHI'   ).setLogic( d.EM15VHI    & physcond).setTriggerType( TT.calo )   
         LVL1MenuItem('L1_EM16'      ).setLogic( d.EM16       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM8VH'     ).setLogic( d.EM8VH      & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM8VH'     ).setLogic( d.EM8VH      & physcond).setTriggerType( TT.calo )           # noqa: F821
         LVL1MenuItem('L1_EM10VH'    ).setLogic( d.EM10VH     & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM20A'     ).setLogic( d.EM20A      & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM20C'     ).setLogic( d.EM20C      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM13VH'    ).setLogic( d.EM13VH     & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15VH'    ).setLogic( d.EM15VH     & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM18'      ).setLogic( d.EM18       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM18VH'    ).setLogic( d.EM18VH     & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM18VHI'   ).setLogic( d.EM18VHI    & physcond).setTriggerType( TT.calo )      # noqa: F821
         LVL1MenuItem('L1_EM20'      ).setLogic( d.EM20       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM20VH'    ).setLogic( d.EM20VH     & physcond).setTriggerType( TT.calo )  
         LVL1MenuItem('L1_EM20VHI'   ).setLogic( d.EM20VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
+        LVL1MenuItem('L1_EM30VHI'   ).setLogic( d.EM30VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
         LVL1MenuItem('L1_EM22'      ).setLogic( d.EM22       & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM22VH'    ).setLogic( d.EM22VH      & physcond).setTriggerType( TT.calo )    # noqa: F821
         LVL1MenuItem('L1_EM22VHI'   ).setLogic( d.EM22VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
+        LVL1MenuItem('L1_EM24VHIM'   ).setLogic( d.EM24VHIM   & physcond).setTriggerType( TT.calo )    # noqa: F821
         LVL1MenuItem('L1_EM50V'     ).setLogic( d.EM50V      & physcond).setTriggerType( TT.calo )
 
 
+   
+
+
+
 
         # 2xEM, 3xEM
         LVL1MenuItem('L1_2EM3'           ).setLogic( d.EM3.x(2)             & physcond).setTriggerType( TT.calo )
@@ -115,25 +119,25 @@ class ItemDef(object):
         LVL1MenuItem('L1_2EM7'           ).setLogic( d.EM7.x(2)             & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_2EM10'          ).setLogic( d.EM10.x(2)            & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_2EM10VH'        ).setLogic( d.EM10VH.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM13VH'        ).setLogic( d.EM13VH.x(2)          & physcond).setTriggerType( TT.calo )                
         LVL1MenuItem('L1_2EM15'          ).setLogic( d.EM15.x(2)            & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_2EM15VH'        ).setLogic( d.EM15VH.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM18VH'        ).setLogic( d.EM18VH.x(2)          & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_2EM15VHI'       ).setLogic( d.EM15VHI.x(2)      & physcond).setTriggerType( TT.calo )        # noqa: F821
         LVL1MenuItem('L1_2EM20VH'        ).setLogic( d.EM20VH.x(2)          & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM7_2EM3'       ).setLogic( d.EM7 & d.EM3.x(2)       & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM12_2EM3'      ).setLogic( d.EM12 & d.EM3.x(2)      & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM20VH_2EM7'    ).setLogic( d.EM20VH & d.EM7.x(2)    & physcond).setTriggerType( TT.calo )        
 
         LVL1MenuItem('L1_EM20VH_3EM10VH' ).setLogic( d.EM20VH & d.EM10VH.x(3)    & physcond).setTriggerType( TT.calo )        
-        LVL1MenuItem('L1_EM20VH_2EM10VH_3EM8VH' ).setLogic( d.EM20VH & d.EM10VH.x(2) & d.EM8VH.x(3)    & physcond).setTriggerType( TT.calo )        
+        LVL1MenuItem('L1_EM20VH_2EM10VH_3EM8VH' ).setLogic( d.EM20VH & d.EM10VH.x(2) & d.EM8VH.x(3)    & physcond).setTriggerType( TT.calo )
+
+
+
 
         # 4xEM
         LVL1MenuItem('L1_EM15VH_3EM7'         ).setLogic( d.EM15VH & d.EM7.x(3)    & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15VH_3EM8VH'       ).setLogic( d.EM15VH & d.EM8VH.x(3)    & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15VH_3EM10VH'      ).setLogic( d.EM15VH & d.EM10VH.x(3)    & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15VH_2EM10VH_3EM7' ).setLogic( d.EM15VH & d.EM10VH.x(2) & d.EM7.x(3)     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM18VH_3EM8VH'       ).setLogic( d.EM18VH & d.EM8VH.x(3)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM18VH_2EM10VH_3EM7' ).setLogic( d.EM18VH & d.EM10VH.x(2) & d.EM7.x(3)     & physcond).setTriggerType( TT.calo )
 
         # EM and jet
         LVL1MenuItem('L1_JJ15.23ETA49' ).setLogic( d.JJ1523ETA49 & physcond).setTriggerType(TT.calo)
@@ -152,18 +156,10 @@ class ItemDef(object):
         LVL1MenuItem('L1_J20.0ETA28'  ).setLogic( d.J200ETA28 & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_J25.0ETA23'  ).setLogic( d.J250ETA23 & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_J35.0ETA23'  ).setLogic( d.J350ETA23 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20.0ETA49'  ).setLogic( d.J200ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.0ETA49'  ).setLogic( d.J300ETA49 & physcond).setTriggerType(TT.calo)
         
 
 
 
-
-
-
-
-
-
         # HI
         LVL1MenuItem('L1_EM3_NZ'         ).setLogic( d.EM3      & Not(d.ZDC_AND) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_2EM3_NZ'        ).setLogic( d.EM3.x(2) & Not(d.ZDC_AND) & physcond).setTriggerType( TT.calo )   
@@ -210,6 +206,7 @@ class ItemDef(object):
         LVL1MenuItem('L1_MU11' ).setLogic( d.MU11 & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_MU15' ).setLogic( d.MU15 & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_MU20' ).setLogic( d.MU20 & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU21' ).setLogic( d.MU21 & physcond).setTriggerType(TT.muon)    
 
         # 2xMU, 3xMU, 4xMU
         LVL1MenuItem('L1_2MU0'     ).setLogic( d.MU0.x(2)        & physcond).setTriggerType(TT.muon)
@@ -222,6 +219,7 @@ class ItemDef(object):
         LVL1MenuItem('L1_MU6_MU4' ).setLogic( d.MU6 & d.MU4      & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_MU10_2MU6').setLogic( d.MU10 & d.MU6.x(2) & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_MU11_2MU6').setLogic( d.MU11 & d.MU6.x(2) & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_MU11_2MU10').setLogic( d.MU11 & d.MU10.x(2) & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_MU10_2MU4').setLogic( d.MU10 & d.MU4.x(2) & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_3MU4'     ).setLogic( d.MU4.x(3)        & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_4MU4'     ).setLogic( d.MU4.x(4)        & physcond).setTriggerType(TT.muon)
@@ -255,13 +253,6 @@ class ItemDef(object):
         LVL1MenuItem('L1_MU4_TE120' ).setLogic( d.MU4     & d.TE120 & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_MU4_TE160' ).setLogic( d.MU4     & d.TE160 & physcond).setTriggerType(TT.muon)
         
-        LVL1MenuItem('L1_MU4_TE10.0ETA24' ).setLogic( d.MU4      & d.TE100ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE15.0ETA24' ).setLogic( d.MU4      & d.TE150ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE20.0ETA24' ).setLogic( d.MU4      & d.TE200ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE25.0ETA24' ).setLogic( d.MU4      & d.TE250ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE30.0ETA24' ).setLogic( d.MU4     & d.TE300ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE35.0ETA24' ).setLogic( d.MU4      & d.TE350ETA24 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE40.0ETA24' ).setLogic( d.MU4      & d.TE400ETA24 & physcond).setTriggerType(TT.muon)
         
         LVL1MenuItem('L1_MU0_VTE50').setLogic( d.MU0      & Not(d.TE50) & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_MU4_VTE50').setLogic( d.MU4      & Not(d.TE50) & physcond).setTriggerType(TT.muon)
@@ -297,18 +288,21 @@ class ItemDef(object):
         LVL1MenuItem('L1_EM6_MU10'   ).setLogic( d.EM6        & d.MU10     & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_EM7_MU10'   ).setLogic( d.EM7        & d.MU10     & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_EM7_MU15'   ).setLogic( d.EM7        & d.MU15     & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_EM7_MU20'   ).setLogic( d.EM7        & d.MU20     & physcond).setTriggerType(TT.muon)   
         LVL1MenuItem('L1_EM8VH_MU15' ).setLogic( d.EM8VH      & d.MU15     & physcond).setTriggerType(TT.muon)
+        LVL1MenuItem('L1_EM8VH_MU20' ).setLogic( d.EM8VH      & d.MU20     & physcond).setTriggerType(TT.muon)   
         LVL1MenuItem('L1_EM8_MU10'   ).setLogic( d.EM8        & d.MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM8I_MU10'  ).setLogic( d.EM8I       & d.MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM15I_MU4'   ).setLogic( d.EM15  & d.EM8I     & d.MU4      & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_EM15VH_MU10').setLogic( d.EM15VH     & d.MU10     & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_EM3_MU20'   ).setLogic( d.EM3        & d.MU20     & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_2EM8VH_MU10').setLogic( d.EM8VH.x(2) & d.MU10     & physcond).setTriggerType(TT.muon)
         LVL1MenuItem('L1_EM15VH_2EM8VH_MU6').setLogic( d.EM15VH & d.EM8VH.x(2) &  d.MU6 & physcond).setTriggerType(TT.muon)
 
         # TAU ctpid=[0x40:0x4f]
+        LVL1MenuItem('L1_TAU5'  ).setLogic( d.HA5   & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU6'  ).setLogic( d.HA6   & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU8'  ).setLogic( d.HA8   & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_2TAU5' ).setLogic( d.HA5.x(2)  & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_2TAU8' ).setLogic( d.HA8.x(2)  & physcond).setTriggerType(TT.calo)
 
         #LVL1MenuItem('L1_TAU10IM').setLogic( d.HA10IM  & physcond).setTriggerType( TT.calo )
 
@@ -316,7 +310,6 @@ class ItemDef(object):
 
         LVL1MenuItem('L1_TAU12IL').setLogic( d.HA12IL & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU12IM').setLogic( d.HA12IM & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12IT').setLogic( d.HA12IT & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU12I').setLogic( d.HA12I & physcond).setTriggerType( TT.calo )
 
         LVL1MenuItem('L1_TAU15' ).setLogic( d.HA15  & physcond).setTriggerType( TT.calo )
@@ -324,17 +317,16 @@ class ItemDef(object):
         LVL1MenuItem('L1_TAU20' ).setLogic( d.HA20  & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IL' ).setLogic( d.HA20IL  & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IM' ).setLogic( d.HA20IM  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IT' ).setLogic( d.HA20IT  & physcond).setTriggerType( TT.calo )
         
         LVL1MenuItem('L1_TAU20A' ).setLogic( d.HA20A  & physcond).setTriggerType( TT.calo ) 
         LVL1MenuItem('L1_TAU20C' ).setLogic( d.HA20C  & physcond).setTriggerType( TT.calo ) 
 
         LVL1MenuItem('L1_TAU25' ).setLogic( d.HA25  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU25IT' ).setLogic( d.HA25IT  & physcond).setTriggerType( TT.calo )
 
         LVL1MenuItem('L1_TAU30' ).setLogic( d.HA30  & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU40' ).setLogic( d.HA40  & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU60' ).setLogic( d.HA60  & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU90' ).setLogic( d.HA90  & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU100' ).setLogic( d.HA100  & physcond).setTriggerType( TT.calo )
 
         LVL1MenuItem('L1_TAU8_UNPAIRED_ISO'   ).setLogic( d.HA8   & unpaired_isocond ).setTriggerType( TT.calo ) 
@@ -356,13 +348,11 @@ class ItemDef(object):
         LVL1MenuItem('L1_TAU20_2TAU12I' ).setLogic( d.HA20 & d.HA12I.x(2) &  physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU40_2TAU20IM' ).setLogic( d.HA40 & d.HA20IM.x(2) &  physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IM_2TAU12IM' ).setLogic( d.HA20IM & d.HA12IM.x(2) &  physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU60_2TAU40').setLogic( d.HA60 & d.HA40.x(2)  & physcond).setTriggerType( TT.calo )
 
         # mixed tau
         LVL1MenuItem('L1_EM15VH_2TAU12'                ).setLogic( d.EM15VH  & d.HA12.x(2)          & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15VH_2TAU12IL'              ).setLogic( d.EM15VH  & d.HA12IL.x(2)        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12'                ).setLogic( d.EM15HI  & d.HA12.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12IL'              ).setLogic( d.EM15HI  & d.HA12IL.x(2)        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12IM'              ).setLogic( d.EM15HI  & d.HA12IM.x(2)        & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15_2TAU12'                  ).setLogic( d.EM15    & d.HA12.x(2)          & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15_2TAU20'                  ).setLogic( d.EM15    & d.HA20.x(2)          & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM15VH_2TAU20'                ).setLogic( d.EM15VH  & d.HA20.x(2)          & physcond).setTriggerType( TT.calo )
@@ -370,10 +360,6 @@ class ItemDef(object):
         LVL1MenuItem('L1_EM15HI_TAU40_2TAU15'          ).setLogic( d.EM15HI  & d.HA40 & d.HA15.x(2)   & physcond).setTriggerType( TT.calo )
 
         LVL1MenuItem('L1_EM15_2TAU12_J25_2J15_3J12'    ).setLogic( d.EM15  & d.HA12.x(2)  & d.J25 & d.J15.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12I_J25_2J15_3J12'  ).setLogic( d.EM15HI  & d.HA12I.x(2)  & d.J25 & d.J15.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12IM_J25_3J12'  ).setLogic( d.EM15HI  & d.HA12IM.x(2)  & d.J25 & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12IL_J25_3J12'  ).setLogic( d.EM15HI  & d.HA12IL.x(2)  & d.J25 & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12_J25_3J12'  ).setLogic( d.EM15HI  & d.HA12.x(2)  & d.J25 & d.J12.x(3) & physcond).setTriggerType( TT.calo )
 
         LVL1MenuItem('L1_MU10_TAU12'       ).setLogic( d.MU10  & d.HA12          & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12I'      ).setLogic( d.MU10  & d.HA12I         & physcond).setTriggerType( TT.calo )
@@ -389,14 +375,17 @@ class ItemDef(object):
         LVL1MenuItem('L1_MU10_TAU12_J25_2J12' ).setLogic( d.MU10 & d.HA12 & d.J25 & d.J12.x(2)     & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12IM_J25_2J12' ).setLogic( d.MU10 & d.HA12IM & d.J25 & d.J12.x(2)    & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12IL_J25_2J12' ).setLogic( d.MU10 & d.HA12IL & d.J25 & d.J12.x(2)    & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU25IM_2TAU20IM_2J25_3J20').setLogic( d.HA25IM & d.HA20IM.x(2)     & d.J25.x(2)  & d.J20.x(3) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU12I_MU10_J20.31ETA49' ).setLogic( d.HA12I & d.MU10 & d.J2031ETA49    & physcond).setTriggerType( TT.calo )
-
+        LVL1MenuItem('L1_MU10_TAU12IM_3J12' ).setLogic( d.MU10 & d.HA12IM & d.J12.x(3)    & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12.0ETA23').setLogic( d.HA20IM & d.HA12IM.x(2)  & d.J120ETA23.x(4) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12.0ETA25').setLogic( d.HA20IM & d.HA12IM.x(2)  & d.J120ETA25.x(4) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12.0ETA28').setLogic( d.HA20IM & d.HA12IM.x(2)  & d.J120ETA28.x(4) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20_2TAU12I_J25_2J15_3J12'   ).setLogic( d.HA20 & d.HA12I.x(2)     & d.J25 & d.J15.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20_2TAU12_J25_2J20_3J12'   ).setLogic( d.HA20 & d.HA12.x(2)     & d.J25 & d.J20.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IM_2TAU12IM_J25_2J20_3J12').setLogic( d.HA20IM & d.HA12IM.x(2)     & d.J25 & d.J20.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IL_2TAU12IL_J25_2J20_3J12').setLogic( d.HA20IL & d.HA12IL.x(2)     & d.J25 & d.J20.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
 
-        LVL1MenuItem('L1_TAU25IT_2TAU12IT_2J25_3J12').setLogic( d.HA25IT & d.HA12IT.x(2)     & d.J25.x(2)  & d.J12.x(3) & physcond).setTriggerType( TT.calo )
 
         LVL1MenuItem('L1_2TAU12I_TAU20_J25_2J15_3J12'  ).setLogic( d.HA12I.x(2)   & d.HA20  & d.J25 & d.J15.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20_2J20_XE45'              ).setLogic( d.HA20    & d.J20.x(2)   & d.XE45 & physcond).setTriggerType( TT.calo )
@@ -406,20 +395,18 @@ class ItemDef(object):
         LVL1MenuItem('L1_TAU20_2TAU12_XE35'            ).setLogic( d.HA20    & d.HA12.x(2)  & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE35'        ).setLogic( d.HA20IM  & d.HA12IM.x(2)  & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IL_2TAU12IL_XE35'        ).setLogic( d.HA20IL  & d.HA12IL.x(2)  & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IT_2TAU12IT_XE35'        ).setLogic( d.HA20IT  & d.HA12IT.x(2)  & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE40'        ).setLogic( d.HA20IM  & d.HA12IM.x(2)  & d.XE40 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40_2TAU12IM_XE40'        ).setLogic( d.HA40  & d.HA12IM.x(2)  & d.XE40 & physcond).setTriggerType( TT.calo )   
-        LVL1MenuItem('L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15'          ).setLogic( d.EM15HI  &  d.HA20IM  &  d.HA15.x(2) &  d.J25  & d.J20.x(2) & d.J15.x(3) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_TAU40_2TAU12IM_XE40'          ).setLogic( d.HA40  & d.HA12IM.x(2)  & d.XE40 & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VHI_2TAU12IM'             ).setLogic( d.EM15VHI  & d.HA12IM.x(2)        & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VHI_TAU40_2TAU15'          ).setLogic( d.EM15VHI  & d.HA40 & d.HA15.x(2)   & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VHI_2TAU12IM_J25_3J12'    ).setLogic( d.EM15VHI  & d.HA12IM.x(2)  & d.J25 & d.J12.x(3) & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VHI_2TAU12IM_4J12'        ).setLogic( d.EM15VHI  & d.HA12IM.x(2) & d.J12.x(4) & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_EM20VHI_TAU20IM_2TAU20_J25_3J20'          ).setLogic( d.EM20VHI  &  d.HA20IM  &  d.HA20.x(2) &  d.J25  & d.J20.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12I_XE35'          ).setLogic( d.EM15HI  & d.HA12I.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12IM_XE35'         ).setLogic( d.EM15HI  & d.HA12IM.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12IL_XE35'         ).setLogic( d.EM15HI  & d.HA12IL.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_2TAU12_XE35'         ).setLogic( d.EM15HI  & d.HA12.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
+        LVL1MenuItem('L1_EM15VHI_2TAU12IM_XE35'        ).setLogic( d.EM15VHI  & d.HA12IM.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12I_XE35'             ).setLogic( d.MU10    & d.HA12I      & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12_XE35'              ).setLogic( d.MU10    & d.HA12       & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12IL_XE35'            ).setLogic( d.MU10    & d.HA12IL     & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12IM_XE35'            ).setLogic( d.MU10    & d.HA12IM     & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IT_XE35'            ).setLogic( d.MU10    & d.HA12IT     & d.XE35 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_MU10_TAU12IM_XE40'            ).setLogic( d.MU10    & d.HA12IM     & d.XE40 & physcond).setTriggerType( TT.calo )
         LVL1MenuItem('L1_TAU20I_2TAU12I_XE35'          ).setLogic( d.HA20I   & d.HA12I.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
 
@@ -503,16 +490,19 @@ class ItemDef(object):
         LVL1MenuItem('L1_4J10'   ).setLogic( d.J10.x(4)    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_4J15'   ).setLogic( d.J15.x(4)    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_4J20'   ).setLogic( d.J20.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J20.0ETA49').setLogic( d.J200ETA49.x(4) & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_4J30'   ).setLogic( d.J30.x(4)    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_6J15'   ).setLogic( d.J15.x(6)    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_J75_3J20' ).setLogic( d.J75 & d.J20.x(3)    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_J85_3J30' ).setLogic( d.J85 & d.J30.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.0ETA49_2J20.0ETA49' ).setLogic( d.J300ETA49 & d.J200ETA49.x(2)    & physcond).setTriggerType(TT.calo)
+#        LVL1MenuItem('L1_4J20.0ETA49').setLogic( d.J200ETA49.x(4) & physcond).setTriggerType(TT.calo)    # noqa: F821
+        LVL1MenuItem('L1_J30.0ETA49_2J20.0ETA49' ).setLogic( d.J300ETA49 & d.J200ETA49.x(2)    & physcond).setTriggerType(TT.calo)    # noqa: F821
         LVL1MenuItem('L1_J15.0ETA25_2J15.31ETA49' ).setLogic( d.J150ETA25 & d.J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_J40.0ETA25_2J15.31ETA49' ).setLogic( d.J400ETA25 & d.J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_J40.0ETA25_2J25_J20.31ETA49' ).setLogic( d.J400ETA25 & d.J25.x(2) & d.J2031ETA49   & physcond).setTriggerType(TT.calo) 
         LVL1MenuItem('L1_J40.0ETA25_2J30_J20.31ETA49' ).setLogic( d.J400ETA25 & d.J30.x(2) & d.J2031ETA49   & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J45.0ETA20_3J15.0ETA25'  ).setLogic( d.J450ETA20 & d.J150ETA25.x(3) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J50_2J40.0ETA25_3J15.0ETA25'  ).setLogic( d.J50 & d.J400ETA25.x(2) & d.J150ETA25.x(3) & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_J25.0ETA23_2J15.31ETA49'  ).setLogic( d.J250ETA23 & d.J1531ETA49.x(2) & physcond).setTriggerType(TT.calo)
 
         LVL1MenuItem('L1_4J17.0ETA22' ).setLogic( d.J170ETA22.x(4) & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_3J25.0ETA23' ).setLogic( d.J250ETA23.x(3) & physcond).setTriggerType(TT.calo)
@@ -538,21 +528,20 @@ class ItemDef(object):
         LVL1MenuItem('L1_2J40_XE45').setLogic( d.J40.x(2) & d.XE45 & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_2J50_XE40').setLogic( d.J50.x(2) & d.XE50 & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_J40_XE60').setLogic( d.J40 & d.XE60 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30.0ETA49_XE50').setLogic( d.J300ETA49 & d.XE50 & physcond).setTriggerType(TT.calo)
 
         LVL1MenuItem('L1_3J15.0ETA25_XE40').setLogic( d.J150ETA25.x(3) & d.XE40 & physcond).setTriggerType(TT.calo)
         
         # combined em - jet
         LVL1MenuItem('L1_EM15VH_JJ15.23ETA49' ).setLogic( d.EM15VH  & d.JJ1523ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM13VH_3J20' ).setLogic( d.EM13VH  & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
         ### ATR-15524
-        LVL1MenuItem('L1_EM18VH_3J20' ).setLogic( d.EM18VH  & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_EM18VHI_3J20' ).setLogic( d.EM18VHI  & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_EM20VH_3J20' ).setLogic( d.EM20VH  & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
 
         # combined mu - jet
         LVL1MenuItem('L1_MU4_J12'   ).setLogic( d.MU4 & d.J12    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_MU6_J20'   ).setLogic( d.MU6 & d.J20    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J30.0ETA49_2J20.0ETA49').setLogic( d.MU6 & d.J300ETA49 & d.J200ETA49.x(2) & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_MU6_J40'   ).setLogic( d.MU6 & d.J40    & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_MU6_J30.0ETA49_2J20.0ETA49').setLogic( d.MU6 & d.J300ETA49 & d.J200ETA49.x(2) & physcond).setTriggerType(TT.calo)    # noqa: F821
         LVL1MenuItem('L1_MU6_J75'   ).setLogic( d.MU6 & d.J75    & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_MU4_3J15'  ).setLogic( d.MU4 & d.J15.x(3)  & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_MU4_3J20'  ).setLogic( d.MU4 & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
@@ -562,9 +551,14 @@ class ItemDef(object):
         LVL1MenuItem('L1_MU10_2J20'  ).setLogic( d.MU10 & d.J20.x(2)  & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_MU10_2J15_J20'  ).setLogic( d.MU10 & d.J15.x(2) & d.J20  & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_MU4_J50_XE40'   ).setLogic( d.MU4 & d.J50 & d.XE40  & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_2MU4_J40_XE50'  ).setLogic( d.MU4.x(2) & d.J40 & d.XE50  & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_2MU4_J40_XE20'  ).setLogic( d.MU4.x(2) & d.J40 & d.XE20  & physcond).setTriggerType(TT.calo)
+        LVL1MenuItem('L1_MU4_J30_XE40_DPHI-J20s2XE30').setLogic( d.MU4 & d.J30 & d.XE40 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
+        LVL1MenuItem('L1_MU4_J50_XE50_DPHI-J20s2XE30').setLogic( d.MU4 & d.J50 & d.XE50 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
         LVL1MenuItem('L1_MU20_J40'  ).setLogic( d.MU20 & d.J40 & physcond).setTriggerType(TT.calo) ## ATR-14377
+        LVL1MenuItem('L1_MU20_J50'  ).setLogic( d.MU20 & d.J50  & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_MU20_XE30' ).setLogic( d.MU20 & d.XE30 & physcond) ## ATR-14377
+        LVL1MenuItem('L1_MU4_XE60'  ).setLogic( d.MU4 & d.XE60  & physcond).setTriggerType(TT.calo)
         # HI
         LVL1MenuItem('L1_J15_NZ' ).setLogic( d.J15      & Not(d.ZDC_AND) & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_2J15_NZ').setLogic( d.J15.x(2) & Not(d.ZDC_AND) & physcond).setTriggerType(TT.calo)   
@@ -643,31 +637,6 @@ class ItemDef(object):
         LVL1MenuItem('L1_TE12000').setLogic( d.TE12000 & physcond).setTriggerType(TT.calo)
         LVL1MenuItem('L1_TE14000').setLogic( d.TE14000 & physcond).setTriggerType(TT.calo)
 
-        LVL1MenuItem('L1_TE0.0ETA24').setLogic( d.TE00ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3.0ETA24').setLogic( d.TE30ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5.0ETA24').setLogic( d.TE50ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE10.0ETA24').setLogic( d.TE100ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE15.0ETA24').setLogic( d.TE150ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE20.0ETA24').setLogic( d.TE200ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE25.0ETA24').setLogic( d.TE250ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE30.0ETA24').setLogic( d.TE300ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE35.0ETA24').setLogic( d.TE350ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE40.0ETA24').setLogic( d.TE400ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE45.0ETA24').setLogic( d.TE450ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE50.0ETA24').setLogic( d.TE500ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE55.0ETA24').setLogic( d.TE550ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE60.0ETA24').setLogic( d.TE600ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE65.0ETA24').setLogic( d.TE650ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE70.0ETA24').setLogic( d.TE700ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE80.0ETA24').setLogic( d.TE800ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE110.0ETA24').setLogic( d.TE1100ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE150.0ETA24').setLogic( d.TE1500ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE180.0ETA24').setLogic( d.TE1800ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE2000.0ETA24').setLogic( d.TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5000.0ETA24').setLogic( d.TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE6500.0ETA24').setLogic( d.TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE8000.0ETA24').setLogic( d.TE20000ETA24 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE9000.0ETA24').setLogic( d.TE20000ETA24 & physcond).setTriggerType(TT.calo)
 
   # HI items
         LVL1MenuItem('L1_TE500.0ETA49').setLogic( d.TE5000ETA49 & physcond).setTriggerType(TT.calo)
@@ -1255,19 +1224,11 @@ class ItemDef(object):
 
                     # B-jet
                     LVL1MenuItem('L1_BTAG-MU4J15').setLogic( d.TOPO_0DR04_MU4ab_CJ15ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU4J30').setLogic( d.TOPO_0DR04_MU4ab_CJ30ab & physcond)
                     LVL1MenuItem('L1_BTAG-MU6J20').setLogic( d.TOPO_0DR04_MU6ab_CJ20ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU6J25').setLogic( d.TOPO_0DR04_MU6ab_CJ25ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU4J20').setLogic( d.TOPO_0DR04_MU4ab_CJ20ab & physcond)
-                    LVL1MenuItem('L1_3J15_BTAG-MU4J15').setLogic( d.J15.x(3) & d.TOPO_0DR04_MU4ab_CJ15ab & physcond)
-                    LVL1MenuItem('L1_3J15_BTAG-MU4J30').setLogic( d.J15.x(3) & d.TOPO_0DR04_MU4ab_CJ30ab & physcond)
-                    LVL1MenuItem('L1_3J15_BTAG-MU6J25').setLogic( d.J15.x(3) & d.TOPO_0DR04_MU6ab_CJ25ab & physcond)
-                    LVL1MenuItem('L1_3J20_BTAG-MU4J20').setLogic( d.J20.x(3) & d.TOPO_0DR04_MU4ab_CJ20ab & physcond)
-                    #LVL1MenuItem('L1_3J20_BTAG-MU4J30').setLogic( d.J20.x(3) & d.TOPO_0DR04_MU4ab_CJ30ab & physcond)
-                    #LVL1MenuItem('L1_3J20_BTAG-MU6J25').setLogic( d.J20.x(3) & d.TOPO_0DR04_MU6ab_CJ25ab & physcond)
+
 
                     # ZH
-                    LVL1MenuItem('L1_DPHI-AJ20s2XE50'  ).setLogic( d.TOPO_10MINDPHI_AJ20s2_XE50    & physcond)
+                    #LVL1MenuItem('L1_DPHI-AJ20s2XE50'  ).setLogic( d.TOPO_10MINDPHI_AJ20s2_XE50    & physcond)
 
                     #LVL1MenuItem('L1_J40_DPHI-Js2XE50'  ).setLogic( d.J40 & d.TOPO_10MINDPHI_Js2_XE50    & physcond) 
                     LVL1MenuItem('L1_J40_DPHI-J20s2XE50').setLogic( d.J40 & d.TOPO_10MINDPHI_J20s2_XE50  & physcond) 
@@ -1279,21 +1240,26 @@ class ItemDef(object):
 
 
                     LVL1MenuItem('L1_J40_XE50_DPHI-J20s2XE50').setLogic( d.J40 & d.XE50 & d.TOPO_10MINDPHI_J20s2_XE50  & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-J20XE50'  ).setLogic( d.J40 & d.TOPO_10MINDPHI_J20ab_XE50  & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-CJ20XE50' ).setLogic( d.J40 & d.TOPO_10MINDPHI_CJ20ab_XE50 & physcond) 
+                    #LVL1MenuItem('L1_J40_DPHI-J20XE50'  ).setLogic( d.J40 & d.TOPO_10MINDPHI_J20ab_XE50  & physcond) 
+                    #LVL1MenuItem('L1_J40_DPHI-CJ20XE50' ).setLogic( d.J40 & d.TOPO_10MINDPHI_CJ20ab_XE50 & physcond) 
 
                     # HT
                     #LVL1MenuItem('L1_HT0-J0.ETA49'     ).setLogic( d.TOPO_HT0_AJ0allETA49    & physcond)
-                    LVL1MenuItem('L1_HT190-J15.ETA21'  ).setLogic( d.TOPO_HT190_AJ15allETA21 & physcond)
+                    #LVL1MenuItem('L1_HT190-J15.ETA21'  ).setLogic( d.TOPO_HT190_AJ15allETA21 & physcond)
                     LVL1MenuItem('L1_HT190-J15s5.ETA21').setLogic( d.TOPO_HT190_J15s5ETA21   & physcond)
-                    LVL1MenuItem('L1_HT150-J20.ETA31'  ).setLogic( d.TOPO_HT150_AJ20allETA31 & physcond)
+                    #LVL1MenuItem('L1_HT150-J20.ETA31'  ).setLogic( d.TOPO_HT150_AJ20allETA31 & physcond)
                     LVL1MenuItem('L1_HT150-J20s5.ETA31').setLogic( d.TOPO_HT150_J20s5ETA31   & physcond)
 
 
-                    LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400').setLogic( d.TOPO_HT150_J20s5ETA31 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)# new
-                    LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400-CF').setLogic( d.TOPO_HT150_J20s5ETA31 & d.TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond) #new 
+                    #LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400').setLogic( d.TOPO_HT150_J20s5ETA31 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)# new
+                    LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400-CF').setLogic( d.TOPO_HT150_J20s5ETA31 & d.TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond) #new
+                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI20').setLogic( d.TOPO_400INVM9999_0DPHI20_J30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI22').setLogic( d.TOPO_400INVM9999_0DPHI22_J30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI24').setLogic( d.TOPO_400INVM9999_0DPHI24_J30s6_AJ20s6 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI26').setLogic( d.TOPO_400INVM9999_0DPHI26_J30s6_AJ20s6 & physcond)    # noqa: F821
+
                     # Jpsi T&P
-                    LVL1MenuItem("L1_JPSI-1M5"     ).setLogic( d.TOPO_1INVM5_EMs1_EMs6   & physcond)
+                    #LVL1MenuItem("L1_JPSI-1M5"     ).setLogic( d.TOPO_1INVM5_EMs1_EMs6   & physcond)
                     LVL1MenuItem("L1_JPSI-1M5-EM7" ).setLogic( d.TOPO_1INVM5_EM7s1_EMs6  & physcond)
                     LVL1MenuItem("L1_JPSI-1M5-EM12").setLogic( d.TOPO_1INVM5_EM12s1_EMs6 & physcond)
 
@@ -1323,58 +1289,58 @@ class ItemDef(object):
                     #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30"           ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj20s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & d.XS30 & physcond)
                     #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE"                ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj20s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
                     #else:
-                    LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( d.TOPO_05MINDPHI_AJj10s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( d.TOPO_10MINDPHI_AJj10s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( d.TOPO_15MINDPHI_AJj10s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( d.TOPO_05MINDPHI_EM12s6_XE0  & physcond)
-
-                    LVL1MenuItem("L1_W-05DPHI-EM15XE-1"  ).setLogic( d.TOPO_05MINDPHI_EM15s6_XE0  & physcond)
-
-                    LVL1MenuItem("L1_W-15DPHI-EM15XE-1"  ).setLogic( d.TOPO_15MINDPHI_EM15s6_XE0  & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-EMXE-1"  ).setLogic( d.TOPO_15MINDPHI_EM12s6_XE0  & physcond)
-                    LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( d.TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)
-                    LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)
-                    LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( d.TOPO_HT20_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( d.TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( d.TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & d.TOPO_05RATIO_XE0_SUM0_EM10s1_HT0_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25").setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & physcond)
+#                    LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( d.TOPO_05MINDPHI_AJj10s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( d.TOPO_10MINDPHI_AJj10s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( d.TOPO_15MINDPHI_AJj10s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( d.TOPO_05MINDPHI_EM12s6_XE0  & physcond)
+#
+#                    LVL1MenuItem("L1_W-05DPHI-EM15XE-1"  ).setLogic( d.TOPO_05MINDPHI_EM15s6_XE0  & physcond)
+#
+#                    LVL1MenuItem("L1_W-15DPHI-EM15XE-1"  ).setLogic( d.TOPO_15MINDPHI_EM15s6_XE0  & physcond)
+#                    LVL1MenuItem("L1_W-15DPHI-EMXE-1"  ).setLogic( d.TOPO_15MINDPHI_EM12s6_XE0  & physcond)
+#                    LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( d.TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)
+#                    LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)
+#                    LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
+#                    LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( d.TOPO_HT20_AJj15allETA49 & physcond)
+#                    LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( d.TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)
+#                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( d.TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & d.TOPO_05RATIO_XE0_SUM0_EM10s1_HT0_AJj15allETA49 & physcond)
+                    #LVL1MenuItem("L1_EM12_W-MT25").setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & physcond)
                     #LVL1MenuItem("L1_EM12_W-MT30").setLogic( d.TOPO_30MT_EM12s6_XE0 & d.EM12 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & physcond)
+                    #LVL1MenuItem("L1_EM15_W-MT35").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & physcond)
 
-                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS40 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & physcond)
+                    #LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
+                    #LVL1MenuItem("L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
+                    #LVL1MenuItem("L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS40 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
+                    #LVL1MenuItem("L1_EM15_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & physcond)
 
-                    LVL1MenuItem("L1_EM15VH_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15VH & d.XS60 & physcond)
-                    LVL1MenuItem("L1_EM20VH_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM20VH & d.XS60 & physcond)
-                    LVL1MenuItem("L1_EM22VHI_W-MT35_XS40").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM22VHI & d.XS40 & physcond)
+                    #LVL1MenuItem("L1_EM15VH_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15VH & d.XS60 & physcond)
+                    #LVL1MenuItem("L1_EM20VH_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM20VH & d.XS60 & physcond)
+                    #LVL1MenuItem("L1_EM22VHI_W-MT35_XS40").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM22VHI & d.XS40 & physcond)
 
 
                     
-                    LVL1MenuItem("L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE"            ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS40 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM12s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & physcond)                    
-                    LVL1MenuItem("L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM12s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35_XS50").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS50 & physcond)
-                    LVL1MenuItem("L1_EM10VH_W-MT35_XS50").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM10VH & d.XS50 & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-EM15XE-0"  ).setLogic( d.TOPO_15MINDPHI_EM15s6_XE0  & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS40 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-                    LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( d.TOPO_15MINDPHI_EM12s6_XE0  & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE"            ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS30 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE"  ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-                    # Old
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0"   ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.XS30 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.XS20 & physcond)
-                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-
-
-                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30"         ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & d.XS30 & physcond)
-                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE"              ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-
+                    #LVL1MenuItem("L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE"            ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS40 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM12s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_EM12_W-MT35").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & physcond)                    
+#                    #LVL1MenuItem("L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM12s6_XE0 & physcond)
+#                    #LVL1MenuItem("L1_EM12_W-MT35_XS50").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS50 & physcond)
+#                    #LVL1MenuItem("L1_EM10VH_W-MT35_XS50").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM10VH & d.XS50 & physcond)
+#                    #LVL1MenuItem("L1_W-15DPHI-EM15XE-0"  ).setLogic( d.TOPO_15MINDPHI_EM15s6_XE0  & physcond)
+#                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS40 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( d.TOPO_15MINDPHI_EM12s6_XE0  & physcond)
+#                    LVL1MenuItem("L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE"            ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS30 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
+#                    LVL1MenuItem("L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE"  ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
+#                    # Old
+#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0"   ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)
+#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.XS30 & physcond)
+#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.XS20 & physcond)
+#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
+#
+#
+#                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30"         ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & d.XS30 & physcond)
+#                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE"              ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
+#
                     #LVL1MenuItem("L1_W-10DPHI-JXE-0").setLogic( d.TOPO_10MINDPHI_AJj15s2_XE0 & physcond)
                     #LVL1MenuItem("L1_W-20DPHI-JXE-1").setLogic( d.TOPO_20MINDPHI_AJjs6_XE0 & physcond)
                     #LVL1MenuItem("L1_W-20DPHI-JXE-0").setLogic( d.TOPO_20MINDPHI_AJj15s2_XE0 & physcond)
@@ -1407,35 +1373,34 @@ class ItemDef(object):
     #                     LVL1MenuItem("L1_BPH-DR-2MU6_BPH-4M8-2MU6").setLogic( d.TOPO_2DR15_2MU6ab & d.TOPO_4INVM8_2MU6ab & physcond)            
 
                     ##Combined L1Top 
-                    LVL1MenuItem('L1_DR-MU10TAU12I_TAU12I-J25').setLogic( d.TOPO_0DR28_MU10ab_TAU12abi &  d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
-                    LVL1MenuItem('L1_MU10_TAU12I-J25').setLogic( d.MU10 &  d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
+                    #LVL1MenuItem('L1_DR-MU10TAU12I_TAU12I-J25').setLogic( d.TOPO_0DR28_MU10ab_TAU12abi &  d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
+                    #LVL1MenuItem('L1_MU10_TAU12I-J25').setLogic( d.MU10 &  d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
                     #LVL1MenuItem('L1_XE35_EM15-TAU12I').setLogic( d.XE35 &  d.TOPO_DISAMB_EM15abhi_TAU12abi & physcond)  
                     #LVL1MenuItem('L1_XE40_EM15-TAU12I').setLogic( d.XE40 &  d.TOPO_DISAMB_EM15abhi_TAU12abiOB & physcond)  
                     #LVL1MenuItem('L1_XE45_TAU20-J20').setLogic( d.XE45 & d.TOPO_1DISAMB_TAU20ab_J20ab & physcond)
                     LVL1MenuItem('L1_J25_2J20_3J12_DR-TAU20ITAU12I').setLogic( d.J25 & d.J20.x(2) & d.J12.x(3) &  d.TOPO_0DR28_TAU20abi_TAU12abi & physcond)
                     #LVL1MenuItem('L1_J25_3J12_EM15-TAU12I').setLogic( d.J25 & d.J12.x(3) &  d.TOPO_DISAMB_EM15abhi_TAU12abi & physcond)  
-                    LVL1MenuItem('L1_J25_2J12_DR-MU10TAU12I').setLogic( d.J25 & d.J12.x(2) &  d.TOPO_0DR28_MU10ab_TAU12abi & physcond)
-                    LVL1MenuItem('L1_J25_2J20_3J12_BOX-TAU20ITAU12I').setLogic( d.J25 & d.J20.x(2) & d.J12.x(3) & d.TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
+                    #LVL1MenuItem('L1_J25_2J12_DR-MU10TAU12I').setLogic( d.J25 & d.J12.x(2) &  d.TOPO_0DR28_MU10ab_TAU12abi & physcond)
+                    #LVL1MenuItem('L1_J25_2J20_3J12_BOX-TAU20ITAU12I').setLogic( d.J25 & d.J20.x(2) & d.J12.x(3) & d.TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
 
-                    LVL1MenuItem('L1_MU6_MJJ-200').setLogic( d.MU6 & d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_MU6_MJJ-200').setLogic( d.MU6 & d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
                     LVL1MenuItem('L1_MU6_MJJ-300').setLogic( d.MU6 & d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MU6_MJJ-400').setLogic( d.MU6 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MU6_MJJ-500').setLogic( d.MU6 & d.TOPO_500INVM9999_AJ30s6_AJ20s6 & physcond) 
+                    #LVL1MenuItem('L1_MU6_MJJ-400').setLogic( d.MU6 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_MU6_MJJ-500').setLogic( d.MU6 & d.TOPO_500INVM9999_AJ30s6_AJ20s6 & physcond) 
 
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-400').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-700').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond) 
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-800').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-900').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-400').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-700').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond) 
+                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-800').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-900').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
 
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-400').setLogic( d.J20.x(3) & d.J200ETA49.x(4) & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-700').setLogic( d.J20.x(3) & d.J200ETA49.x(4) & d.TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond) 
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-800').setLogic( d.J20.x(3) & d.J200ETA49.x(4) & d.TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_3J20_4J20.0ETA49_MJJ-900').setLogic( d.J20.x(3) & d.J200ETA49.x(4) & d.TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
 
-                    LVL1MenuItem('L1_XE35_MJJ-200').setLogic( d.XE35 & d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
-                    
+                    #LVL1MenuItem('L1_XE35_MJJ-200').setLogic( d.XE35 & d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #
                     ### ATR-15062
-                    LVL1MenuItem('L1_EM18VH_MJJ-300').setLogic( d.EM18VH & d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_EM18VH_MJJ-300').setLogic( d.EM18VH & d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
+                    LVL1MenuItem('L1_EM18VHI_MJJ-300').setLogic( d.EM18VHI & d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
+                    
+
 
                     # CTP items for L1Topo streamers
                     #LVL1MenuItem('L1_DPhi_AJsAJs').setLogic( d.TOPO_DPhi_AJsAJs & physcond)
@@ -1455,12 +1420,34 @@ class ItemDef(object):
     #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-B').setLogic( d.TOPO_4INVM8_ONEBARREL_MU6ab_MU4ab & physcond)
     #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-BO').setLogic( d.TOPO_4INVM8_CMU6ab_CMU4ab & physcond)
 
-                    LVL1MenuItem('L1_DY-DR-2MU4').setLogic( d.TOPO_2DR99_2MU4ab & physcond)
+#                    LVL1MenuItem('L1_DY-DR-2MU4').setLogic( d.TOPO_2DR99_2MU4ab & physcond)
                     LVL1MenuItem('L1_DY-BOX-MU6MU4').setLogic( d.TOPO_5DETA99_5DPHI99_MU6ab_MU4ab & physcond)
                     LVL1MenuItem('L1_DY-BOX-2MU6').setLogic( d.TOPO_5DETA99_5DPHI99_2MU6ab & physcond)
-     
+
+                    LVL1MenuItem('L1_BPH-0M10-3MU4' ).setLogic( d.TOPO_0INVM10_3MU4ab & physcond)# noqa: F821
+                    
+                    #LVL1MenuItem('L1_LFV-EM8I-MU11' ).setLogic( d.TOPO_0INVM10_0DR15_EM8abi_MU10ab & d.MU11 & physcond) # noqa: F821
+                    #LVL1MenuItem('L1_LFV-EM12I-MU6' ).setLogic( d.TOPO_0INVM10_0DR15_EM12abi_MU6ab & physcond) # noqa: F821
+
+                    LVL1MenuItem('L1_ZAFB-04DPHI-EM15I' ).setLogic( d.TOPO_60INVM9999_04DPHI32_EM15abhi_FJj15s623ETA49 & physcond) # noqa: F821
+                    LVL1MenuItem('L1_ZAFB-25DPHI-EM15I' ).setLogic( d.TOPO_60INVM9999_25DPHI32_EM15abhi_FJj15s623ETA49 & physcond) # noqa: F821
+                    #LVL1MenuItem('L1_DPHI-M70-2EM12I' ).setLogic( d.TOPO_0INVM70_27DPHI32_EM12his1_EM12his6 & physcond)  # noqa: F821
+
+                                
+
+                    LVL1MenuItem('L1_DPHI-M70-2EM12I' ).setLogic( d.TOPO_0INVM70_27DPHI32_EM12his1_EM12his6 & physcond)  # noqa: F821
+
+                    LVL1MenuItem('L1_DY-BOX-2MU4' ).setLogic( d.TOPO_5DETA99_5DPHI99_2MU4ab & d.MU4.x(2) & physcond)  # noqa: F821
+
+
+                                
+
+ 
+
+ 
                     LVL1MenuItem('L1_LFV-MU6').setLogic( d.TOPO_0DR15_2MU6ab & physcond)
-                    LVL1MenuItem('L1_LFV-MU').setLogic( d.TOPO_0DR10_MU10ab_MU6ab & physcond)
+                    #LVL1MenuItem('L1_LFV-MU').setLogic( d.TOPO_0DR10_MU10ab_MU6ab & physcond)
+                    LVL1MenuItem('L1_LFV-MU11').setLogic( d.TOPO_0DR15_2MU6ab & d.MU11 & d.MU6.x(2) & physcond)
                     if not '_v7' in TriggerFlags.triggerMenuSetup() and not 'LS2_v' in TriggerFlags.triggerMenuSetup() and not 'run3_v' in TriggerFlags.triggerMenuSetup():
                         LVL1MenuItem('L1_LFV-EM8I').setLogic( d.TOPO_0DETA04_0DPHI03_EM8abi_MU10ab & physcond)
                     else:
@@ -1470,49 +1457,53 @@ class ItemDef(object):
                     else:
                         LVL1MenuItem('L1_LFV-EM15I').setLogic( d.TOPO_0DETA04_EM15abi_MUab & d.TOPO_0DPHI03_EM15abi_MUab & physcond) #ATR-14282
                     LVL1MenuItem('L1_DPHI-J20s2XE50').setLogic( d.TOPO_10MINDPHI_J20s2_XE50 & physcond)
-                    LVL1MenuItem('L1_DPHI-J20XE50').setLogic( d.TOPO_10MINDPHI_J20ab_XE50 & physcond)
-                    LVL1MenuItem('L1_DPHI-CJ20XE50').setLogic( d.TOPO_10MINDPHI_CJ20ab_XE50 & physcond)
+                    #LVL1MenuItem('L1_DPHI-J20XE50').setLogic( d.TOPO_10MINDPHI_J20ab_XE50 & physcond)
+                    #LVL1MenuItem('L1_DPHI-CJ20XE50').setLogic( d.TOPO_10MINDPHI_CJ20ab_XE50 & physcond)
 
-                    LVL1MenuItem('L1_MJJ-900').setLogic( d.TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-800').setLogic( d.TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_MJJ-900').setLogic( d.TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_MJJ-800').setLogic( d.TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
                     LVL1MenuItem('L1_MJJ-700').setLogic( d.TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-400').setLogic( d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_MJJ-400').setLogic( d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
                     #LVL1MenuItem('L1_MJJ-350').setLogic( d.TOPO_350INVM9999_AJ30s6_AJ20s6 & physcond)
                     LVL1MenuItem('L1_MJJ-300').setLogic( d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-200').setLogic( d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-100').setLogic( d.TOPO_100INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_MJJ-200').setLogic( d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_MJJ-100').setLogic( d.TOPO_100INVM9999_AJ30s6_AJ20s6 & physcond)
 
                     #LVL1MenuItem('L1_MJJ-350-0').setLogic( d.TOPO_350INVM9999_J30s6_J20s6 & physcond)
                     #LVL1MenuItem('L1_MJJ-300-0').setLogic( d.TOPO_300INVM9999_J30s6_J20s6 & physcond)
                     #LVL1MenuItem('L1_MJJ-250-0').setLogic( d.TOPO_250INVM9999_J30s6_J20s6 & physcond)
                     #LVL1MenuItem('L1_MJJ-200-0').setLogic( d.TOPO_200INVM9999_J30s6_J20s6 & physcond)
-                    LVL1MenuItem('L1_HT150-JJ15.ETA49').setLogic( d.TOPO_HT150_AJj15allETA49 & physcond)
-                    LVL1MenuItem('L1_HT150-JJ15.ETA49_MJJ-400').setLogic( d.TOPO_HT150_AJj15allETA49 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
+                    #LVL1MenuItem('L1_HT150-JJ15.ETA49').setLogic( d.TOPO_HT150_AJj15allETA49 & physcond)
+                    #LVL1MenuItem('L1_HT150-JJ15.ETA49_MJJ-400').setLogic( d.TOPO_HT150_AJj15allETA49 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
 
+                    LVL1MenuItem('L1_MJJ-500-NFF').setLogic( d.TOPO_500INVM9999_J30s6_AJ20s6 & physcond)
+                    LVL1MenuItem('L1_J50_DETA20-J50J').setLogic( d.J50 & d.TOPO_0DETA20_J50s1_Js2 & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DPHI-2EM3').setLogic( d.TOPO_27DPHI32_EMs1_EMs6 & physcond)    # noqa: F821
                     
-                    LVL1MenuItem('L1_J4-MATCH').setLogic( d.TOPO_0MATCH_4AJ20ETA31_4AJj15ETA31 & physcond)
+                    #LVL1MenuItem('L1_J4-MATCH').setLogic( d.TOPO_0MATCH_4AJ20ETA31_4AJj15ETA31 & physcond)
 
                     LVL1MenuItem('L1_LLP-RO').setLogic( d.TOPO_100RATIO_0MATCH_TAU30si2_EMall & physcond)
 
-                    LVL1MenuItem('L1_LLP-NOMATCH').setLogic( d.TOPO_NOT_0MATCH_TAU30si2_EMall & physcond)
-                    LVL1MenuItem('L1_DR-MU10TAU12I').setLogic( d.TOPO_0DR28_MU10ab_TAU12abi & physcond)
-                    LVL1MenuItem('L1_TAU12I-J25').setLogic( d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
-                    LVL1MenuItem('L1_EM15TAU12I-J25').setLogic( d.TOPO_1DISAMB_EM15his2_TAU12abi_J25ab & physcond)
+                    #LVL1MenuItem('L1_LLP-NOMATCH').setLogic( d.TOPO_NOT_0MATCH_TAU30si2_EMall & physcond)
+                    #LVL1MenuItem('L1_DR-MU10TAU12I').setLogic( d.TOPO_0DR28_MU10ab_TAU12abi & physcond)
+                    #LVL1MenuItem('L1_TAU12I-J25').setLogic( d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
+                    #LVL1MenuItem('L1_EM15TAU12I-J25').setLogic( d.TOPO_1DISAMB_EM15his2_TAU12abi_J25ab & physcond)
 
-                    LVL1MenuItem('L1_DR-EM15TAU12I').setLogic( d.TOPO_DISAMB_0DR28_EM15his2_TAU12abi & physcond)
-                    LVL1MenuItem('L1_DR-EM15TAU12I-J25').setLogic( d.TOPO_1DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond)
-                    LVL1MenuItem('L1_TAU20ITAU12I-J25').setLogic( d.TOPO_1DISAMB_TAU20abi_TAU12abi_J25ab & physcond)
+                    #LVL1MenuItem('L1_DR-EM15TAU12I').setLogic( d.TOPO_DISAMB_0DR28_EM15his2_TAU12abi & physcond)
+                    #LVL1MenuItem('L1_DR-EM15TAU12I-J25').setLogic( d.TOPO_1DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond)
+                    #LVL1MenuItem('L1_TAU20ITAU12I-J25').setLogic( d.TOPO_1DISAMB_TAU20abi_TAU12abi_J25ab & physcond)
                     LVL1MenuItem('L1_DR25-TAU20ITAU12I').setLogic( d.TOPO_0DR25_TAU20abi_TAU12abi & physcond)
 
                     LVL1MenuItem('L1_30M-EM20ITAU12').setLogic( d.TOPO_DISAMB_30INVM_EM20his2_TAU12ab & physcond)
                     LVL1MenuItem('L1_MJJ-400-CF').setLogic( d.TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond)
                     LVL1MenuItem('L1_DR-TAU20ITAU12I').setLogic( d.TOPO_0DR28_TAU20abi_TAU12abi & physcond)
-                    LVL1MenuItem('L1_BOX-TAU20ITAU12I').setLogic( d.TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
-                    LVL1MenuItem('L1_DR-TAU20ITAU12I-J25').setLogic( d.TOPO_1DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond)
+                    #LVL1MenuItem('L1_BOX-TAU20ITAU12I').setLogic( d.TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
+                    LVL1MenuItem('L1_DR-TAU20ITAU12I-J25').setLogic( d.TOPO_2DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond)    # noqa: F821
 
-                    LVL1MenuItem('L1_DR25-TAU20ITAU12I-J25').setLogic( d.TOPO_1DISAMB_J25ab_0DR25_TAU20abi_TAU12abi & physcond)
-                    LVL1MenuItem('L1_LAR-EM').setLogic( d.TOPO_LAR_EM50s1 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-11897)
-                    LVL1MenuItem('L1_LAR-J').setLogic( d.TOPO_LAR_J100s1 & physcond).setTriggerType( TT.lardemo )  # LAr demo (ATR-11897)
+                    LVL1MenuItem('L1_DR25-TAU20ITAU12I-J25').setLogic( d.TOPO_2DISAMB_J25ab_0DR25_TAU20abi_TAU12abi & physcond)    # noqa: F821
+                    LVL1MenuItem('L1_DR-EM15TAU12I-J25').setLogic( d.TOPO_2DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond)    # noqa: F821
+#                    LVL1MenuItem('L1_LAR-EM').setLogic( d.TOPO_LAR_EM50s1 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-11897)
+#                    LVL1MenuItem('L1_LAR-J').setLogic( d.TOPO_LAR_J100s1 & physcond).setTriggerType( TT.lardemo )  # LAr demo (ATR-11897)
                     # if not '_v6' in TriggerFlags.triggerMenuSetup():
                     #     LVL1MenuItem('L1_BPH-DR-2MU4-B').setLogic( d.TOPO_2DR15_CMU4ab_MU4ab & physcond)
                     #     LVL1MenuItem('L1_BPH-DR-2MU4-BO').setLogic( d.TOPO_2DR15_2CMU4ab & physcond)
@@ -1536,16 +1527,16 @@ class ItemDef(object):
     # nominal L1-topo items
                     #LVL1MenuItem('L1_BPH-1M19-2MU4_BPH-0DR34-2MU4'    ).setLogic( d.TOPO_1INVM19_2MU4ab & d.TOPO_0DR34_2MU4ab & physcond)           # 50% for Bs,J/psi,Upsi
              
-                    LVL1MenuItem('L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM8_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-                    LVL1MenuItem('L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM9_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2MU4ab & physcond)           # 78% for Upsi
-                    LVL1MenuItem('L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM8_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi
-                    LVL1MenuItem('L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM9_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)
-  
-                    LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4').setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & d.TOPO_0DR22_MU6ab_MU4ab & physcond) # 86% for Upsi
-                    LVL1MenuItem('L1_BPH-2M9-2MU6_BPH-2DR15-2MU6'     ).setLogic( d.TOPO_2INVM9_2MU6ab & d.TOPO_2DR15_2MU6ab & physcond)            # 96% for Bs,J/psi
+#                    LVL1MenuItem('L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM8_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
+#                    LVL1MenuItem('L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM9_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
+#                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2MU4ab & physcond)           # 78% for Upsi
+#                    LVL1MenuItem('L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM8_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi
+#                    LVL1MenuItem('L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM9_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)
+#  
+                    #LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4').setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & d.TOPO_0DR22_MU6ab_MU4ab & physcond) # 86% for Upsi
+                    #LVL1MenuItem('L1_BPH-2M9-2MU6_BPH-2DR15-2MU6'     ).setLogic( d.TOPO_2INVM9_2MU6ab & d.TOPO_2DR15_2MU6ab & physcond)            # 96% for Bs,J/psi
      
-                    LVL1MenuItem('L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'    ).setLogic( d.TOPO_8INVM15_2MU6ab & d.TOPO_0DR22_2MU6ab & physcond)           # 96% for Upsi
+                    #LVL1MenuItem('L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'    ).setLogic( d.TOPO_8INVM15_2MU6ab & d.TOPO_0DR22_2MU6ab & physcond)           # 96% for Upsi
 
 # Barrel and BarrelOnly items w/o topo selection
 #                    LVL1MenuItem('L1_CMU6_2CMU4').setLogic( d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & physcond) # d.MU6_2MU4_BarrelOnly
@@ -1556,28 +1547,36 @@ class ItemDef(object):
 # Barrel and BarrelOnly variants of L1Topo items
                     #LVL1MenuItem('L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'    ).setLogic( d.TOPO_1INVM19_CMU4ab_MU4ab & d.TOPO_0DR34_2MU4ab & physcond)               # 50% for Bs,J/psi,Upsi + OneBarrel
 
-                    LVL1MenuItem('L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM8_CMU4ab_MU4ab & d.TOPO_0DR15_2MU4ab & physcond)                # 78% for Bs,J/psi + OneBarrel
+                    #LVL1MenuItem('L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM8_CMU4ab_MU4ab & d.TOPO_0DR15_2MU4ab & physcond)                # 78% for Bs,J/psi + OneBarrel
 
-                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_CMU4ab_MU4ab & physcond)               # 78% for Upsi + OneBarrel
-                    #LVL1MenuItem('L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   ).setLogic( d.TOPO_1INVM19_2CMU4ab & d.TOPO_0DR34_2MU4ab & physcond)                    # 50% for Bs,J/psi,Upsi + BarrelOnly
+                    #LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_CMU4ab_MU4ab & physcond)               # 78% for Upsi + OneBarrel
+                    ##LVL1MenuItem('L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   ).setLogic( d.TOPO_1INVM19_2CMU4ab & d.TOPO_0DR34_2MU4ab & physcond)                    # 50% for Bs,J/psi,Upsi + BarrelOnly
 
-                        #LVL1MenuItem('L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'    ).setLogic( d.TOPO_2INVM8_2CMU4ab & d.TOPO_0DR15_2MU4ab & physcond)                     # 78% for Bs,J/psi + BarrelOnly
-                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'   ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2CMU4ab & physcond)                    # 78% for Upsi + BarrelOnly
-                    LVL1MenuItem('L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM8_ONEBARREL_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi + OneBarrel
+                    #    #LVL1MenuItem('L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'    ).setLogic( d.TOPO_2INVM8_2CMU4ab & d.TOPO_0DR15_2MU4ab & physcond)                     # 78% for Bs,J/psi + BarrelOnly
+                    #LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'   ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2CMU4ab & physcond)                    # 78% for Upsi + BarrelOnly
+                    #LVL1MenuItem('L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM8_ONEBARREL_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi + OneBarrel
 
-                    LVL1MenuItem('L1_BPH-2M8-2MU4'       ).setLogic( d.TOPO_2INVM8_2MU4ab & physcond)                 # backup 71% for Bs,J/psi
-                    #LVL1MenuItem('L1_BPH-2M9-2MU4'       ).setLogic( d.TOPO_2INVM9_2MU4ab & physcond)
-                    LVL1MenuItem('L1_BPH-8M15-MU6MU4'    ).setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & physcond)           # backup 71% for Upsi
-                    LVL1MenuItem('L1_BPH-8M15-2MU6'      ).setLogic( d.TOPO_8INVM15_2MU6ab & physcond)                # backup 95% for Upsi
+                    #LVL1MenuItem('L1_BPH-2M8-2MU4'       ).setLogic( d.TOPO_2INVM8_2MU4ab & physcond)                 # backup 71% for Bs,J/psi
+                    ##LVL1MenuItem('L1_BPH-2M9-2MU4'       ).setLogic( d.TOPO_2INVM9_2MU4ab & physcond)
+                    #LVL1MenuItem('L1_BPH-8M15-MU6MU4'    ).setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & physcond)           # backup 71% for Upsi
+                    #LVL1MenuItem('L1_BPH-8M15-2MU6'      ).setLogic( d.TOPO_8INVM15_2MU6ab & physcond)                # backup 95% for Upsi
     #SX end ATR-12789
 
+                    LVL1MenuItem('L1_LATE-MU10_XE40').setLogic( d.TOPO_LATE_MU10s1 & d.XE40 & physcond)  # noqa: F821
                     LVL1MenuItem('L1_LATE-MU10_XE50').setLogic( d.TOPO_LATE_MU10s1 & d.XE50 & physcond) 
                     LVL1MenuItem('L1_LATE-MU10_J50').setLogic(  d.TOPO_LATE_MU10s1 & d.J50 & physcond)  
                     LVL1MenuItem('L1_SC111').setLogic(  d.TOPO_SC111_CJ15abETA26 & physcond)
-                    LVL1MenuItem('L1_SC85').setLogic(  d.TOPO_SC85_CJ15abETA26 & physcond)
+                    #LVL1MenuItem('L1_SC85').setLogic(  d.TOPO_SC85_CJ15abETA26 & physcond)
+                    LVL1MenuItem('L1_SC111-CJ15').setLogic(  d.TOPO_SC111_CJ15abETA26 & physcond)    # noqa: F821
 
                     LVL1MenuItem('L1_TAU60_DR-TAU20ITAU12I' ).setLogic( d.HA60 & d.TOPO_0DR28_TAU20abi_TAU12abi & physcond)
 
+                    LVL1MenuItem('L1_CEP-CJ60').setLogic( d.TOPO_CEP_CJ60s6 & physcond ) # noqa: F821
+                    LVL1MenuItem('L1_CEP-CJ50').setLogic( d.TOPO_CEP_CJ50s6 & physcond ) # noqa: F821
+
+                    LVL1MenuItem('L1_BPH-8M15-2MU4-BO' ).setLogic( d.TOPO_8INVM15_2CMU4ab & physcond) # noqa: F821
+
+
             except Exception as ex:
                     print ("Creation of L1Topo item failed, will abort! Exception is : " , ex)
                     raise RuntimeError("Creation of L1Topo item failed, will not continue")
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
index 3ccc35a1ff29868aaa97695948fea1b9ac163dd2..269dade098bc6928afc1a1513925f2569b7a5ad9 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 def defineMenu():
     """
@@ -38,14 +38,13 @@ def defineMenu():
         # SLOT 7 / CON 0,1 (EM1,2)
         #-------------------------
         
+ 
         # 16 x EM
         'EM3', 'EM7', 'EM8VH',
-        'EM8I',
-        'EM10VH', 'EM12', 'EM13VH', 'EM15', 'EM15VH',
-        'EM15HI',
-        'EM18VH', 'EM20VH', 'EM20VHI', 'EM22VHI', 'EM24VHI', 'EM26VHI', 
-
-        # 1 x ZB
+        'EM10VH', 'EM12', 'EM15', 'EM15VH',
+        'EM15VHI',
+        'EM18VHI', 'EM20VH', 'EM20VHI', 'EM22VH', 'EM22VHI', 'EM24VHI', 'EM24VHIM', 'EM30VHI', 
+        # 1 x ZB/
         'ZB_EM15',
 
         #--------------------------
@@ -53,7 +52,8 @@ def defineMenu():
         #--------------------------
 
         # 16 x TAU
-        'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA12IT', 'HA15', 'HA20', 'HA20IL',  'HA20IM', 'HA20IT', 'HA25', 'HA25IT', 'HA30', 'HA40', 'HA60', 'HA100', 
+        'HA5', 'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA15', 'HA20', 'HA20IL', 'HA20IM', 'HA25', 'HA25IM', 'HA30', 'HA40', 'HA60', 'HA90', 'HA100',
+ 
 
         #----------------------
         # SLOT 8 / CON 0 (JET1)
@@ -61,9 +61,11 @@ def defineMenu():
         # 10 x 3-bit JET (can have multiplicity 4 or more)
 
         # 8 x JETs and central jets
-        'J12', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30', 'J40',
-        
-        # 2 x VBF
+        'J12', 'J12.0ETA23', 'J15', 'J15.0ETA25','J20', 'J25','J25.0ETA23','J30',
+        # 2 x Central Jets
+         'J12.0ETA28', #'J12.0ETA25',
+
+        # VBF Jets
         'J20.0ETA49', 'J30.0ETA49',
 
 
@@ -73,37 +75,33 @@ def defineMenu():
         # 15 x 2-bit JET (can have maximum multiplicity of 3) (SLOT 8, CON 1)
 
         # 3 x Central Jet
-        'J35.0ETA23','J40.0ETA25', 'J20.28ETA31',
+        'J35.0ETA23','J40.0ETA25', #'J20.28ETA31',
+
+        # 6 Jets # replace J400 with J45.0ETA20 - ATR-19309
+        'J40', 'J50', 'J75', 'J85', 'J100', 'J45.0ETA20',  'J400', #'J120',
 
-        # 6 Jets
-        'J50', 'J75', 'J85', 'J100', 'J120', 'J400',
 
         # 6 x FJ              
-        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 'J100.31ETA49', 
+        'J15.31ETA49', 'J20.31ETA49', 'J30.31ETA49', 'J50.31ETA49', 'J75.31ETA49', 
+ 
 
 
         #---------------------
-        # SLOT 8 / CON 2 (EN1)
+        # SLOT 8 / CON 2 (EN1) 
         #---------------------
         # 24 x 1-bit thresholds
-        
-        # 8 x TE
-        #'TE3', 'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40',
-        #'TE5', 'TE30', 'TE40', 'TE45', 'TE50', 'TE55', 'TE60', 'TE65',
-        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE70',
 
+        # 8 x TE
+        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE50',
+    
         # 8 x XE (for standard XE)
-        #'XE35', 'XE40', 'XE45', 'XE50', 'XE55', 'XE60', 'XE70', 'XE80',
-        # 8 x XE (for restricted ETA XE: check ATR-13234 for any further change)
-        #'XE10', 'XE20', 'XE25', 'XE30', 'XE65', 'XE75', 'XE150', 'XE300',
-
         'XE10', 'XE20', 'XE25', 'XE30', 'XE35', 'XE40', 'XE45', 'XE50',
         'XE55', 'XE60', 'XE65', 'XE70', 'XE75', 'XE80', 'XE150', 'XE300',
         
         # 8 x XS
         'XS20', 'XS30', 'XS40', 'XS45', 'XS50', 'XS55', 'XS60', 'XS65', 
 
-
+ 
         #---------------------
         # SLOT 8 / CON 3 (EN2)
         #---------------------
@@ -113,18 +111,18 @@ def defineMenu():
         #'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR
 
         # 8 x restricted eta range
-        #'TE3.0ETA24', 'TE5.0ETA24','TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24',
-        #'TE5.0ETA24', 'TE30.0ETA24','TE40.0ETA24', 'TE45.0ETA24', 'TE50.0ETA24', 'TE55.0ETA24', 'TE60.0ETA24', 'TE65.0ETA24',
-        'TE5.0ETA24', 'TE10.0ETA24', 'TE15.0ETA24', 'TE20.0ETA24', 'TE25.0ETA24', 'TE30.0ETA24', 'TE40.0ETA24', 'TE70.0ETA24',
+        #'TE5.24ETA49', 'TE10.24ETA49', 'TE15.24ETA49', 'TE20.24ETA49', 'TE25.24ETA49', 'TE30.24ETA49', 'TE40.24ETA49', 'TE70.24ETA49',
+
+
 
         #------------------------
-        # SLOT 9 / CON 0 (MUCTPi)
+        # SLOT 9 / CON 0 (MUCTPi) 
         #------------------------
         
         # 6 x MU
-        'MU4', 'MU6', 'MU10', 'MU11', 'MU15', 'MU20',
-
+        'MU4', 'MU6', 'MU10', 'MU11', 'MU20', 'MU21',
 
+        
         #------------------------
         # SLOT 9 / CON 1 (CTPCal)
         #------------------------
@@ -153,6 +151,8 @@ def defineMenu():
         # 3 x CALREQ
         'CAL0','CAL1','CAL2',
 
+ 
+
         #-----------------------------
         # SLOT 9 / CON 2,3 (NIM1,NIM2)
         #-----------------------------
@@ -160,11 +160,13 @@ def defineMenu():
         # 2 x MBTS
         'MBTS_A', 'MBTS_C',
 
-        # 24 x MBTSSI (all FTHR)
-        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4'  , 'MBTS_A5', 'MBTS_A6', 'MBTS_A7', 
-        'MBTS_A8', 'MBTS_A10', 'MBTS_A12' , 'MBTS_A14',
-        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4'  , 'MBTS_C5', 'MBTS_C6', 'MBTS_C7', 
-        'MBTS_C8', 'MBTS_C10', 'MBTS_C12' , 'MBTS_C14',
+        # 32 x MBTSSI (all FTHR)
+        # NOTE: THESE ARE OUT OF ORDER FOR A REASON! Do not change!
+        # The order defines the mapping - see ATR-17870.
+        'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4', 'MBTS_A5', 'MBTS_A6', 'MBTS_A7',
+        'MBTS_A8', 'MBTS_A10', 'MBTS_A12', 'MBTS_A14', 'MBTS_A9', 'MBTS_A11','MBTS_A13', 'MBTS_A15',
+        'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7',
+        'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', 'MBTS_C11', 'MBTS_C13','MBTS_C9','MBTS_C15',
 
         # L1A for CTP monitoring itself
         'NIML1A',
@@ -182,394 +184,317 @@ def defineMenu():
         'NIMTRT',
 
         # AFP
-        'AFP_NSC', 'AFP_FSC',
+        'AFP_NSC', 'AFP_NSA',
+        #'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG',
+        #'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF',
 
+        
         #-------------------------------------------------------------------
         #L1 TOPO inputs 
         #-------------------------------------------------------------------
-        
+
+        #B-jets
+        #'BTAG-MU4J15',
+        #'BTAG-MU6J20',
+
         #HT
-        'HT190-AJ15all.ETA21',
         'HT190-J15s5.ETA21',
-        'HT150-AJ20all.ETA31',
         'HT150-J20s5.ETA31',
 
         
 
         #ZH 
-        '10MINDPHI-AJ20s2-XE50', '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', '10MINDPHI-J20ab-XE50', '10MINDPHI-CJ20ab-XE50', 
+        '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', 
+
         #Jpsi T&P
-        '1INVM5-EMs1-EMs6', '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
-
-        #W T&P
-        '05MINDPHI-AJj10s6-XE0',
-        '10MINDPHI-AJj10s6-XE0',
-        '15MINDPHI-AJj10s6-XE0',
-        '05MINDPHI-EM12s6-XE0',
-        '15MINDPHI-EM12s6-XE0',
-        '05MINDPHI-EM15s6-XE0',
-        '15MINDPHI-EM15s6-XE0',
-        '05RATIO-XE0-HT0-AJj15all.ETA49',
-        '90RATIO2-XE0-HT0-AJj15all.ETA49',
-        '250RATIO2-XE0-HT0-AJj15all.ETA49',
-        'HT20-AJj15all.ETA49',
-        'NOT-02MATCH-EM10s1-AJj15all.ETA49',
-        '25MT-EM12s6-XE0',
-        '35MT-EM12s6-XE0',
-        '35MT-EM15s6-XE0',
-        #'10MINDPHI-AJj15s2-XE0',
-        #'20MINDPHI-AJjs6-XE0',
-        #'20MINDPHI-AJj15s2-XE0',
-        #'10MINDPHI-EM6s1-XE0',
-        #'20MINDPHI-EM9s6-XE0',
-        #'20MINDPHI-EM6s1-XE0',
-        #'05RATIO-XE0-HT0-AJj15all.ETA49',
-        #'08RATIO-XE0-HT0-AJj0all.ETA49',
-        #'40RATIO2-XE0-HT0-AJj15all.ETA49',
-        #'90RATIO2-XE0-HT0-AJj0all.ETA49',
-        #'HT20-AJj0all.ETA49',
-        #'NOT-02MATCH-EM9s1-AJj15all.ETA49',
-        #'05RATIO-XE0-SUM0-EM9s1-HT0-AJj15all.ETA49',
-        #'20MT-EM6s6-XE0',
-        #'30MT-EM6s6-XE0',
-        #'40MT-EM6s6-XE0',
+         '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
+
+        #W T&P - all were commented out
+ 
         
         # central muon
         'MULT-CMU4ab',
         'MULT-CMU6ab',
         
-        #B-jet
-        '0DR04-MU4ab-CJ15ab', '0DR04-MU4ab-CJ20ab', '0DR04-MU4ab-CJ30ab', '0DR04-MU6ab-CJ20ab', '0DR04-MU6ab-CJ25ab',
+
         #B-physics
-#SX        '2DR15-2MU4ab', 
-#SX        '2INVM999-2MU4ab', 
-#SX        '4INVM8-2MU4ab',
-        '2DR15-2MU6ab', 
-#SX        '2INVM999-2MU6ab', 
-#SX        '4INVM8-2MU6ab',
+        '0DR03-EM7ab-CJ15ab',
+ 
 
         # L1 thresholds for L1Topo streamers
-#SX        '2INVM999-CMU4ab-MU4ab',
-#SX        '2INVM999-2CMU4ab',
-#SX        '2INVM999-MU6ab-MU4ab',
-#SX        '2INVM999-ONEBARREL-MU6ab-MU4ab',
-#SX        '2INVM999-CMU6ab-CMU4ab',
-#SX        '4INVM8-CMU4ab-MU4ab',
-#SX        '4INVM8-2CMU4ab',
-#SX        '4INVM8-MU6ab-MU4ab',
-#SX        '4INVM8-ONEBARREL-MU6ab-MU4ab',
-#SX        '4INVM8-CMU6ab-CMU4ab',        
-        '2DR99-2MU4ab',
+        #'2DR99_2MU4ab',
         '5DETA99-5DPHI99-MU6ab-MU4ab',
         '5DETA99-5DPHI99-2MU6ab',
-        '0DR10-MU10ab-MU6ab',
         '0DR15-2MU6ab',
-#        '0DETA04-0DPHI03-EM8abi-MU10ab',
         '0DETA04-EM8abi-MU10ab',
         '0DPHI03-EM8abi-MU10ab',
-#        '0DETA04-0DPHI03-EM15abi-MUab',
         '0DETA04-EM15abi-MUab',
         '0DPHI03-EM15abi-MUab',
-        '10MINDPHI-AJ20s2-XE50',
-        '10MINDPHI-J20s2-XE50',
-        '10MINDPHI-J20ab-XE50',
-        '10MINDPHI-CJ20ab-XE50',
-        '900INVM9999-AJ30s6-AJ20s6',
-        '800INVM9999-AJ30s6-AJ20s6',
+        #'800INVM9999-AJ30s6-AJ20s6',
         '700INVM9999-AJ30s6-AJ20s6',
-        '500INVM9999-AJ30s6-AJ20s6',
-        '400INVM9999-AJ30s6-AJ20s6',
-        #'350INVM9999-AJ30s6-AJ20s6',
         '300INVM9999-AJ30s6-AJ20s6',
-        '200INVM9999-AJ30s6-AJ20s6',
-        '100INVM9999-AJ30s6-AJ20s6',
-        #'350INVM9999-J30s6-J20s6',
-        #'300INVM9999-J30s6-J20s6',
-        #'250INVM9999-J30s6-J20s6',
-        #'200INVM9999-J30s6-J20s6',
-        'HT150-AJj15all.ETA49',
-        '0MATCH-4AJ20.ETA31-4AJj15.ETA31',
+        #'400INVM9999-AJ30s6-AJ20s6',
+        '500INVM9999-J30s6-AJ20s6',
+        #'100INVM9999-AJ30s6-AJ20s6',
+        '0DETA20-J50s1-Js2',
+        '27DPHI32-EMs1-EMs6',
+        #'HT150-AJj15all.ETA49',
+        #'0MATCH-4AJ20.ETA31-4AJj15.ETA31',
         '100RATIO-0MATCH-TAU30si2-EMall',
-        'NOT-0MATCH-TAU30si2-EMall',
-        '0DR28-MU10ab-TAU12abi',
-        '1DISAMB-TAU12abi-J25ab',
-        '1DISAMB-EM15his2-TAU12abi-J25ab',
-        'DISAMB-0DR28-EM15his2-TAU12abi',
-        '1DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
-        '1DISAMB-TAU20abi-TAU12abi-J25ab',
+        'NOT-0MATCH-TAU30si1-EMall',
+        #'1DISAMB-TAU12abi-J25ab',
+        #'1DISAMB-EM15his2-TAU12abi-J25ab',
+        '2DISAMB-TAU12abi-J25ab',
+        '2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
+        #'0DR28-MU10ab-TAU12abi',  # add back if needed
+        #'1DISAMB-TAU20abi-TAU12abi-J25ab',
         '0DR25-TAU20abi-TAU12abi',
         '0DR28-TAU20abi-TAU12abi',
-        '0DETA20-0DPHI20-TAU20abi-TAU12abi',
-        '1DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
-        '1DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
+        '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
+        '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
         'DISAMB-30INVM-EM20his2-TAU12ab',
         '400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49',
-        'LAR-EM50s1',
-        'LAR-J100s1',
-#SX        '2DR15-CMU4ab-MU4ab',
-#SX        '2DR15-2CMU4ab',
-#SX        '2DR15-MU6ab-MU4ab',
-#SX        '2DR15-ONEBARREL-MU6ab-MU4ab',
-#SX        '2DR15-CMU6ab-CMU4ab',
-
-        '2INVM9-2MU6ab',
-        '7INVM15-2MU4ab', 
-        '2INVM8-ONEBARREL-MU6ab-MU4ab', 
-        '0DR24-2CMU4ab', 
-        '0DR22-2MU6ab',
-        '0DR34-2MU4ab', 
-        '0DR24-2MU4ab', 
-        '0DR24-CMU4ab-MU4ab',  
-        '2INVM8-CMU4ab-MU4ab',
-        '0DR15-2MU4ab',  
-        '0DR15-MU6ab-MU4ab',  
-        '0DR22-MU6ab-MU4ab', 
-        '8INVM15-MU6ab-MU4ab',  
-        '8INVM15-2MU6ab', 
-        '2INVM8-2MU4ab',  # ATR-15197 '2INVM9-2MU4ab',
-        '2INVM8-MU6ab-MU4ab', # ATR-15197 '2INVM9-MU6ab-MU4ab',
-        '2INVM9-2MU4ab',
-        '2INVM9-MU6ab-MU4ab',
-        'KF-XE40-AJall',
-        'KF-XE50-AJall',
-        'KF-XE55-AJall',
-        'KF-XE60-AJall',
-        'KF-XE65-AJall',
-        'KF-XE75-AJall',
+
+        '0INVM9-EM7ab-EMab',
+        '400INVM9999-0DPHI20-J30s6-AJ20s6',
+        '400INVM9999-0DPHI22-J30s6-AJ20s6',
+        '400INVM9999-0DPHI24-J30s6-AJ20s6',
+        '400INVM9999-0DPHI26-J30s6-AJ20s6',
 
         'LATE-MU10s1',
         'SC111-CJ15ab.ETA26',
-        'SC85-CJ15ab.ETA26',
+        
         
         # ALFA (the replication is needed to build all the combinations in the CTPCore)
         'ALFA_B7R1L', 'ALFA_B7R1U', 'ALFA_A7R1L', 'ALFA_A7R1U', 'ALFA_A7L1L', 'ALFA_A7L1U', 'ALFA_B7L1L', 'ALFA_B7L1U',
         'ALFA2_B7R1L', 'ALFA2_B7R1U', 'ALFA2_A7R1L', 'ALFA2_A7R1U', 'ALFA2_A7L1L', 'ALFA2_A7L1U', 'ALFA2_B7L1L', 'ALFA2_B7L1U',
         'ALFA3_B7R1L', 'ALFA3_B7R1U', 'ALFA3_A7R1L', 'ALFA3_A7R1U', 'ALFA3_A7L1L', 'ALFA3_A7L1U', 'ALFA3_B7L1L', 'ALFA3_B7L1U',
         'ALFA4_B7R1L', 'ALFA4_B7R1U', 'ALFA4_A7R1L', 'ALFA4_A7R1U', 'ALFA4_A7L1L', 'ALFA4_A7L1U', 'ALFA4_B7L1L', 'ALFA4_B7L1U',
-#ATR-13743        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
-
+#ATR-13743      
+        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
+
+        #ATR-19355
+        '0INVM10-3MU4ab',
+
+        #ATR-18815 - Algorithm needs to be moved to master
+#        '0INVM10-0DR15-EM8abi-MU10ab',
+#        '0INVM10-0DR15-EM12abi-MU6ab',
+
+        #ATR-18824
+        '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49',
+        '60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49',
+        #ATR-19302
+        '0INVM70-27DPHI32-EM12his1-EM12his6',
+
+        #ATR-19720
+        #'8INVM15-0DR22-2MU6ab',
+        #'2INVM9-2DR15-2MU6ab',
+        #'2INVM9-0DR15-MU6ab-MU4ab',
+        #'8INVM15-0DR22-MU6ab-MU4ab',
+        #'2INVM9-0DR15-2MU4ab',
+
+        #ATR-19510
+        '5DETA99-5DPHI99-2MU4ab',
+            
+        #ATR-17320
+        'CEP-CJ60s6',
+        'CEP-CJ50s6',
+       
+        #ATR-20174
+        '8INVM15-2CMU4ab'
 
-        ]
+        
+    ]
 
     
     Lvl1Flags.items = [
 
-        
         # single EM
 
         'L1_EM3','L1_EM7','L1_EM12', 'L1_EM8VH',
-#        'L1_EM8I',
-        'L1_EM10VH', 'L1_EM13VH', 'L1_EM15',
-        'L1_EM15I','L1_EM15HI',
-        'L1_EM26VHI','L1_EM15VH', 'L1_EM18VH', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM24VHI', # see Jira ATR-10334'L1_EM22VHLIL', #'L1_EM50V',
-        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY','L1_EM7_UNPAIRED_NONISO',
+        'L1_EM10VH', 'L1_EM15',
+        'L1_EM30VHI',
+        'L1_EM15VHI',
+        'L1_EM24VHIM','L1_EM15VH', 'L1_EM18VHI', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM22VH','L1_EM24VHI', 
+        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY',
         'L1_EM20VH_FIRSTEMPTY',
-        'L1_EM22VHI_FIRSTEMPTY',
-        #'L1_EM15_BGRP7',
 
-        # see savannah https://savannah.cern.ch/bugs/?103935
 
-        # combined EM -jet
-        #'L1_JJ15.23ETA49', # 4x4 window
+        # combined EM -jet - all commented
 
         # single MU
-        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU15", "L1_MU20",
-
+        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU20", "L1_MU21",
+        
         "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
-        'L1_MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_NONISO',
-         'L1_MU20_FIRSTEMPTY',
+        'L1_MU4_UNPAIRED_ISO',
+
 
-        
         
         # multi lepton
-        "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM13VH", "L1_2EM15", "L1_2EM15VH", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7", "L1_EM15VH_3EM8VH", "L1_EM15VH_2EM10VH_3EM7",
-        "L1_2EM18VH", "L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM18VH_3EM8VH", "L1_EM18VH_2EM10VH_3EM7", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH",
+        "L1_2EM3", "L1_2EM7",
+        "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI",
+        "L1_2EM20VH",
+        "L1_EM20VH_3EM10VH", 
         "L1_EM7_MU10",
-        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY", "L1_MU10_2MU6", "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4",
-
-        "L1_EM8I_MU10", "L1_EM15I_MU4", "L1_2EM8VH_MU10", "L1_EM15VH_MU10", 
-
+        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY",  "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4", "L1_2MU11", "L1_MU11_2MU10",
+        "L1_2EM8VH_MU10", "L1_EM15VH_MU10",  "L1_EM7_MU20", "L1_EM8VH_MU20",
 
         # single tau
-        "L1_TAU12", "L1_TAU12IM",  "L1_TAU20", "L1_TAU20IM",
-        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU100", "L1_TAU8", "L1_TAU8_EMPTY", 
-        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY","L1_TAU8_UNPAIRED_NONISO",
+        "L1_TAU5", "L1_TAU12", "L1_TAU12IM",   "L1_TAU20IM",
+        "L1_TAU30","L1_TAU30_EMPTY","L1_TAU30_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU90", "L1_TAU100", "L1_TAU8_EMPTY", 
+        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY",
 
         # multi tau
-        "L1_TAU20IM_2TAU12IM", "L1_TAU20_2TAU12", "L1_TAU40_2TAU20IM",
+        "L1_TAU20IM_2TAU12IM",   "L1_TAU60_2TAU40", "L1_2TAU5", "L1_2TAU8",
 
         # combined tau - lepton
-        "L1_EM15HI_2TAU12IM",          
-        "L1_EM15HI_2TAU12IM_J25_3J12",   
-        "L1_EM15HI_TAU40_2TAU15",
+        "L1_EM15VHI_2TAU12IM",          
+        "L1_EM15VHI_2TAU12IM_J25_3J12",   
+        "L1_EM15VHI_2TAU12IM_4J12",
+        "L1_EM15VHI_TAU40_2TAU15",
         "L1_MU10_TAU12IM",  
-        "L1_MU10_TAU12IM_J25_2J12", 
-#        "L1_MU10_TAU12_J25_2J12", 
-#        "L1_MU10_TAU20",
+        "L1_MU10_TAU12IM_J25_2J12",
+        "L1_MU10_TAU12IM_3J12",
+        #'L1_DR-MU10TAU12I_TAU12I-J25',
         "L1_MU10_TAU20IM",
         "L1_MU11_TAU20IM",
         "L1_MU10_TAU20IM_J25_2J20",
 
         # combined tau - jet
-#        "L1_TAU25IT_2TAU12IT_2J25_3J12", 
 
-        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12", 
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I',  
-        'L1_DR-MU10TAU12I_TAU12I-J25', 
-        "L1_MU10_TAU12I-J25",
+        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12",
+        "L1_TAU20IM_2TAU12IM_4J12.0ETA23",
+        #"L1_TAU20IM_2TAU12IM_4J12.0ETA25",
+        "L1_TAU20IM_2TAU12IM_4J12.0ETA28",
+        "L1_TAU25IM_2TAU20IM_2J25_3J20", 
+
 
 
         # combined tau - xe
         "L1_TAU20IM_2J20_XE45", 
-#        "L1_TAU20_2J20_XE45", 
-#        "L1_TAU20IM_2J20_XE50",   
+        "L1_TAU20IM_2J20_XE50", 
+
 
         #"L1_EM15HI_2TAU12I_XE35", 
-        "L1_EM15HI_2TAU12IM_XE35", 
-        "L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15",
+        "L1_EM15VHI_2TAU12IM_XE35", 
         'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',
 
 
         "L1_MU10_TAU12IM_XE35",  
-#        "L1_MU10_TAU12IM_XE40",  
 
         "L1_TAU20IM_2TAU12IM_XE35", 
-        "L1_TAU20_2TAU12_XE35",
         "L1_TAU40_2TAU12IM_XE40",  
 
 
 
         # combined em - jet
-        #'L1_EM15VH_J15.23ETA49',
-#        'L1_EM15VH_JJ15.23ETA49',
-        'L1_EM13VH_3J20',
-        'L1_EM18VH_3J20',
+        'L1_EM18VHI_3J20',
+        'L1_EM20VH_3J20',
+
+        
 
         # combined mu - jet
-        'L1_MU4_J12',  'L1_MU4_J50_XE40', 'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
-#ATR-13743        'L1_MU4_J30',
-        #'L1_MU4_J50',
+        'L1_MU6_J20', 'L1_MU6_J30.0ETA49_2J20.0ETA49', 'L1_MU6_J40', 'L1_MU6_J75',
         'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20',
-        'L1_2MU4_J40_XE20',
         'L1_MU20_J40',
         'L1_MU20_XE30',
+        'L1_MU20_J50',
 
         # single jet
-        "L1_J12","L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100", "L1_J120", "L1_J400",
-        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", "L1_J100.31ETA49",
-        #'L1_J15.23ETA49',
-         'L1_J15.31ETA49',
-        "L1_J20.28ETA31",
-        #'L1_J40.0ETA25', 
+        "L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100",  "L1_J400", #"L1_J120",
+        "L1_J20.31ETA49", "L1_J30.31ETA49", "L1_J50.31ETA49", "L1_J75.31ETA49", 
+        'L1_J15.31ETA49',
         "L1_J12_EMPTY","L1_J12_FIRSTEMPTY", "L1_J12_UNPAIRED_ISO", "L1_J12_UNPAIRED_NONISO", "L1_J12_ABORTGAPNOTCALIB", 
         "L1_J15.31ETA49_UNPAIRED_ISO",
         "L1_J30_EMPTY", "L1_J30_FIRSTEMPTY", "L1_J30.31ETA49_EMPTY", "L1_J30.31ETA49_UNPAIRED_ISO",
         "L1_J30.31ETA49_UNPAIRED_NONISO",
         "L1_J50_UNPAIRED_ISO", "L1_J50_UNPAIRED_NONISO", "L1_J50_ABORTGAPNOTCALIB",         
-        "L1_J12_BGRP12", "L1_J30.31ETA49_BGRP12",
         'L1_J100_FIRSTEMPTY',
-        'L1_J100.31ETA49_FIRSTEMPTY',
+ 
         
         # multi jet
-
-        "L1_J20_J20.31ETA49",
-        "L1_3J15", "L1_3J20","L1_3J40", 'L1_3J15.0ETA25', "L1_3J50", "L1_4J15", "L1_4J20",
-        "L1_4J20.0ETA49",
+        "L1_J45.0ETA20_3J15.0ETA25",
+        "L1_J50_2J40.0ETA25_3J15.0ETA25",
+        "L1_3J50", "L1_4J15", "L1_4J20", #"L1_4J20.0ETA49",
         "L1_3J15.0ETA25_XE40",
         
-        #"L1_3J75",
-        #"L1_4J30",
         "L1_6J15",
-        "L1_J75_3J20",
         "L1_J85_3J30",
-        "L1_J30.0ETA49_2J20.0ETA49",
-
-        "L1_J15.0ETA25_2J15.31ETA49",
+       # multi jet forward
+        "L1_J25.0ETA23_2J15.31ETA49",
         "L1_J40.0ETA25_2J15.31ETA49",
         "L1_J40.0ETA25_2J25_J20.31ETA49",
-        "L1_J40.0ETA25_2J30_J20.31ETA49",
+        "L1_J30.0ETA49_2J20.0ETA49",
         
         # multi jet central
         "L1_3J25.0ETA23",
         "L1_3J35.0ETA23",
         "L1_4J15.0ETA25",
         "L1_5J15.0ETA25", 
-        
         # combined jet
-        "L1_2J15_XE55", "L1_J40_XE50", "L1_J75_XE50",
+        "L1_2J15_XE55", "L1_J40_XE50",
 
         #'L1_2J40_XE45',
-        "L1_2J50_XE40", "L1_J40_XE60","L1_J40.0ETA25_XE50",
+        "L1_2J50_XE40", "L1_J40_XE60",
+        
 
         # XE
         "L1_XE35", "L1_XE40", "L1_XE45", "L1_XE50", 
         "L1_XE55", "L1_XE60", "L1_XE70", "L1_XE80",
-        'L1_XE10', 'L1_XE30', 'L1_XE65', 'L1_XE75', 'L1_XE150', 'L1_XE300',
+        'L1_XE30', 'L1_XE300',
+        "L1_XE10",
         
         #XS
-        'L1_XS20', 'L1_XS30',
         'L1_EM12_XS20', 'L1_EM15_XS30',
         
         # TE
-        #"L1_TE3",        "L1_TE5",        "L1_TE10",        "L1_TE15",        "L1_TE20",        "L1_TE25",        "L1_TE30",        "L1_TE40",
-        #"L1_TE5",        "L1_TE30",        "L1_TE40",        "L1_TE45",        "L1_TE50",        "L1_TE55",        "L1_TE60",        "L1_TE65",
-        "L1_TE5",        "L1_TE10",        "L1_TE15",   "L1_TE20",  "L1_TE25",  "L1_TE30",        "L1_TE40",      "L1_TE70",      
+#        'L1_TE5', ## disabled?
 
-        #"L1_TE3.0ETA24", "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", 
-        #"L1_TE5.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24", "L1_TE45.0ETA24", "L1_TE50.0ETA24", "L1_TE55.0ETA24", "L1_TE60.0ETA24", "L1_TE65.0ETA24", 
-        "L1_TE5.0ETA24", "L1_TE10.0ETA24", "L1_TE15.0ETA24", "L1_TE20.0ETA24", "L1_TE25.0ETA24", "L1_TE30.0ETA24", "L1_TE40.0ETA24","L1_TE70.0ETA24",
+        #VTE + MBTS
+        #"L1_MBTS_1_VTE2", "L1_MBTS_1_VTE3", "L1_MBTS_1_VTE4", "L1_MBTS_1_VTE5", "L1_MBTS_1_VTE10", "L1_MBTS_2_VTE2", "L1_MBTS_2_VTE3", "L1_MBTS_2_VTE4", "L1_MBTS_2_VTE5", "L1_MBTS_2_VTE10", 
+        
+        #TE + MU
 
         # MBTS
-        "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-        "L1_MBTS_1_EMPTY", "L1_MBTS_1_UNPAIRED_ISO", 
-        "L1_MBTS_2_EMPTY", "L1_MBTS_2_UNPAIRED_ISO",
-        "L1_MBTS_1_1_EMPTY", "L1_MBTS_1_1_UNPAIRED_ISO","L1_MBTS_4_A_UNPAIRED_ISO","L1_MBTS_4_C_UNPAIRED_ISO",
-#        'L1_MBTSA0' ,'L1_MBTSA1' ,'L1_MBTSA2' ,'L1_MBTSA3' ,'L1_MBTSA4' ,
-#        'L1_MBTSA5' ,'L1_MBTSA6' ,'L1_MBTSA7' ,'L1_MBTSA8' ,
-#        'L1_MBTSA10','L1_MBTSA12','L1_MBTSA14',
-#        'L1_MBTSC0' ,'L1_MBTSC1' ,'L1_MBTSC2' ,'L1_MBTSC3' ,'L1_MBTSC4' ,
-#        'L1_MBTSC5' ,'L1_MBTSC6' ,'L1_MBTSC7' ,'L1_MBTSC8' ,
-#        'L1_MBTSC10','L1_MBTSC12','L1_MBTSC14',
         # beam splashes
-        "L1_MBTS_4_A", "L1_MBTS_4_C",
+        
+        #Overlay
+#        "L1_MBTS_1_OVERLAY","L1_TE20_OVERLAY",
+        
+        #BeamSpot
+#        "L1_MBTS_1_VTE70",
 
         #BGRP9
-        'L1_MBTS_1_BGRP9','L1_MBTS_2_BGRP9',
 
         #BGRP11
-        'L1_MBTS_1_BGRP11','L1_MBTS_2_BGRP11',
 
         # RNDM
-        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO','L1_RD0_EMPTY',
-        "L1_RD1_FILLED","L1_RD1_EMPTY","L1_RD1_BGRP10",
-        "L1_RD2_FILLED","L1_RD2_EMPTY","L1_RD2_BGRP12",
-        "L1_RD3_FILLED","L1_RD3_EMPTY",
-        'L1_RD0_FIRSTEMPTY', 
-        'L1_RD0_BGRP9', 'L1_RD0_BGRP11', 'L1_RD0_ABORTGAPNOTCALIB',
+        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY',
+        "L1_RD1_EMPTY","L1_RD2_EMPTY",
+#        'L1_RD0_FIRSTEMPTY', 
+        'L1_RD0_ABORTGAPNOTCALIB',
+#        'L1_RD2_FILLED', # This is not needed?
 
         #LUCID
-        'L1_LUCID', 'L1_LUCID_EMPTY', 'L1_LUCID_UNPAIRED_ISO', 
-        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
+#        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
         #'L1_LUCID_COMM_EMPTY', 'L1_LUCID_COMM_UNPAIRED_ISO', 
 
+        
+
         # ZDC
-        'L1_ZDC_A', 'L1_ZDC_C', 'L1_ZDC_A_C',
-        'L1_ZDC_AND', # FTHR
+         # FTHR
 
         # VDM
-        'L1_BGRP9', #"L1_BGRP7",
+         #"L1_BGRP7",
 
         # TRT
         # "L1_TRT",
-        "L1_TRT_FILLED",
-        "L1_TRT_EMPTY",
 
         # TGC
         "L1_TGC_BURST",
 #        "L1_TGC_BURST_EMPTY",
 
         # LHCF
-        "L1_LHCF", "L1_LHCF_UNPAIRED_ISO", "L1_LHCF_EMPTY",
     
         #CALREQ
         "L1_CALREQ2",
@@ -578,244 +503,124 @@ def defineMenu():
         "L1_ZB",
 
         # BPTX
-        "L1_BPTX0_BGRP0", "L1_BPTX1_BGRP0",
         
         # BCM
-        'L1_BCM_Wide_BGRP0','L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO', 'L1_BCM_AC_CA_UNPAIRED_ISO',
+         #'L1_BCM_AC_CA_UNPAIRED_ISO',
+        'L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
         'L1_BCM_AC_UNPAIRED_ISO','L1_BCM_CA_UNPAIRED_ISO',
         'L1_BCM_AC_UNPAIRED_NONISO','L1_BCM_CA_UNPAIRED_NONISO',
         'L1_BCM_AC_ABORTGAPNOTCALIB', 'L1_BCM_CA_ABORTGAPNOTCALIB','L1_BCM_Wide_ABORTGAPNOTCALIB',
         'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB','L1_BCM_Wide_CALIB',
 
         #AFP
-        'L1_AFP_NSC', 'L1_AFP_FSC', 
-        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
+#         'L1_AFP_FSC', 
+#        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
 
-        #--------------------------------
+#	'L1_EM7_AFP_A_AND_C','L1_EM12_AFP_A_AND_C',
+
+
+          #--------------------------------
         # TOPO items
         #--------------------------------
 
         # B-jet
-        'L1_BTAG-MU4J15', 'L1_BTAG-MU4J30', 'L1_BTAG-MU6J20', 'L1_BTAG-MU6J25',
-        #'L1_BTAG-MU4J20',
-        'L1_3J15_BTAG-MU4J15', 'L1_3J15_BTAG-MU4J30', 'L1_3J15_BTAG-MU6J25', 'L1_3J20_BTAG-MU4J20',
-        #'L1_3J20_BTAG-MU4J30', 'L1_3J20_BTAG-MU6J25',
-
-        # ZH
-        'L1_DPHI-AJ20s2XE50', 'L1_J40_DPHI-J20s2XE50', 'L1_J40_DPHI-J20XE50', 'L1_J40_DPHI-CJ20XE50', #'L1_J40_DPHI-J20s2XE30',
-#SX        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO',
-#SX        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO',
+        #'L1_BTAG-MU4J15',
+        #'L1_BTAG-MU6J20',
+
+        # ZH - all removed
+   
+
+        #Higgsino
+        'L1_2MU4_J40_XE50',
+        'L1_MU4_J30_XE40_DPHI-J20s2XE30','L1_MU4_J50_XE50_DPHI-J20s2XE30',
+        'L1_MU4_XE60',
 
         # HT
-        'L1_HT190-J15.ETA21',
         'L1_HT190-J15s5.ETA21',
-        'L1_HT150-J20.ETA31',
-        'L1_HT150-J20s5.ETA31',   
 
-        "L1_HT150-J20s5.ETA31_MJJ-400",
         "L1_HT150-J20s5.ETA31_MJJ-400-CF",
         
         # Jpsi T&P
-        'L1_JPSI-1M5', 'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
-        'L1_KF-XE40', 'L1_KF-XE50', 'L1_KF-XE55', 'L1_KF-XE60', 'L1_KF-XE65', 'L1_KF-XE75',
+        'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
+#            
         
-        # W T&P
-#        'L1_W-05DPHI-JXE-0',
-#        'L1_W-10DPHI-JXE-0',
-#        'L1_W-15DPHI-JXE-0',
-#        'L1_W-05DPHI-EMXE-1',
-        #'L1_W-15DPHI-EMXE-1',
-#        'L1_W-05DPHI-EM15XE-1',
-        #'L1_W-15DPHI-EM15XE-1',
-        'L1_W-05RO-XEHT-0',
-        'L1_W-90RO2-XEHT-0',
-        'L1_W-250RO2-XEHT-0',
-        'L1_W-HT20-JJ15.ETA49',
-        'L1_W-NOMATCH',
-        #'L1_W-NOMATCH_W-05RO-XEEMHT',
-        'L1_EM12_W-MT25',
-#        'L1_EM12_W-MT35',
-        'L1_EM15_W-MT35',
-        'L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE',
-        'L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE',
-        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE',
-        'L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        'L1_EM12_W-MT35_XS50',
-        'L1_EM15_W-MT35_XS60',
-        'L1_EM10VH_W-MT35_XS50',
-        'L1_EM15VH_W-MT35_XS60',
-        'L1_EM20VH_W-MT35_XS60',
-        'L1_EM22VHI_W-MT35_XS40',
-        # Old
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0',
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20',
-        'L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE',
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30',
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE',
-        #'L1_W-10DPHI-JXE-0',
-        #'L1_W-20DPHI-JXE-1',
-        #'L1_W-20DPHI-JXE-0',
-        #'L1_W-20DPHI-EMXE-1',
-        #'L1_W-20DPHI-EMXE-0',
-        #'L1_W-05RO-XEHT-0',
-        #'L1_W-08RO-XEHT-1',
-        #'L1_W-40RO2-XEHT-0',
-        #'L1_W-90RO2-XEHT-1',
-        #'L1_W-HT20-JJ0.ETA49',
-        #'L1_W-NOMATCH',
-        #'L1_W-NOMATCH_W-05RO-XEEMHT',
-        #'L1_EM3_W-MT20',
-        #'L1_EM3_W-MT40',
-
-        #Bphysics items
-#SX        'L1_BPH-DR-2MU4', 
-#SX        'L1_BPH-2M-2MU4', 
-#SX        'L1_BPH-4M8-2MU4',
-#SX        'L1_BPH-DR-2MU4_BPH-2M-2MU4', 'L1_BPH-DR-2MU4_BPH-4M8-2MU4',
-
-#SX        'L1_BPH-DR-2MU6', 
-#SX        'L1_BPH-2M-2MU6', 'L1_BPH-4M8-2MU6',
-#SX        'L1_BPH-DR-2MU6_BPH-2M-2MU6', 'L1_BPH-DR-2MU6_BPH-4M8-2MU6',
-
-        # temporarily commented out until CTP Simulation is fixed (menu generation and TMC understand multiplicity topo)
-#SX uncommenting
-        'L1_2MU4-BO',
-        'L1_2MU6-BO',
-        'L1_MU6MU4-BO', 
-
-        # L1 items for L1Topo streamers
-#SX        'L1_BPH-2M-2MU4-B',
-#SX        'L1_BPH-2M-2MU4-BO',
-#SX        'L1_BPH-2M-MU6MU4',
-#SX        'L1_BPH-2M-MU6MU4-B',
-#SX        'L1_BPH-2M-MU6MU4-BO',    
-#SX        'L1_BPH-4M8-2MU4-B',
-#SX        'L1_BPH-4M8-2MU4-BO',
-#SX        'L1_BPH-4M8-MU6MU4',
-#SX        'L1_BPH-4M8-MU6MU4-B',        
-#SX        'L1_BPH-4M8-MU6MU4-BO',
-        'L1_DY-DR-2MU4',
-        'L1_EM15VH_2EM8VH_MU6',
-        #'L1_DY-BOX-MU6MU4',
-        'L1_DY-BOX-2MU6',
-        'L1_LFV-MU',
+        # W T&P - all removed
+
         'L1_LFV-MU6',
+        'L1_LFV-MU11',
         'L1_LFV-EM8I',
         'L1_LFV-EM15I',
-        'L1_EM7_MU15',
-        'L1_EM8VH_MU15',
         'L1_DPHI-J20s2XE50',
         'L1_J40_XE50_DPHI-J20s2XE50',
-        'L1_DPHI-J20XE50',
-        'L1_DPHI-CJ20XE50',
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30',
         'L1_2MU4_J20_XE30_DPHI-J20s2XE30',
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30',
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50',
-        'L1_MJJ-900',
-        'L1_MJJ-800',
         'L1_MJJ-700',
-        'L1_MJJ-400',
-        #'L1_MJJ-350',
-#        'L1_MJJ-300',
-#        'L1_MJJ-200',
-        'L1_MJJ-100',
-        'L1_HT150-JJ15.ETA49',
-        'L1_HT150-JJ15.ETA49_MJJ-400',
-        'L1_J4-MATCH',
+        'L1_MJJ-300',
+        #'L1_MJJ-100',
+        #'L1_MJJ-400',
+        #'L1_MJJ-800',
+        'L1_MJJ-500-NFF',
+        'L1_J50_DETA20-J50J',
+        'L1_DPHI-2EM3',
+        #'L1_HT150-JJ15.ETA49',
+        #'L1_HT150-JJ15.ETA49_MJJ-400',
+        #'L1_J4-MATCH',
         'L1_LLP-RO',
-        'L1_LLP-NOMATCH',
-        'L1_DR-MU10TAU12I',    
-#        'L1_TAU12I-J25',    
-        'L1_EM15TAU12I-J25',
-        'L1_DR-EM15TAU12I',    
-        'L1_DR-EM15TAU12I-J25',    
-        'L1_TAU20ITAU12I-J25',
+        #'L1_LLP-NOMATCH',
+        #'L1_EM15TAU12I-J25',
+        'L1_DR-EM15TAU12I-J25',
+        #'L1_TAU20ITAU12I-J25',
         'L1_DR-TAU20ITAU12I',    
-        'L1_BOX-TAU20ITAU12I',
         'L1_DR-TAU20ITAU12I-J25',
+        #'L1_DR-MU10TAU12I',
 
-        'L1_DR25-TAU20ITAU12I',
-        'L1_DR25-TAU20ITAU12I-J25',
         'L1_30M-EM20ITAU12',
         'L1_MJJ-400-CF',
     
-        'L1_LAR-EM',
-        'L1_LAR-J',
-#SX        'L1_BPH-DR-2MU4-B',
-#SX        'L1_BPH-DR-2MU4-BO',
-#SX        'L1_BPH-DR-MU6MU4',
-#SX        'L1_BPH-DR-MU6MU4-B',
-#SX        'L1_BPH-DR-MU6MU4-BO',
-
-#new bhysics
-        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4',
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4',
-        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6',
-        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
-        'L1_2MU4-B',
-        'L1_2MU6-B' ,
-        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4',
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B' ,
-        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4' ,
-        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4' ,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO' ,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4',
-        'L1_MU6_2MU4-B',
-
-        'L1_BPH-2M8-2MU4', # ATR-15197 'L1_BPH-2M9-2MU4',
-        'L1_BPH-8M15-MU6MU4',
-        'L1_BPH-8M15-2MU6',
-        
+        #'L1_LAR-EM',
+        #'L1_LAR-J',
+        #'L1_LAR-ZEE',
+        #'L1_LAR-ZEE_LAR-EM',
+        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
+        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
+        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
+        #'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',
+
+        #ATR-19720 - no algorithm in master
+#        'L1_BPH-8M15-0DR22-2MU6',
+#        'L1_BPH-2M9-2DR15-2MU6',
+#        'L1_BPH-2M9-0DR15-MU6MU4',
+#        'L1_BPH-8M15-0DR22-MU6MU4-BO',
+#        'L1_BPH-2M9-0DR15-2MU4',
+#
+#        'L1_BPH-0M9-EM7-EM5',        
+#        'L1_BPH-0DR3-EM7J15',
+#        'L1_BPH-0M9-EM7-EM5_MU6',
+#        'L1_BPH-0DR3-EM7J15_MU6',
+#        'L1_BPH-0M9-EM7-EM5_2MU4',
+#        'L1_BPH-0DR3-EM7J15_2MU4',
+#
         # combined L1Topo for VBF
-        'L1_MU6_MJJ-200',
-        'L1_MU6_MJJ-300',
-        'L1_MU6_MJJ-400',
-        'L1_MU6_MJJ-500',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800',
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900',
-        'L1_3J20_4J20.0ETA49_MJJ-400',
-        'L1_3J20_4J20.0ETA49_MJJ-700',
-        'L1_3J20_4J20.0ETA49_MJJ-800',
-        'L1_3J20_4J20.0ETA49_MJJ-900',
         
-        'L1_XE35_MJJ-200',
+        # INVM + DPHI 
+        #'L1_MJJ-400-NFF-0DPHI20',
+        'L1_MJJ-400-NFF-0DPHI22',
+        'L1_MJJ-400-NFF-0DPHI24',
+        'L1_MJJ-400-NFF-0DPHI26',
    
         ### ATR-15062
-        'L1_EM18VH_MJJ-300',
+        'L1_EM18VHI_MJJ-300',
 
-        'L1_LATE-MU10_XE50', 'L1_LATE-MU10_J50',
+        'L1_LATE-MU10_XE50','L1_LATE-MU10_XE40', 'L1_LATE-MU10_J50',
 
         'L1_TAU60_DR-TAU20ITAU12I',
 
-        'L1_SC111',
-        'L1_SC85',
+        'L1_SC111-CJ15',
+#        'L1_SC85-CJ15',
         
         ##     # Partition 1
         ##     'L1_CALREQ0_P1', 'L1_CALREQ1_P1', 'L1_CALREQ2_P1',
 
         #ALFA
-#ALFA_B7R1L_OD        'L1_ALFA_ELAST1',
-#        'L1_ALFA_ELAST2',
-#        'L1_ALFA_ELAST11','L1_ALFA_ELAST12',
-#        'L1_ALFA_ELAST13','L1_ALFA_ELAST14','L1_ALFA_ELAST15','L1_ALFA_ELAST15_Calib',
-#        'L1_ALFA_ELAST16','L1_ALFA_ELAST17','L1_ALFA_ELAST18','L1_ALFA_ELAST18_Calib',
 #        'L1_ALFA_SDIFF5','L1_ALFA_SDIFF6','L1_ALFA_SDIFF7','L1_ALFA_SDIFF8',
 #        'L1_MBTS_1_A_ALFA_C','L1_MBTS_1_C_ALFA_A','L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO',
 #        'L1_MBTS_2_A_ALFA_C','L1_MBTS_2_C_ALFA_A','L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO',
@@ -829,64 +634,105 @@ def defineMenu():
 #
 #        'L1_EM3_ALFA_EINE',
 #        'L1_J12_ALFA_ANY','L1_J12_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO','L1_TE5_ALFA_EINE',
+#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO',
+#         'L1_TE5_ALFA_EINE',
 #        'L1_TRT_ALFA_ANY','L1_TRT_ALFA_ANY_UNPAIRED_ISO',
 #        'L1_TRT_ALFA_EINE',
 #        #'L1_LHCF_ALFA_ANY_A',
 #        #'L1_LHCF_ALFA_ANY_C',
 ##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO','L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO',
-#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO','L1_ALFA_BGT_BGRP10',
-#        'L1_ALFA_SHOWSYST5',
-#        'L1_ALFA_SYST9' ,'L1_ALFA_SYST10','L1_ALFA_SYST11','L1_ALFA_SYST12',
-#        'L1_ALFA_SYST17','L1_ALFA_SYST18',
-         'L1_ALFA_ANY',
-#        'L1_ALFA_ANY_EMPTY','L1_ALFA_ANY_FIRSTEMPTY','L1_ALFA_ANY_UNPAIRED_ISO','L1_ALFA_ANY_UNPAIRED_NONISO',
-#        'L1_ALFA_ANY_BGRP10','L1_ALFA_ANY_ABORTGAPNOTCALIB','L1_ALFA_ANY_CALIB',
-        'L1_ALFA_B7L1U','L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L','L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',
+#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO',
 #        'L1_ALFA_ANY_A_EMPTY','L1_ALFA_ANY_C_EMPTY',
-#        'L1_ALFA_B7L1U_OD','L1_ALFA_B7L1L_OD','L1_ALFA_A7L1U_OD','L1_ALFA_A7L1L_OD','L1_ALFA_A7R1U_OD','L1_ALFA_A7R1L_OD','L1_ALFA_B7R1U_OD','L1_ALFA_B7R1L_OD',
-#        'L1_ALFA_B7L1_OD','L1_ALFA_A7L1_OD','L1_ALFA_B7R1_OD','L1_ALFA_A7R1_OD',
 #
-         'L1_AFP_C_MBTS_A',
-         'L1_AFP_C_ZDC_C',
-         'L1_AFP_C_J12',
-         'L1_AFP_C_EM3',
-         'L1_AFP_C_TE5',
-         'L1_AFP_C_ALFA_C',
-         'L1_AFP_C_ALFA_A',
-         'L1_AFP_C_ANY_MBTS_A',
-         'L1_AFP_C_MU4',
+#         'L1_AFP_C_MBTS_A',
+#         'L1_AFP_C_ZDC_C',
+#         'L1_AFP_C_J12',
+#         'L1_AFP_C_EM3',
+#         'L1_AFP_C_TE5',
+#         'L1_AFP_C_ALFA_C',
+#         'L1_AFP_C_ALFA_A',
+#         'L1_AFP_C_ANY_MBTS_A',
+#         'L1_AFP_C_MU4',
+
+        # Items for beta*=90m run
+#        'L1_J12_ALFA_EINE',
+#        'L1_2EM3_ALFA_EINE',
+#        'L1_MU4_ALFA_ANY',
+#        'L1_MU4_ALFA_ANY_UNPAIRED_ISO',
+#        'L1_MU4_ALFA_ANY_PAIRED_UNPAIRED_ISO',
+#        'L1_MU4_ALFA_EINE',
+
+
+        #ATR-18815
+        #'L1_LFV-EM8I-MU11',
+        #'L1_LFV-EM12I-MU6',
+
+        #ATR-19355
+        'L1_BPH-0M10-3MU4',
+
+        #ATR-18824
+        'L1_ZAFB-04DPHI-EM15I',
+        'L1_ZAFB-25DPHI-EM15I',
+        #'L1_ZAFB-25DPHI-EM18I',
+
+        #ATR-19302: 
+#        'L1_DPHI-M70-2EM10I',
+        'L1_DPHI-M70-2EM12I',
+
+        #ATR-19510
+        'L1_DY-BOX-2MU4',
+        #'L1_DY-DR-2MU4',
+        'L1_DY-BOX-2MU6',
+
+                
+        #ATR-17320
+        'L1_CEP-CJ60',
+        'L1_CEP-CJ50' ,
+
+        #ATR-20174
+        'L1_BPH-8M15-2MU4-BO'
+
+
 
         ]
     
 
-    # the CTP ID mapping still has to be defined, currently it is taken from the order of the items
-    #Free slot [ATR-14858], 16-08-16
-    #[82,143,377,378,379,406,409,416,480]
+    #CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
+    # Run this file as python <this file> to print out available IDs
+    # 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (from run 2)
+    # 509-511 are reserved for CALREQ
 
     
 
     Lvl1Flags.CtpIdMap = {
+
         'L1_EM3' : 0,
         'L1_EM7' : 1,
         'L1_EM12' : 2,
         'L1_EM8VH' : 3,
         'L1_EM10VH' : 4,
-        'L1_EM13VH' : 5,
         'L1_EM15' : 6,
+        'L1_EM30VHI' : 25,
+        'L1_EM15VHI' : 29,
+        'L1_EM24VHIM' : 30,
         'L1_EM15VH' : 7,
-        'L1_EM18VH' : 8,
+        'L1_EM18VHI' : 8,
         'L1_EM20VH' : 9,
         'L1_EM20VHI' : 10,
         'L1_EM22VHI' : 11,
+        'L1_EM22VH' : 295,
+        'L1_EM24VHI' : 392,
         'L1_EM3_EMPTY' : 12,
         'L1_EM7_EMPTY' : 13,
+        'L1_EM7_UNPAIRED_ISO' : 389,
+        'L1_EM7_FIRSTEMPTY' : 371,
+        'L1_EM20VH_FIRSTEMPTY' : 411,
         'L1_MU4' : 14,
         'L1_MU6' : 15,
         'L1_MU10' : 16,
         'L1_MU11' : 256,
-        'L1_MU15' : 17,
         'L1_MU20' : 18,
+        'L1_MU21' : 17,
         'L1_MU4_EMPTY' : 19,
         'L1_MU6_EMPTY' : 66,
         'L1_MU4_FIRSTEMPTY' : 20,
@@ -894,103 +740,99 @@ def defineMenu():
         'L1_MU4_UNPAIRED_ISO' : 22,
         'L1_2EM3' : 23,
         'L1_2EM7' : 24,
-        'L1_2EM10VH' : 25,
-        'L1_2EM13VH' : 26,
         'L1_2EM15' : 27,
         'L1_2EM15VH' : 28,
-        'L1_EM7_2EM3' : 29,
-        'L1_EM12_2EM3' : 30,
-        'L1_EM15VH_3EM7' : 31,
-        'L1_2EM18VH':398,
-        'L1_2EM20VH':400,
-        'L1_EM15VH_3EM10VH':401,
-        'L1_EM18VH_3EM8VH':406,
-        'L1_EM18VH_2EM10VH_3EM7':408,
-        'L1_EM20VH_3EM10VH':431, 
-        'L1_EM20VH_2EM10VH_3EM8VH':432,
+        'L1_2EM15VHI' : 31,
+        'L1_2EM20VH' : 400,
+        'L1_EM20VH_3EM10VH' : 431,
+        'L1_EM7_MU10' : 65,
         'L1_2MU4' : 32,
         'L1_2MU6' : 33,
         'L1_2MU10' : 34,
         'L1_2MU20_OVERLAY' : 35,
-        'L1_MU10_2MU6' : 36,
         'L1_MU11_2MU6' : 37,
         'L1_3MU4' : 38,
         'L1_MU6_2MU4' : 39,
         'L1_3MU6' : 40,
         'L1_4MU4' : 46,
-        'L1_4J15.0ETA25' : 41,
-        'L1_EM15I_MU4' : 42,
+        'L1_MU6_3MU4' : 36,
+        'L1_2MU6_3MU4' : 42,
+        'L1_2MU11' : 48,
+        'L1_MU11_2MU10' : 49,
         'L1_2EM8VH_MU10' : 43,
         'L1_EM15VH_MU10' : 44,
+        'L1_EM7_MU20' : 483,
+        'L1_EM8VH_MU20' : 484,
+        'L1_TAU5' : 50,
         'L1_TAU12' : 45,
         'L1_TAU12IM' : 47,
-        'L1_TAU20' : 49,
         'L1_TAU20IM' : 51,
         'L1_TAU30' : 53,
+        'L1_TAU30_EMPTY' : 341,
+        'L1_TAU30_UNPAIRED_ISO' : 343,
         'L1_TAU40' : 54,
         'L1_TAU60' : 55,
+        'L1_TAU90' : 56,
         'L1_TAU100' : 52,
-        'L1_TAU8' : 56,
         'L1_TAU8_EMPTY' : 57,
+        'L1_TAU8_UNPAIRED_ISO' : 388,
+        'L1_TAU8_FIRSTEMPTY' : 391,
         'L1_TAU20IM_2TAU12IM' : 58,
-        'L1_TAU20_2TAU12' : 59,
-        'L1_EM15HI_2TAU12IM' : 60,
-        'L1_EM15HI_2TAU12IM_J25_3J12' : 61,
-        'L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15' : 378,
-        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
-        'L1_EM15HI_TAU40_2TAU15' : 62,
+        'L1_TAU60_2TAU40' : 458,
+        'L1_2TAU5' : 59,
+        'L1_2TAU8' : 166,
+        'L1_EM15VHI_2TAU12IM' : 60,
+        'L1_EM15VHI_2TAU12IM_J25_3J12' : 61,
+        'L1_EM15VHI_2TAU12IM_4J12' : 5,
+        'L1_EM15VHI_TAU40_2TAU15' : 62,
         'L1_MU10_TAU12IM' : 63,
         'L1_MU10_TAU12IM_J25_2J12' : 64,
-        'L1_EM7_MU10':65,
-        'L1_TAU30_EMPTY':341,
+        'L1_MU10_TAU12IM_3J12' : 482,
         'L1_MU10_TAU20IM' : 67,
         'L1_MU11_TAU20IM' : 430,
         'L1_MU10_TAU20IM_J25_2J20' : 377,
-
         'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
-        'L1_J25_2J20_3J12_BOX-TAU20ITAU12I' : 71,
-        'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
-        'L1_MU10_TAU12I-J25' : 73,
+        'L1_TAU20IM_2TAU12IM_4J12.0ETA23' : 316,
+        #'L1_TAU20IM_2TAU12IM_4J12.0ETA25' : 73,
+        'L1_TAU20IM_2TAU12IM_4J12.0ETA28' : 77,
+        'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
         'L1_TAU20IM_2J20_XE45' : 74,
-        'L1_TAU30_UNPAIRED_ISO' :343,
-        'L1_TAU60_DR-TAU20ITAU12I' : 76,
-        'L1_EM15HI_2TAU12IM_XE35' : 78,
+        'L1_TAU20IM_2J20_XE50' : 79,
+        'L1_EM15VHI_2TAU12IM_XE35' : 78,
+        'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
         'L1_MU10_TAU12IM_XE35' : 81,
-#        'L1_MU10_TAU12IM_XE40' : 82,
         'L1_TAU20IM_2TAU12IM_XE35' : 83,
-        'L1_TAU20_2TAU12_XE35' : 84,
         'L1_TAU40_2TAU12IM_XE40' : 429,
-#        'L1_EM15VH_JJ15.23ETA49' : 86,
-        'L1_MU4_J12' : 87,
-        'L1_MU4_J50_XE40' : 330,
+        'L1_EM18VHI_3J20' : 172,
+        'L1_EM20VH_3J20' : 26,
         'L1_MU6_J20' : 88,
+        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
         'L1_MU6_J40' : 89,
         'L1_MU6_J75' : 90,
-        'L1_2MU4_J40_XE20' : 331,
-        'L1_MU20_J40'  : 428,
+        'L1_MU10_2J20' : 278,
+        'L1_MU10_3J20' : 173,
+        'L1_MU10_2J15_J20' : 255,
+        'L1_MU20_J40' : 428,
         'L1_MU20_XE30' : 433,
-        'L1_J12' : 91,
+        'L1_MU20_J50' : 82,
         'L1_J15' : 92,
         'L1_J20' : 93,
         'L1_J25' : 94,
         'L1_J30' : 95,
-        
         'L1_J40' : 96,
         'L1_J50' : 97,
         'L1_J75' : 98,
         'L1_J85' : 99,
         'L1_J100' : 100,
-        'L1_J120' : 101,
+        #'L1_J120' : 101,
         'L1_J400' : 102,
+        #'L1_4J20.0ETA49' : 383,
         'L1_J20.31ETA49' : 103,
         'L1_J30.31ETA49' : 104,
         'L1_J50.31ETA49' : 105,
         'L1_J75.31ETA49' : 106,
-        'L1_J100.31ETA49' : 107,
-#        'L1_J40.0ETA25' : 108,
-        
         'L1_J15.31ETA49' : 109,
-        'L1_J20.28ETA31' : 110,
+        'L1_J30.0ETA49_2J20.0ETA49' : 137,
         'L1_J12_EMPTY' : 111,
         'L1_J12_FIRSTEMPTY' : 112,
         'L1_J12_UNPAIRED_ISO' : 113,
@@ -1005,43 +847,27 @@ def defineMenu():
         'L1_J50_UNPAIRED_ISO' : 121,
         'L1_J50_UNPAIRED_NONISO' : 122,
         'L1_J50_ABORTGAPNOTCALIB' : 123,
-
-        'L1_J20_J20.31ETA49' : 125,
-        'L1_3J15' : 126,
-        'L1_3J20' : 127,
-        'L1_3J40' : 128,
-        'L1_3J15.0ETA25' : 129,
+        'L1_J100_FIRSTEMPTY' : 414,
+        'L1_J45.0ETA20_3J15.0ETA25' : 86,
+        'L1_J50_2J40.0ETA25_3J15.0ETA25' : 87,
         'L1_3J50' : 130,
         'L1_4J15' : 131,
         'L1_4J20' : 132,
         'L1_3J15.0ETA25_XE40' : 184,
-        
-#        'L1_3J75' : 133,
-#        'L1_4J30' : 134,
         'L1_6J15' : 135,
-        'L1_J75_3J20' : 136,
         'L1_J85_3J30' : 480,
-        'L1_J30.0ETA49_2J20.0ETA49' : 137,
-
-       
-        'L1_TE10' : 138,
-        'L1_TE15' : 82,
-        'L1_TE25' : 143,
-
+        'L1_J25.0ETA23_2J15.31ETA49' : 335,
+        'L1_J40.0ETA25_2J15.31ETA49' : 181,
+        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
+        'L1_3J25.0ETA23' : 373,
+        'L1_3J35.0ETA23' : 425,
+        'L1_4J15.0ETA25' : 41,
         'L1_5J15.0ETA25' : 140,
         'L1_2J15_XE55' : 141,
         'L1_J40_XE50' : 142,
-        #'L1_J75_XE40' : 143,
-        'L1_J75_XE50' : 133,
-
+        'L1_2J50_XE40' : 175,
+        'L1_J40_XE60' : 176,
         'L1_XE10': 68,
-        #'L1_XE25': 82,
-        'L1_XE30': 85,
-        'L1_XE65': 108,
-        'L1_XE75': 134,
-        'L1_XE150': 156,
-        'L1_XE300': 187,
-        
         'L1_XE35' : 144,
         'L1_XE40' : 145,
         'L1_XE45' : 146,
@@ -1050,129 +876,23 @@ def defineMenu():
         'L1_XE60' : 149,
         'L1_XE70' : 150,
         'L1_XE80' : 151,
-        'L1_XS20' : 152,
-        'L1_XS30' : 153,
+        'L1_XE30' : 85,
+        'L1_XE300' : 187,
         'L1_EM12_XS20' : 154,
         'L1_EM15_XS30' : 155,
-
-        'L1_TE30' : 157,
-        'L1_TE40' : 158,
-        'L1_TE70' : 159,
-        'L1_TE30.0ETA24' : 160,
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_BCM_AC_CA_UNPAIRED_ISO' : 162,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
-        'L1_MBTS_1_EMPTY' : 164,
-        'L1_MBTS_1_UNPAIRED_ISO' : 165,
-        'L1_MBTS_2_EMPTY' : 166,
-        'L1_MBTS_2_UNPAIRED_ISO' : 167,
-        'L1_MBTS_1_1_EMPTY' : 168,
-        'L1_MBTS_1_1_UNPAIRED_ISO' : 169,
-
-        'L1_DPHI-AJ20s2XE50' : 171,
-        'L1_EM13VH_3J20' : 172,
-        'L1_EM18VH_3J20' : 295,
-        'L1_MU10_3J20' : 173,
-
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
-        'L1_J40.0ETA25_XE50' : 177,
-        'L1_MU10_2J20' : 278,
-        'L1_TAU40_2TAU20IM' : 254,
-        'L1_MU10_2J15_J20' : 255,
-# freeing some CTPIDs  
-#        'L1_MBTSA0' : 170,
-#        'L1_MBTSA1' : 171,
-#        'L1_MBTSA2' : 172,
-#        'L1_MBTSA3' : 173,
-#        'L1_MBTSA4' : 174,
-#        'L1_MBTSA5' : 175,
-#        'L1_MBTSA6' : 176,
-#        'L1_MBTSA7' : 177,
-#        'L1_MBTSA8' : 178,
-#        'L1_MBTSA10' : 179,
-#        'L1_MBTSA12' : 180,
-#        'L1_MBTSA14' : 181,
-#        'L1_MBTSC0' : 182,
-#        'L1_MBTSC1' : 183,
-#        'L1_MBTSC2' : 184,
-#        'L1_MBTSC3' : 185,
-#        'L1_MBTSC4' : 186,
-#        'L1_MBTSC5' : 187,
-#        'L1_MBTSC6' : 188,
-#        'L1_MBTSC7' : 189,
-#        'L1_MBTSC8' : 190,
-#        'L1_MBTSC10' : 191,
-#        'L1_MBTSC12' : 192,
-#        'L1_MBTSC14' : 193,
-
-        
-        'L1_BPH-2M8-2MU4' : 178, # ATR-15197 'L1_BPH-2M9-2MU4' : 178,
-        'L1_BPH-8M15-MU6MU4' : 179,
-        'L1_BPH-8M15-2MU6' : 180,
-        'L1_J15.0ETA25_2J15.31ETA49': 305 , 
-        'L1_J40.0ETA25_2J15.31ETA49' : 181,
-        'L1_J40.0ETA25_2J25_J20.31ETA49' : 182,
-
-        "L1_J40.0ETA25_2J30_J20.31ETA49":250 , 
-
-        "L1_HT150-J20s5.ETA31_MJJ-400": 272 , ## noid(ea)
-        "L1_HT150-J20s5.ETA31_MJJ-400-CF": 273,
-        
-        ## the ctp ids are a mess.. no 7 consequetive ids are free.. but these here are:
-        'L1_AFP_C_MBTS_A':183,
-        'L1_AFP_C_ZDC_C':189,
-        'L1_AFP_C_J12':190,
-        'L1_AFP_C_EM3':191,
-        'L1_AFP_C_TE5':192,
-        'L1_AFP_C_ALFA_C':193,
-        'L1_AFP_C_ALFA_A':170,
-        'L1_AFP_C_ANY_MBTS_A':174,
-        'L1_AFP_C_MU4':379,   
-        
-#        'L1_EM8I' : 183,
-#        'L1_EM15I': 184,
-        'L1_MBTS_4_A_UNPAIRED_ISO' : 185,
-        'L1_MBTS_4_C_UNPAIRED_ISO' : 186,        
-        'L1_MBTS_4_A' : 194,
-        'L1_MBTS_4_C' : 195,
-        'L1_MBTS_1_BGRP9' : 196,
-        'L1_MBTS_2_BGRP9' : 197,
-        'L1_MBTS_1_BGRP11' : 198,
-        'L1_MBTS_2_BGRP11' : 199,
         'L1_RD0_FILLED' : 200,
         'L1_RD0_UNPAIRED_ISO' : 201,
         'L1_RD0_EMPTY' : 202,
-        'L1_RD1_FILLED' : 203,
         'L1_RD1_EMPTY' : 204,
-        'L1_RD1_BGRP10' : 188,
-        'L1_RD2_FILLED' : 205,
         'L1_RD2_EMPTY' : 206,
-        'L1_RD3_FILLED' : 207,
-        'L1_RD3_EMPTY' : 208,
-        'L1_RD0_FIRSTEMPTY' : 209,
-        'L1_RD0_BGRP9' : 210,
-        'L1_RD0_BGRP11' : 211,
-        'L1_LUCID' : 212,
-        'L1_LUCID_EMPTY' : 213,
-        'L1_LUCID_UNPAIRED_ISO' : 214,
-        'L1_LUCID_A_C_EMPTY' : 215,
-        'L1_LUCID_A_C_UNPAIRED_ISO' : 216,
-        'L1_LUCID_A_C_UNPAIRED_NONISO' : 217,
-        'L1_TRT_FILLED' : 218,
-        'L1_TRT_EMPTY' : 219,
+        'L1_RD0_ABORTGAPNOTCALIB' : 372,
         'L1_TGC_BURST' : 220,
-#        'L1_TGC_BURST_EMPTY' : 184,
-        'L1_LHCF' : 221,
-        'L1_BCM_Wide_BGRP0' : 222,
+        'L1_ZB' : 240,
         'L1_BCM_AC_CA_BGRP0' : 223,
         'L1_BCM_Wide_EMPTY' : 224,
         'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-        'L1_MBTS_1' : 226,
-        'L1_MBTS_2' : 227,
-        'L1_MBTS_1_1' : 228,
-        
-      
+        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
+        'L1_BCM_AC_UNPAIRED_ISO' : 163,
         'L1_BCM_CA_UNPAIRED_ISO' : 229,
         'L1_BCM_AC_UNPAIRED_NONISO' : 230,
         'L1_BCM_CA_UNPAIRED_NONISO' : 231,
@@ -1182,338 +902,89 @@ def defineMenu():
         'L1_BCM_AC_CALIB' : 235,
         'L1_BCM_CA_CALIB' : 236,
         'L1_BCM_Wide_CALIB' : 237,
-        'L1_BTAG-MU4J15' : 238,
-        'L1_BTAG-MU4J30' : 239,
-        'L1_ZB' : 240,
-        'L1_BPTX0_BGRP0' : 241,
-        'L1_BPTX1_BGRP0' : 242,
-        'L1_BTAG-MU6J20' : 243,
-        'L1_BTAG-MU6J25' : 244,
-#        'L1_BTAG-MU4J20' : 245,
-        'L1_3J15_BTAG-MU4J15' : 246,
-        'L1_3J15_BTAG-MU4J30' : 247,
-        'L1_3J15_BTAG-MU6J25' : 248,
-        'L1_3J20_BTAG-MU4J20' : 249,
-#        'L1_J40_DPHI-Js2XE50' : 250,
-        'L1_J40_DPHI-J20s2XE50' : 251,
-        #'L1_J40_DPHI-J20s2XE30' : 257,
-        'L1_J40_XE50_DPHI-J20s2XE50': 245,
-        'L1_J40_DPHI-J20XE50' : 252,
-        'L1_J40_DPHI-CJ20XE50' : 253,
-        'L1_MU4_J20_XE30_DPHI-J20s2XE30' : 257,
-        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
-        'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30' : 434,
-        'L1_3EM3_J40_XE50_DPHI-J20s2XE50' : 435,
-#SX
-#        'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B' : 254,
-#        'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B' : 255,
-#        'L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO' : 256,
-#        'L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO' : 257,
-
-        
-        'L1_HT190-J15.ETA21' : 258,
+        #'L1_BTAG-MU4J15' : 238,
+        #'L1_BTAG-MU6J20' : 243,
+        'L1_2MU4_J40_XE50' : 449,
+        'L1_MU4_J30_XE40_DPHI-J20s2XE30' : 452,
+        'L1_MU4_J50_XE50_DPHI-J20s2XE30' : 453,
+        'L1_MU4_XE60' : 454,
         'L1_HT190-J15s5.ETA21' : 259,
-        'L1_HT150-J20.ETA31' : 260,
-        'L1_HT150-J20s5.ETA31' : 261,
-        'L1_JPSI-1M5' : 262,
+        'L1_HT150-J20s5.ETA31_MJJ-400-CF' : 91,
         'L1_JPSI-1M5-EM7' : 263,
         'L1_JPSI-1M5-EM12' : 264,
-        'L1_KF-XE40' : 265,
-        'L1_KF-XE50' : 266,
-        'L1_KF-XE55' : 267,
-        'L1_KF-XE60' : 268,
-        'L1_KF-XE65' : 269,
-        'L1_KF-XE75' : 270,
-#        'L1_W-05DPHI-JXE-0' : 271,
-#        'L1_W-10DPHI-JXE-0' : 272,
-#        'L1_W-15DPHI-JXE-0' : 273,
-        #'L1_W-15DPHI-EMXE-1' : 271,
-        #'L1_W-15DPHI-EM15XE-1' : 272,
-#        'L1_W-05DPHI-EMXE-1' : 276,
-        'L1_W-05RO-XEHT-0' : 277,
-        'L1_W-90RO2-XEHT-0' : 279,
-        'L1_W-250RO2-XEHT-0' : 280,
-        'L1_W-HT20-JJ15.ETA49' : 281,
-        'L1_W-NOMATCH' : 282,
-        #'L1_W-NOMATCH_W-05RO-XEEMHT' : 283,
-        'L1_EM10_W-MT25' : 284,
-        'L1_EM15_W-MT35' : 286,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0' : 287,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30' : 288,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20' : 289,
-        'L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE' : 290,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0' : 291,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60' : 292,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30' : 293,
-        'L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE' : 294,
-#SX
-#        'L1_BPH-DR-2MU4' : 295,
-#        'L1_BPH-2M-2MU4' : 296,
-#        'L1_BPH-4M8-2MU4' : 297,
-#        'L1_BPH-DR-2MU4_BPH-2M-2MU4' : 298,
-#        'L1_BPH-DR-2MU4_BPH-4M8-2MU4' : 299,
-#        'L1_BPH-DR-2MU6' : 300,
-#        'L1_BPH-2M-2MU6' : 301,
-#        'L1_BPH-4M8-2MU6' : 302,
-#        'L1_BPH-DR-2MU6_BPH-2M-2MU6' : 303,
-#        'L1_BPH-DR-2MU6_BPH-4M8-2MU6' : 304,
-#        'L1_BPH-2M-2MU4-B' : 305,
-#        'L1_BPH-2M-2MU4-BO' : 306,
-#        'L1_BPH-2M-MU6MU4' : 307,
-#        'L1_BPH-2M-MU6MU4-B' : 308,
-#        'L1_BPH-2M-MU6MU4-BO' : 309,
-#        'L1_BPH-4M8-2MU4-B' : 310,
-#        'L1_BPH-4M8-2MU4-BO' : 311,
-#        'L1_BPH-4M8-MU6MU4' : 312,
-#        'L1_BPH-4M8-MU6MU4-B' : 313,
-#        'L1_BPH-4M8-MU6MU4-BO' : 314,
-
-#SX adding
-        #'L1_BPH-1M19-2MU4_BPH-0DR34-2MU4' : 295,
-        'L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'  : 296, #  ATR-15197 'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'  : 296,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'  : 297,
-        'L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4'  : 298, # ATR-15197 'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4'  : 298,
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4'  : 299,
-        'L1_BPH-2M9-2MU6_BPH-2DR15-2MU6' : 300,
-        'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'  : 301,
-        'L1_MU6MU4-BO' : 302,
-        'L1_2MU4-B' : 303,
-        'L1_2MU6-B'  : 304,
-        #'L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'  : 305,
-        'L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'  : 306,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'  :  307,
-        #'L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   : 308,
-        #'L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'  : 309,
-        'L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'  : 310,
-        'L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' : 311,
-        'L1_2MU4-BO' : 312,
-        'L1_2MU6-BO' : 313,
-        'L1_MU6_2MU4-B'  : 314,
-
-        ### ATR-14350 - these should be replaced in 2017 with items 296 and 298
-        'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
-        'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
-
-
-        'L1_DY-DR-2MU4' : 315,
-        'L1_EM15VH_2EM8VH_MU6' : 316,
-        #'L1_DY-BOX-MU6MU4' : 317,
-        'L1_DY-BOX-2MU6' : 318,
-        'L1_LFV-MU' : 319,
         'L1_LFV-MU6' : 332,
+        'L1_LFV-MU11' : 364,
         'L1_LFV-EM8I' : 320,
         'L1_LFV-EM15I' : 321,
-        'L1_EM7_MU15' : 322,
-        'L1_EM8VH_MU15' : 48,
         'L1_DPHI-J20s2XE50' : 323,
-        'L1_DPHI-J20XE50' : 324,
-        'L1_DPHI-CJ20XE50' : 325,
-        'L1_MJJ-900' : 326,
-        'L1_MJJ-800' : 327,
-        'L1_MJJ-700' : 328,
-        'L1_MJJ-400' : 329,
-        #'L1_MJJ-350' : 330,
-#        'L1_MJJ-300' : 331,
-#        'L1_MJJ-200' : 332,
-        'L1_MJJ-100' : 333,
-        'L1_HT150-JJ15.ETA49' : 334,
-        'L1_J4-MATCH' : 336,
+        'L1_J40_XE50_DPHI-J20s2XE50' : 245,
+        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
+        'L1_MJJ-700' : 216,
+        'L1_MJJ-300' : 331,
+        #'L1_MJJ-100' : 333,
+        #'L1_MJJ-400' : 329,
+        #'L1_MJJ-800' : 327,
+        'L1_MJJ-500-NFF' : 108,
+        'L1_J50_DETA20-J50J' : 275,
+        'L1_DPHI-2EM3' : 288,
+        #'L1_HT150-JJ15.ETA49' : 334,
+        #'L1_HT150-JJ15.ETA49_MJJ-400' : 416,
+        #'L1_J4-MATCH' : 336,
         'L1_LLP-RO' : 338,
-        'L1_LLP-NOMATCH' : 339,
-        'L1_DR-MU10TAU12I' : 340,
-#        'L1_TAU12I-J25' : 341,
-        'L1_EM15TAU12I-J25' : 345,
+        #'L1_LLP-NOMATCH' : 339,
+        #'L1_EM15TAU12I-J25' : 345,
+        #'L1_DR-MU10TAU12I' : 340,
+        #'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
         'L1_DR-EM15TAU12I-J25' : 346,
-        'L1_TAU20ITAU12I-J25' : 347,
+        #'L1_TAU20ITAU12I-J25' : 347,
         'L1_DR-TAU20ITAU12I' : 348,
-        'L1_BOX-TAU20ITAU12I' : 349,
         'L1_DR-TAU20ITAU12I-J25' : 350,
-
-        'L1_DR25-TAU20ITAU12I' : 337,
-
-        'L1_DR25-TAU20ITAU12I-J25' : 386,
         'L1_30M-EM20ITAU12' : 387,
-        'L1_MJJ-400-CF': 397,
-
-        'L1_LAR-EM' : 351,
-        'L1_LAR-J' : 352,
-        'L1_DR-EM15TAU12I' : 353,        
-        'L1_LATE-MU10_XE50': 354,
+        'L1_MJJ-400-CF' : 397,
+        #'L1_LAR-EM' : 351,
+        #'L1_LAR-J' : 352,
+        #'L1_LAR-ZEE' : 71,
+        #'L1_LAR-ZEE_LAR-EM' : 285,
+        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
+        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
+        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO' : 488,
+        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6' : 301,
+        'L1_BPH-8M15-0DR22-2MU6' : 107,
+        'L1_BPH-2M9-2DR15-2MU6' : 110,
+        'L1_BPH-2M9-0DR15-MU6MU4' : 125,
+        'L1_BPH-8M15-0DR22-MU6MU4-BO' : 126,
+        'L1_BPH-2M9-0DR15-2MU4' : 127,
+        'L1_BPH-0M9-EM7-EM5' : 80,
+        'L1_BPH-0DR3-EM7J15' : 84,
+        'L1_BPH-0M9-EM7-EM5_MU6' : 124,
+        'L1_BPH-0DR3-EM7J15_MU6' : 134,
+        'L1_BPH-0M9-EM7-EM5_2MU4' : 153,
+        'L1_BPH-0DR3-EM7J15_2MU4' : 156,
+        #'L1_MJJ-400-NFF-0DPHI20' : 128,
+        'L1_MJJ-400-NFF-0DPHI22' : 129,
+        'L1_MJJ-400-NFF-0DPHI24' : 133,
+        'L1_MJJ-400-NFF-0DPHI26' : 136,
+        'L1_EM18VHI_MJJ-300' : 385,
+        'L1_LATE-MU10_XE50' : 354,
+        'L1_LATE-MU10_XE40' : 466,
         'L1_LATE-MU10_J50' : 355,
-        'L1_SC111' : 356,
-        'L1_SC85' : 357,
-#SX
-#        'L1_BPH-DR-2MU4-B' : 353,
-#        'L1_BPH-DR-2MU4-BO' : 354,
-#        'L1_BPH-DR-MU6MU4' : 355,
-#        'L1_BPH-DR-MU6MU4-B' : 356,
-#        'L1_BPH-DR-MU6MU4-BO' : 357,
-        'L1_MU6_MJJ-200' : 358,
-        'L1_MU6_MJJ-300' : 359,
-        'L1_MU6_MJJ-400' : 360,
-        'L1_MU6_MJJ-500' : 361,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-400' : 362,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-700' : 363,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-800' : 364,
-        'L1_J30_2J20_4J20.0ETA49_MJJ-900' : 365,
-        'L1_3J20_4J20.0ETA49_MJJ-400' : 366,
-        'L1_3J20_4J20.0ETA49_MJJ-700' : 367,
-        'L1_3J20_4J20.0ETA49_MJJ-800' : 368,
-        'L1_3J20_4J20.0ETA49_MJJ-900' : 369,
-        'L1_XE35_MJJ-200' : 370,
-        'L1_EM7_FIRSTEMPTY': 371, 
-        'L1_RD0_ABORTGAPNOTCALIB':372,
-        'L1_3J25.0ETA23' : 373,
-        'L1_3J35.0ETA23' : 425,
-        'L1_TE20' : 374,
-        'L1_TE10.0ETA24' : 375,
-        'L1_TE15.ETA24' : 416,
-        'L1_TE20.0ETA24' : 376,
-        'L1_TE25.0ETA24' : 409,
-        #'L1_XS40' : 377,
-        #'L1_XS50' : 378,
-        #'L1_XS60' : 379,
-        'L1_J12_BGRP12' : 380,
-        'L1_J30.31ETA49_BGRP12' : 381,
-        'L1_MU6_J30.0ETA49_2J20.0ETA49' : 382,
-        'L1_4J20.0ETA49' : 383,
-        'L1_HT150-JJ15.ETA49_MJJ400' : 384,
-
-        ### ATR-15062
-        'L1_EM18VH_MJJ-300' : 385,
-        
-#ATR-13743        'L1_MU4_J30' : 386,
-#        'L1_MU4_J50' : 387,
-
-        
-        'L1_TAU8_UNPAIRED_ISO': 388,
-        'L1_EM7_UNPAIRED_ISO': 389,
-        'L1_TAU8_UNPAIRED_NONISO': 467,
-        'L1_EM7_UNPAIRED_NONISO': 468,
-        'L1_MU4_UNPAIRED_NONISO' : 469,
-        'L1_RD2_BGRP12'   : 390,
-        'L1_TAU8_FIRSTEMPTY': 391,
-        'L1_EM24VHI'           : 392,
-        'L1_LHCF_UNPAIRED_ISO' : 393,
-        'L1_LHCF_EMPTY' : 394,
-        'L1_EM15VH_2EM10VH_3EM7': 395,
-        'L1_EM15VH_3EM8VH': 396, 
-        'L1_EM8I_MU10'  : 399,
-        "L1_EM26VHI"    :402,
-        "L1_EM15HI"    :423,
-        "L1_EM15I"    :424,
-        "L1_MU6_3MU4"  :403,
-        "L1_2MU6_3MU4" :404,
-        "L1_BGRP9"     :405,
-        #'L1_TE50'       :406,
-        'L1_TE5'       :407,
-        #'L1_TE60'      :408,
-        #'L1_TE50.0ETA24':409,
-        'L1_TE5.0ETA24':410, 
-        'L1_EM20VH_FIRSTEMPTY':411, 
-        'L1_EM22VHI_FIRSTEMPTY':412, 
-        'L1_MU20_FIRSTEMPTY':413, 
-        'L1_J100_FIRSTEMPTY':414, 
-        'L1_J100.31ETA49_FIRSTEMPTY':415, 
-        #'L1_TE60.0ETA24':416, 
-        'L1_TE70.0ETA24':417, 
-        'L1_TE40.0ETA24':418, 
-
-        # 3 x ZDC
-        'L1_ZDC_A':419,
-        'L1_ZDC_C':420,
-        'L1_ZDC_AND':421, 
-        'L1_ZDC_A_C':422, 
-        
-#ATR-13743        'L1_ALFA_ELAST1'  : 424,
-#        'L1_ALFA_ELAST2'  : 425,
-#        'L1_ALFA_ELAST11' : 426,
-#        'L1_ALFA_ELAST12' : 427,
-#        'L1_ALFA_ELAST13' : 428,
-#        'L1_ALFA_ELAST14' : 429,
-#        'L1_ALFA_ELAST15' : 430,
-#        'L1_ALFA_ELAST15_Calib' : 431,
-#        'L1_ALFA_ELAST16' : 432,
-#        'L1_ALFA_ELAST17' : 433,
-#        'L1_ALFA_ELAST18' : 434,
-#        'L1_ALFA_ELAST18_Calib' : 435,
-#        'L1_ALFA_SDIFF5' : 436,
-#        'L1_ALFA_SDIFF6' : 437,
-#        'L1_ALFA_SDIFF7' : 438,
-#        'L1_ALFA_SDIFF8' : 439,
-#        'L1_MBTS_1_A_ALFA_C' : 440,
-#        'L1_MBTS_1_C_ALFA_A' : 441,
-#        'L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO' : 442,
-#        'L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO' : 443,
-#        'L1_MBTS_2_A_ALFA_C' : 444,
-#        'L1_MBTS_2_C_ALFA_A' : 445,
-#        'L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO' : 446,
-#        'L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO' : 447,
-#        'L1_LUCID_A_ALFA_C' : 448,
-#        'L1_LUCID_C_ALFA_A' : 449,
-#        'L1_LUCID_A_ALFA_C_UNPAIRED_ISO' : 450,
-#        'L1_LUCID_C_ALFA_A_UNPAIRED_ISO' : 451,
-#        'L1_EM3_ALFA_ANY' : 452,
-#        'L1_EM3_ALFA_ANY_UNPAIRED_ISO' : 453,
-#        'L1_EM3_ALFA_EINE' :   454,
-#        'L1_ALFA_ELASTIC_UNPAIRED_ISO' : 455,
-#        'L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO' : 456,
-#        'L1_ALFA_ANY_A_EMPTY' : 457,
-#        'L1_ALFA_ANY_C_EMPTY' : 458,
-#        'L1_J12_ALFA_ANY' : 459,
-#        'L1_J12_ALFA_ANY_UNPAIRED_ISO' : 460,
-#        'L1_TE5_ALFA_ANY' : 461,
-#        'L1_TE5_ALFA_ANY_UNPAIRED_ISO' : 462,
-#        'L1_TE5_ALFA_EINE' : 463,
-#        'L1_TRT_ALFA_ANY' : 464,
-#        'L1_TRT_ALFA_ANY_UNPAIRED_ISO' : 465,
-#        'L1_TRT_ALFA_EINE' :   466,
-##        'L1_LHCF_ALFA_ANY_A' : 467,
-##        'L1_LHCF_ALFA_ANY_C' : 468,
-##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO' : 469,
-##        'L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO' : 470,
-#        
-#        'L1_ALFA_BGT' : 471,
-#        'L1_ALFA_BGT_UNPAIRED_ISO' : 472,
-#        'L1_ALFA_BGT_BGRP10' : 473,
-#        'L1_ALFA_SHOWSYST5' : 474,
-#        'L1_ALFA_SYST9'  : 475,
-#        'L1_ALFA_SYST10' : 476,
-#        'L1_ALFA_SYST11' : 477,
-#        'L1_ALFA_SYST12' : 478,
-#        'L1_ALFA_SYST17' : 479,
-#        'L1_ALFA_SYST18' : 480,
-         'L1_ALFA_ANY' : 481,
-#        'L1_ALFA_ANY_EMPTY' : 482,
-#        'L1_ALFA_ANY_FIRSTEMPTY' : 483,
-#        'L1_ALFA_ANY_UNPAIRED_ISO' : 484,
-#        'L1_ALFA_ANY_UNPAIRED_NONISO' : 485,
-#        'L1_ALFA_ANY_BGRP10' : 486,
-#        'L1_ALFA_ANY_ABORTGAPNOTCALIB' : 487,
-#        'L1_ALFA_ANY_CALIB' : 488,
-         'L1_ALFA_B7L1U' : 489,
-         'L1_ALFA_B7L1L' : 490,
-         'L1_ALFA_A7L1U' : 491,
-         'L1_ALFA_A7L1L' : 492,
-         'L1_ALFA_A7R1U' : 493,
-         'L1_ALFA_A7R1L' : 494,
-         'L1_ALFA_B7R1U' : 495,
-         'L1_ALFA_B7R1L' : 496,
+        'L1_TAU60_DR-TAU20ITAU12I' : 76,
+        'L1_SC111-CJ15' : 356,
+        #'L1_LFV-EM8I-MU11' : 138,
+        #'L1_LFV-EM12I-MU6' : 139,
+        'L1_BPH-0M10-3MU4' : 143,
+        'L1_ZAFB-04DPHI-EM15I' : 152,
+        'L1_ZAFB-25DPHI-EM15I' : 157,
+        #'L1_ZAFB-25DPHI-EM18I' : 158,
+        'L1_DPHI-M70-2EM12I' : 159,
+        #'L1_DY-DR-2MU4' : 315,
+        'L1_DY-BOX-2MU6' : 318,
+        'L1_DY-BOX-2MU4' : 160,
+        'L1_CEP-CJ60' : 162,
+        'L1_CEP-CJ50' : 164,
+        'L1_BPH-8M15-2MU4-BO' : 165,
+        'L1_CALREQ2' : 511,
 
-        
-#        'L1_ALFA_B7L1U_OD' : 497,
-#        'L1_ALFA_B7L1L_OD' : 498,
-#        'L1_ALFA_A7L1U_OD' : 499,
-#        'L1_ALFA_A7L1L_OD' : 500,
-#        'L1_ALFA_A7R1U_OD' : 501,
-#        'L1_ALFA_A7R1L_OD' : 502,
-#        'L1_ALFA_B7R1U_OD' : 503,
-#        'L1_ALFA_B7R1L_OD' : 504,
-#        'L1_ALFA_B7L1_OD'  : 505,
-#        'L1_ALFA_A7L1_OD'  : 506,
-#        'L1_ALFA_B7R1_OD'  : 507,
-#        'L1_ALFA_A7R1_OD'  : 508,
-        'L1_CALREQ2' : 511,  # never use 509-511 for anything else than CALREQ triggers
 }
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py
index adb3918da11d38f9562e3d3396105cac479a779d..6bece23735bec1dba7a81c5a767d1902d6532770 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.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 TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Thresholds import ThresholdValue
 from TriggerMenuMT.LVL1MenuConfig.LVL1.Limits import CaloLimits as CL
 
@@ -18,7 +18,7 @@ class ThresholdDef(object):
         # MUON
         ThresholdValue.setDefaults('MUON', {'etamin' : -49,'etamax' : 49, 'phimin' : 0,'phimax' : 64}) # keep this as an example how defaults for groups can be defined
 
-        for thrV in [0, 4, 6, 10, 11, 15, 20]:
+        for thrV in [0, 4, 6, 10, 11, 15, 20, 21]:
             tc.registerThr('MU%i' % thrV, 'MUON').addThrValue(thrV)
 
 
@@ -107,12 +107,15 @@ class ThresholdDef(object):
             .addThrValue(18, -14, -13, priority=2).addThrValue(18, 13, 14, priority=2)\
             .addThrValue(17, -15, -14, priority=2).addThrValue(17, 14, 15, priority=2)\
             .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
-            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)       
+            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
+
 
         # I section
 
         ThresholdValue.setDefaults('EM', {'isobits' : '00010', 'use_relIso' : True })
 
+   
+ 
         for thrV in [8]:
             tc.registerThr('EM%iI' % thrV, 'EM').addThrValue(thrV)
 
@@ -124,6 +127,26 @@ class ThresholdDef(object):
         for thrV in [15]:
             tc.registerThr('EM%iHI' % thrV, 'EM').addThrValue(thrV)
 
+        tc.registerThr( 'EM15VHI', type='EM').addThrValue(17, priority=1)\
+            .addThrValue(17, -7, 0, priority=2).addThrValue(17, 0, 7, priority=2)\
+            .addThrValue(16, -9, -7, priority=2).addThrValue(16, 7, 9, priority=2)\
+            .addThrValue(15, -12, -9, priority=2).addThrValue(15, 9, 12, priority=2)\
+            .addThrValue(14, -14, -12, priority=2).addThrValue(14, 12, 14, priority=2)\
+            .addThrValue(13, -15, -14, priority=2).addThrValue(13, 14, 15, priority=2)\
+            .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
+            .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)
+
+        tc.registerThr( 'EM18VHI', type='EM').addThrValue(20, priority=1)\
+            .addThrValue(20, -7, 0, priority=2).addThrValue(20, 0, 7, priority=2)\
+            .addThrValue(19, -8, -7, priority=2).addThrValue(19, 7, 8, priority=2)\
+            .addThrValue(18, -11, -8, priority=2).addThrValue(18, 8, 11, priority=2)\
+            .addThrValue(17, -13, -11, priority=2).addThrValue(17, 11, 13, priority=2)\
+            .addThrValue(16, -14, -13, priority=2).addThrValue(16, 13, 14, priority=2)\
+            .addThrValue(15, -15, -14, priority=2).addThrValue(15, 14, 15, priority=2)\
+            .addThrValue(17, -17, -15, priority=2).addThrValue(17, 15, 17, priority=2)\
+            .addThrValue(19, -25, -17, priority=2).addThrValue(19, 17, 25, priority=2)
+
+
         tc.registerThr( 'EM20VHI', type='EM').addThrValue(22, priority=1)\
             .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
             .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
@@ -134,6 +157,17 @@ class ThresholdDef(object):
             .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
             .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
 
+        tc.registerThr( 'EM22VH', type='EM').addThrValue(24, priority=1)\
+            .addThrValue(24, -7, 0, priority=2).addThrValue(24, 0, 7, priority=2)\
+            .addThrValue(23, -8, -7, priority=2).addThrValue(23, 7, 8, priority=2)\
+            .addThrValue(22, -11, -8, priority=2).addThrValue(22, 8, 11, priority=2)\
+            .addThrValue(21, -13, -11, priority=2).addThrValue(21, 11, 13, priority=2)\
+            .addThrValue(20, -14, -13, priority=2).addThrValue(20, 13, 14, priority=2)\
+            .addThrValue(19, -15, -14, priority=2).addThrValue(19, 14, 15, priority=2)\
+            .addThrValue(21, -17, -15, priority=2).addThrValue(21, 15, 17, priority=2)\
+            .addThrValue(23, -25, -17, priority=2).addThrValue(23, 17, 25, priority=2)
+
+
         tc.registerThr( 'EM22VHI', type='EM').addThrValue(24, priority=1)\
             .addThrValue(24, -7, 0, priority=2).addThrValue(24, 0, 7, priority=2)\
             .addThrValue(23, -8, -7, priority=2).addThrValue(23, 7, 8, priority=2)\
@@ -153,6 +187,18 @@ class ThresholdDef(object):
             .addThrValue(21, -15, -14, priority=2).addThrValue(21, 14, 15, priority=2)\
             .addThrValue(23, -17, -15, priority=2).addThrValue(23, 15, 17, priority=2)\
             .addThrValue(25, -25, -17, priority=2).addThrValue(25, 17, 25, priority=2)
+
+        tc.registerThr( 'EM24VHIM', type='EM').addThrValue(24, priority=1)\
+            .addThrValue(26, -7, 0, priority=2).addThrValue(26, 0, 7, priority=2)\
+            .addThrValue(25, -8, -7, priority=2).addThrValue(25, 7, 8, priority=2)\
+            .addThrValue(24, -11, -8, priority=2).addThrValue(24, 8, 11, priority=2)\
+            .addThrValue(23, -13, -11, priority=2).addThrValue(23, 11, 13, priority=2)\
+            .addThrValue(22, -14, -13, priority=2).addThrValue(22, 13, 14, priority=2)\
+            .addThrValue(21, -15, -14, priority=2).addThrValue(21, 14, 15, priority=2)\
+            .addThrValue(23, -17, -15, priority=2).addThrValue(23, 15, 17, priority=2)\
+            .addThrValue(25, -25, -17, priority=2).addThrValue(25, 17, 25, priority=2)
+
+
         
         tc.registerThr( 'EM26VHI', type='EM').addThrValue(26, priority=1)\
             .addThrValue(28, -7, 0, priority=2).addThrValue(28, 0, 7, priority=2)\
@@ -164,6 +210,17 @@ class ThresholdDef(object):
             .addThrValue(25, -17, -15, priority=2).addThrValue(25, 15, 17, priority=2)\
             .addThrValue(27, -25, -17, priority=2).addThrValue(27, 17, 25, priority=2)
 
+        tc.registerThr( 'EM30VHI', type='EM').addThrValue(30, priority=1)\
+            .addThrValue(32, -7, 0, priority=2).addThrValue(32, 0, 7, priority=2)\
+            .addThrValue(31, -8, -7, priority=2).addThrValue(31, 7, 8, priority=2)\
+            .addThrValue(30, -11, -8, priority=2).addThrValue(30, 8, 11, priority=2)\
+            .addThrValue(29, -13, -11, priority=2).addThrValue(29, 11, 13, priority=2)\
+            .addThrValue(28, -14, -13, priority=2).addThrValue(28, 13, 14, priority=2)\
+            .addThrValue(27, -15, -14, priority=2).addThrValue(27, 14, 15, priority=2)\
+            .addThrValue(29, -17, -15, priority=2).addThrValue(29, 15, 17, priority=2)\
+            .addThrValue(31, -29, -17, priority=2).addThrValue(31, 17, 29, priority=2)
+
+
 
         tc.registerThr( 'EM3HI', type='EM').addThrValue(3, priority=1)\
 
@@ -183,7 +240,7 @@ class ThresholdDef(object):
 
         ThresholdValue.setDefaults('TAU',{'isobits' : '00000', 'use_relIso' : True })
 
-        for thrV in [6, 8, 12, 15, 20, 25, 30, 35, 40, 50, 60,100]:
+        for thrV in [5, 6, 8, 12, 15, 20, 25, 30, 35, 40, 50, 60, 90, 100]:
             tc.registerThr('HA%i' % thrV, 'TAU').addThrValue(thrV)
 
         # beam splashes     
@@ -205,7 +262,7 @@ class ThresholdDef(object):
             tc.registerThr('HA%iIL' % thrV, 'TAU').addThrValue(thrV)
 
         ThresholdValue.setDefaults('TAU', {'isobits' : '00010', 'use_relIso' : True })
-        for thrV in [12,20]:
+        for thrV in [12,20,25]:
             tc.registerThr('HA%iIM' % thrV, 'TAU').addThrValue(thrV)
 
         ThresholdValue.setDefaults('TAU', {'isobits' : '00100', 'use_relIso' : True })
@@ -244,7 +301,7 @@ class ThresholdDef(object):
         
 
         # Central jet
-        for (thrV, etamax) in [(15,25), (17,22), (20,28), (25,23), (35,23), (20,49), (30,49), (40,25)]:
+        for (thrV, etamax) in [(12,23), (12,25), (12,28), (15,25), (17,22), (20,28), (25,23), (35,23), (20,49), (30,49), (40,25), (45,20)]:
             tc.registerThr('J%i.0ETA%i'  % (thrV, etamax), 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = -etamax,  etamax = etamax, priority=1)  
 
         # Standard forward jet
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_full_menu_cf.sh b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_full_menu_cf.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9b360d1fc1bf2f5619d0964aa29a88cd8b1db429
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_full_menu_cf.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# This is not an ART test, but a unit test
+
+# This is a unit test of HLT Control Flow 
+
+
+athena.py --imf --threads=1 --evtMax 5  --filesInput /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 --config-only=config.pkl -c "doWriteBS=False;doWriteRDOTrigger=True;" TriggerMenuMT/full_menu_cf.py
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py b/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py
similarity index 97%
rename from Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py
rename to Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py
index 6cd3ef7e08e343fb231477f2b30b3cbcb08d182d..bea915b129bd6ed4a98e60b8aea6f8cdf32ddafb 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py
@@ -14,7 +14,7 @@
 
 def generateChains():
     from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
-    from TrigUpgradeTest.TestUtils import makeChain
+    from DecisionHandling.TestUtils import makeChain
     
     testChains = []
     ##################################################################
@@ -119,7 +119,7 @@ def generateChains():
     # jet chains
     ##################################################################
     if opt.doJetSlice == True:
-        from TrigUpgradeTest.jetMenuHelper import jetMenuSequenceFromString
+        from DecisionHandling.jetMenuHelper import jetMenuSequenceFromString
 
         # small-R jets, different calibrations HLT_AntiKt4EMTopoJets_subjesIS
         jetSeq_a4_tc_em = jetMenuSequenceFromString("a4_tc_em_subjesIS")
@@ -161,7 +161,7 @@ def generateChains():
     # bjet chains
     ##################################################################
     if opt.doBjetSlice == True:
-        from TrigUpgradeTest.jetMenuHelper import jetMenuSequenceFromString
+        from DecisionHandling.jetMenuHelper import jetMenuSequenceFromString
         from TriggerMenuMT.HLTMenuConfig.Bjet.BjetSequenceSetup import getBJetSequence
 
         jetSequence = jetMenuSequenceFromString("a4_tc_em_subjesgscIS_ftf")
@@ -271,10 +271,12 @@ def generateChains():
 from AthenaCommon.Logging import logging
 __log = logging.getLogger('full_menu')
 
+from TriggerJobOpts.TriggerFlags import TriggerFlags
 createHLTMenuExternally=True # menu will be build up explicitly here 
 doWriteRDOTrigger = False
 doWriteBS = False
 forceEnableAllChains=True
+TriggerFlags.triggerMenuSetup = "LS2_v1"
 
 include("TriggerJobOpts/runHLT_standalone.py")
 
@@ -285,12 +287,14 @@ from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
 generateChains()
 makeHLTTree( triggerConfigHLT=TriggerConfigHLT )
 
-from TrigConfigSvc.TrigConfigSvcCfg import createHLTPrescalesFileFromMenu
-createHLTPrescalesFileFromMenu()
 
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON
 generateJSON()
-    
+
+from TrigConfigSvc.TrigConfigSvcCfg import createHLTPrescalesFileFromMenu
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+createHLTPrescalesFileFromMenu(ConfigFlags)
+   
 from AthenaCommon.AlgSequence import dumpSequence, AthSequencer
 dumpSequence(topSequence)